kms

package module
v0.0.0-...-e2ddeb5 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(kmsClient kmsiface.KMSAPI, storage KMSStorage, symmetricMasterKeyAlias string) security.SecureModule

New creates and instance of secure module based on AWS KMS service for asymmetric and symmetric security

func NewAsync

func NewAsync(kmsClient kmsiface.KMSAPI) security.SecureModule

New creates and instance of secure module based on AWS KMS service only for asymmetric security

Types

type KMSStorage

type KMSStorage interface {
	Save(ctx runtime.Context, alias string, criptedKey []byte, algo string) error
	Get(ctx runtime.Context, alias string) (KMSStorageData, error)
}

KMSStorage defines the behavior of the KMS storage. KMS needs a master KEY (stored in the AWS KMS service) used to generate a random AES key This interface will be used to store the random AES Key that will be used to encrypt or decrypt data. This AES Key is encrypted with the master Key and can be used only with Encrypt/Decrypt KMS client operations

type KMSStorageData

type KMSStorageData struct {
	Key  []byte
	Algo string
}

KMSStorageData is the entity stored in the KMS Storage

Jump to

Keyboard shortcuts

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