Documentation
¶
Index ¶
- Constants
- func WithAccessKey(with string) wrapping.Option
- func WithRegion(with string) wrapping.Option
- func WithSecretKey(with string) wrapping.Option
- func WithSessionToken(with string) wrapping.Option
- type OptionFunc
- type Wrapper
- func (k *Wrapper) Decrypt(_ context.Context, in *wrapping.BlobInfo, opt ...wrapping.Option) ([]byte, error)
- func (k *Wrapper) Encrypt(_ context.Context, plaintext []byte, opt ...wrapping.Option) (*wrapping.BlobInfo, error)
- func (k *Wrapper) KeyId(_ context.Context) (string, error)
- func (k *Wrapper) SetConfig(_ context.Context, opt ...wrapping.Option) (*wrapping.WrapperConfig, error)
- func (k *Wrapper) Type(_ context.Context) (wrapping.WrapperType, error)
Constants ¶
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 ¶
func WithAccessKey ¶
WithAccessKey provides a way to chose the access key
func WithRegion ¶
WithRegion provides a way to chose the region
func WithSecretKey ¶
WithSecretKey provides a way to chose the secret key
func WithSessionToken ¶
WithSessionToken provides a way to chose the session token
Types ¶
type OptionFunc ¶
type OptionFunc func(*options) error
OptionFunc holds a function with local options
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
Wrapper is a wrapper that uses TencentCloud KMS
func (*Wrapper) Decrypt ¶
func (k *Wrapper) Decrypt(_ context.Context, in *wrapping.BlobInfo, opt ...wrapping.Option) ([]byte, 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 []byte, opt ...wrapping.Option) (*wrapping.BlobInfo, 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.