encryption

package
v0.0.0-...-045538f Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const NonceSize = 12

Variables

This section is empty.

Functions

This section is empty.

Types

type Cryptor

type Cryptor interface {
	Encryptor
	Decryptor
}

func NewCryptor

func NewCryptor(keyManager KeyManager, prng io.Reader) Cryptor

type Decryptor

type Decryptor interface {
	Decrypt(encrypted Encrypted) ([]byte, error)
}

type Encrypted

type Encrypted struct {
	Nonce      []byte
	KeyLabel   string
	CipherText []byte
}

type EncryptionFlags

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

func AddEncryptionFlags

func AddEncryptionFlags(flagSet *flag.FlagSet) *EncryptionFlags

func NewEncryptionFlags

func NewEncryptionFlags() EncryptionFlags

func (*EncryptionFlags) Parse

func (ef *EncryptionFlags) Parse() (Key, []Key, error)

type EncryptionKeys

type EncryptionKeys map[string]struct{}

func (EncryptionKeys) Set

func (e EncryptionKeys) Set(key string) error

func (EncryptionKeys) String

func (EncryptionKeys) String() string

type Encryptor

type Encryptor interface {
	Encrypt(plaintext []byte) (Encrypted, error)
}

type Key

type Key interface {
	Label() string
	Block() cipher.Block
}

func NewKey

func NewKey(label, phrase string) (Key, error)

type KeyManager

type KeyManager interface {
	EncryptionKey() Key
	DecryptionKey(label string) Key
}

func NewKeyManager

func NewKeyManager(encryptionKey Key, decryptionKeys []Key) (KeyManager, error)

Directories

Path Synopsis
This file was generated by counterfeiter This file was generated by counterfeiter
This file was generated by counterfeiter This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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