verinec.util
Class J2sshProcess.SingleKnownHostsKeyVerification

java.lang.Object
  extended by verinec.util.J2sshProcess.SingleKnownHostsKeyVerification
All Implemented Interfaces:
com.sshtools.j2ssh.transport.HostKeyVerification
Enclosing class:
J2sshProcess

public static class J2sshProcess.SingleKnownHostsKeyVerification
extends Object
implements com.sshtools.j2ssh.transport.HostKeyVerification

Used if the fingerprint of the target host is specified. It can only verify if the specified host has the specified fingerprint. If hostname or fingerprint do not match, connection will be refused. Warning: j2ssh hangs when the key is refused...


Field Summary
private  String fingerprint
           
private  String hostname
           
 
Constructor Summary
J2sshProcess.SingleKnownHostsKeyVerification(String host, String fingerprint)
          Initialize hostname and fingerprint.
 
Method Summary
 boolean verifyHost(String host, com.sshtools.j2ssh.transport.publickey.SshPublicKey pk)
          Check if the public key fingerprint and the hostname match the parameters given in the constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hostname

private String hostname

fingerprint

private String fingerprint
Constructor Detail

J2sshProcess.SingleKnownHostsKeyVerification

public J2sshProcess.SingleKnownHostsKeyVerification(String host,
                                                    String fingerprint)
Initialize hostname and fingerprint. The fingerprint format should be the same as OpenSsh use, but it is not.

Parameters:
host - The host name of target host
fingerprint - The fingerprint of target hosts certificate
Method Detail

verifyHost

public boolean verifyHost(String host,
                          com.sshtools.j2ssh.transport.publickey.SshPublicKey pk)
Check if the public key fingerprint and the hostname match the parameters given in the constructor.

Specified by:
verifyHost in interface com.sshtools.j2ssh.transport.HostKeyVerification
Parameters:
host - Hostname to be checked
pk - Public key of that host, its fingerprint will be compared to the parameter.
Returns:
whether the hostname and fingerprint match.

Copyright © 2005 Verinec, DIUF