Package com.sshtools.common.hosts
Class DialogKnownHostsKeyVerification
- java.lang.Object
-
- com.sshtools.j2ssh.transport.AbstractKnownHostsKeyVerification
-
- com.sshtools.common.hosts.DialogKnownHostsKeyVerification
-
- All Implemented Interfaces:
HostKeyVerification
public class DialogKnownHostsKeyVerification extends AbstractKnownHostsKeyVerification
- Version:
- $Revision: 1.13 $
- Author:
- $author$
-
-
Constructor Summary
Constructors Constructor Description DialogKnownHostsKeyVerification(java.awt.Component parent)
Creates a new DialogKnownHostsKeyVerification object.DialogKnownHostsKeyVerification(java.awt.Component parent, java.lang.String hostFileName)
Creates a new DialogKnownHostsKeyVerification object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onDeniedHost(java.lang.String host)
void
onHostKeyMismatch(java.lang.String host, SshPublicKey recorded, SshPublicKey actual)
Called by theverifyHost
method when the host key supplied by the host does not match the current key recording in the known hosts file.void
onUnknownHost(java.lang.String host, SshPublicKey key)
Called by theverifyHost
method when the host key supplied is not recorded in the known_hosts file.void
setVerificationEnabled(boolean enabled)
-
Methods inherited from class com.sshtools.j2ssh.transport.AbstractKnownHostsKeyVerification
allowedHosts, allowHost, isHostFileWriteable, removeAllowedHost, saveHostFile, toString, verifyHost
-
-
-
-
Constructor Detail
-
DialogKnownHostsKeyVerification
public DialogKnownHostsKeyVerification(java.awt.Component parent) throws InvalidHostFileException
Creates a new DialogKnownHostsKeyVerification object.- Parameters:
parent
-- Throws:
InvalidHostFileException
-
DialogKnownHostsKeyVerification
public DialogKnownHostsKeyVerification(java.awt.Component parent, java.lang.String hostFileName) throws InvalidHostFileException
Creates a new DialogKnownHostsKeyVerification object.- Parameters:
parent
-hostFileName
-- Throws:
InvalidHostFileException
-
-
Method Detail
-
setVerificationEnabled
public void setVerificationEnabled(boolean enabled)
- Parameters:
enabled
-
-
onDeniedHost
public void onDeniedHost(java.lang.String host) throws TransportProtocolException
- Parameters:
host
-- Throws:
TransportProtocolException
-
onHostKeyMismatch
public void onHostKeyMismatch(java.lang.String host, SshPublicKey recorded, SshPublicKey actual) throws TransportProtocolException
Description copied from class:AbstractKnownHostsKeyVerification
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.- Specified by:
onHostKeyMismatch
in classAbstractKnownHostsKeyVerification
- Parameters:
host
-recorded
-actual
-- Throws:
TransportProtocolException
-
onUnknownHost
public void onUnknownHost(java.lang.String host, SshPublicKey key) throws TransportProtocolException
Description copied from class:AbstractKnownHostsKeyVerification
Called by the
verifyHost
method when the host key supplied is not recorded in the known_hosts file.- Specified by:
onUnknownHost
in classAbstractKnownHostsKeyVerification
- Parameters:
host
-key
-- Throws:
TransportProtocolException
-
-