store

package
v0.0.0-...-9af3c23 Latest Latest
Warning

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

Go to latest
Published: May 7, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EntryMap

type EntryMap map[string]Value

EntryMap represents the contents of the file.

type FileStore

type FileStore string

FileStore stores an EntryMap in a YAML file on local disk.

func NewFileStore

func NewFileStore(filename string) FileStore

NewFileStore constructs a FileStore for a specific filename.

func (FileStore) Get

func (f FileStore) Get(name string) (Value, error)

Get a value.

func (FileStore) GetAll

func (f FileStore) GetAll() (EntryMap, error)

GetAll returns all of the entries in the file.

func (FileStore) GetKeyIds

func (f FileStore) GetKeyIds() (map[string]int, error)

GetKeyIds returns a histogram of occurrences of key IDs.

func (FileStore) Put

func (f FileStore) Put(name string, value Value) error

Put a value.

type Value

type Value struct {
	// KeyID of the key that this value is encrypted under. This identifies which key the
	// Provider should use.
	KeyID string `yaml:"key_id,omitempty"`
	// KeyManager indicates which key manager provided this key.
	KeyManager string `yaml:"key_manager,omitempty"`
	// KeyCiphertext is the encryption key that Ciphertext is encrypted with, but encrypted with a
	// key that only the Provider has.
	KeyCiphertext string `yaml:"key_ciphertext,omitempty"`
	// Algorithm used to populate Ciphertext.
	Algorithm string `yaml:"algorithm"`
	// Ciphertext is the plaintext encrypted with the ephemeral key.
	Ciphertext string `yaml:"ciphertext"`
}

Value is one entry in the file.

func (*Value) GetCiphertext

func (v *Value) GetCiphertext() ([]byte, error)

GetCiphertext returns the base64-decoded ciphertext.

func (*Value) GetKeyCiphertext

func (v *Value) GetKeyCiphertext() ([]byte, error)

GetKeyCiphertext returns the base64-decoded encrypted key.

Jump to

Keyboard shortcuts

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