0 votes
by (230 points)

Hi

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
xxxx
Private-Lines: 14
xxxx

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

1 Answer

0 votes
by (144k 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.

...