keys

package
v1.2.13 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoKeyInSecret is returned when a secret was expected to contain an
	// encryption key, but didn't.
	ErrNoKeyInSecret = errors.New("secret does not contain encryption key")
)

Functions

This section is empty.

Types

type KeyManager

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

KeyManager generates, stores and removes encryption keys.

func New

func New(client client.Client) *KeyManager

New creates a new KeyManager that is responsible for generationg and storing volume encryption keys. The client should be uncached so that created secrets can be read back immediately.

func (*KeyManager) Ensure

func (m *KeyManager) Ensure(ctx context.Context, nsKeyRef client.ObjectKey, volKeyRef client.ObjectKey, nsSecretLabels map[string]string, volSecretLabels map[string]string) error

Ensure that a secret exists at volKeyRef, creating it with valid keys if needed. If a secret already exists, it does not verify validity.

Jump to

Keyboard shortcuts

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