Documentation ¶
Index ¶
- Constants
- Variables
- func MarshalPrivKeyPem(key crypto.PrivKey) ([]byte, error)
- func MarshalPubKeyPem(key crypto.PubKey) ([]byte, error)
- func ParseKeyPem(pemDat []byte) (crypto.PrivKey, crypto.PubKey, error)
- func ParsePrivKeyPem(pemDat []byte) (crypto.PrivKey, error)
- func ParsePubKeyPem(pemDat []byte) (crypto.PubKey, error)
Constants ¶
View Source
const PrivPemType = "LIBP2P PRIVATE KEY"
PrivPemType is the expected header type on private keys.
View Source
const PubPemType = "LIBP2P PUBLIC KEY"
PubPemType is the expected header type on public keys.
Variables ¶
View Source
var ErrUnexpectedPemType = errors.New("keypem: unexpected pem type")
ErrUnexpectedPemType is returned for an unexpected pem type.
Functions ¶
func MarshalPrivKeyPem ¶
MarshalPrivKeyPem marshals a private key to pem.
func MarshalPubKeyPem ¶
MarshalPubKeyPem marshals a public key to pem.
func ParseKeyPem ¶ added in v0.12.4
ParseKeyPem parses a private or public key in pem format. Derives the public key from the private key. Returns nil for the private key if not set. Returns nil, nil, nil if nothing found in the pem.
func ParsePrivKeyPem ¶
ParsePrivKeyPem parses a private key in pem format. If none is found returns nil
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.