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

PKCS8 private key cannot be parsed #5599

Open
biningo opened this issue May 10, 2024 · 0 comments · May be fixed by #5600
Open

PKCS8 private key cannot be parsed #5599

biningo opened this issue May 10, 2024 · 0 comments · May be fixed by #5600
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@biningo
Copy link

biningo commented May 10, 2024

What would you like to be added/modified:
support parse PKCS8 private key

Why is this needed:
PKCS8 private key cannot be parsed

var caKey crypto.Signer
caKeyDER := hubconfig.Config.CaKey
caKey, err = x509.ParseECPrivateKey(caKeyDER)
if err != nil {
caKey, err = x509.ParsePKCS1PrivateKey(caKeyDER)
if err != nil {
return nil, fmt.Errorf("unable to Parse PrivateKey: %v", err)
}
}

caKey, err := x509.ParseECPrivateKey(caKeyDER)
if err != nil {
return nil, nil, fmt.Errorf("failed to parse ECPrivateKey, err: %v", err)
}

@biningo biningo added the kind/feature Categorizes issue or PR as related to a new feature. label May 10, 2024
@biningo biningo linked a pull request May 10, 2024 that will close this issue
@biningo biningo changed the title PCKS8 private key cannot be parsed PKCS8 private key cannot be parsed May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant