-
-
Notifications
You must be signed in to change notification settings - Fork 963
Closed
Description
At the Moment only PKCS#1 RSA keys are supported.
Those begin with -----BEGIN RSA PRIVATE KEY-----
However PKCS#8 Keys are not supported.
Those begin with -----BEGIN PRIVATE KEY-----
I stumbled across this problem when using openssl to generate a key.
By default openssl will write using the PKCS#8 format.
Only if you give it the -traditional
flag, it will write in PKCS#1 format.
The error I was getting with PKCS#8 was the following one, because the RegEx that is used to extract the algorithm did not match, because the algorithm is not present in -----BEGIN PRIVATE KEY-----
.
Renci.SshNet.Common.SshException: Invalid private key file.
at Renci.SshNet.PrivateKeyFile.Open(Stream privateKey, String passPhrase)
at Renci.SshNet.PrivateKeyFile..ctor(Stream privateKey)
Mizuwokiru, lstyles, jenieto and irwin-chequer
Metadata
Metadata
Assignees
Labels
No labels