public class ConsoleKnownHostsFile extends KnownHostsFile
KnownHostsKeyVerification.BlankEntry, KnownHostsKeyVerification.CertAuthorityEntry, KnownHostsKeyVerification.CommentEntry, KnownHostsKeyVerification.HostFileEntry, KnownHostsKeyVerification.InvalidEntry, KnownHostsKeyVerification.KeyEntry, KnownHostsKeyVerification.RevokedEntry, KnownHostsKeyVerification.Ssh2KeyEntry| Constructor and Description |
|---|
ConsoleKnownHostsFile() |
ConsoleKnownHostsFile(java.io.File file) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
onHostKeyMismatch(java.lang.String host,
java.util.List<SshPublicKey> allowedHostKey,
SshPublicKey actual)
Called by the
verifyHost method when the host key supplied by
the host does not match the current key recording in the known hosts file. |
protected void |
onInvalidHostEntry(java.lang.String entry) |
protected void |
onRevokedKey(java.lang.String host,
SshPublicKey key)
Called by the
verifyHost method when the host key supplied is
listed as a revoked key. |
void |
onUnknownHost(java.lang.String host,
SshPublicKey pk)
Prompts the user through the console to verify the host key.
|
getKnownHostsFile, isHostFileWriteable, onHostKeyAdded, onHostKeyRemoved, onHostKeyUpdated, save, storeaddEntry, allowHost, clear, getKeyEntries, isKnownHost, load, removeEntries, removeEntries, removeEntries, removeEntry, resolveNames, setComment, setHashHosts, setUseCanonicalHostnames, setUseReverseDNS, toString, updateHostKey, useCanonicalHostname, useHashHosts, useReverseDNS, verifyHostpublic ConsoleKnownHostsFile()
throws SshException,
java.io.IOException
SshExceptionjava.io.IOExceptionpublic ConsoleKnownHostsFile(java.io.File file)
throws SshException,
java.io.IOException
SshExceptionjava.io.IOExceptionprotected void onRevokedKey(java.lang.String host,
SshPublicKey key)
KnownHostsKeyVerificationverifyHost method when the host key supplied is
listed as a revoked key. This is informational, any changes made to the
current entries will still result in a failed host verification.onRevokedKey in class KnownHostsFileprotected void onHostKeyMismatch(java.lang.String host,
java.util.List<SshPublicKey> allowedHostKey,
SshPublicKey actual)
throws SshException
KnownHostsKeyVerification
Called by the verifyHost method when the host key supplied by
the host does not match the current key recording in the known hosts file.
onHostKeyMismatch in class KnownHostsFilehost - the name of the hostallowedHostKey - the current key recorded in the known_hosts file.actual - the actual key supplied by the userSshException - if an error occurspublic void onUnknownHost(java.lang.String host,
SshPublicKey pk)
Prompts the user through the console to verify the host key.
onUnknownHost in class KnownHostsFilehost - the name of the hostpk - the public key supplied by the hostprotected void onInvalidHostEntry(java.lang.String entry)
throws SshException
onInvalidHostEntry in class KnownHostsFileSshExceptionCopyright © 2022. All rights reserved.