Skip to content

Enhancement/decrypt pkcs8 private keys #315

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

Merged

Conversation

skydudie
Copy link
Contributor

I came across a similar situation as #258 where I has been given a PKCS#8 Private Encrypted Key generated from OpenSSL. The framework was unable to decrypt it as the function loadKeyFromPEM was only looking for a PKCS#1 formatted encrypted key. Since openssl_pkey_get_private supports decrypting PKCS#8 formatted encrypted keys, I thought it might be useful to add another if block to the function to try and decrypt it.

Do let me know if this is something you'd think might be useful or if I had missed anything out of the PR (:

@Spomky
Copy link
Member

Spomky commented Aug 24, 2021

Hi @skydudie,

You are right, The old fashion code for old OpenSSL version I wrote few years ago could be enhanced now.
Let me dig into this before merging this PR.

Regards.

@Spomky Spomky self-assigned this Aug 24, 2021
@Spomky Spomky modified the milestones: v3.0, v2.2 Aug 24, 2021
@Spomky Spomky merged commit dbdaa46 into web-token:v2.2 Oct 13, 2021
@skydudie skydudie deleted the enhancement/decrypt-pkcs8-private-keys branch October 14, 2021 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants