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

crypto/x509: offer a useful error when ParsePKCS8PrivateKey/ParseECPrivateKey/ParsePKCS1PrivateKey or ParsePKIXPublicKey/ParsePKCS1PrivateKey are mixed up #30094

FiloSottile opened this issue Feb 5, 2019 · 3 comments


Copy link

@FiloSottile FiloSottile commented Feb 5, 2019

When parsing fails in one of these functions, we could check if one of the others would have worked, and offer a helpful error message.

Copy link

@arashbina arashbina commented Feb 6, 2019

I can work on this.
So if I understand correctly when unmarshalling to one structure if it fails try the counterpart to see if it succeeds and return a descriptive error.

Copy link
Member Author

@FiloSottile FiloSottile commented Feb 6, 2019

Correct. Please add me to the reviewers for the change. Thank you!

Copy link

@gopherbot gopherbot commented Feb 7, 2019

Change mentions this issue: x509: improve error when PKCS1, PKCS8, EC, PKIX keys are mixed up

@gopherbot gopherbot closed this in 694ee61 Feb 27, 2019
@golang golang locked and limited conversation to collaborators Feb 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.