wrapper

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package wrapper contains mocks for kms+crypto wrapper APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockFixedKeyCrypto

type MockFixedKeyCrypto struct {
	SignVal   []byte
	SignErr   error
	VerifyErr error
}

MockFixedKeyCrypto mocks kmscrypto.FixedKeyCrypto.

func (*MockFixedKeyCrypto) Sign

func (m *MockFixedKeyCrypto) Sign(msg []byte) ([]byte, error)

Sign mock.

func (*MockFixedKeyCrypto) SignMulti

func (m *MockFixedKeyCrypto) SignMulti(msgs [][]byte) ([]byte, error)

SignMulti mock.

func (*MockFixedKeyCrypto) Verify

func (m *MockFixedKeyCrypto) Verify(sig, msg []byte) error

Verify mock.

type MockKMSCrypto

type MockKMSCrypto struct {
	CreateVal         *jwk.JWK
	PubKeyBytes       []byte
	PubKeyType        kms.KeyType
	PubKeyErr         error
	CreateRawKID      string
	CreateRawVal      interface{}
	CreateErr         error
	SignVal           []byte
	SignErr           error
	VerifyErr         error
	FixedKeyCryptoVal *MockFixedKeyCrypto
	FixedKeyCryptoErr error
	EncryptVal        []byte
	EncryptNonce      []byte
	EncryptErr        error
	DecryptVal        []byte
	DecryptErr        error
}

MockKMSCrypto mocks wrapper.KMSCrypto.

func (*MockKMSCrypto) Create

func (m *MockKMSCrypto) Create(keyType kms.KeyType) (*jwk.JWK, error)

Create mock.

func (*MockKMSCrypto) CreateRaw

func (m *MockKMSCrypto) CreateRaw(keyType kms.KeyType) (string, interface{}, error)

CreateRaw mock.

func (*MockKMSCrypto) Decrypt

func (m *MockKMSCrypto) Decrypt(cipher, aad, nonce []byte, kid string) (msg []byte, err error)

Decrypt mock.

func (*MockKMSCrypto) Encrypt

func (m *MockKMSCrypto) Encrypt(msg, aad []byte, kid string) (cipher, nonce []byte, err error)

Encrypt mock.

func (*MockKMSCrypto) ExportPubKeyBytes added in v1.2.0

func (m *MockKMSCrypto) ExportPubKeyBytes(id string) ([]byte, kms.KeyType, error)

ExportPubKeyBytes mock.

func (*MockKMSCrypto) FixedKeyCrypto

func (m *MockKMSCrypto) FixedKeyCrypto(pub *jwk.JWK) (wrapperapi.FixedKeyCrypto, error)

FixedKeyCrypto mock.

func (*MockKMSCrypto) FixedKeyMultiSigner

func (m *MockKMSCrypto) FixedKeyMultiSigner(pub *jwk.JWK) (wrapperapi.FixedKeyMultiSigner, error)

FixedKeyMultiSigner mock.

func (*MockKMSCrypto) FixedKeySigner

func (m *MockKMSCrypto) FixedKeySigner(pub *jwk.JWK) (wrapperapi.FixedKeySigner, error)

FixedKeySigner mock.

func (*MockKMSCrypto) FixedMultiSignerGivenKID

func (m *MockKMSCrypto) FixedMultiSignerGivenKID(kid string) (wrapperapi.FixedKeyMultiSigner, error)

FixedMultiSignerGivenKID mock.

func (*MockKMSCrypto) Sign

func (m *MockKMSCrypto) Sign(msg []byte, pub *jwk.JWK) ([]byte, error)

Sign mock.

func (*MockKMSCrypto) SignMulti

func (m *MockKMSCrypto) SignMulti(msgs [][]byte, pub *jwk.JWK) ([]byte, error)

SignMulti mock.

func (*MockKMSCrypto) Verify

func (m *MockKMSCrypto) Verify(sig, msg []byte, pub *jwk.JWK) error

Verify mock.

Jump to

Keyboard shortcuts

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