Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
com.sshtools.j2ssh.transport.AbstractKnownHostsKeyVerification
com.sshtools.j2ssh.transport.ConsoleKnownHostsKeyVerification
public class ConsoleKnownHostsKeyVerification
AbstractKnownHostsKeyVerification
to provide
host key verification through the console.
Constructor Summary | |
| |
|
Method Summary | |
void |
|
void |
|
Methods inherited from class com.sshtools.j2ssh.transport.AbstractKnownHostsKeyVerification | |
allowHost , allowedHosts , isHostFileWriteable , onHostKeyMismatch , onUnknownHost , removeAllowedHost , saveHostFile , toString , verifyHost |
public ConsoleKnownHostsKeyVerification() throws InvalidHostFileException
Constructs the verification instance with the default known_hosts file from $HOME/.ssh/known_hosts.
- Throws:
InvalidHostFileException
- if the known_hosts file is invalid.
- Since:
- 0.2.0
public ConsoleKnownHostsKeyVerification(String knownhosts) throws InvalidHostFileException
Constructs the verification instance with the specified known_hosts file.
- Parameters:
knownhosts
- the path to the known_hosts file
- Throws:
InvalidHostFileException
- if the known_hosts file is invalid.
- Since:
- 0.2.0
public void onHostKeyMismatch(String host, SshPublicKey pk, SshPublicKey actual)
Prompts the user through the console to verify the host key.
- Overrides:
- onHostKeyMismatch in interface AbstractKnownHostsKeyVerification
- Parameters:
host
- the name of the hostpk
- the current public key of the hostactual
- the actual public key supplied by the host
- Since:
- 0.2.0
public void onUnknownHost(String host, SshPublicKey pk)
Prompts the user through the console to verify the host key.
- Overrides:
- onUnknownHost in interface AbstractKnownHostsKeyVerification
- Parameters:
host
- the name of the hostpk
- the public key supplied by the host
- Since:
- 0.2.0