der

package
v1.3.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2020 License: Apache-2.0 Imports: 8 Imported by: 84

Documentation

Index

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

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.

Types

This section is empty.

Directories

Path Synopsis
Package proto registers a DER keys.ProtoHandler using keys.RegisterHandler.
Package proto registers a DER keys.ProtoHandler using keys.RegisterHandler.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL