Versions in this module Expand all Collapse all v2 v2.10.0 Jun 13, 2023 Changes in this version + var ErrFunctionNotImplemented = errors.New("the wrapping plugin does not implement this function") + var ErrInvalidParameter = errors.New("invalid parameter") + var File_github_com_hashicorp_go_kms_wrapping_v2_types_proto protoreflect.FileDescriptor + func EnvelopeDecrypt(data *EnvelopeInfo, opt ...Option) ([]byte, error) + type AeadType uint32 + const AeadTypeAesGcm + const AeadTypeUnknown + func AeadTypeMap(t string) AeadType + func (t AeadType) String() string + type BlobInfo struct + Ciphertext []byte + ClientData *_struct.Struct + Hmac []byte + Iv []byte + KeyInfo *KeyInfo + Plaintext []byte + ValuePath string + Wrapped bool + func (*BlobInfo) Descriptor() ([]byte, []int) + func (*BlobInfo) ProtoMessage() + func (x *BlobInfo) GetCiphertext() []byte + func (x *BlobInfo) GetClientData() *_struct.Struct + func (x *BlobInfo) GetHmac() []byte + func (x *BlobInfo) GetIv() []byte + func (x *BlobInfo) GetKeyInfo() *KeyInfo + func (x *BlobInfo) GetPlaintext() []byte + func (x *BlobInfo) GetValuePath() string + func (x *BlobInfo) GetWrapped() bool + func (x *BlobInfo) ProtoReflect() protoreflect.Message + func (x *BlobInfo) Reset() + func (x *BlobInfo) String() string + type EnvelopeInfo struct + Ciphertext []byte + Iv []byte + Key []byte + func EnvelopeEncrypt(plaintext []byte, opt ...Option) (*EnvelopeInfo, error) + func (*EnvelopeInfo) Descriptor() ([]byte, []int) + func (*EnvelopeInfo) ProtoMessage() + func (x *EnvelopeInfo) GetCiphertext() []byte + func (x *EnvelopeInfo) GetIv() []byte + func (x *EnvelopeInfo) GetKey() []byte + func (x *EnvelopeInfo) ProtoReflect() protoreflect.Message + func (x *EnvelopeInfo) Reset() + func (x *EnvelopeInfo) String() string + type HashType uint32 + const HashTypeSha256 + const HashTypeUnknown + func HashTypeMap(t string) HashType + func (t HashType) String() string + type HmacComputer interface + HmacKeyId func(context.Context) (string, error) + type InitFinalizer interface + Finalize func(ctx context.Context, options ...Option) error + Init func(ctx context.Context, options ...Option) error + type KeyExporter interface + KeyBytes func(context.Context) ([]byte, error) + type KeyInfo struct + Flags uint64 + HmacKeyId string + HmacMechanism uint64 + KeyId string + Mechanism uint64 + WrappedKey []byte + func (*KeyInfo) Descriptor() ([]byte, []int) + func (*KeyInfo) ProtoMessage() + func (x *KeyInfo) GetFlags() uint64 + func (x *KeyInfo) GetHmacKeyId() string + func (x *KeyInfo) GetHmacMechanism() uint64 + func (x *KeyInfo) GetKeyId() string + func (x *KeyInfo) GetMechanism() uint64 + func (x *KeyInfo) GetWrappedKey() []byte + func (x *KeyInfo) ProtoReflect() protoreflect.Message + func (x *KeyInfo) Reset() + func (x *KeyInfo) String() string + type Option func() interface + func WithAad(with []byte) Option + func WithConfigMap(with map[string]string) Option + func WithIV(with []byte) Option + func WithKeyId(with string) Option + type OptionFunc func(*Options) error + type Options struct + WithAad []byte + WithConfigMap map[string]string + WithIv []byte + WithKeyId string + func GetOpts(opt ...Option) (*Options, error) + func (*Options) Descriptor() ([]byte, []int) + func (*Options) ProtoMessage() + func (x *Options) GetWithAad() []byte + func (x *Options) GetWithConfigMap() map[string]string + func (x *Options) GetWithIv() []byte + func (x *Options) GetWithKeyId() string + func (x *Options) ProtoReflect() protoreflect.Message + func (x *Options) Reset() + func (x *Options) String() string + type TestInitFinalizer struct + func NewTestInitFinalizer(secret []byte) *TestInitFinalizer + func (t *TestInitFinalizer) Finalize(_ context.Context, _ ...Option) error + func (t *TestInitFinalizer) Init(_ context.Context, _ ...Option) error + type TestInitFinalizerHmacComputer struct + func NewTestInitFinalizerHmacComputer(secret []byte) *TestInitFinalizerHmacComputer + func (t *TestInitFinalizerHmacComputer) HmacKeyId(_ context.Context) (string, error) + type TestWrapper struct + func NewTestEnvelopeWrapper(secret []byte) *TestWrapper + func NewTestWrapper(secret []byte) *TestWrapper + func (t *TestWrapper) Decrypt(_ context.Context, dwi *BlobInfo, opts ...Option) ([]byte, error) + func (t *TestWrapper) Encrypt(ctx context.Context, plaintext []byte, opts ...Option) (*BlobInfo, error) + func (t *TestWrapper) HmacKeyId(_ context.Context) string + func (t *TestWrapper) KeyBytes(context.Context) ([]byte, error) + func (t *TestWrapper) KeyId(_ context.Context) (string, error) + func (t *TestWrapper) SetConfig(_ context.Context, opt ...Option) (*WrapperConfig, error) + func (t *TestWrapper) SetKeyId(k string) + func (t *TestWrapper) Type(_ context.Context) (WrapperType, error) + type Wrapper interface + Decrypt func(ctx context.Context, ciphertext *BlobInfo, options ...Option) ([]byte, error) + Encrypt func(ctx context.Context, plaintext []byte, options ...Option) (*BlobInfo, error) + KeyId func(context.Context) (string, error) + SetConfig func(ctx context.Context, options ...Option) (*WrapperConfig, error) + Type func(context.Context) (WrapperType, error) + type WrapperConfig struct + Metadata map[string]string + func (*WrapperConfig) Descriptor() ([]byte, []int) + func (*WrapperConfig) ProtoMessage() + func (x *WrapperConfig) GetMetadata() map[string]string + func (x *WrapperConfig) ProtoReflect() protoreflect.Message + func (x *WrapperConfig) Reset() + func (x *WrapperConfig) String() string + type WrapperType string + const WrapperTypeAead + const WrapperTypeAliCloudKms + const WrapperTypeAwsKms + const WrapperTypeAzureKeyVault + const WrapperTypeGcpCkms + const WrapperTypeHsmAuto + const WrapperTypeHuaweiCloudKms + const WrapperTypeOciKms + const WrapperTypePkcs11 + const WrapperTypePooled + const WrapperTypeShamir + const WrapperTypeTencentCloudKms + const WrapperTypeTest + const WrapperTypeTransit + const WrapperTypeUnknown + func (t WrapperType) String() string