Documentation ¶
Overview ¶
Pakcage kx509 supports marshaling and unmarshaling of EC-KCDSA and KCDSA private/public keys.
Warning: It is no nomative.
Index ¶
- func MarshalECKCPrivateKey(key *eckcdsa.PrivateKey) ([]byte, error)
- func MarshalPKCS8PrivateKey(key interface{}) ([]byte, error)
- func MarshalPKIXPublicKey(pub interface{}) ([]byte, error)
- func ParseECKCPrivateKey(der []byte) (*eckcdsa.PrivateKey, error)
- func ParsePKCS8PrivateKey(der []byte) (key interface{}, err error)
- func ParsePKIXPublicKey(derBytes []byte) (pub interface{}, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalECKCPrivateKey ¶
func MarshalECKCPrivateKey(key *eckcdsa.PrivateKey) ([]byte, error)
MarshalECKCPrivateKey converts an EC private key to SEC 1, ASN.1 DER form.
This kind of key is commonly encoded in PEM blocks of type "EC PRIVATE KEY". For a more flexible key format which is not EC specific, use MarshalPKCS8PrivateKey.
warning: this is non-normative
func MarshalPKCS8PrivateKey ¶
MarshalPKCS8PrivateKey converts a private key to PKCS #8, ASN.1 DER form.
supported key types : *eckcdsa.PublicKey and *kcdsa.PublicKey. for unsupported types, returns the result of crypto/x509.MarshalPKCS8PrivateKey
This kind of key is commonly encoded in PEM blocks of type "PRIVATE KEY".
func MarshalPKIXPublicKey ¶
MarshalPKIXPublicKey converts a public key to PKIX, ASN.1 DER form.
supported key types : *eckcdsa.PublicKey and *kcdsa.PublicKey. for unsupported types, returns the result of crypto/x509.MarshalPKIXPublicKey
This kind of key is commonly encoded in PEM blocks of type "PUBLIC KEY".
func ParseECKCPrivateKey ¶
func ParseECKCPrivateKey(der []byte) (*eckcdsa.PrivateKey, error)
ParseECKCPrivateKey parses an EC private key in SEC 1, ASN.1 DER form.
This kind of key is commonly encoded in PEM blocks of type "EC PRIVATE KEY".
warning: this is non-normative
func ParsePKCS8PrivateKey ¶
ParsePKCS8PrivateKey parses an unencrypted private key in PKCS #8, ASN.1 DER form.
It returns an *eckcdsa.PrivateKey, an *kcdsa.PrivateKey, or the result of crypto/x509.ParsePKCS8PrivateKey
This kind of key is commonly encoded in PEM blocks of type "PRIVATE KEY".
func ParsePKIXPublicKey ¶
ParsePKIXPublicKey parses a public key in PKIX, ASN.1 DER form.
It returns an *eckcdsa.PublicKey, an *kcdsa.PublicKey, or the result of crypto/x509.ParsePKIXPublicKey
This kind of key is commonly encoded in PEM blocks of type "PUBLIC KEY".
Types ¶
This section is empty.