vault

package
v1.2.0-beta Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDone = errors.New("done")
	ErrKey  = errors.New("unsupported key type")
)

ErrDone is the error returned by iterator when the iteration is done.

Functions

func Commands

func Commands() []*cobra.Command

func RegisterCommand

func RegisterCommand(cmd *cobra.Command)

func RegisterVault

func RegisterVault(name string, newFunc newVaultFunc)

Types

type Factory

type Factory interface {
	New(ctx context.Context, name string, conf *yaml.Node) (Vault, error)
}

func Registry

func Registry() Factory

type FactoryFunc

type FactoryFunc func(ctx context.Context, name string, conf *yaml.Node) (Vault, error)

func (FactoryFunc) New

func (f FactoryFunc) New(ctx context.Context, name string, conf *yaml.Node) (Vault, error)

type Importer

type Importer interface {
	Vault
	Import(ctx context.Context, pk crypt.PrivateKey, opt utils.Options) (KeyReference, error)
}

Importer interface representing an importer backend

type IteratorFunc

type IteratorFunc func() (key KeyReference, err error)

func (IteratorFunc) Next

func (i IteratorFunc) Next() (key KeyReference, err error)

type KeyIterator

type KeyIterator interface {
	Next() (KeyReference, error)
}

KeyIterator is used to iterate over stored public keys

type KeyReference

type KeyReference interface {
	PublicKey() crypt.PublicKey
	Sign(ctx context.Context, message []byte) (crypt.Signature, error)
	Vault() Vault
}

KeyReference represents a public key which has a private counterpart stored on the backend side

func Collect

func Collect(it KeyIterator) ([]KeyReference, error)

type ReadinessChecker

type ReadinessChecker interface {
	Ready(ctx context.Context) (bool, error)
}

ReadinessChecker is an optional interface implemented by a backend

type Unlocker

type Unlocker interface {
	Vault
	Unlock(ctx context.Context) error
}

Unlocker interface representing an unlocker backend

type Vault

type Vault interface {
	List(ctx context.Context) KeyIterator
	Close(ctx context.Context) error
	Name() string
}

Vault interface that represent a secure key store

type WithID

type WithID interface {
	KeyReference
	ID() string // Additional backend specific ID that can be displayed alongside the public key
}

Directories

Path Synopsis
jwk
Package memory provides a basis for file based and in-memory vaults
Package memory provides a basis for file based and in-memory vaults

Jump to

Keyboard shortcuts

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