Documentation
¶
Index ¶
- func AuthorizedKeysPath() string
- func GenerateHostKey(path string) error
- func GenerateRelayKey(path string) (ssh.Signer, ssh.PublicKey, error)
- func KeyPath() string
- func LoadHostKey(path string) (ssh.Signer, error)
- func LoadOrGenerateRelayKey(path string) (ssh.Signer, ssh.PublicKey, error)
- func LoadOrGenerateTLS(certPath, keyPath string) (tls.Certificate, error)
- func RelayKeyPath() string
- func TLSPaths() (certPath, keyPath string)
- type AuthorizedKey
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuthorizedKeysPath ¶
func AuthorizedKeysPath() string
AuthorizedKeysPath returns the default authorized_keys path.
func GenerateHostKey ¶
GenerateHostKey creates a new ed25519 key pair and saves the private key in OpenSSH format.
func GenerateRelayKey ¶
GenerateRelayKey always generates a new relay Ed25519 keypair at path. Returns the signer and the SSH public key.
func LoadHostKey ¶
LoadHostKey reads an ed25519 private key from file. If the file doesn't exist, generates a new key first.
func LoadOrGenerateRelayKey ¶
LoadOrGenerateRelayKey loads or creates the relay Ed25519 keypair. Returns the signer and the SSH public key.
func LoadOrGenerateTLS ¶
func LoadOrGenerateTLS(certPath, keyPath string) (tls.Certificate, error)
LoadOrGenerateTLS loads a TLS certificate from certPath/keyPath. If the files don't exist, generates a self-signed certificate.
Types ¶
type AuthorizedKey ¶
AuthorizedKey holds a parsed public key and its comment.
func LoadAuthorizedKeys ¶
func LoadAuthorizedKeys(path string) ([]AuthorizedKey, error)
LoadAuthorizedKeys reads public keys from an authorized_keys file. Returns nil (no keys) if the file doesn't exist. Rejects the file if permissions are too open (must be 0600 or stricter).