"Invalid key format" exception while loading RSA private putty key

0
Hi, I am trying to load the private key files using the code mentioned in the following page [http://doc.componentpro.com/ComponentPro-Sftp/loading-keys][1] My code is as follows public static void ReadPrivateKey(byte[] key, string passPhrase) { try { using (Stream stream = new MemoryStream(key)) { var privateKeyObject = new SecureShellPrivateKey(stream,passPhrase); ... } } catch (Exception ex) { throw 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. Thanks, Amol **Update 1:** I tried the rsa putty key [http://doc.componentpro.com/ComponentPro-Sftp/private-key-formats][2] 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? [1]: http://doc.componentpro.com/ComponentPro-Sftp/loading-keys [2]: http://doc.componentpro.com/ComponentPro-Sftp/private-key-formats
edited 3/7/2018 2:48:29 PM
asked 3/7/2018 1:19:00 PM
add a comment

1 Answers

0
Hello, Yes the SSH-1 format is not supported.
 
answered 3/8/2018 5:19:57 PM
add a comment

Your Answer

Not the answer you're looking for? Browse other questions tagged ultimate sftp or ask your own question.