Load .ppk without passphrase

0 votes
asked Mar 21 by shanawazali (120 points)

I have two scenarios:
1. Have .ppk with a Passphrase.
2. Have only .ppk WITHOUT a Passphrase.

For the first scenario, this works:
privateKey = new SshPrivateKey(PrivateKeyPath, PrivateKeyPassPhrase);
_sftp.Login(UserName, privateKey)

But for the Second Scenario, I don't know how to load the private key without a passphrase and login.

Please advise.

Thanks.

Applies to: Rebex SFTP

1 Answer

0 votes
answered Mar 22 by Lukas Matyska (42,060 points)

If your .ppk has no password use:

PrivateKeyPassPhrase = "";
...