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

0 votes
asked Sep 20, 2021 by brandon-w-8204 (32,530 points)

I am getting the following error:

Caused by: com.jcraft.jsch.JSchException: invalid privatekey: [B@26120bf2
   at com.jcraft.jsch.KeyPair.load(
   at com.jcraft.jsch.KeyPair.load(
   at com.jcraft.jsch.IdentityFile.newInstance(
   at com.jcraft.jsch.JSch.addIdentity(
   at com.jcraft.jsch.JSch.addIdentity(
   at org.apache.camel.component.file.remote.SftpOperations.createSession(
   at org.apache.camel.component.file.remote.SftpOperations.connect(

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


answered Sep 20, 2021 by brandon-w-8204 (32,530 points)