mocks

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2017 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EncrypterOpts

type EncrypterOpts struct{}

type HashOpts

type HashOpts struct{}

func (HashOpts) Algorithm

func (HashOpts) Algorithm() string

type KeyDerivOpts

type KeyDerivOpts struct {
	EphemeralValue bool
}

func (*KeyDerivOpts) Algorithm

func (*KeyDerivOpts) Algorithm() string

func (*KeyDerivOpts) Ephemeral

func (o *KeyDerivOpts) Ephemeral() bool

type KeyGenOpts

type KeyGenOpts struct {
	EphemeralValue bool
}

func (*KeyGenOpts) Algorithm

func (*KeyGenOpts) Algorithm() string

func (*KeyGenOpts) Ephemeral

func (o *KeyGenOpts) Ephemeral() bool

type KeyImportOpts

type KeyImportOpts struct{}

func (*KeyImportOpts) Algorithm

func (*KeyImportOpts) Algorithm() string

func (*KeyImportOpts) Ephemeral

func (*KeyImportOpts) Ephemeral() bool

type KeyStore

type KeyStore struct {
	GetKeyValue bccsp.Key
	GetKeyErr   error
	StoreKeyErr error
}

func (*KeyStore) GetKey

func (ks *KeyStore) GetKey(ski []byte) (k bccsp.Key, err error)

func (*KeyStore) ReadOnly

func (*KeyStore) ReadOnly() bool

func (*KeyStore) StoreKey

func (ks *KeyStore) StoreKey(k bccsp.Key) (err error)

type MockBCCSP

type MockBCCSP struct {
	SignArgKey    bccsp.Key
	SignDigestArg []byte
	SignOptsArg   bccsp.SignerOpts

	SignValue []byte
	SignErr   error

	VerifyValue bool
	VerifyErr   error
}

func (*MockBCCSP) Decrypt

func (*MockBCCSP) Decrypt(k bccsp.Key, ciphertext []byte, opts bccsp.DecrypterOpts) (plaintext []byte, err error)

func (*MockBCCSP) Encrypt

func (*MockBCCSP) Encrypt(k bccsp.Key, plaintext []byte, opts bccsp.EncrypterOpts) (ciphertext []byte, err error)

func (*MockBCCSP) GetHash

func (*MockBCCSP) GetHash(opts bccsp.HashOpts) (h hash.Hash, err error)

func (*MockBCCSP) GetKey

func (*MockBCCSP) GetKey(ski []byte) (k bccsp.Key, err error)

func (*MockBCCSP) Hash

func (*MockBCCSP) Hash(msg []byte, opts bccsp.HashOpts) (hash []byte, err error)

func (*MockBCCSP) KeyDeriv

func (*MockBCCSP) KeyDeriv(k bccsp.Key, opts bccsp.KeyDerivOpts) (dk bccsp.Key, err error)

func (*MockBCCSP) KeyGen

func (*MockBCCSP) KeyGen(opts bccsp.KeyGenOpts) (k bccsp.Key, err error)

func (*MockBCCSP) KeyImport

func (*MockBCCSP) KeyImport(raw interface{}, opts bccsp.KeyImportOpts) (k bccsp.Key, err error)

func (*MockBCCSP) Sign

func (b *MockBCCSP) Sign(k bccsp.Key, digest []byte, opts bccsp.SignerOpts) (signature []byte, err error)

func (*MockBCCSP) Verify

func (b *MockBCCSP) Verify(k bccsp.Key, signature, digest []byte, opts bccsp.SignerOpts) (valid bool, err error)

type MockKey

type MockKey struct {
	BytesValue []byte
	BytesErr   error
	Symm       bool
	PK         bccsp.Key
	PKErr      error
}

func (*MockKey) Bytes

func (m *MockKey) Bytes() ([]byte, error)

func (*MockKey) Private

func (*MockKey) Private() bool

func (*MockKey) PublicKey

func (m *MockKey) PublicKey() (bccsp.Key, error)

func (*MockKey) SKI

func (*MockKey) SKI() []byte

func (*MockKey) Symmetric

func (m *MockKey) Symmetric() bool

type SignerOpts

type SignerOpts struct {
	HashFuncValue crypto.Hash
}

func (*SignerOpts) HashFunc

func (o *SignerOpts) HashFunc() crypto.Hash

Jump to

Keyboard shortcuts

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