Skip to content

Commit

Permalink
adding support for ed25519 public keys (#9703) (#9755)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Hoffman <[email protected]>
  • Loading branch information
calvn and chrishoffman authored Aug 17, 2020
1 parent 3254fcb commit bca8298
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sdk/helper/certutil/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"crypto"
"crypto/ecdsa"
"crypto/ed25519"
"crypto/elliptic"
"crypto/rand"
"crypto/rsa"
Expand Down Expand Up @@ -307,9 +308,12 @@ func ParsePublicKeyPEM(data []byte) (interface{}, error) {
if ecPublicKey, ok := rawKey.(*ecdsa.PublicKey); ok {
return ecPublicKey, nil
}
if edPublicKey, ok := rawKey.(ed25519.PublicKey); ok {
return edPublicKey, nil
}
}

return nil, errors.New("data does not contain any valid RSA or ECDSA public keys")
return nil, errors.New("data does not contain any valid public keys")
}

// addPolicyIdentifiers adds certificate policies extension
Expand Down

0 comments on commit bca8298

Please sign in to comment.