keyring

package
v0.11.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidKeyType = errors.New("invalid key type")
)

Functions

This section is empty.

Types

type CACertsKey added in v0.4.2

type CACertsKey struct {
	// DER-encoded certificates
	CACerts [][]byte `json:"caCerts"`
}

func NewCACertsKey added in v0.4.2

func NewCACertsKey(certs []*x509.Certificate) *CACertsKey

type EphemeralKey added in v0.8.2

type EphemeralKey = ephemeral.Key

type Keyring

type Keyring interface {
	// Try will call the provided function for each key matching the type of
	// the argument of the function. Try intentionally does not short-circuit;
	// it will always call the function for every key.
	Try(...UseKeyFn) bool
	// ForEach is like Try, except it will call the function for every key
	// regardless of type.
	ForEach(func(key any))
	// Marshal returns a wire representation of the keyring. The specific format
	// is unspecified.
	Marshal() ([]byte, error)
	// Merge returns a new keyring that contains all keys from both keyrings.
	// It does not deduplicate keys.
	Merge(Keyring) Keyring
}

func New

func New(keys ...any) Keyring

func Unmarshal

func Unmarshal(data []byte) (Keyring, error)

type PKPKey

type PKPKey struct {
	PinnedKeys []*pkp.PublicKeyPin `json:"pinnedKeys"`
}

func NewPKPKey

func NewPKPKey(pinnedKeys []*pkp.PublicKeyPin) *PKPKey

type SharedKeys

type SharedKeys struct {
	ClientKey []byte `json:"clientKey"`
	ServerKey []byte `json:"serverKey"`
}

func NewSharedKeys

func NewSharedKeys(secret []byte) *SharedKeys

type UseKeyFn

type UseKeyFn any // func(*KeyringType)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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