mirror of https://github.com/golang-jwt/jwt.git
add parser
This commit is contained in:
parent
5e25c22bd5
commit
e02edc50e4
|
@ -25,7 +25,9 @@ func ParseECPrivateKeyFromPEM(key []byte) (*ecdsa.PrivateKey, error) {
|
||||||
// Parse the key
|
// Parse the key
|
||||||
var parsedKey interface{}
|
var parsedKey interface{}
|
||||||
if parsedKey, err = x509.ParseECPrivateKey(block.Bytes); err != nil {
|
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
|
var pkey *ecdsa.PrivateKey
|
||||||
|
|
Loading…
Reference in New Issue