cancel
Showing results for 
Search instead for 
Did you mean: 

Java proxy problem

Former Member
0 Kudos

Hi,

I created a java proxy for SFTP using uid pwd authentication and it works fine.

Now we want to use public key authentication , so i have to use a private key file in the java proxy instead of pwd.

The constructor for my SSH session is as follows.

SshParameters params = new SshParameters("host","uid", File privateKey);

but i guess i cant access the private key file in a EJB(the Java proxy) from the file system.

I saw that people usually use getClass.getResourceAsStream() for reading data inside an EJB but the output of that will be a InputStream object , which i can convert to String but i cant cast it to File...

What can i do in such a situtation?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

closed

Former Member
0 Kudos

using getClass().getResourceAsStream u can also access the file