hi,

> I have a problem when executing the following code.This code works

> fine for username and password but not for private key. Can u give the

> solution for this.

>

>

> The error is:

>

>

> com.jscape.inet.sftp.SftpException: file corrupted or bad passphrase

>

> at com.jscape.inet.sftp.Sftp.connect(Unknown Source)

>

> at SFtpExample.getListing(SFtpExample.java:129)

>

> at SFtpExample.main(SFtpExample.java:173)

>

>

> ======================================================================

> ==

> =========================

>

> The code is:

>

>

> ftpHostname = "host address";

>

> ftpUsername = "lms";

>

> ftpPassword = "lms123";

>

>

> File privateKey = new File("D:/Jscape/examples/sftp/sftp/id_rsa");

> // private key(RSA) SSH key gen

>

> SshParameters params = new SshParameters(ftpHostname,ftpUsername,

> privateKey);

>

>

> Sftp sftp = new Sftp(params);

>

> sftp.addSftpListener(new SFtpExample());

>

> sftp.connect();

>

> String results = sftp.getDirListingAsString();

>

> sftp.disconnect();

>

>

> ======================================================================

> ==

> ==========================

>

> I want to know whether this works fine for private key generated by

> putty and other tools or it is specific.

>

>

>

> Waiting for your reply