kms

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrKeyAlreadyExists = fmt.Errorf("kms key already exists")

Functions

This section is empty.

Types

type KMS

type KMS interface {
	Init(context.Context) (*string, error)
	Encrypt(context.Context, []byte) ([]byte, error)
	Decrypt(context.Context, []byte) ([]byte, error)
}

func NewKMSConfig

func NewKMSConfig(ctx context.Context, key *string) (KMS, error)

type KMSConfig

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

func (*KMSConfig) Decrypt

func (k *KMSConfig) Decrypt(ctx context.Context, data []byte) ([]byte, error)

Decrypt

func (*KMSConfig) Encrypt

func (k *KMSConfig) Encrypt(ctx context.Context, data []byte) ([]byte, error)

Encrypt

func (*KMSConfig) Init

func (k *KMSConfig) Init(ctx context.Context) (*string, error)

Init creates a kms key for decryptying and encrypting data

Jump to

Keyboard shortcuts

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