keymanager

package
v0.0.0-...-9af3c23 Latest Latest
Warning

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

Go to latest
Published: May 7, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetDefaultKeyManager

func GetDefaultKeyManager() string

GetDefaultKeyManager returns the default key managerlabel.

func GetKeyManagers

func GetKeyManagers() []string

GetKeyManagers returns a list of registered key managers.

Types

type EnvelopeKey

type EnvelopeKey struct {
	// Plaintext is the plaintext encryption key.
	Plaintext []byte
	// Ciphertext is the ciphertext of the encryption key, encrypted with a key that is managed
	// by the key manager..
	Ciphertext []byte
}

EnvelopeKey represents the key used in envelope encryption.

func (*EnvelopeKey) GetPlaintext32

func (e *EnvelopeKey) GetPlaintext32() *[32]byte

GetPlaintext32 returns the Plaintext key as a byte array.

type KeyManager

type KeyManager interface {
	GenerateEnvelopeKey(keyID, secretID string) (EnvelopeKey, error)
	Decrypt(keyMetadata []byte, secretID string) ([]byte, error)
	Label() string
}

KeyManager represents a service that can generate envelope keys and provide decryption keys.

func New

func New(label string) (KeyManager, error)

New returns a KeyManager of the requested type.

func NewKms

func NewKms() KeyManager

NewKms returns a new Kms.

type Kms

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

Kms is a KeyManager for AWS KMS.

func (*Kms) Decrypt

func (k *Kms) Decrypt(keyCiphertext []byte, secretID string) ([]byte, error)

Decrypt decrypts the encrypted key.

func (*Kms) GenerateEnvelopeKey

func (k *Kms) GenerateEnvelopeKey(keyID string, secretID string) (EnvelopeKey, error)

GenerateEnvelopeKey generates an EnvelopeKey under a specific KeyID.

func (*Kms) Label

func (k *Kms) Label() string

Label returns kmsLabel

Jump to

Keyboard shortcuts

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