I am attempting to connect to the SFTP server using public key authentication. To do so I need to call JSch.AddIdentity() and pass in the private key.
The private key I need to use is stored in a Java KeyStore object. When the key is retrieved from the KeyStore it is a PrivateKey type. From trawling the internet it appears the private key is in the DER format.
What format is required for AddIdentity()?
I have searched for examples of converting the PrivateKey to a PEM string which is equivalent to the contents of a private key file used by SSH. But no luck so far.
I am attempting to connect to the SFTP server using public key authentication. To do so I need to call JSch.AddIdentity() and pass in the private key.
The private key I need to use is stored in a Java KeyStore object. When the key is retrieved from the KeyStore it is a PrivateKey type. From trawling the internet it appears the private key is in the DER format.
What format is required for AddIdentity()?
I have searched for examples of converting the PrivateKey to a PEM string which is equivalent to the contents of a private key file used by SSH. But no luck so far.