Documentation
¶
Index ¶
- func ECDSAP256() (crypto.PrivateKey, error)
- func ECDSAP384() (crypto.PrivateKey, error)
- func ECDSAP521() (crypto.PrivateKey, error)
- func ED25519() (crypto.PrivateKey, error)
- func FormatKey(pk crypto.PrivateKey, comment string) (private string, public string, keyAlgorithm string, err error)
- func GenerateHostKeys() ([]crypto.PrivateKey, error)
- func MarshalPrivateKey(privateKey crypto.PrivateKey) ([]byte, error)
- func NewMarshalledED25519() ([]byte, error)
- func RSA2048() (crypto.PrivateKey, error)
- func RSA3072() (crypto.PrivateKey, error)
- func UnmarshalPrivateKey(data []byte) (crypto.PrivateKey, error)
- type KeyProfile
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ECDSAP256 ¶
func ECDSAP256() (crypto.PrivateKey, error)
ECDSAP256 returns a ECDSA 256 private key
func ECDSAP384 ¶
func ECDSAP384() (crypto.PrivateKey, error)
ECDSA384 returns a ECDSA 384 private key
func ECDSAP521 ¶
func ECDSAP521() (crypto.PrivateKey, error)
ECDSAP521 returns a ECDSA 521 private key
func FormatKey ¶
func FormatKey(pk crypto.PrivateKey, comment string) (private string, public string, keyAlgorithm string, err error)
FormatKey formats the crypto key into PKCS8 encoded private key and openssh public keyline.
func GenerateHostKeys ¶
func GenerateHostKeys() ([]crypto.PrivateKey, error)
GenerateHostKeys returns newly generated keys of various algorithms/curves/parameters to be used as ssh host heys.
func MarshalPrivateKey ¶
func MarshalPrivateKey(privateKey crypto.PrivateKey) ([]byte, error)
MarshalPrivateKey marshals a private key to a PEM encoded byte slice.
func NewMarshalledED25519 ¶
NewMarshalledED25519 is a convenience function wrapping a call to create a new ED25519 private key and then marhsalling the result.
func UnmarshalPrivateKey ¶
func UnmarshalPrivateKey(data []byte) (crypto.PrivateKey, error)
UnmarshalPrivateKey unmarshals a private key from a PEM encoded byte slice.
Types ¶
type KeyProfile ¶
type KeyProfile func() (crypto.PrivateKey, error)
Click to show internal directories.
Click to hide internal directories.