Documentation ¶
Index ¶
- func FromProto(pb *keyspb.PrivateKey) (crypto.Signer, error)
- func FromPublicProto(pb *keyspb.PublicKey) (crypto.PublicKey, error)
- func MarshalPrivateKey(key crypto.Signer) ([]byte, error)
- func MarshalPublicKey(pubKey crypto.PublicKey) ([]byte, error)
- func NewProtoFromSpec(spec *keyspb.Specification) (*keyspb.PrivateKey, error)
- func ToPublicProto(pubKey crypto.PublicKey) (*keyspb.PublicKey, error)
- func UnmarshalPrivateKey(keyDER []byte) (crypto.Signer, error)
- func UnmarshalPublicKey(keyDER []byte) (crypto.PublicKey, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromProto ¶
func FromProto(pb *keyspb.PrivateKey) (crypto.Signer, error)
FromProto takes a PrivateKey protobuf message and returns the private key contained within.
func FromPublicProto ¶
FromPublicProto takes a PublicKey protobuf message and returns the public key contained within.
func MarshalPrivateKey ¶
MarshalPrivateKey serializes an RSA or ECDSA private key as DER.
func MarshalPublicKey ¶
MarshalPublicKey serializes an RSA or ECDSA public key as DER.
func NewProtoFromSpec ¶
func NewProtoFromSpec(spec *keyspb.Specification) (*keyspb.PrivateKey, error)
NewProtoFromSpec creates a new private key based on a key specification. It returns a PrivateKey protobuf message that contains the private key.
func ToPublicProto ¶
ToPublicProto returns a keyspb.PublicKey that contains pubKey in DER encoding.
func UnmarshalPrivateKey ¶
UnmarshalPrivateKey reads a DER-encoded private key.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.