You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2019/04/26 11:26:27 UTC

[GitHub] [commons-vfs] RoTkay commented on a change in pull request #60: VFS-609: VFS SFTP doesn't support a private key as byte array

RoTkay commented on a change in pull request #60: VFS-609: VFS SFTP doesn't support a private key as byte array
URL: https://github.com/apache/commons-vfs/pull/60#discussion_r278908794
 
 

 ##########
 File path: commons-vfs2/src/main/java/org/apache/commons/vfs2/provider/sftp/SftpClientFactory.java
 ##########
 @@ -195,11 +195,17 @@ private static void setConfigRepository(final JSch jsch, final File sshDir, fina
         }
     }
 
-    private static void addIndentity(final JSch jsch, final IdentityInfo info) throws FileSystemException {
+    private static void addIdentity(final JSch jsch, final IdentityInfo info) throws FileSystemException {
         try {
-            final String privateKeyFile = info.getPrivateKey() != null ? info.getPrivateKey().getAbsolutePath() : null;
-            final String publicKeyFile = info.getPublicKey() != null ? info.getPublicKey().getAbsolutePath() : null;
-            jsch.addIdentity(privateKeyFile, publicKeyFile, info.getPassPhrase());
+            if (info.getPrivateKey() != null) {
 
 Review comment:
   Sorry, I didn't catch what do you mean by that. Throw` IllegalStateException` in which case?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services