Versions in this module Expand all Collapse all v2 v2.3.3 Jun 18, 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 + var HmacType_name = map[int32]string + var HmacType_value = map[string]int32 + var KeyEncoding_name = map[int32]string + var KeyEncoding_value = map[string]int32 + var KeyPurpose_name = map[int32]string + var KeyPurpose_value = map[string]int32 + var KeyType_name = map[int32]string + var KeyType_value = map[string]int32 + 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 *structpb.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() *structpb.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 HmacType int32 + const HmacType_Sha224 + const HmacType_Sha256 + const HmacType_Sha384 + const HmacType_Sha512 + const HmacType_Unknown_HmacType + func (HmacType) Descriptor() protoreflect.EnumDescriptor + func (HmacType) EnumDescriptor() ([]byte, []int) + func (HmacType) Type() protoreflect.EnumType + func (x HmacType) Enum() *HmacType + func (x HmacType) Number() protoreflect.EnumNumber + func (x HmacType) String() string + type InitFinalizer interface + Finalize func(ctx context.Context, options ...Option) error + Init func(ctx context.Context, options ...Option) error + type KeyEncoding int32 + const KeyEncoding_Bytes + const KeyEncoding_Pkcs8 + const KeyEncoding_Pkix + const KeyEncoding_Unknown_KeyEncoding + func (KeyEncoding) Descriptor() protoreflect.EnumDescriptor + func (KeyEncoding) EnumDescriptor() ([]byte, []int) + func (KeyEncoding) Type() protoreflect.EnumType + func (x KeyEncoding) Enum() *KeyEncoding + func (x KeyEncoding) Number() protoreflect.EnumNumber + func (x KeyEncoding) String() string + type KeyExporter interface + KeyBytes func(context.Context) ([]byte, error) + type KeyInfo struct + Flags uint64 + HmacKeyId string + HmacMechanism uint64 + Key []byte + KeyEncoding KeyEncoding + KeyId string + KeyPurposes []KeyPurpose + KeyType KeyType + Mechanism uint64 + WrappedKey []byte + WrappedKeyEncoding KeyEncoding + 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) GetKey() []byte + func (x *KeyInfo) GetKeyEncoding() KeyEncoding + func (x *KeyInfo) GetKeyId() string + func (x *KeyInfo) GetKeyPurposes() []KeyPurpose + func (x *KeyInfo) GetKeyType() KeyType + func (x *KeyInfo) GetMechanism() uint64 + func (x *KeyInfo) GetWrappedKey() []byte + func (x *KeyInfo) GetWrappedKeyEncoding() KeyEncoding + func (x *KeyInfo) ProtoReflect() protoreflect.Message + func (x *KeyInfo) Reset() + func (x *KeyInfo) String() string + type KeyPurpose int32 + const KeyPurpose_Decrypt + const KeyPurpose_Encrypt + const KeyPurpose_KeyPurpose_Unknown + const KeyPurpose_MAC + const KeyPurpose_Sign + const KeyPurpose_Unwrap + const KeyPurpose_Verify + const KeyPurpose_Wrap + func (KeyPurpose) Descriptor() protoreflect.EnumDescriptor + func (KeyPurpose) EnumDescriptor() ([]byte, []int) + func (KeyPurpose) Type() protoreflect.EnumType + func (x KeyPurpose) Enum() *KeyPurpose + func (x KeyPurpose) Number() protoreflect.EnumNumber + func (x KeyPurpose) String() string + type KeyType int32 + const KeyType_Aes256 + const KeyType_Ed25519 + const KeyType_EdsaP256 + const KeyType_EdsaP384 + const KeyType_EdsaP521 + const KeyType_HMAC + const KeyType_Rsa2048 + const KeyType_Rsa3072 + const KeyType_Rsa4096 + const KeyType_Unknown_KeyType + func (KeyType) Descriptor() protoreflect.EnumDescriptor + func (KeyType) EnumDescriptor() ([]byte, []int) + func (KeyType) Type() protoreflect.EnumType + func (x KeyType) Enum() *KeyType + func (x KeyType) Number() protoreflect.EnumNumber + func (x KeyType) String() string + type Option func() interface + func WithAad(with []byte) Option + func WithConfigMap(with map[string]string) Option + func WithDisallowEnvVars(disallowEnvVars bool) Option + func WithIV(with []byte) Option + func WithKeyEncoding(encoding KeyEncoding) Option + func WithKeyId(with string) Option + func WithKeyPurposes(purpose ...KeyPurpose) Option + func WithKeyType(keyType KeyType) Option + func WithRandomBytes(b []byte) Option + func WithWrappedKeyEncoding(encoding KeyEncoding) Option + type OptionFunc func(*Options) error + type Options struct + WithAad []byte + WithConfigMap map[string]string + WithDisallowEnvVars bool + WithIv []byte + WithKeyEncoding KeyEncoding + WithKeyId string + WithKeyPurposes []KeyPurpose + WithKeyType KeyType + WithRandomBytes []byte + WithWrappedKeyEncoding KeyEncoding + 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) GetWithDisallowEnvVars() bool + func (x *Options) GetWithIv() []byte + func (x *Options) GetWithKeyEncoding() KeyEncoding + func (x *Options) GetWithKeyId() string + func (x *Options) GetWithKeyPurposes() []KeyPurpose + func (x *Options) GetWithKeyType() KeyType + func (x *Options) GetWithRandomBytes() []byte + func (x *Options) GetWithWrappedKeyEncoding() KeyEncoding + func (x *Options) ProtoReflect() protoreflect.Message + func (x *Options) Reset() + func (x *Options) String() string + type SigInfo struct + HmacType *HmacType + KeyInfo *KeyInfo + Signature []byte + func (*SigInfo) Descriptor() ([]byte, []int) + func (*SigInfo) ProtoMessage() + func (x *SigInfo) GetHmacType() HmacType + func (x *SigInfo) GetKeyInfo() *KeyInfo + func (x *SigInfo) GetSignature() []byte + func (x *SigInfo) ProtoReflect() protoreflect.Message + func (x *SigInfo) Reset() + func (x *SigInfo) String() string + type SigInfoSigner interface + Sign func(ctx context.Context, msg []byte, opt ...Option) (*SigInfo, error) + type SigInfoVerifier interface + Verify func(ctx context.Context, msg []byte, sig *SigInfo, opt ...Option) (bool, error) + 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 + ReturnDecryptError error + ReturnEncryptError error + ReturnKeyIdError error + 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 WrapperTypeSepiorTSM + const WrapperTypeShamir + const WrapperTypeTencentCloudKms + const WrapperTypeTest + const WrapperTypeTransit + const WrapperTypeUnknown + func (t WrapperType) String() string