public class ConsoleKnownHostsKeyVerification extends AbstractKnownHostsKeyVerification
Implements the AbstractKnownHostsKeyVerification
to provide
host key verification through the console.
Constructor and Description |
---|
ConsoleKnownHostsKeyVerification()
Constructs the verification instance with the default known_hosts file
from $HOME/.ssh/known_hosts.
|
ConsoleKnownHostsKeyVerification(java.lang.String knownhosts)
Constructs the verification instance with the specified known_hosts
file.
|
Modifier and Type | Method and Description |
---|---|
void |
onHostKeyMismatch(java.lang.String host,
SshPublicKey pk,
SshPublicKey actual)
Prompts the user through the console to verify the host key.
|
void |
onUnknownHost(java.lang.String host,
SshPublicKey pk)
Prompts the user through the console to verify the host key.
|
allowedHosts, allowHost, isHostFileWriteable, removeAllowedHost, saveHostFile, toString, verifyHost
public ConsoleKnownHostsKeyVerification() throws InvalidHostFileException
Constructs the verification instance with the default known_hosts file from $HOME/.ssh/known_hosts.
InvalidHostFileException
- if the known_hosts file is invalid.public ConsoleKnownHostsKeyVerification(java.lang.String knownhosts) throws InvalidHostFileException
Constructs the verification instance with the specified known_hosts file.
knownhosts
- the path to the known_hosts fileInvalidHostFileException
- if the known_hosts file is invalid.public void onHostKeyMismatch(java.lang.String host, SshPublicKey pk, SshPublicKey actual)
Prompts the user through the console to verify the host key.
onHostKeyMismatch
in class AbstractKnownHostsKeyVerification
host
- the name of the hostpk
- the current public key of the hostactual
- the actual public key supplied by the hostpublic void onUnknownHost(java.lang.String host, SshPublicKey pk)
Prompts the user through the console to verify the host key.
onUnknownHost
in class AbstractKnownHostsKeyVerification
host
- the name of the hostpk
- the public key supplied by the hostCopyright © 2002-2003 Lee David Painter & Contributors. All Rights Reserved.