Hi,

You are right, the current implementation doesn't work with identity and known 
hosts files from anywhere but the file system. JSch has actually three ways of 
setting these entities, one with a filename (which camel uses now), one with an 
InputStream and one with implementations of the Identity and 
KnownHostsRepository interfaces. Behind the scenes JSch is using the default 
implementation of these interfaces that are capable of parsing files in the 
OpenSSH format. My idea was to extend camel in a way that it's also possible to 
pass objects implementing these interfaces to the endpoint, so you could get 
your key material from wherever you want (e.g. a database or a file in a 
different format), however on a second thought this has two disadvantages.
1. The camel component would expose interfaces from the underlying JSch 
implementation.
2. The default implementation from JSch have private constructors, so we should 
at least also offer an InputStream interface as we most likely do not want to 
parse these files ourselves...

Claus: what do you think would be best?

Best regards
Stephan

-----Original Message-----
From: javamonkey79 [mailto:javamonke...@gmail.com] 
Sent: Donnerstag, 20. Juni 2013 22:11
To: users@camel.apache.org
Subject: RE: camel sftp privateKeyFile - load from classpath

@Stephan - that is a bit over my head, perhaps I don't understand the sftp
component and jsch well enough yet. What I do know is that jsch is taking
the String param passed in via Camel (the fileName param) and turning that
in to a File, which I don't think will work with classpath resources? There
is a another method in the jsch Util class that loads in by bytes instead -
or perhaps camel is not calling the Util class at all, I'm not sure.

If someone could point me at the spot where camel hooks the keyfile in to
jsch I'd be happy to take a shot at improving it if possible. 



--
View this message in context: 
http://camel.465427.n5.nabble.com/camel-sftp-privateKeyFile-load-from-classpath-tp5734394p5734460.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to