Documentation ¶
Index ¶
- Constants
- type Wrapper
- func (v *Wrapper) Decrypt(ctx context.Context, in *wrapping.EncryptedBlobInfo, aad []byte) (pt []byte, err error)
- func (v *Wrapper) Encrypt(ctx context.Context, plaintext, aad []byte) (blob *wrapping.EncryptedBlobInfo, err error)
- func (v *Wrapper) Finalize(context.Context) error
- func (v *Wrapper) HMACKeyID() string
- func (v *Wrapper) Init(context.Context) error
- func (v *Wrapper) KeyID() string
- func (v *Wrapper) SetConfig(config map[string]string) (map[string]string, error)
- func (v *Wrapper) Type() string
Constants ¶
View Source
const ( EnvAzureKeyVaultWrapperVaultName = "AZUREKEYVAULT_WRAPPER_VAULT_NAME" EnvVaultAzureKeyVaultVaultName = "VAULT_AZUREKEYVAULT_VAULT_NAME" EnvAzureKeyVaultWrapperKeyName = "AZUREKEYVAULT_WRAPPER_KEY_NAME" EnvVaultAzureKeyVaultKeyName = "VAULT_AZUREKEYVAULT_KEY_NAME" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
Wrapper is an Wrapper that uses Azure Key Vault for crypto operations. Azure Key Vault currently does not support keys that can encrypt long data (RSA keys). Due to this fact, we generate and AES key and wrap the key using Key Vault and store it with the data
func NewWrapper ¶
func NewWrapper(opts *wrapping.WrapperOptions) *Wrapper
NewWrapper creates a new wrapper with the given options
func (*Wrapper) Decrypt ¶
func (v *Wrapper) Decrypt(ctx context.Context, in *wrapping.EncryptedBlobInfo, aad []byte) (pt []byte, err error)
Decrypt is used to decrypt the ciphertext
func (*Wrapper) Encrypt ¶
func (v *Wrapper) Encrypt(ctx context.Context, plaintext, aad []byte) (blob *wrapping.EncryptedBlobInfo, err error)
Encrypt is used to encrypt using Azure Key Vault. This returns the ciphertext, and/or any errors from this call.
Click to show internal directories.
Click to hide internal directories.