crypto

package
v0.1.4 Latest Latest
Warning

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

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

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
}

Crypto mock.

func (*Crypto) ComputeMAC added in v0.1.3

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) Verify

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

Verify returns a mocked value.

func (*Crypto) VerifyMAC added in v0.1.3

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

VerifyMAC returns a mocked value.

type SignFunc added in v0.1.4

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