SshSessionImpl.enforceNegotiatedHostKey

private void enforceNegotiatedHostKey(string keyAlgorithm, string signatureAlgorithm)

Binds the presented host key and signature to the negotiated host-key algorithm (RFC 4253 section 7.1).

RSA keys keep the ssh-rsa blob name while the signature must match the negotiated SHA-2 name exactly; every other algorithm must agree in both places.

Parameters

keyAlgorithmBlob algorithm of the presented host key.
signatureAlgorithmAlgorithm named by the signature blob.

Throws

SshKeyException on any mismatch.