tencentcloudkms

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 4, 2022 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PROVIDER_SECRET_ID      = "TENCENTCLOUD_SECRET_ID"
	PROVIDER_SECRET_KEY     = "TENCENTCLOUD_SECRET_KEY"
	PROVIDER_SECURITY_TOKEN = "TENCENTCLOUD_SECURITY_TOKEN"
	PROVIDER_REGION         = "TENCENTCLOUD_REGION"
	PROVIDER_KMS_KEY_ID     = "TENCENTCLOUD_KMS_KEY_ID"
)

These constants are TencentCloud accepted env vars

Variables

This section is empty.

Functions

This section is empty.

Types

type Wrapper

type Wrapper struct {
	// contains filtered or unexported fields
}

Wrapper is a wrapper that uses TencentCloud KMS

func NewWrapper

func NewWrapper(opts *wrapping.WrapperOptions) *Wrapper

NewWrapper returns a new TencentCloud wrapper

func (*Wrapper) Decrypt

func (k *Wrapper) Decrypt(_ context.Context, in *wrapping.EncryptedBlobInfo, aad []byte) (pt []byte, err error)

Decrypt is used to decrypt the ciphertext using the the TencentCloud KMS. This should be called after the KMS client has been instantiated.

func (*Wrapper) Encrypt

func (k *Wrapper) Encrypt(_ context.Context, plaintext, aad []byte) (blob *wrapping.EncryptedBlobInfo, err error)

Encrypt is used to encrypt the master key using the the TencentCloud KMS. 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

func (k *Wrapper) Finalize(_ context.Context) error

Finalize is called during shutdown. No-op at the moment.

func (*Wrapper) HMACKeyID

func (k *Wrapper) HMACKeyID() string

HMACKeyID returns nothing, it's here to satisfy the interface

func (*Wrapper) Init

func (k *Wrapper) Init(_ context.Context) error

Init is called during core.Initialize. No-op at the moment.

func (*Wrapper) KeyID

func (k *Wrapper) KeyID() string

KeyID returns the last known key id

func (*Wrapper) SetConfig

func (k *Wrapper) SetConfig(config map[string]string) (map[string]string, error)

SetConfig sets the fields on the wrapper object based on TencentCloud config parameter

Order of precedence values: * Environment variable * Instance metadata role

func (*Wrapper) Type

func (k *Wrapper) Type() string

Type returns the type for this particular wrapper implementation

Directories

Path Synopsis
module

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL