keymanagerbase

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: Apache-2.0 Imports: 16 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SortKeyEntries

func SortKeyEntries(entries []*KeyEntry)

Types

type Base

type Base struct {
	keymanagerv1.UnsafeKeyManagerServer
	// contains filtered or unexported fields
}

Base is the base KeyManager implementation

func New

func New(funcs Funcs) *Base

New creates a new base key manager using the provided Funcs. Default implementations are provided for any that aren't set.

func (*Base) GenerateKey

GenerateKey implements the KeyManager RPC of the same name.

func (*Base) GetPublicKey

GetPublicKey implements the KeyManager RPC of the same name.

func (*Base) GetPublicKeys

GetPublicKeys implements the KeyManager RPC of the same name.

func (*Base) SetEntries

func (m *Base) SetEntries(entries []*KeyEntry)

SetEntries is used to replace the set of managed entries. This is generally called by implementations when they are first loaded to set the initial set of entries.

func (*Base) SignData

SignData implements the KeyManager RPC of the same name.

type Funcs added in v1.0.0

type Funcs struct {
	WriteEntries       func(ctx context.Context, entries []*KeyEntry) error
	GenerateRSA2048Key func() (*rsa.PrivateKey, error)
	GenerateRSA4096Key func() (*rsa.PrivateKey, error)
	GenerateEC256Key   func() (*ecdsa.PrivateKey, error)
	GenerateEC384Key   func() (*ecdsa.PrivateKey, error)
}

Funcs is a collection of optional callbacks. Default implementations will be used when not provided.

type KeyEntry

type KeyEntry struct {
	PrivateKey crypto.Signer
	*keymanagerv1.PublicKey
}

KeyEntry is an entry maintained by the key manager

func MakeKeyEntryFromKey

func MakeKeyEntryFromKey(id string, privateKey crypto.PrivateKey) (*KeyEntry, error)

Jump to

Keyboard shortcuts

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