mockkms

package
v2.0.0-...-797e9f4 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package mockkms provides a partial implementation of AWS' KMS interface sufficient to satisfy the KMSClient interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyType

type KeyType int

KeyType describes the type of a key.

const (
	KeyTypeECCNISTP256 KeyType = iota
	KeyTypeECCNISTP384
	KeyTypeECCNISTP521
	KeyTypeRSA2048
)

type MockKMS

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

MockKMS implements the KMSClient interface backed by in-memory storage. It is safe for concurrent use.

func NewMockKMS

func NewMockKMS() *MockKMS

NewMockKMS constructs a new MockKMS instance.

func (*MockKMS) GenerateKey

func (k *MockKMS) GenerateKey(kt KeyType) (string, error)

GenerateKey generates a key of the type described by kt and returns the KeyId which can be used by subsequent calls to refer to the generated key.

func (*MockKMS) GetPublicKeyWithContext

func (k *MockKMS) GetPublicKeyWithContext(ctx aws.Context, in *kms.GetPublicKeyInput, opts ...request.Option) (*kms.GetPublicKeyOutput, error)

func (*MockKMS) SignWithContext

func (k *MockKMS) SignWithContext(ctx aws.Context, in *kms.SignInput, opts ...request.Option) (*kms.SignOutput, error)

func (*MockKMS) VerifyWithContext

func (k *MockKMS) VerifyWithContext(ctx aws.Context, in *kms.VerifyInput, opts ...request.Option) (*kms.VerifyOutput, error)

Jump to

Keyboard shortcuts

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