seal

package
v0.0.0-...-e8682ef Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestSeal

func NewTestSeal(opts *TestSealOpts) (Access, *ToggleableWrapper)

Types

type Access

type Access interface {
	wrapping.Wrapper
	wrapping.InitFinalizer

	GetWrapper() wrapping.Wrapper
}

Access is the embedded implementation of autoSeal that contains logic specific to encrypting and decrypting data, or in this case keys.

func NewAccess

func NewAccess(w wrapping.Wrapper) Access

func NewToggleableTestSeal

func NewToggleableTestSeal(opts *TestSealOpts) (Access, func(error))

type Envelope

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

func NewEnvelope

func NewEnvelope() *Envelope

func (*Envelope) Decrypt

func (e *Envelope) Decrypt(data *wrapping.EnvelopeInfo, aad []byte) ([]byte, error)

func (*Envelope) Encrypt

func (e *Envelope) Encrypt(plaintext, aad []byte) (*wrapping.EnvelopeInfo, error)

type StoredKeysSupport

type StoredKeysSupport int
const (
	// The 0 value of StoredKeysSupport is an invalid option
	StoredKeysInvalid StoredKeysSupport = iota
	StoredKeysNotSupported
	StoredKeysSupportedGeneric
	StoredKeysSupportedShamirRoot
)

func (StoredKeysSupport) String

func (s StoredKeysSupport) String() string

type TestSealOpts

type TestSealOpts struct {
	Logger     hclog.Logger
	StoredKeys StoredKeysSupport
	Secret     []byte
	Name       wrapping.WrapperType
}

type ToggleableWrapper

type ToggleableWrapper struct {
	wrapping.Wrapper
	// contains filtered or unexported fields
}

func (ToggleableWrapper) Decrypt

func (t ToggleableWrapper) Decrypt(ctx context.Context, info *wrapping.BlobInfo, opts ...wrapping.Option) ([]byte, error)

func (*ToggleableWrapper) Encrypt

func (t *ToggleableWrapper) Encrypt(ctx context.Context, bytes []byte, opts ...wrapping.Option) (*wrapping.BlobInfo, error)

func (*ToggleableWrapper) SetError

func (t *ToggleableWrapper) SetError(err error)

func (*ToggleableWrapper) Type

Jump to

Keyboard shortcuts

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