kms

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package kms implements KMS operations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deployer

type Deployer interface {
	// CreateKey creates a new AWS KMS customer master key (CMK)
	// https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html
	CreateKey() error

	// ScheduleKeyDeletion schedules a key deletion.
	// Minimum pending days are 7.
	ScheduleKeyDeletion(pendingDays int64) error

	// ListAllKeys lists all KMS keys.
	ListAllKeys() ([]kms.KeyListEntry, error)

	EnableKey() error
	DisableKey() error

	EnableKeyRotation() error
	DisableKeyRotation() error

	// GenerateDataKey creates a unique data key. It returns a plaintext copy of the data
	// key and a copy that is encrypted under a customer master key (CMK).
	// ref. https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateDataKey.html
	GenerateDataKey(encryptionCtx map[string]string, keySpec string, keyBytes int64) (cipher []byte, plain []byte, err error)

	// Encrypt encrypts plaintext into ciphertext by using a customer master key (CMK).
	// It can encrypt up to 4 kilobytes (4096 bytes) of arbitrary data.
	Encrypt(encryptionCtx map[string]string, plain []byte) (cipher []byte, err error)
	// Decrypt decrypts ciphertext. Ciphertext is plaintext that has been previously encrypted
	// by using any of the following operations:
	//   GenerateDataKey
	//   GenerateDataKeyWithoutPlaintext
	//   Encrypt
	Decrypt(encryptionCtx map[string]string, cipher []byte) (plain []byte, err error)
}

Deployer defines KMS deployer.

func New

func New(cfg *kmsconfig.Config) (Deployer, error)

New returns a new KMS deployer.

Jump to

Keyboard shortcuts

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