vault

package
v0.3.1-beta-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDone = errors.New("done")

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 cryptoutils.PrivateKey, opt utils.Options) (StoredKey, error)
}

Importer interface representing an importer backend

type RawSigner

type RawSigner interface {
	SignRaw(ctx context.Context, data []byte, key StoredKey) (cryptoutils.Signature, error)
}

RawSigner may be implemented by some vaults that expect raw data instead of a precomputed hash

type ReadinessChecker

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

ReadinessChecker is an optional interface implemented by a backend

type StoredKey

type StoredKey interface {
	PublicKey() crypto.PublicKey
	ID() string
}

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

type StoredKeysIterator

type StoredKeysIterator interface {
	Next() (StoredKey, error)
}

StoredKeysIterator is used to iterate over stored public keys

type Unlocker

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

Unlocker interface representing an unlocker backend

type Vault

type Vault interface {
	GetPublicKey(ctx context.Context, id string) (StoredKey, error)
	ListPublicKeys(ctx context.Context) StoredKeysIterator
	Sign(ctx context.Context, digest []byte, key StoredKey) (cryptoutils.Signature, error)
	Name() string
}

Vault interface that represent a secure key store

type VaultNamer

type VaultNamer interface {
	VaultName() string
}

VaultNamer might be implemented by some backends which can handle multiple vaults under single account

Directories

Path Synopsis
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