public class SshHostKeys
extends java.lang.Object
implements java.io.Serializable
NullPointerException
if some object
parameter is null
and IllegalArgumentException
if some parameter doesn't correspond to the method contract.Modifier and Type | Class and Description |
---|---|
static class |
SshHostKeys.Entry
A store entry.
|
static class |
SshHostKeys.Fingerprint |
Constructor and Description |
---|
SshHostKeys(SshHostKeys.Entry... entries)
Creates a new store instance.
|
Modifier and Type | Method and Description |
---|---|
SshHostKeys |
addKey(java.net.InetAddress host,
java.lang.String keyFingerprint)
Deprecated.
use put()
|
void |
clear()
Clears the store contents.
|
boolean |
contains(java.net.InetAddress host,
java.security.PublicKey key)
Checks if specified key is already known.
|
java.util.Collection<SshHostKeys.Entry> |
entriesOf(java.net.InetAddress host)
Returns a collection of known key entries for specified host.
|
java.util.List<java.lang.String> |
fingerprintsOf(java.net.InetAddress host)
Returns a collection of known key fingerprints for specified host.
|
java.util.Iterator |
getHosts()
Deprecated.
use hosts()
|
java.util.Iterator<java.lang.String> |
getKeys(java.net.InetAddress host)
Deprecated.
use entriesOf()
|
java.util.Collection<java.net.InetAddress> |
hosts()
Returns known server hosts.
|
java.util.List<java.security.PublicKey> |
keysOf(java.net.InetAddress host)
Returns a collection of known keys for specified host.
|
SshHostKeys |
put(java.net.InetAddress host,
java.security.PublicKey key)
Puts a key to the store.
|
SshHostKeys |
put(java.net.InetAddress host,
java.lang.String keyFingerprint)
Puts a key to the store.
|
SshHostKeys |
remove(java.net.InetAddress host,
java.security.PublicKey key)
Removes a key from the store.
|
SshHostKeys |
remove(java.net.InetAddress host,
java.lang.String keyFingerprint)
Removes a key from the store.
|
void |
removeKey(java.net.InetAddress host,
java.lang.String keyFingerprint)
Deprecated.
use remove()
|
SshHostKeys |
set(SshHostKeys.Entry... entries)
Sets the store entries.
|
java.lang.String |
toString() |
public SshHostKeys(SshHostKeys.Entry... entries)
entries
- public SshHostKeys set(SshHostKeys.Entry... entries)
entries
- entriespublic SshHostKeys put(java.net.InetAddress host, java.security.PublicKey key)
host
- a server hostkey
- a server keypublic SshHostKeys put(java.net.InetAddress host, java.lang.String keyFingerprint)
host
- a server hostkeyFingerprint
- a key fingerprint@Deprecated public SshHostKeys addKey(java.net.InetAddress host, java.lang.String keyFingerprint)
host
- the host addresskeyFingerprint
- host key fingerprint stringpublic SshHostKeys remove(java.net.InetAddress host, java.security.PublicKey key)
host
- a server hostkey
- a server keypublic SshHostKeys remove(java.net.InetAddress host, java.lang.String keyFingerprint)
host
- a server hostkeyFingerprint
- a key fingerprint@Deprecated public void removeKey(java.net.InetAddress host, java.lang.String keyFingerprint)
host
- target hostkeyFingerprint
- key fingerprint to removepublic void clear()
public java.util.Collection<java.net.InetAddress> hosts()
@Deprecated public java.util.Iterator getHosts()
public java.util.Collection<SshHostKeys.Entry> entriesOf(java.net.InetAddress host)
host
- a server host@Deprecated public java.util.Iterator<java.lang.String> getKeys(java.net.InetAddress host)
host
- target hostpublic java.util.List<java.security.PublicKey> keysOf(java.net.InetAddress host)
host
- a server hostpublic java.util.List<java.lang.String> fingerprintsOf(java.net.InetAddress host)
host
- a server hostpublic boolean contains(java.net.InetAddress host, java.security.PublicKey key)
host
- a server hostkey
- a server keytrue
if key is known; false
otherwisepublic java.lang.String toString()
toString
in class java.lang.Object
Copyright © JSCAPE LLC. 1999-2023. All Rights Reserved