chacha20poly1305

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockHSM

type MockHSM struct {
	Key []byte
}

MockHSM is mock of HSM. It's a fake HSM and using ChaCha20Poly1305 for encryption.

func NewMockHSM

func NewMockHSM(key []byte) *MockHSM

NewMockHSM creates new HSM.

func (*MockHSM) Decrypt

func (h *MockHSM) Decrypt(cipherByte []byte) (plainText string, err error)

Decrypt decrypts prefixed cipherByte.

func (*MockHSM) Encrypt

func (h *MockHSM) Encrypt(plainText string) (cipherText string, err error)

Encrypt encrypts plainText and adds prefix.

Jump to

Keyboard shortcuts

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