Documentation
¶
Index ¶
- Constants
- Variables
- type EncryptedBlobInfo
- func (*EncryptedBlobInfo) Descriptor() ([]byte, []int)deprecated
- func (x *EncryptedBlobInfo) GetCiphertext() []byte
- func (x *EncryptedBlobInfo) GetHMAC() []byte
- func (x *EncryptedBlobInfo) GetIV() []byte
- func (x *EncryptedBlobInfo) GetKeyInfo() *KeyInfo
- func (x *EncryptedBlobInfo) GetValuePath() string
- func (x *EncryptedBlobInfo) GetWrapped() bool
- func (*EncryptedBlobInfo) ProtoMessage()
- func (x *EncryptedBlobInfo) ProtoReflect() protoreflect.Message
- func (x *EncryptedBlobInfo) Reset()
- func (x *EncryptedBlobInfo) String() string
- type Envelope
- type EnvelopeInfo
- type EnvelopeOptions
- type KeyInfo
- func (*KeyInfo) Descriptor() ([]byte, []int)deprecated
- 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 (*KeyInfo) ProtoMessage()
- func (x *KeyInfo) ProtoReflect() protoreflect.Message
- func (x *KeyInfo) Reset()
- func (x *KeyInfo) String() string
- type TestWrapper
- func (t *TestWrapper) Decrypt(_ context.Context, dwi *EncryptedBlobInfo, _ []byte) ([]byte, error)
- func (t *TestWrapper) Encrypt(_ context.Context, plaintext, _ []byte) (*EncryptedBlobInfo, error)
- func (t *TestWrapper) Finalize(_ context.Context) error
- func (t *TestWrapper) HMACKeyID() string
- func (t *TestWrapper) Init(_ context.Context) error
- func (t *TestWrapper) KeyID() string
- func (t *TestWrapper) SetKeyID(k string)
- func (t *TestWrapper) Type() string
- type Wrapper
- type WrapperOptions
Constants ¶
const ( AEAD = "aead" AliCloudKMS = "alicloudkms" AWSKMS = "awskms" AzureKeyVault = "azurekeyvault" GCPCKMS = "gcpckms" HuaweiCloudKMS = "huaweicloudkms" OCIKMS = "ocikms" PKCS11 = "pkcs11" Shamir = "shamir" TencentCloudKMS = "tencentcloudkms" Transit = "transit" Test = "test-auto" // HSMAutoDeprecated is a deprecated type relevant to Vault prior to 0.9.0. // It is still referenced in certain code paths for upgrade purporses HSMAutoDeprecated = "hsm-auto" )
These values define known types of Wrappers
Variables ¶
var File_types_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type EncryptedBlobInfo ¶
type EncryptedBlobInfo struct { // Ciphertext is the encrypted bytes Ciphertext []byte `protobuf:"bytes,1,opt,name=ciphertext,proto3" json:"ciphertext,omitempty"` // IV is the initialization value used during encryption IV []byte `protobuf:"bytes,2,opt,name=iv,proto3" json:"iv,omitempty"` // HMAC is the bytes of the HMAC, if any HMAC []byte `protobuf:"bytes,3,opt,name=hmac,proto3" json:"hmac,omitempty"` // Wrapped can be used by the client to indicate whether Ciphertext // actually contains wrapped data or not. This can be useful if you want to // reuse the same struct to pass data along before and after wrapping. Wrapped bool `protobuf:"varint,4,opt,name=wrapped,proto3" json:"wrapped,omitempty"` // KeyInfo contains information about the key that was used to create this value KeyInfo *KeyInfo `protobuf:"bytes,5,opt,name=key_info,json=keyInfo,proto3" json:"key_info,omitempty"` // ValuePath can be used by the client to store information about where the // value came from ValuePath string `protobuf:"bytes,6,opt,name=ValuePath,proto3" json:"ValuePath,omitempty"` // contains filtered or unexported fields }
EncryptedBlobInfo contains information about the encrypted value along with information about the key used to encrypt it
func (*EncryptedBlobInfo) Descriptor
deprecated
func (*EncryptedBlobInfo) Descriptor() ([]byte, []int)
Deprecated: Use EncryptedBlobInfo.ProtoReflect.Descriptor instead.
func (*EncryptedBlobInfo) GetCiphertext ¶
func (x *EncryptedBlobInfo) GetCiphertext() []byte
func (*EncryptedBlobInfo) GetHMAC ¶
func (x *EncryptedBlobInfo) GetHMAC() []byte
func (*EncryptedBlobInfo) GetIV ¶
func (x *EncryptedBlobInfo) GetIV() []byte
func (*EncryptedBlobInfo) GetKeyInfo ¶
func (x *EncryptedBlobInfo) GetKeyInfo() *KeyInfo
func (*EncryptedBlobInfo) GetValuePath ¶
func (x *EncryptedBlobInfo) GetValuePath() string
func (*EncryptedBlobInfo) GetWrapped ¶
func (x *EncryptedBlobInfo) GetWrapped() bool
func (*EncryptedBlobInfo) ProtoMessage ¶
func (*EncryptedBlobInfo) ProtoMessage()
func (*EncryptedBlobInfo) ProtoReflect ¶ added in v0.5.7
func (x *EncryptedBlobInfo) ProtoReflect() protoreflect.Message
func (*EncryptedBlobInfo) Reset ¶
func (x *EncryptedBlobInfo) Reset()
func (*EncryptedBlobInfo) String ¶
func (x *EncryptedBlobInfo) String() string
type Envelope ¶
type Envelope struct{}
Envelope performs encryption or decryption, wrapping sensitive data. It creates a random key. This is usable on its own but since many KMS systems or key types cannot support large values, this is used by implementations in this package to encrypt large values with a DEK and use the actual KMS to encrypt the DEK.
func NewEnvelope ¶
func NewEnvelope(opts *EnvelopeOptions) *Envelope
NewEnvelope retuns an Envelope that is ready to use for use. It is valid to pass nil EnvelopeOptions.
type EnvelopeInfo ¶
EnvelopeInfo contains the information necessary to perfom encryption or decryption in an envelope fashion
type EnvelopeOptions ¶
type EnvelopeOptions struct{}
EnvelopeOptions is a placeholder for future options, such as the ability to switch which algorithm is used
type KeyInfo ¶
type KeyInfo struct { // Mechanism is the method used by the wrapper to encrypt and sign the // data as defined by the wrapper. Mechanism uint64 `protobuf:"varint,1,opt,name=Mechanism,proto3" json:"Mechanism,omitempty"` HMACMechanism uint64 `protobuf:"varint,2,opt,name=HMACMechanism,proto3" json:"HMACMechanism,omitempty"` // This is an opaque ID used by the wrapper to identify the specific // key to use as defined by the wrapper. This could be a version, key // label, or something else. KeyID string `protobuf:"bytes,3,opt,name=KeyID,proto3" json:"KeyID,omitempty"` HMACKeyID string `protobuf:"bytes,4,opt,name=HMACKeyID,proto3" json:"HMACKeyID,omitempty"` // These value are used when generating our own data encryption keys // and encrypting them using the wrapper WrappedKey []byte `protobuf:"bytes,5,opt,name=WrappedKey,proto3" json:"WrappedKey,omitempty"` // Mechanism specific flags Flags uint64 `protobuf:"varint,6,opt,name=Flags,proto3" json:"Flags,omitempty"` // contains filtered or unexported fields }
KeyInfo contains information regarding which Wrapper key was used to encrypt the entry
func (*KeyInfo) Descriptor
deprecated
func (*KeyInfo) GetHMACKeyID ¶
func (*KeyInfo) GetHMACMechanism ¶
func (*KeyInfo) GetMechanism ¶
func (*KeyInfo) GetWrappedKey ¶
func (*KeyInfo) ProtoMessage ¶
func (*KeyInfo) ProtoMessage()
func (*KeyInfo) ProtoReflect ¶ added in v0.5.7
func (x *KeyInfo) ProtoReflect() protoreflect.Message
type TestWrapper ¶
type TestWrapper struct {
// contains filtered or unexported fields
}
TestWrapper is a wrapper that can be used for tests
func NewTestWrapper ¶
func NewTestWrapper(secret []byte) *TestWrapper
NewTestWrapper constructs a test wrapper
func (*TestWrapper) Decrypt ¶
func (t *TestWrapper) Decrypt(_ context.Context, dwi *EncryptedBlobInfo, _ []byte) ([]byte, error)
Decrypt allows decrypting via the test wrapper
func (*TestWrapper) Encrypt ¶
func (t *TestWrapper) Encrypt(_ context.Context, plaintext, _ []byte) (*EncryptedBlobInfo, error)
Encrypt allows encrypting via the test wrapper
func (*TestWrapper) Finalize ¶
func (t *TestWrapper) Finalize(_ context.Context) error
Finalize finalizes the test wrapper
func (*TestWrapper) HMACKeyID ¶
func (t *TestWrapper) HMACKeyID() string
HMACKeyID returns the configured HMAC key ID
func (*TestWrapper) Init ¶
func (t *TestWrapper) Init(_ context.Context) error
Init initializes the test wrapper
func (*TestWrapper) KeyID ¶
func (t *TestWrapper) KeyID() string
KeyID returns the configured key ID
func (*TestWrapper) SetKeyID ¶
func (t *TestWrapper) SetKeyID(k string)
SetKeyID allows setting the test wrapper's key ID
func (*TestWrapper) Type ¶
func (t *TestWrapper) Type() string
Type returns the type of the test wrapper
type Wrapper ¶
type Wrapper interface { // Type is the type of Wrapper Type() string // KeyID is the ID of the key currently used for encryption KeyID() string // HMACKeyID is the ID of the key currently used for HMACing (if any) HMACKeyID() string // Init allows performing any necessary setup calls before using this Wrapper Init(context.Context) error // Finalize should be called when all usage of this Wrapper is done Finalize(context.Context) error // Encrypt encrypts the given byte slice and puts information about the final result in the returned value. The second byte slice is to pass any additional authenticated data; this may or may not be used depending on the particular implementation. Encrypt(context.Context, []byte, []byte) (*EncryptedBlobInfo, error) // Decrypt takes in the value and decrypts it into the byte slice. The byte slice is to pass any additional authenticated data; this may or may not be used depending on the particular implementation. Decrypt(context.Context, *EncryptedBlobInfo, []byte) ([]byte, error) }
Wrapper is the embedded implementation of autoSeal that contains logic specific to encrypting and decrypting data, or in this case keys.
type WrapperOptions ¶
type WrapperOptions struct {
Logger hclog.Logger
}
WrapperOptions contains options used when creating a Wrapper
Directories
¶
Path | Synopsis |
---|---|
entropy
module
|
|
extras
|
|
kms
Module
|
|
kms/examples
Module
|
|
internal
|
|
plugin
module
|
|
wrappers
|
|