Documentation ¶
Overview ¶
Package keygen package is a single entry point for generating OpenSSH keys
Index ¶
Constants ¶
View Source
const ( DSA = "dsa" ECDSA = "ecdsa" RSA = "rsa" ED25519 = "ed25519" )
These constants represent the support key types
Variables ¶
View Source
var ( // ErrUnsupportedKeyType is the error returned when an unsupported key type is requested ErrUnsupportedKeyType = errors.New("unsupported key type") // ErrUnsupportedKeyLength is the error returned when an invalid key length is supplied for the key type ErrUnsupportedKeyLength = errors.New("invalid key length") // ErrUnsuppontedCurve is the error returned when generating an ECDSA key and an invalid curve is requested ErrUnsuppontedCurve = errors.New("only P-256, P-384 and P-521 EC keys are supported") )
Functions ¶
This section is empty.
Types ¶
type Keydgen ¶
type Keydgen struct { Type string Bits uint16 Curve uint16 // contains filtered or unexported fields }
Keydgen represents an OpenSSH key generator
func (*Keydgen) GenerateKey ¶
GenerateKey generates and/or returns a private key
func (*Keydgen) MarshalPrivateKey ¶
MarshalPrivateKey returns an OpenSSH formatted private key
func (*Keydgen) MarshalPublicKey ¶
MarshalPublicKey returns an OpenSSH formatted public key
Click to show internal directories.
Click to hide internal directories.