Sidebar

How do I resolve the error "com.jcraft.jsch.JSchException: invalid privatekey:" with sftp?

0 votes
8.3K views
asked Sep 20, 2021 by brandon-w-8204 (33,270 points)

I am getting the following error:

Caused by: com.jcraft.jsch.JSchException: invalid privatekey: [B@26120bf2
   at com.jcraft.jsch.KeyPair.load(KeyPair.java:747)
   at com.jcraft.jsch.KeyPair.load(KeyPair.java:561)
   at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:40)
   at com.jcraft.jsch.JSch.addIdentity(JSch.java:407)
   at com.jcraft.jsch.JSch.addIdentity(JSch.java:388)
   at org.apache.camel.component.file.remote.SftpOperations.createSession(SftpOperations.java:184)
   at org.apache.camel.component.file.remote.SftpOperations.connect(SftpOperations.java:115)

What is the cause and how do I resolve this?

1 Answer

0 votes

Putty has a new version of their ppk or private keys.

PuTTY-User-Key-File-3: ssh-rsa

This does not appear to be supported by Camel FTP jar library that Qvera Interface Engine uses for SFTP. We have found you can export it as an Open SSH key and it will work. Below are the steps to do this.

1. Download and install puttyGen version .76.
2. Use the Conversions menu "Import Key" and import your ppk file.
3. After Import select "Export OpenSSH key" and select a location for the new file.


4. In QIE point to the new file that is open SSH from step 3. See https://www.qvera.com/kb/index.php/1368/how-do-sftp-file-using-rsa-key-certificate-without-password?show=1368#q1368

 

answered Sep 20, 2021 by brandon-w-8204 (33,270 points)
...