keys

package
v1.5.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package keys contains various encryption KeyHandler implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler interface {
	GetKey(options ...KeyOption) ([]byte, error)
}

Handler represents an interface for fetching encryption keys.

func NewHandler

func NewHandler(key config.EncryptionKey) (Handler, error)

NewHandler creates a new key handler depending on key handler kind.

type KeyOption

type KeyOption func(o *KeyOptions) error

KeyOption represents key option callback used in KeyHandler.GetKey func.

func WithPartitionLabel

func WithPartitionLabel(label string) KeyOption

WithPartitionLabel passes the partition label in to GetKey function.

type KeyOptions

type KeyOptions struct {
	PartitionLabel string
}

KeyOptions set of options to be used in KeyHandler.GetKey func.

func NewDefaultOptions

func NewDefaultOptions(options []KeyOption) (*KeyOptions, error)

NewDefaultOptions creates new KeyOptions.

type NodeIDKeyHandler

type NodeIDKeyHandler struct{}

NodeIDKeyHandler generates the key based on current node information and provided template string.

func NewNodeIDKeyHandler

func NewNodeIDKeyHandler() (*NodeIDKeyHandler, error)

NewNodeIDKeyHandler creates new NodeIDKeyHandler.

func (*NodeIDKeyHandler) GetKey

func (h *NodeIDKeyHandler) GetKey(options ...KeyOption) ([]byte, error)

GetKey implements KeyHandler interface.

type StaticKeyHandler

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

StaticKeyHandler just handles the static key value all the time.

func NewStaticKeyHandler

func NewStaticKeyHandler(key []byte) (*StaticKeyHandler, error)

NewStaticKeyHandler creates new EphemeralKeyHandler.

func (*StaticKeyHandler) GetKey

func (h *StaticKeyHandler) GetKey(options ...KeyOption) ([]byte, error)

GetKey implements KeyHandler interface.

Jump to

Keyboard shortcuts

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