Class FingerprintVerifier
java.lang.Object
net.schmizz.sshj.transport.verification.FingerprintVerifier
- All Implemented Interfaces:
HostKeyVerifier
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateFingerprintVerifier(String digestAlgorithm, String base64Fingerprint) -
Method Summary
Modifier and TypeMethodDescriptionfindExistingAlgorithms(String hostname, int port) It is necessary to connect with the type of algorithm that matches an existing know_host entry.static HostKeyVerifiergetInstance(String fingerprint) Valid examples:4b:69:6c:72:6f:79:20:77:61:73:20:68:65:72:65:21MD5:4b:69:6c:72:6f:79:20:77:61:73:20:68:65:72:65:21SHA1:FghNYu1l/HyE/qWbdQ2mkxrd0rUSHA1:FghNYu1l/HyE/qWbdQ2mkxrd0rU=SHA256:l/SjyCoKP8jAx3d8k8MWH+UZG0gcuIR7TQRE/A3faQoSHA256:l/SjyCoKP8jAx3d8k8MWH+UZG0gcuIR7TQRE/A3faQo=toString()booleanThis callback is invoked when the server's host key needs to be verified.
-
Field Details
-
MD5_FINGERPRINT_PATTERN
-
digestAlgorithm
-
fingerprintData
private final byte[] fingerprintData
-
-
Constructor Details
-
FingerprintVerifier
-
-
Method Details
-
getInstance
Valid examples:4b:69:6c:72:6f:79:20:77:61:73:20:68:65:72:65:21MD5:4b:69:6c:72:6f:79:20:77:61:73:20:68:65:72:65:21SHA1:FghNYu1l/HyE/qWbdQ2mkxrd0rUSHA1:FghNYu1l/HyE/qWbdQ2mkxrd0rU=SHA256:l/SjyCoKP8jAx3d8k8MWH+UZG0gcuIR7TQRE/A3faQoSHA256:l/SjyCoKP8jAx3d8k8MWH+UZG0gcuIR7TQRE/A3faQo=
- Parameters:
fingerprint- of an SSH fingerprint in MD5 (hex), SHA-1 (base64) or SHA-256(base64) format- Returns:
- Host Key Verifier
-
verify
Description copied from interface:HostKeyVerifierThis callback is invoked when the server's host key needs to be verified. The return value indicates to the caller whether the SSH connection should proceed. Note: host key verification is the basis for security in SSH, therefore exercise due caution in implementing!- Specified by:
verifyin interfaceHostKeyVerifier- Parameters:
hostname- remote hostnameport- remote portkey- host key of server- Returns:
trueif key is acceptable,falseotherwise
-
findExistingAlgorithms
Description copied from interface:HostKeyVerifierIt is necessary to connect with the type of algorithm that matches an existing know_host entry. This will allow a match when we later verify with the negotiated keyHostKeyVerifier.verify- Specified by:
findExistingAlgorithmsin interfaceHostKeyVerifier- Parameters:
hostname- remote hostnameport- remote port- Returns:
- existing key types or empty list if no keys known for hostname
-
toString
-