keyring

package
v0.0.0-...-3a74bb8 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Store  storage.Storage
	Logger logging.Logger

	DecryptionKeys map[string]*vaultv1.KeyEncryptionKey
	EncryptionKey  *vaultv1.KeyEncryptionKey
}

type Keyring

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

func New

func New(config Config) (*Keyring, error)

func (*Keyring) CreateKey

func (k *Keyring) CreateKey(ctx context.Context, ringID string) (*vaultv1.DataEncryptionKey, error)

func (*Keyring) DecodeAndDecryptKey

func (k *Keyring) DecodeAndDecryptKey(ctx context.Context, b []byte) (*vaultv1.DataEncryptionKey, string, error)

func (*Keyring) EncryptAndEncodeKey

func (k *Keyring) EncryptAndEncodeKey(ctx context.Context, dek *vaultv1.DataEncryptionKey) ([]byte, error)

func (*Keyring) GetKey

func (k *Keyring) GetKey(ctx context.Context, ringID, keyID string) (*vaultv1.DataEncryptionKey, error)

func (*Keyring) GetLatestKey

func (k *Keyring) GetLatestKey(ctx context.Context, ringID string) (*vaultv1.DataEncryptionKey, error)

GetLatestKey returns the latest key from the keyring. If no key is found, it creates a new key.

func (*Keyring) GetOrCreateKey

func (k *Keyring) GetOrCreateKey(ctx context.Context, ringID, keyID string) (*vaultv1.DataEncryptionKey, error)

func (*Keyring) RollKeys

func (k *Keyring) RollKeys(ctx context.Context, ringID string) error

Jump to

Keyboard shortcuts

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