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

Unwanted pickiness on private key format #547

Open
dimbleby opened this issue May 31, 2019 · 0 comments
Open

Unwanted pickiness on private key format #547

dimbleby opened this issue May 31, 2019 · 0 comments

Comments

@dimbleby
Copy link

If I provide a private key that's not of exactly the expected format, it is wrongly treated as a filename.

Here the code insists that a private key have header -----BEGIN RSA PRIVATE KEY-----.

I believe that this is effectively forcing people to use the PKCS1 format; but PKCS8 is nowadays generally preferred.

Eg openssl genpkey -out private.key -algorithm RSA will generate a key that begins -----BEGIN PRIVATE KEY----- (note no "RSA" here).

Propose that if you want to check whether a string is a private key, it would be better to do this by using a cryptographic library and trying to load it. Failing that, please allow valid keys in modern format.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant