Documentation
¶
Index ¶
- Variables
- func DecodePrivateKey(pemEncodedPrivate []byte) (*ecdsa.PrivateKey, error)
- func DecodePublicKey(pemEncodedPublic []byte) (*ecdsa.PublicKey, error)
- func EncodeKey(privateKey *ecdsa.PrivateKey, publicKey *ecdsa.PublicKey) ([]byte, []byte, error)
- func EncodePrivateKey(privateKey *ecdsa.PrivateKey) ([]byte, error)
- func EncodePublicKey(publicKey *ecdsa.PublicKey) ([]byte, error)
- func GenerateKeyPEM(c elliptic.Curve, seed io.Reader) ([]byte, []byte, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrKeyNotECDSA = errors.New("key is not ECDSA")
ErrKeyNotECDSA is the error returned when trying to decode a non ECDSA key
Functions ¶
func DecodePrivateKey ¶
func DecodePrivateKey(pemEncodedPrivate []byte) (*ecdsa.PrivateKey, error)
DecodePrivateKey decodes a PEM block of a DER encoded ecdsa private key
func DecodePublicKey ¶
DecodePublicKey decodes a PEM block of a DER encoded ecdsa private key
func EncodePrivateKey ¶
func EncodePrivateKey(privateKey *ecdsa.PrivateKey) ([]byte, error)
EncodePrivateKey encodes a given ECDSA private key to PEM block
func EncodePublicKey ¶
EncodePublicKey encodes a given ECDSA public key to PEM block
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.