Secure FTP Factory

com.jscape.inet.ssh.util
Class SshHostKeys

java.lang.Object
  extended by com.jscape.inet.ssh.util.SshHostKeys
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class SshHostKeys
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Associative host keys store. Contains host addresses with associated host keys as one-to-one map. Supports serialization for simplifying physical save/restore process. Methods of this class are not thread-safe. All methods throw NullPointerException if some object parameter is null and IllegalArgumentException if some parameter doesn't correspond to the method contract.

Version:
1.0
Author:
Alex
See Also:
Source code, Serialized Form

Constructor Summary
SshHostKeys()
           
 
Method Summary
 boolean addKey(java.net.InetAddress host, java.lang.String fingerprint)
          Adds a new key entry to the store.
 void clear()
          Clears the store contents.
 java.lang.Object clone()
           
 boolean containsKey(java.net.InetAddress host, java.lang.String fingerprint)
          Checks if the store contains the specified host key.
 java.util.Iterator getHosts()
          Returns current hosts collection contained in the store.
 java.util.Iterator getKeys(java.net.InetAddress host)
          Returns keys iterator for the specified host.
 void removeKey(java.net.InetAddress host, java.lang.String fingerprint)
          Removes the key entry for the specified host.
 void setVerifyHostKeyListener(VerifyHostKeyListener listener)
          Sets the host key verifier listener.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SshHostKeys

public SshHostKeys()
Method Detail

addKey

public boolean addKey(java.net.InetAddress host,
                      java.lang.String fingerprint)
Adds a new key entry to the store.

Parameters:
host - the host address
fingerprint - host key fingerprint string

setVerifyHostKeyListener

public void setVerifyHostKeyListener(VerifyHostKeyListener listener)
Sets the host key verifier listener.

Parameters:
listener - The verifier listener.

removeKey

public void removeKey(java.net.InetAddress host,
                      java.lang.String fingerprint)
Removes the key entry for the specified host.

Parameters:
host - target host
fingerprint - key fingerprint to remove

clear

public void clear()
Clears the store contents.


getKeys

public java.util.Iterator getKeys(java.net.InetAddress host)
Returns keys iterator for the specified host.

Parameters:
host - target host
Returns:
host key iterator

containsKey

public boolean containsKey(java.net.InetAddress host,
                           java.lang.String fingerprint)
Checks if the store contains the specified host key.

Parameters:
host - host
fingerprint - host key fingerprint
Returns:
true if the store contains the specified key; false otherwise

getHosts

public java.util.Iterator getHosts()
Returns current hosts collection contained in the store.

Returns:
current hosts collection

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object
See Also:
Object.clone()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

Secure FTP Factory

Copyright © JSCAPE LLC. 1999-2010. All Rights Reserved