|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sshtools.j2ssh.transport.HostKeyVerification
Implement this class to define specific handling of server host authorization events. The default hosts file is hosts.xml and should be located in JSSH_HOME.
Constructor Summary | |
HostKeyVerification()
Constructs the object loading the default hosts file. |
|
HostKeyVerification(java.lang.String hostFileName)
Constructs the object loading the host file specified. |
Method Summary | |
void |
allowHost(java.lang.String host,
java.lang.String hostKeyFingerprint,
boolean always)
Allows the host access if the host provides the host key specified. |
void |
denyHost(java.lang.String host,
boolean always)
Denys the host access. |
abstract void |
onDeniedHost(java.lang.String host)
Abstract method called by the framework when a connection has been made to a denied host. |
abstract void |
onHostKeyMismatch(java.lang.String host,
java.lang.String allowedHostKey,
java.lang.String actualHostKey)
Abstract method called by the framework when a host key has been supplied that does not match the host key recorded in the host file. |
abstract void |
onUnknownHost(java.lang.String host,
java.lang.String hostKeyFingerprint)
Abstract method called by the framework when a host key has been supplied that is not currently recorded in the hosts file. |
boolean |
verifyHost(java.lang.String host,
java.lang.String fingerprint)
Called by the framework to verify a host key |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public HostKeyVerification() throws InvalidHostFileException
Constructs the object loading the default hosts file.
InvalidHostFileException
- Description of the Exceptionpublic HostKeyVerification(java.lang.String hostFileName) throws InvalidHostFileException
Constructs the object loading the host file specified.
hostFileName
-
InvalidHostFileException
- Description of the ExceptionMethod Detail |
public abstract void onUnknownHost(java.lang.String host, java.lang.String hostKeyFingerprint)
Abstract method called by the framework when a host key has been supplied that is not currently recorded in the hosts file.
host
- The name of the host.hostKeyFingerprint
- The fingerprint of the host key supplied.public abstract void onHostKeyMismatch(java.lang.String host, java.lang.String allowedHostKey, java.lang.String actualHostKey)
Abstract method called by the framework when a host key has been supplied that does not match the host key recorded in the host file.
host
- The name of the host.allowedHostKey
- The host key currently allowed.actualHostKey
- The host key provided.public abstract void onDeniedHost(java.lang.String host)
Abstract method called by the framework when a connection has been made to a denied host.
NOTE: This currently does not supply the fingerprint of the denied host for a reason; if the host has been denied, most probably by an administrator then we should not be providing the host key for the user to subsequently allow the host.
host
- The name of the denied host.public void allowHost(java.lang.String host, java.lang.String hostKeyFingerprint, boolean always) throws InvalidHostFileException
Allows the host access if the host provides the host key specified.
host
- The name of the host.hostKeyFingerprint
- The fingerprint of the acceptable
host key.always
- Specifies whether to always allow
the host access (true) or only allow access this time.
InvalidHostFileException
- Description of the Exceptionpublic void denyHost(java.lang.String host, boolean always) throws InvalidHostFileException
Denys the host access.
host
- The name of the host.always
- Specifies whether to always deny the
specified host (true) or just deny the host acceess this time
(false)
InvalidHostFileException
- Description of the Exceptionpublic boolean verifyHost(java.lang.String host, java.lang.String fingerprint)
Called by the framework to verify a host key
host
- The name of the hostfingerprint
- The fingerprint of the host key
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |