mocks

package
v0.0.0-...-beacba6 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockKeyStore

func NewMockKeyStore() interfaces.KeyStore

Types

type MockCSP

type MockCSP struct {
	SignArgKey    interfaces.Key
	SignDigestArg []byte
	SignOptsArg   interfaces.SignerOpts

	SignValue []byte
	SignErr   error

	VerifyValue bool
	VerifyErr   error

	ExpectedSig []byte

	KeyImportValue interfaces.Key
	KeyImportErr   error

	EncryptErr error
	DecryptErr error

	HashValue []byte
	HashErr   error
}

func (*MockCSP) Decrypt

func (m *MockCSP) Decrypt(key interfaces.Key, ciphertext []byte, opts interfaces.DecrypterOpts) ([]byte, error)

func (*MockCSP) Encrypt

func (m *MockCSP) Encrypt(key interfaces.Key, plaintext []byte, opts interfaces.EncrypterOpts) ([]byte, error)

func (*MockCSP) GetHash

func (*MockCSP) GetHash(opts interfaces.HashOpts) (hash.Hash, error)

func (*MockCSP) GetKey

func (*MockCSP) GetKey(ski []byte) (interfaces.Key, error)

func (*MockCSP) Hash

func (m *MockCSP) Hash(msg []byte, opts interfaces.HashOpts) ([]byte, error)

func (*MockCSP) KeyDeriv

func (*MockCSP) KeyGen

func (*MockCSP) KeyImport

func (m *MockCSP) KeyImport(raw interface{}, opts interfaces.KeyImportOpts) (interfaces.Key, error)

func (*MockCSP) Sign

func (m *MockCSP) Sign(key interfaces.Key, digest []byte, opts interfaces.SignerOpts) ([]byte, error)

func (*MockCSP) Verify

func (m *MockCSP) Verify(key interfaces.Key, signature, digest []byte, opts interfaces.SignerOpts) (bool, error)

type MockKeyStore

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

func (*MockKeyStore) GetKey

func (m *MockKeyStore) GetKey(ski []byte) (interfaces.Key, error)

func (*MockKeyStore) Num

func (m *MockKeyStore) Num() int

func (*MockKeyStore) ReadOnly

func (m *MockKeyStore) ReadOnly() bool

func (*MockKeyStore) StoreKey

func (m *MockKeyStore) StoreKey(key interfaces.Key) error

Jump to

Keyboard shortcuts

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