0 votes
by (230 points)


I am using version 5.0.7450.0 of your product within visual studio, .NET framework 4.8. I am getting the CryptographicException which reports: "Invalid Private Key Format". There is no password for this file, the code is:

var privateKey = new SshPrivateKey(@"c:\downloads\mypk.ppk");

I have been able to connect via FileZilla with the same key file. It's in the format:

PuTTY-User-Key-File-3: ssh-rsa 
Encryption: none
Comment: xxxx
Public-Lines: 6
Private-Lines: 14

where I've commented out the main info with xxxx.

1 Answer

0 votes
by (145k points)
selected by
Best answer

The "PuTTY-User-Key-File-3" header indicates that this key uses PPKv3 format, which was introduced by PuTTY in 2021. Rebex SFTP v5.0.7450 was published in 2020 and therefore does not support this format yet.

We added PPKv3 format support in Rebex SFTP v5.0.7999 published in 2021.