mocks

package
v0.0.0-...-51fbea3 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 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() csp.KeyStore

Types

type MockCSP

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

	SignValue []byte
	SignErr   error

	VerifyValue bool
	VerifyErr   error

	ExpectedSig []byte

	KeyImportValue csp.Key
	KeyImportErr   error

	EncryptErr error
	DecryptErr error

	HashValue []byte
	HashErr   error
}

func (*MockCSP) Decrypt

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

func (*MockCSP) Encrypt

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

func (*MockCSP) GetHash

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

func (*MockCSP) GetKey

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

func (*MockCSP) Hash

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

func (*MockCSP) KeyDeriv

func (*MockCSP) KeyDeriv(csp.KeyDerivOpts) (csp.Key, error)

func (*MockCSP) KeyGen

func (*MockCSP) KeyGen(csp.KeyGenOpts) (csp.Key, error)

func (*MockCSP) KeyImport

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

func (*MockCSP) Sign

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

func (*MockCSP) Verify

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

type MockKeyStore

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

func (*MockKeyStore) GetKey

func (m *MockKeyStore) GetKey(ski []byte) (csp.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 csp.Key) error

Jump to

Keyboard shortcuts

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