pub struct HostKey { /* private fields */ }Expand description
The server’s persistent SSH host key.
Debug prints the fingerprint only. Private key material must not be one
{:?} away from a log file.
Implementations§
Source§impl HostKey
impl HostKey
Sourcepub fn private_openssh(&self) -> &[u8] ⓘ
pub fn private_openssh(&self) -> &[u8] ⓘ
The OpenSSH-format private key bytes, exactly as stored.
This is what the byte-identical-across-restart assertion compares.
Sourcepub fn private_key(&self) -> &PrivateKey
pub fn private_key(&self) -> &PrivateKey
The parsed key, for russh.
Sourcepub fn public_openssh(&self) -> Result<String, Error>
pub fn public_openssh(&self) -> Result<String, Error>
The public half, as an authorized_keys/known_hosts line.
Sourcepub fn fingerprint(&self) -> Fingerprint
pub fn fingerprint(&self) -> Fingerprint
The fingerprint an operator sees on first connection.
Sourcepub fn from_openssh(bytes: Vec<u8>) -> Result<HostKey, Error>
pub fn from_openssh(bytes: Vec<u8>) -> Result<HostKey, Error>
Parse stored bytes back into a key.
pub since 2026-08-30, for replication’s deploy key.
This type is not “the SSH host key” — it is an ed25519 OpenSSH keypair
with the two accessors anything holding one needs
(private_openssh for a signer,
public_openssh for the line you authorise).
The appliance’s replication key is exactly that, minted by the same
mint_ed25519 and read back through the same parser, and a second
OpenSSH decoder in gunnar-server to avoid making one function public
would be a twin (one implementation).