package der

import "github.com/google/trillian/crypto/keys/der"

Index

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

func FromPublicProto(pb *keyspb.PublicKey) (crypto.PublicKey, error)

FromPublicProto takes a PublicKey protobuf message and returns the public key contained within.

func MarshalPrivateKey

func MarshalPrivateKey(key crypto.Signer) ([]byte, error)

MarshalPrivateKey serializes an RSA or ECDSA private key as DER.

func MarshalPublicKey

func MarshalPublicKey(pubKey crypto.PublicKey) ([]byte, error)

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

func ToPublicProto(pubKey crypto.PublicKey) (*keyspb.PublicKey, error)

ToPublicProto returns a keyspb.PublicKey that contains pubKey in DER encoding.

func UnmarshalPrivateKey

func UnmarshalPrivateKey(keyDER []byte) (crypto.Signer, error)

UnmarshalPrivateKey reads a DER-encoded private key.

func UnmarshalPublicKey

func UnmarshalPublicKey(keyDER []byte) (crypto.PublicKey, error)

UnmarshalPublicKey reads a DER-encoded public key.

Source Files

der.go

Directories

PathSynopsis
crypto/keys/der/protoPackage proto registers a DER keys.ProtoHandler using keys.RegisterHandler.
Version
v1.3.3
Published
Oct 31, 2019
Platform
js/wasm
Imports
8 packages
Last checked
28 minutes ago

Tools for package owners.