We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Go standard crypto package only support unencrypted PKCS#8 private keys so this function cannot parse encrypted PKCS#8 private keys .
func parsePrivateKey(bytes []byte, password string) (crypto.PrivateKey, error) { var key crypto.PrivateKey key, err := x509.ParsePKCS1PrivateKey(bytes) if err == nil { return key, nil } //x509.ParsePKCS8PrivateKey not support parse encrypted PKCS#8 private keys key, err = x509.ParsePKCS8PrivateKey(bytes, []byte(password)) if err == nil { return key, nil } return nil, ErrFailedToParsePrivateKey }
I tried another resposity https://github.com/youmark/pkcs8 , it works. maybe you can merge into your project
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Go standard crypto package only support unencrypted PKCS#8 private keys
so this function cannot parse encrypted PKCS#8 private keys .
I tried another resposity https://github.com/youmark/pkcs8 , it works. maybe you can merge into your project
The text was updated successfully, but these errors were encountered: