kms

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 8 Imported by: 2

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

type Provider added in v0.1.3

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

Provider provides mock Provider implementation.

func NewProvider added in v0.1.3

func NewProvider(storeProvider storage.Provider, secretLock secretlock.Service) *Provider

NewProvider creates a new mock Provider.

func (*Provider) SecretLock added in v0.1.3

func (p *Provider) SecretLock() secretlock.Service

SecretLock returns a secret lock service

func (*Provider) StorageProvider added in v0.1.3

func (p *Provider) StorageProvider() storage.Provider

StorageProvider return a storage provider.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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