|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.XMLFilterImpl
uk.me.nxg.enormity.SigningXMLReader
public class SigningXMLReader
An XML reader which can sign and verify XML in passing. This is an implementation of the SAX XMLReader interface, and may be used as such.
Normally, you obtain a SAX reader using a
SAXParserFactory
; if you
instead obtain a reader using the getXMLReader(File,String,String)
method, then it can be used in the same way as any other parser,
except that:
<?signature ...?>
processing
instruction in the input XML, then the signature will be checked,
and another <?signature ...?>
PI generated, with
information about the verification.In each case, further information can be retrieved about the
parse using the information object returned by
getGPGInformation(org.xml.sax.XMLReader)
.
Method Summary | |
---|---|
void |
characters(char[] ch,
int start,
int length)
|
void |
endDocument()
|
void |
endElement(String uri,
String localName,
String qName)
|
void |
endPrefixMapping(String prefix)
|
static GPGInformation |
getGPGInformation(XMLReader r)
Retrieves extra information about the work done by the SigningXMLReader which is passed as argument. |
static XMLReader |
getXMLReader(File gpgHome)
Obtains a new XMLreader which can verify input XML. |
static XMLReader |
getXMLReader(File gpgHome,
String identity,
String passphrase)
Obtains a new XMLReader which can either sign or verify input XML. |
static XMLFilter |
getXMLReader(File gpgHome,
String identity,
String passphrase,
XMLReader xmlReader)
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
|
void |
parse(InputSource is)
|
void |
processingInstruction(String target,
String data)
|
void |
setDocumentLocator(Locator locator)
|
void |
skippedEntity(String name)
|
void |
startDocument()
|
void |
startElement(String uri,
String localName,
String qName,
Attributes atts)
|
void |
startPrefixMapping(String prefix,
String uri)
|
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl |
---|
error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, notationDecl, parse, resolveEntity, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static GPGInformation getGPGInformation(XMLReader r)
r
- an XMLReader, typically a SigningXMLReader
public static XMLReader getXMLReader(File gpgHome) throws SAXException
getXMLReader(gpgHome, null, null)
SAXException
public static XMLReader getXMLReader(File gpgHome, String identity, String passphrase) throws SAXException
gpgHome
- the location of the GPG keys to be usedidentity
- the GPG identity to use to sign keys, or nullpassphrase
- the passphrase for the key associated with
the identity, or null
SAXException
public static XMLFilter getXMLReader(File gpgHome, String identity, String passphrase, XMLReader xmlReader) throws SAXException
SAXException
public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
characters
in class org.xml.sax.helpers.XMLFilterImpl
SAXException
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException
ignorableWhitespace
in interface ContentHandler
ignorableWhitespace
in class org.xml.sax.helpers.XMLFilterImpl
SAXException
public void processingInstruction(String target, String data) throws SAXException
processingInstruction
in interface ContentHandler
processingInstruction
in class org.xml.sax.helpers.XMLFilterImpl
SAXException
public void setDocumentLocator(Locator locator)
setDocumentLocator
in interface ContentHandler
setDocumentLocator
in class org.xml.sax.helpers.XMLFilterImpl
public void skippedEntity(String name) throws SAXException
skippedEntity
in interface ContentHandler
skippedEntity
in class org.xml.sax.helpers.XMLFilterImpl
SAXException
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
startDocument
in class org.xml.sax.helpers.XMLFilterImpl
SAXException
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
endDocument
in class org.xml.sax.helpers.XMLFilterImpl
SAXException
public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException
startElement
in interface ContentHandler
startElement
in class org.xml.sax.helpers.XMLFilterImpl
SAXException
public void endElement(String uri, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class org.xml.sax.helpers.XMLFilterImpl
SAXException
public void startPrefixMapping(String prefix, String uri) throws SAXException
startPrefixMapping
in interface ContentHandler
startPrefixMapping
in class org.xml.sax.helpers.XMLFilterImpl
SAXException
public void endPrefixMapping(String prefix) throws SAXException
endPrefixMapping
in interface ContentHandler
endPrefixMapping
in class org.xml.sax.helpers.XMLFilterImpl
SAXException
public void parse(InputSource is) throws SAXException, IOException
parse
in interface XMLReader
parse
in class org.xml.sax.helpers.XMLFilterImpl
SAXException
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |