kms

package
v0.1.3-0...-617a0de Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMockKeyHandle

func CreateMockKeyHandle() (*keyset.Handle, error)

CreateMockKeyHandle is a utility function that returns a mock key (for tests only. ie: not registered in Tink)

Types

type KeyManager

type KeyManager struct {
	CreateKeyID    string
	CreateKeyValue *keyset.Handle
	CreateKeyErr   error
	GetKeyValue    *keyset.Handle
	GetKeyErr      error
	RotateKeyID    string
	RotateKeyValue *keyset.Handle
	RotateKeyErr   error
}

KeyManager mocks a local Key Management Service

func (*KeyManager) Create

func (k *KeyManager) Create(kt kmsservice.KeyType) (string, interface{}, error)

Create a new mock ey/keyset/key handle for the type kt

func (*KeyManager) Get

func (k *KeyManager) Get(keyID string) (interface{}, error)

Get a mock key handle for the given keyID

func (*KeyManager) Rotate

func (k *KeyManager) Rotate(kt kmsservice.KeyType, keyID string) (string, interface{}, error)

Rotate returns a mocked rotated keyset handle and its ID

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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