keystore

package
v0.0.0-...-9d47661 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyStore

type KeyStore struct {
	// contains filtered or unexported fields
}

KeyStore represents an in memory store implementation of the KeyLookup interface.

func New

func New() *KeyStore

New constructs an empty KeyStore ready for use.

func NewFS

func NewFS(fsys fs.FS) (*KeyStore, error)

NewFS constructs a KeyStore based on a set of PEM files rooted inside of a directory. The name of each PEM file with be used as the key id. Example: keystore.NewFS(os.DirFS("/zarf/keys")) Example: /zarf/keys/54bb2165-71e1-41a6-af3e-7da4a0e1e2c1.pem

func NewMap

func NewMap(store map[string]PrivateKey) *KeyStore

NewMap constructs a KeyStore with an initial set of keys.

func (*KeyStore) PrivateKey

func (ks *KeyStore) PrivateKey(kid string) (string, error)

func (*KeyStore) PublicKey

func (ks *KeyStore) PublicKey(kid string) (string, error)

type PrivateKey

type PrivateKey struct {
	PK  *rsa.PrivateKey
	PEM []byte
}

PrivateKey represents key information.

Jump to

Keyboard shortcuts

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