aead

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2020 License: MPL-2.0 Imports: 8 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ShamirWrapper added in v0.5.2

type ShamirWrapper struct {
	*Wrapper
}

ShamirWrapper is here for backwards compatibility for Vault; it reports a type of "shamir" instead of "aead"

func NewShamirWrapper added in v0.5.2

func NewShamirWrapper(opts *wrapping.WrapperOptions) *ShamirWrapper

func (*ShamirWrapper) Type added in v0.5.2

func (s *ShamirWrapper) Type() string

type Wrapper

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

Wrapper implements the wrapping.Wrapper interface for AEAD

func NewWrapper

func NewWrapper(opts *wrapping.WrapperOptions) *Wrapper

NewWrapper creates a new Wrapper with the provided logger

func (*Wrapper) Decrypt

func (s *Wrapper) Decrypt(_ context.Context, in *wrapping.EncryptedBlobInfo, aad []byte) ([]byte, error)

func (*Wrapper) Encrypt

func (s *Wrapper) Encrypt(_ context.Context, plaintext, aad []byte) (*wrapping.EncryptedBlobInfo, error)

Encrypt is used to encrypt the plaintext using the aead held by the seal.

func (*Wrapper) Finalize

func (s *Wrapper) Finalize(_ context.Context) error

Finalize is called during shutdown. This is a no-op since Wrapper doesn't require any cleanup.

func (*Wrapper) GetKeyBytes

func (s *Wrapper) GetKeyBytes() []byte

func (*Wrapper) HMACKeyID

func (s *Wrapper) HMACKeyID() string

HMACKeyID returns the last known HMAC key id

func (*Wrapper) Init

func (s *Wrapper) Init(_ context.Context) error

Init is a no-op at the moment

func (*Wrapper) KeyID

func (s *Wrapper) KeyID() string

KeyID returns the last known key id

func (*Wrapper) SetAEAD

func (s *Wrapper) SetAEAD(aead cipher.AEAD)

func (*Wrapper) SetAESGCMKeyBytes

func (s *Wrapper) SetAESGCMKeyBytes(key []byte) error

SetAESGCMKeyBytes takes in a byte slice and constucts an AES-GCM AEAD from it

func (*Wrapper) SetConfig added in v0.5.3

func (s *Wrapper) SetConfig(config map[string]string) (map[string]string, error)

SetConfig sets the fields on the Wrapper object based on values from the config parameter.

func (*Wrapper) Type

func (s *Wrapper) Type() string

Type returns the seal type for this particular Wrapper implementation

Directories

Path Synopsis
module

Jump to

Keyboard shortcuts

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