verifyHostKey function
Verifies that key
signed exH
producing sig
.
Implementation
bool verifyHostKey(
Uint8List exH, int hostkeyType, Uint8List key, Uint8List sig) {
if (hostkeyType == Key.RSA) {
return verifyRSASignature(RSAKey()..deserialize(SerializableInput(key)),
RSASignature()..deserialize(SerializableInput(sig)), exH);
} else if (Key.ellipticCurveDSA(hostkeyType)) {
return verifyECDSASignature(
hostkeyType,
ECDSAKey()..deserialize(SerializableInput(key)),
ECDSASignature()..deserialize(SerializableInput(sig)),
exH);
} else if (hostkeyType == Key.ED25519) {
return verifyEd25519Signature(
Ed25519Key()..deserialize(SerializableInput(key)),
Ed25519Signature()..deserialize(SerializableInput(sig)),
exH);
} else {
return false;
}
}