Documentation ¶
Overview ¶
Package ssh supports generation of key pairs in different formats with as few parameters as possible
Index ¶
- Constants
- func LocalKeyPair(bits int) (private, public []byte, err error)
- func PrivateAndPublicKeyBytes(bits int) ([]byte, []byte, error)
- func ReadLocalPublicKey(pubPath string) (out ssh.PublicKey, comment string, options []string, rest []byte, err error)
- func SaveNewKeyPair(privPath, pubPath string, bits int) error
Constants ¶
View Source
const ( // RSA1024 is 1024 bits (should only be used for testing) RSA1024 = 1 << (10 + iota) // RSA2048 is 2048 bits RSA2048 // RSA4096 is 4096 bits RSA4096 )
Variables ¶
This section is empty.
Functions ¶
func LocalKeyPair ¶
LocalKeyPair returns bits formatted for a local ssh key pair (id_rsa, id_rsa.pub - AuthorizedKey format)
func PrivateAndPublicKeyBytes ¶
PrivateAndPublicKeyBytes takes a privateKey and returns the private and public key bytes, the public key bytes are in the wire format protocol
func ReadLocalPublicKey ¶
func ReadLocalPublicKey(pubPath string) (out ssh.PublicKey, comment string, options []string, rest []byte, err error)
ReadLocalPublicKey reads a local path for a public key stored in the AuthorizedKeys format
func SaveNewKeyPair ¶
SaveNewKeyPair generates a new key and saves private and public keys to a local path with the given bit
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.