Documentation
¶
Overview ¶
package ssh provides convenience wrappers around the golang.org/x/crypto/ssh package for handling SSH key formatting and operations.
package ssh provides cryptographic helpers for SSH key operations. This file contains logic for generating new SSH key pairs.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var FingerprintSHA256 = ssh.FingerprintSHA256
FingerprintSHA256 returns the SHA256 fingerprint of the public key.
var MarshalAuthorizedKey = ssh.MarshalAuthorizedKey
MarshalAuthorizedKey serializes a public key to the authorized_keys wire format.
var NewPublicKey = ssh.NewPublicKey
NewPublicKey creates a new ssh.PublicKey from a crypto.PublicKey.
Functions ¶
func GenerateAndMarshalEd25519Key ¶ added in v1.3.3
func GenerateAndMarshalEd25519Key(comment string, passphrase string) (publicKeyString string, privateKeyString string, err error)
GenerateAndMarshalEd25519Key creates a new ed25519 key pair and returns them as formatted strings: the public key in authorized_keys format and the private key in PEM format. If a non-empty passphrase is provided, the private key will be encrypted with it.
func MarshalEd25519PrivateKey ¶
MarshalEd25519PrivateKey converts an ed25519 private key to PEM format. It wraps the functionality from golang.org/x/crypto/ssh to produce a PEM block in the modern OpenSSH private key format.
Types ¶
This section is empty.