Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateKey(path, name string) error
- func KeyId(key *ecdsa.PublicKey) string
- func LoadPEM(path string) (interface{}, *pem.Block, error)
- func SaveNamedPrivatePEM(path, name string, key *ecdsa.PrivateKey) error
- func SaveNamedPublicPEM(path, name string, key *ecdsa.PublicKey) error
- func SavePrivatePEM(path string, key *ecdsa.PrivateKey) error
- func SavePublicPEM(path string, key *ecdsa.PublicKey) error
- func SetDefault(keys Keys)
- type Directory
- type KeyCheck
- type KeyGen
- type Keys
- type TestKeys
- type UserKeys
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 SaveNamedPrivatePEM ¶
func SaveNamedPrivatePEM(path, name string, key *ecdsa.PrivateKey) error
func SavePrivatePEM ¶
func SavePrivatePEM(path string, key *ecdsa.PrivateKey) error
func SetDefault ¶
func SetDefault(keys Keys)
Types ¶
type Directory ¶
type Directory struct {
// contains filtered or unexported fields
}
func NewDirectory ¶
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"` }
type KeyGen ¶
type Keys ¶
type TestKeys ¶
type TestKeys struct { Name string Key *ecdsa.PrivateKey }
func (*TestKeys) Gen ¶
func (t *TestKeys) Gen() *ecdsa.PrivateKey
func (*TestKeys) GetPrivate ¶
func (t *TestKeys) GetPrivate(name string) (*ecdsa.PrivateKey, error)
type UserKeys ¶
type UserKeys struct {
// contains filtered or unexported fields
}
func (*UserKeys) GetPrivate ¶
func (u *UserKeys) GetPrivate(name string) (*ecdsa.PrivateKey, error)
Click to show internal directories.
Click to hide internal directories.