package der
import "github.com/google/trillian/crypto/keys/der"
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)
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.
func UnmarshalPublicKey ¶
UnmarshalPublicKey reads a DER-encoded public key.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
crypto/keys/der/proto | Package proto registers a DER keys.ProtoHandler using keys.RegisterHandler. |
- Version
- v1.3.0
- Published
- Jul 11, 2019
- Platform
- js/wasm
- Imports
- 8 packages
- Last checked
- 13 minutes ago –
Tools for package owners.