Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for PKCS#8 encoded RSA private keys in Windows port #260

Open
massi-ang opened this issue Mar 31, 2020 · 5 comments
Open

Support for PKCS#8 encoded RSA private keys in Windows port #260

massi-ang opened this issue Mar 31, 2020 · 5 comments
Labels
feature-request A feature should be added or improved. p2 This is a standard priority issue

Comments

@massi-ang
Copy link
Contributor

Windows port only support RSA private keys in PKCS#1 format.
On Linux and MacOS, PKCS#8 private keys are supported

See also #259

@JonathanHenson
Copy link
Contributor

pkcs 7 should also be supported. Looking into pkcs 8 at the moment

@JonathanHenson JonathanHenson added the feature-request A feature should be added or improved. label Mar 31, 2020
@JonathanHenson
Copy link
Contributor

@JonathanHenson JonathanHenson added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Mar 31, 2020
@massi-ang
Copy link
Contributor Author

My suggestion would be to look at the first line of the PEM file to determine the format of the PEM: PKCS#1, PKCS#8 or SEC1 and then have different code branches to load the key.
I used this code to decode PKCS#8: https://github.com/odzhan/rsa/blob/63838b8799143c91b117d0785ef58c9ddbd3e436/rsa.c#L390

@MikeDombo
Copy link

+1, particularly for EC keys in PKCS#8 format.

The previously linked Microsoft API has been removed and this is now recommended: https://learn.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-pfximportcertstore

@jcosentino11
Copy link

I think this is also an issue on mac, was seeing static: failed to import certificate and private key with error 0. error, but that went away after converting the key to pkcs#1.

@jmklix jmklix added the p2 This is a standard priority issue label Nov 16, 2023
@jmklix jmklix removed the investigating This issue is being investigated and/or work is in progress to resolve the issue. label Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

5 participants