encryption

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrVaultWrite           = errors.New("failed to write to vault")
	ErrVaultRead            = errors.New("failed to read from vault")
	ErrKeyGeneration        = errors.New("failed to generate encryption key")
	ErrInvalidEncryptionKey = errors.New("encryption key invalid")
)

Functions

func CreateKey

func CreateKey() ([]byte, error)

Types

type GenerateKey

type GenerateKey func() ([]byte, error)

type Vault added in v1.3.0

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

func NewVault added in v1.3.0

func NewVault(keyGenerator GenerateKey, client VaultClienter, path string) *Vault

func (*Vault) EncryptionKey added in v1.3.0

func (v *Vault) EncryptionKey(ctx context.Context, filepath string) ([]byte, error)

func (*Vault) GenerateEncryptionKey added in v1.3.0

func (v *Vault) GenerateEncryptionKey(ctx context.Context, filepath string) ([]byte, error)

type VaultClienter added in v1.3.0

type VaultClienter interface {
	ReadKey(path, key string) (string, error)
	WriteKey(path, key, value string) error
	Checker(ctx context.Context, state *healthcheck.CheckState) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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