der

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 9 Imported by: 84

Documentation

Overview

Package der contains functions for marshaling and unmarshaling keys in DER format.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromProto

func FromProto(_ context.Context, pb proto.Message) (crypto.Signer, error)

FromProto builds a crypto.Signer from a proto.Message, which must be of type PrivateKey.

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 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.

Jump to

Keyboard shortcuts

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