public abstract class AbstractHostKeyVerification extends org.xml.sax.helpers.DefaultHandler implements HostKeyVerification
Constructor and Description |
---|
AbstractHostKeyVerification()
Creates a new AbstractHostKeyVerification object.
|
AbstractHostKeyVerification(java.lang.String hostFileName)
Creates a new AbstractHostKeyVerification object.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map |
allowedHosts() |
void |
allowHost(java.lang.String host,
java.lang.String hostKeyFingerprint,
boolean always) |
java.util.List |
deniedHosts() |
void |
denyHost(java.lang.String host,
boolean always) |
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qname) |
boolean |
isHostFileWriteable() |
abstract void |
onDeniedHost(java.lang.String host) |
abstract void |
onHostKeyMismatch(java.lang.String host,
java.lang.String allowedHostKey,
java.lang.String actualHostKey) |
abstract void |
onUnknownHost(java.lang.String host,
java.lang.String hostKeyFingerprint) |
void |
removeAllowedHost(java.lang.String host) |
void |
removeDeniedHost(java.lang.String host) |
void |
saveHostFile() |
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qname,
org.xml.sax.Attributes attrs) |
java.lang.String |
toString() |
boolean |
verifyHost(java.lang.String host,
SshPublicKey pk)
Called by the transport protocol to verify the identity of the server
through the supplied public key.
|
public AbstractHostKeyVerification() throws InvalidHostFileException
InvalidHostFileException
public AbstractHostKeyVerification(java.lang.String hostFileName) throws InvalidHostFileException
hostFileName
- InvalidHostFileException
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qname, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXException
startElement
in interface org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
uri
- localName
- qname
- attrs
- org.xml.sax.SAXException
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qname) throws org.xml.sax.SAXException
endElement
in interface org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
uri
- localName
- qname
- org.xml.sax.SAXException
public boolean isHostFileWriteable()
public abstract void onDeniedHost(java.lang.String host) throws TransportProtocolException
host
- TransportProtocolException
public abstract void onHostKeyMismatch(java.lang.String host, java.lang.String allowedHostKey, java.lang.String actualHostKey) throws TransportProtocolException
host
- allowedHostKey
- actualHostKey
- TransportProtocolException
public abstract void onUnknownHost(java.lang.String host, java.lang.String hostKeyFingerprint) throws TransportProtocolException
host
- hostKeyFingerprint
- TransportProtocolException
public void allowHost(java.lang.String host, java.lang.String hostKeyFingerprint, boolean always) throws InvalidHostFileException
host
- hostKeyFingerprint
- always
- InvalidHostFileException
public java.util.Map allowedHosts()
public java.util.List deniedHosts()
public void removeAllowedHost(java.lang.String host)
host
- public void removeDeniedHost(java.lang.String host)
host
- public void denyHost(java.lang.String host, boolean always) throws InvalidHostFileException
host
- always
- InvalidHostFileException
public boolean verifyHost(java.lang.String host, SshPublicKey pk) throws TransportProtocolException
HostKeyVerification
Called by the transport protocol to verify the identity of the server through the supplied public key.
verifyHost
in interface HostKeyVerification
host
- pk
- TransportProtocolException
public void saveHostFile() throws InvalidHostFileException
InvalidHostFileException
public java.lang.String toString()
toString
in class java.lang.Object
Copyright © 2002-2003 Lee David Painter & Contributors. All Rights Reserved.