crypt

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EncrypterMap = map[string]EncrypterFunc{
		"AES": NewAESEncrypter,
	}
	Providers = []string{
		"AES",
	}
)

Functions

This section is empty.

Types

type AESEncrypter

type AESEncrypter struct {
	HashAlgorithm crypto.Hash
	AEAD          cipher.AEAD
}

func (*AESEncrypter) Algorithm

func (a *AESEncrypter) Algorithm() string

func (*AESEncrypter) Decrypt

func (a *AESEncrypter) Decrypt(r io.Reader) ([]byte, error)

func (*AESEncrypter) Encrypt

func (a *AESEncrypter) Encrypt(r io.Reader) ([]byte, error)

func (*AESEncrypter) Hasher

func (a *AESEncrypter) Hasher() crypto.Hash

type Encrypter

type Encrypter interface {
	Encrypt(io.Reader) ([]byte, error)
	Decrypt(io.Reader) ([]byte, error)
	Algorithm() string
	Hasher() crypto.Hash
}

func New

func New(algorithm, key string) (Encrypter, error)

func NewAESEncrypter

func NewAESEncrypter(key string) Encrypter

func NewFromEnv

func NewFromEnv() (Encrypter, error)

type EncrypterFunc

type EncrypterFunc func(key string) Encrypter

Jump to

Keyboard shortcuts

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