encryption

package
v4.2.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDataIsEncrypted = errors.New("failed to decrypt data that is encrypted")
View Source
var ErrDataIsNotEncrypted = errors.New("failed to decrypt data that is not encrypted")

Functions

This section is empty.

Types

type Key

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

func NewKey

func NewKey(a cipher.AEAD) *Key

func (Key) Decrypt

func (e Key) Decrypt(text string, n *string) ([]byte, error)

func (Key) Encrypt

func (e Key) Encrypt(plaintext []byte) (string, *string, error)

type NoEncryption

type NoEncryption struct{}

func NewNoEncryption

func NewNoEncryption() *NoEncryption

func (NoEncryption) Decrypt

func (n NoEncryption) Decrypt(text string, nonce *string) ([]byte, error)

func (NoEncryption) Encrypt

func (n NoEncryption) Encrypt(plaintext []byte) (string, *string, error)

type Strategy

type Strategy interface {
	Encrypt([]byte) (string, *string, error)
	Decrypt(string, *string) ([]byte, error)
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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