crypto

package
v0.1.6-0...-5c25bcb Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Crypto

type Crypto struct {
	EncryptValue      []byte
	EncryptNonceValue []byte
	EncryptErr        error
	DecryptValue      []byte
	DecryptErr        error
	SignValue         []byte
	SignKey           []byte
	SignFn            SignFunc
	SignErr           error
	VerifyErr         error
	ComputeMACValue   []byte
	ComputeMACErr     error
	VerifyMACErr      error
	WrapValue         *cryptoapi.RecipientWrappedKey
	WrapError         error
	UnwrapValue       []byte
	UnwrapError       error
}

Crypto mock.

func (*Crypto) ComputeMAC

func (c *Crypto) ComputeMAC(data []byte, kh interface{}) ([]byte, error)

ComputeMAC returns a mocked value and a mocked error.

func (*Crypto) Decrypt

func (c *Crypto) Decrypt(cipher, aad, nonce []byte, kh interface{}) ([]byte, error)

Decrypt returns a mocked value and a mocked error.

func (*Crypto) Encrypt

func (c *Crypto) Encrypt(msg, aad []byte, kh interface{}) ([]byte, []byte, error)

Encrypt returns mocked values and a mocked error.

func (*Crypto) Sign

func (c *Crypto) Sign(msg []byte, kh interface{}) ([]byte, error)

Sign returns a mocked value and a mocked error.

func (*Crypto) UnwrapKey

func (c *Crypto) UnwrapKey(recWK *cryptoapi.RecipientWrappedKey, kh interface{},
	wrapKeyOpts ...cryptoapi.WrapKeyOpts) ([]byte, error)

UnwrapKey returns a mocked value.

func (*Crypto) Verify

func (c *Crypto) Verify(signature, msg []byte, kh interface{}) error

Verify returns a mocked value.

func (*Crypto) VerifyMAC

func (c *Crypto) VerifyMAC(mac, data []byte, kh interface{}) error

VerifyMAC returns a mocked value.

func (*Crypto) WrapKey

func (c *Crypto) WrapKey(cek, apu, apv []byte, recPubKey *cryptoapi.PublicKey,
	wrapKeyOpts ...cryptoapi.WrapKeyOpts) (*cryptoapi.RecipientWrappedKey, error)

WrapKey returns a mocked value.

type SignFunc

type SignFunc func([]byte, interface{}) ([]byte, error)

SignFunc mocks Crypto's Sign() function, it useful for executing custom signing with the help of SignKey.

Jump to

Keyboard shortcuts

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