keyring

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2019 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Keyring

type Keyring interface {
	GetKeys() []*keysvc.Key
	GetKey(aliasOrID string) (*keysvc.Key, bool)
	AddKey(*keysvc.Key) error
	Decrypt([]byte) ([]byte, error)
}

func Load

func Load(keyring string) (Keyring, error)

Load loads keyring data (only YAML supported right now)

func LoadYAML

func LoadYAML(path string) (Keyring, error)

LoadYAML loads a YAML file as a keyring If the file does not exist it will return an empty keyring but not an error. This is a convenience function to avoid having a separate "create keyring" step for new users

type YAMLKeyring

type YAMLKeyring struct {
	File string
	Keys []*keysvc.Key
}

func (*YAMLKeyring) AddKey

func (kr *YAMLKeyring) AddKey(key *keysvc.Key) error

AddKey adds a predefined key to the keyring

func (*YAMLKeyring) Decrypt

func (kr *YAMLKeyring) Decrypt(data []byte) ([]byte, error)

func (*YAMLKeyring) GetKey

func (kr *YAMLKeyring) GetKey(aliasOrID string) (*keysvc.Key, bool)

GetKey gets an individual key from the keyring

func (*YAMLKeyring) GetKeys

func (kr *YAMLKeyring) GetKeys() []*keysvc.Key

GetKeys returns an array of all keys in the keyring

Jump to

Keyboard shortcuts

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