Documentation ¶
Index ¶
- Constants
- type Wrapper
- func (k *Wrapper) Decrypt(ctx context.Context, in *wrapping.EncryptedBlobInfo, aad []byte) (pt []byte, err error)
- func (k *Wrapper) Encrypt(ctx context.Context, plaintext, aad []byte) (blob *wrapping.EncryptedBlobInfo, err error)
- func (k *Wrapper) Finalize(_ context.Context) error
- func (k *Wrapper) HMACKeyID() string
- func (k *Wrapper) Init(_ context.Context) error
- func (k *Wrapper) KeyID() string
- func (k *Wrapper) SetConfig(config map[string]string) (map[string]string, error)
- func (k *Wrapper) Type() string
Constants ¶
View Source
const ( // Accepted env vars EnvYandexCloudOAuthToken = "YANDEXCLOUD_OAUTH_TOKEN" EnvYandexCloudServiceAccountKeyFile = "YANDEXCLOUD_SERVICE_ACCOUNT_KEY_FILE" EnvYandexCloudKMSKeyID = "YANDEXCLOUD_KMS_KEY_ID" // Accepted config parameters CfgYandexCloudOAuthToken = "oauth_token" CfgYandexCloudServiceAccountKeyFile = "service_account_key_file" CfgYandexCloudKMSKeyID = "kms_key_id" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
Wrapper represents credentials and key information for the KMS Key used to encryption and decryption
func NewWrapper ¶
func NewWrapper(opts *wrapping.WrapperOptions) *Wrapper
NewWrapper creates a new Yandex.Cloud wrapper
func (*Wrapper) Decrypt ¶
func (k *Wrapper) Decrypt(ctx context.Context, in *wrapping.EncryptedBlobInfo, aad []byte) (pt []byte, err error)
Decrypt is used to decrypt the ciphertext. This should be called after Init.
func (*Wrapper) Encrypt ¶
func (k *Wrapper) Encrypt(ctx context.Context, plaintext, aad []byte) (blob *wrapping.EncryptedBlobInfo, err error)
Encrypt is used to encrypt the master key using Yandex.Cloud symmetric key. This returns the ciphertext, and/or any errors from this call. This should be called after the KMS client has been instantiated.
func (*Wrapper) Finalize ¶
Finalize is called during shutdown. This is a no-op since Wrapper doesn't require any cleanup.
Click to show internal directories.
Click to hide internal directories.