Documentation ¶
Index ¶
- type DerivedWrapperOptions
- type ShamirWrapper
- type Wrapper
- func (s *Wrapper) Decrypt(_ context.Context, in *wrapping.EncryptedBlobInfo, aad []byte) ([]byte, error)
- func (s *Wrapper) Encrypt(_ context.Context, plaintext, aad []byte) (*wrapping.EncryptedBlobInfo, error)
- func (s *Wrapper) Finalize(_ context.Context) error
- func (s *Wrapper) GetKeyBytes() []byte
- func (s *Wrapper) HMACKeyID() string
- func (s *Wrapper) Init(_ context.Context) error
- func (s *Wrapper) KeyID() string
- func (s *Wrapper) NewDerivedWrapper(opts *DerivedWrapperOptions) (*Wrapper, error)
- func (s *Wrapper) SetAEAD(aead cipher.AEAD)
- func (s *Wrapper) SetAESGCMKeyBytes(key []byte) error
- func (s *Wrapper) SetConfig(config map[string]string) (map[string]string, error)
- func (s *Wrapper) Type() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DerivedWrapperOptions ¶ added in v0.5.4
type DerivedWrapperOptions struct { // KeyID is the key ID to set on the derived wrapper KeyID string // AEADType is the type of AEAD to use in the sub-wrapper. An empty value // defaults to "aes-gcm". AEADType string // Hash is the type of hash function to use with HKDF. Defaults to // sha256.New. Hash func() hash.Hash // Salt is the salt value to use, can be (but shouldn't be) nil Salt []byte // Info is the info value to use, can be (but shouldn't be) nil Info []byte }
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(_ *wrapping.WrapperOptions) *Wrapper
NewWrapper creates a new Wrapper with the provided logger
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 ¶
Finalize is called during shutdown. This is a no-op since Wrapper doesn't require any cleanup.
func (*Wrapper) GetKeyBytes ¶
func (*Wrapper) NewDerivedWrapper ¶ added in v0.5.4
func (s *Wrapper) NewDerivedWrapper(opts *DerivedWrapperOptions) (*Wrapper, error)
NewDerivedWrapper returns an aead.Wrapper whose key is set to an hkdf-based derivation from the original wrapper
func (*Wrapper) SetAESGCMKeyBytes ¶
SetAESGCMKeyBytes takes in a byte slice and constucts an AES-GCM AEAD from it
Click to show internal directories.
Click to hide internal directories.