public class ConsoleKnownHostsKeyVerification extends AbstractKnownHostsKeyVerification
Implements the AbstractKnownHostsKeyVerification to provide host key verification through the console.
Constructor and Description |
---|
ConsoleKnownHostsKeyVerification()
Deprecated.
Constructs the verification instance with the default known_hosts file
from $HOME/.ssh/known_hosts.
|
ConsoleKnownHostsKeyVerification(String knownhosts)
Deprecated.
Constructs the verification instance with the specified known_hosts
file.
|
Modifier and Type | Method and Description |
---|---|
void |
onHostKeyMismatch(String host,
SshPublicKey pk,
SshPublicKey actual)
Deprecated.
Prompts the user through the console to verify the host key.
|
protected void |
onInvalidHostEntry(String entry)
Deprecated.
|
void |
onUnknownHost(String host,
SshPublicKey pk)
Deprecated.
Prompts the user through the console to verify the host key.
|
allowedHosts, allowHost, getKnownHostsFile, isHostFileWriteable, removeAllowedHost, saveHostFile, setHashHosts, toString, verifyHost
public ConsoleKnownHostsKeyVerification() throws SshException
Constructs the verification instance with the default known_hosts file from $HOME/.ssh/known_hosts.
InvalidHostFileException
- if the known_hosts file is invalid.SshException
public ConsoleKnownHostsKeyVerification(String knownhosts) throws SshException
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.SshException
public void onHostKeyMismatch(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(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 hostprotected void onInvalidHostEntry(String entry) throws SshException
onInvalidHostEntry
in class AbstractKnownHostsKeyVerification
SshException
Copyright © 2024. All rights reserved.