cryptor

package
v0.0.0-...-95e4a88 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2014 License: BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEFAULT_VERSION = 1
)

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(in []byte) (resp []byte, err error)

Decrypt decrypts a file using the keys in the key cache.

func Encrypt

func Encrypt(in []byte, names []string, min int) (resp []byte, err error)

Encrypt encrypts data with the keys associated with names. This requires a minimum of min keys to decrypt. NOTE: as currently implemented, the maximum value for min is 2.

Types

type EncryptedData

type EncryptedData struct {
	Version   int
	VaultId   int
	KeySet    []MultiWrappedKey
	KeySetRSA map[string]SingleWrappedKey
	IV        []byte
	Data      []byte
	Signature []byte
}

EncryptedData is the format for encrypted data containing all the keys necessary to decrypt it when delegated.

type MultiWrappedKey

type MultiWrappedKey struct {
	Name []string
	Key  []byte
}

MultiWrappedKey is a structure containing a 16-byte key encrypted once for each of the keys corresponding to the names of the users in Name in order.

type SingleWrappedKey

type SingleWrappedKey struct {
	Key []byte
	// contains filtered or unexported fields
}

SingleWrappedKey is a structure containing a 16-byte key encrypted by an RSA or EC key.

Jump to

Keyboard shortcuts

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