We have been asked to connect to an SFTP server using an RSA public key.
I generate the keys using the Java Keytool and store them in a Java Key Store (JKS)
How do I access and use the private key?
asked Jul 24 '12 at 09:28
Chilkat now has a JavaKeyStore object. See the online examples and reference documentation. This answer (below) is no longer the easiest solution...
The solution is to export the key to another format, such as PEM (PKCS8) or .p12 (PFX). This StackOverflow web page shows how to convert to PEM: http://stackoverflow.com/questions/652916/converting-a-java-keystore-into-pem-format
The Chilkat classes can be used to convert keys to virtually any format.
To use the private key with Chilkat SSH/SFTP, it needs to be imported into a Chilkat.SshKey object (or depending on the programming language it may be CkSshKey, CkoSshKey, etc.)
The SshKey object can import private keys from:
The Chilkat.PrivateKey class an import RSA keys from the following formats: PEM, PKCS8, binary DER, PVK, and XML.
The Chilkat.PrivateKey can export to all of these formats as well.
Here's the procedure to get the Java Key Store private key into a Chilkat.SshKey object:
Chilkat now as a JavaKeyStore object. See the online reference documentation and examples..
answered Oct 04 '14 at 12:16