vault

package
v0.0.0-...-52aaef3 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2015 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeySize   = 32
	NonceSize = 12
)

Variables

View Source
var VaultFileExistsError = errors.New("Vault file already exists")

Functions

func AesCBCDecrypter

func AesCBCDecrypter(key interface{}, r io.Reader, w io.Writer) (written int64, err error)

func AesCBCEncrypter

func AesCBCEncrypter(key interface{}, r io.Reader, w io.Writer) (written int64, err error)

func AesCTRDecrypter

func AesCTRDecrypter(key interface{}, r io.Reader, w io.Writer) (int64, error)

func AesCTREncrypter

func AesCTREncrypter(key interface{}, r io.Reader, w io.Writer) (int64, error)

func AesGCMDecrypter

func AesGCMDecrypter(key interface{}, r io.Reader, w io.Writer) (int64, error)

this implementation required to load all information into memory before decrypting data.

func AesGCMEncrypter

func AesGCMEncrypter(key interface{}, r io.Reader, w io.Writer) (int64, error)

this implementation required to load all information into memory before encrypting data.

func AesOFBDecrypter

func AesOFBDecrypter(key interface{}, r io.Reader, w io.Writer) (int64, error)

func AesOFBEncrypter

func AesOFBEncrypter(key interface{}, r io.Reader, w io.Writer) (int64, error)

func Decrypt

func Decrypt(mode string, key interface{}, r io.Reader, w io.Writer) (int64, error)

func Encrypt

func Encrypt(mode string, key interface{}, r io.Reader, w io.Writer) (int64, error)

func GetCipher

func GetCipher(mode string) (Encrypter, Decrypter)

func GetVaultKey

func GetVaultKey(name string) []byte

func GetVaultPath

func GetVaultPath(sum []byte) string

func Marshal

func Marshal(mode string, key interface{}, v interface{}) (data []byte, err error)

func NoopDecrypter

func NoopDecrypter(key interface{}, r io.Reader, w io.Writer) (int64, error)

func NoopEncrypter

func NoopEncrypter(key interface{}, r io.Reader, w io.Writer) (int64, error)

func Unmarshal

func Unmarshal(mode string, key interface{}, data []byte, v interface{}) (err error)

Types

type Decrypter

type Decrypter func(key interface{}, r io.Reader, w io.Writer) (int64, error)

type DriverFs

type DriverFs struct {
	Root string
}

func (*DriverFs) GetReader

func (v *DriverFs) GetReader(name string) (io.ReadCloser, error)

func (*DriverFs) GetWriter

func (v *DriverFs) GetWriter(name string) (io.WriteCloser, error)

func (*DriverFs) Has

func (v *DriverFs) Has(name string) bool

func (*DriverFs) Remove

func (v *DriverFs) Remove(name string) error

type DriverS3

type DriverS3 struct {
	Root        string
	Bucket      string
	Region      string
	EndPoint    string
	Credentials *credentials.Credentials
	// contains filtered or unexported fields
}

func (*DriverS3) GetReader

func (d *DriverS3) GetReader(name string) (io.ReadCloser, error)

func (*DriverS3) GetWriter

func (d *DriverS3) GetWriter(name string) (io.WriteCloser, error)

func (*DriverS3) Has

func (d *DriverS3) Has(name string) bool

func (*DriverS3) Remove

func (d *DriverS3) Remove(name string) error

type Encrypter

type Encrypter func(key interface{}, r io.Reader, w io.Writer) (int64, error)

type Vault

type Vault struct {
	Driver  VaultDriver
	Algo    string
	BaseKey []byte
}

func (*Vault) Get

func (v *Vault) Get(name string, w io.Writer) (written int64, err error)

func (*Vault) GetMeta

func (v *Vault) GetMeta(name string) (vm VaultMetadata, err error)

func (*Vault) Has

func (v *Vault) Has(name string) bool

func (*Vault) Put

func (v *Vault) Put(name string, meta VaultMetadata, r io.Reader) (written int64, err error)

func (*Vault) Remove

func (v *Vault) Remove(name string) error

type VaultDriver

type VaultDriver interface {
	Has(key string) bool
	GetReader(key string) (io.ReadCloser, error)
	GetWriter(key string) (io.WriteCloser, error)
	Remove(key string) error
}

type VaultElement

type VaultElement struct {
	MetaKey []byte `json:"meta_key"`
	BinKey  []byte `json:"bin_key"`
	Algo    string `json:"algo"`
	Hash    string `json:"hash"`
}

func NewVaultElement

func NewVaultElement() *VaultElement

type VaultMetadata

type VaultMetadata map[string]interface{}

func NewVaultMetadata

func NewVaultMetadata() VaultMetadata

Jump to

Keyboard shortcuts

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