keystore

package
v0.0.0-...-c2832fb Latest Latest
Warning

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

Go to latest
Published: Feb 29, 2016 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PEMPrivateKey = "EC PRIVATE KEY"
	PEMPublicKey  = "EC PUBLIC KEY"
)
View Source
const NameHeader = "Canonical-Name"
View Source
const UserKeyDir = ".cypress/keys"

Variables

View Source
var (
	ErrUnknownKey     = errors.New("unknown key")
	ErrUnknownKeyType = errors.New("unknown key type")
)
View Source
var Curve = elliptic.P521()
View Source
var ErrInvalidPermissions = errors.New("key has too wide of permissions")
View Source
var ErrNotDirectory = errors.New("path is not a directory")
View Source
var GlobalKeyDirs = []string{
	"/etc/cypress/keys",
	"/var/lib/cypress/keys",
}

Functions

func GenerateKey

func GenerateKey(path, name string) error

func KeyId

func KeyId(key *ecdsa.PublicKey) string

func LoadPEM

func LoadPEM(path string) (interface{}, *pem.Block, error)

func SaveNamedPrivatePEM

func SaveNamedPrivatePEM(path, name string, key *ecdsa.PrivateKey) error

func SaveNamedPublicPEM

func SaveNamedPublicPEM(path, name string, key *ecdsa.PublicKey) error

func SavePrivatePEM

func SavePrivatePEM(path string, key *ecdsa.PrivateKey) error

func SavePublicPEM

func SavePublicPEM(path string, key *ecdsa.PublicKey) error

func SetDefault

func SetDefault(keys Keys)

Types

type Directory

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

func NewDirectory

func NewDirectory(path string) (*Directory, error)

func (*Directory) Get

func (d *Directory) Get(id string) (*ecdsa.PublicKey, error)

func (*Directory) GetPrivate

func (d *Directory) GetPrivate(id string) (*ecdsa.PrivateKey, error)

type KeyCheck

type KeyCheck struct {
	Args struct {
		File string
	} `positional-args:"yes" required:"true"`
}

func (*KeyCheck) Execute

func (k *KeyCheck) Execute(args []string) error

type KeyGen

type KeyGen struct {
	Name string `short:"n" long:"name" description:"Canonical name to include in the key"`

	Output string `short:"o" long:"output" description:"Where to write the key"	required:"true"`
}

func (*KeyGen) Execute

func (k *KeyGen) Execute(args []string) error

type Keys

type Keys interface {
	Get(name string) (*ecdsa.PublicKey, error)
	GetPrivate(name string) (*ecdsa.PrivateKey, error)
}

func Default

func Default() Keys

type TestKeys

type TestKeys struct {
	Name string
	Key  *ecdsa.PrivateKey
}

func (*TestKeys) Gen

func (t *TestKeys) Gen() *ecdsa.PrivateKey

func (*TestKeys) Get

func (t *TestKeys) Get(name string) (*ecdsa.PublicKey, error)

func (*TestKeys) GetPrivate

func (t *TestKeys) GetPrivate(name string) (*ecdsa.PrivateKey, error)

type UserKeys

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

func (*UserKeys) Get

func (u *UserKeys) Get(name string) (*ecdsa.PublicKey, error)

func (*UserKeys) GetPrivate

func (u *UserKeys) GetPrivate(name string) (*ecdsa.PrivateKey, error)

func (*UserKeys) Setup

func (u *UserKeys) Setup() error

Jump to

Keyboard shortcuts

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