garydgregory 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_r279154638
 
 

 ##########
 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:
   Ah, I see. The issue I have now is that you have to know how which ctor you 
called to know which getters are valid, which is semi-lame. Let me see if I can 
adapt your code...

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to