I am trying to load the private key files using the code mentioned in the following page
My code is as follows
public static void ReadPrivateKey(byte key, string passPhrase)
using (Stream stream = new MemoryStream(key))
var privateKeyObject = new SecureShellPrivateKey(stream,passPhrase);
catch (Exception ex)
Above code works fine for DSA private putty key file. but it fails for RSA Private Putty key file (SSH PRIVATE KEY FILE FORMAT 1.1) generated through puttygen.
It throws exception "Invalid key format".
I would like to upload the RSA Private putty key file but I don't know how to do it.
I tried the rsa putty key
and it does not throw the exception. example key contains can be readable (ASCII format ) but mine is not readable.
**Update 2:** looks like an RSA private putty key with SSH-1 format (SSH PRIVATE KEY FILE FORMAT 1.1) is not supported. Can anybody confirm?
edited 3/7/2018 2:48:29 PM