Using RSA byte array in ftp camel route

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Using RSA byte array in ftp camel route

Sherwin Pinto
HI, All
I have an sftp consumer and I need to use privateKey as consumer option,
the use case is I need to read this key from a vault and pass it as a
byte[] in the option parameter. Besides using @BindToRegistry is there any
other way i can pass privateKey=byte[] while building the route in java.

Thanks

Sherwin
Reply | Threaded
Open this post in threaded view
|

RE: Using RSA byte array in ftp camel route

dimas
Hi Sherwin,

I used the SftpConfiguration object to configure it for the endpoint, here is the code:

public Endpoint sftpEndpoint() {
        SftpEndpoint endpoint = context.getEndpoint(sftpUrl, SftpEndpoint.class);
        SftpConfiguration config = endpoint.getConfiguration();
        config.setPrivateKey(privateKey.getBytes());
        return endpoint;
    }

Cheers,
Dmitry

-----Original Message-----
From: Sherwin Pinto [mailto:[hidden email]]
Sent: Friday, July 26, 2019 3:37 PM
To: [hidden email]
Subject: Using RSA byte array in ftp camel route

HI, All
I have an sftp consumer and I need to use privateKey as consumer option, the use case is I need to read this key from a vault and pass it as a byte[] in the option parameter. Besides using @BindToRegistry is there any other way i can pass privateKey=byte[] while building the route in java.

Thanks

Sherwin