Skip to content

Commit

Permalink
add parser
Browse files Browse the repository at this point in the history
  • Loading branch information
kamedono committed Jul 26, 2019
1 parent 5e25c22 commit e02edc5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ecdsa_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ func ParseECPrivateKeyFromPEM(key []byte) (*ecdsa.PrivateKey, error) {
// Parse the key
var parsedKey interface{}
if parsedKey, err = x509.ParseECPrivateKey(block.Bytes); err != nil {
return nil, err
if parsedKey, err = x509.ParsePKCS8PrivateKey(block.Bytes); err != nil {
return nil, err
}
}

var pkey *ecdsa.PrivateKey
Expand Down

0 comments on commit e02edc5

Please sign in to comment.