I am trying to connect to a sftp server in order to store some files. I want to connect via the SSH. My question is almost identical with: Camel SFTP component - SSH private key URI works with privateKeyFile, doesn't work with privateKey and the following answer: Apache Camel - How to set a private key in a dinamic sftp endpoint But I still I didn't manage to connect.
My working route:
from(mytopic)
.to(sftp://[email protected]:22/folder/?privateKeyFile=path/to/privateRsa)
My NON working route:
from(mytopic)
.to(sftp://[email protected]:22/folder/?privateKey=byteArrayRsa)
I debugged the com.jcraft.jsch.KeyPair class -> following method:
public static KeyPair load(JSch jsch, byte[] prvkey, byte[] pubkey) throws JSchException
And seems that instead of having the correct byte[] prvkey, I got its address. How can I send the correct byte array? I tried to create a bean as it is suggested in one of the links, but it didn't worked. (I am using camel 3.1)