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? It couldn't be file and byte array at
the same time, because you have to choose type due to IdentityInfo constructor
parameters.
----------------------------------------------------------------
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