Skip to content

Commit

Permalink
feat(pki): add support for parsing EC-encoded keys
Browse files Browse the repository at this point in the history
  • Loading branch information
streambinder committed Sep 28, 2022
1 parent 5248361 commit 66d98f1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pki/key.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ func ParseKey(path string) (*Key, error) {
block, _ := pem.Decode(data)
keyData, err := x509.ParsePKCS8PrivateKey(block.Bytes)
if err != nil {
return nil, err
keyData, err = x509.ParseECPrivateKey(block.Bytes)
if err != nil {
return nil, err
}
}
key := Key{keyData, UnsupportedAlgorithm}

Expand Down

0 comments on commit 66d98f1

Please sign in to comment.