|
||||||||||
| 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 ContentHandlercharacters in class org.xml.sax.helpers.XMLFilterImplSAXException
public void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
ignorableWhitespace in interface ContentHandlerignorableWhitespace in class org.xml.sax.helpers.XMLFilterImplSAXException
public void processingInstruction(String target,
String data)
throws SAXException
processingInstruction in interface ContentHandlerprocessingInstruction in class org.xml.sax.helpers.XMLFilterImplSAXExceptionpublic void setDocumentLocator(Locator locator)
setDocumentLocator in interface ContentHandlersetDocumentLocator in class org.xml.sax.helpers.XMLFilterImpl
public void skippedEntity(String name)
throws SAXException
skippedEntity in interface ContentHandlerskippedEntity in class org.xml.sax.helpers.XMLFilterImplSAXException
public void startDocument()
throws SAXException
startDocument in interface ContentHandlerstartDocument in class org.xml.sax.helpers.XMLFilterImplSAXException
public void endDocument()
throws SAXException
endDocument in interface ContentHandlerendDocument in class org.xml.sax.helpers.XMLFilterImplSAXException
public void startElement(String uri,
String localName,
String qName,
Attributes atts)
throws SAXException
startElement in interface ContentHandlerstartElement in class org.xml.sax.helpers.XMLFilterImplSAXException
public void endElement(String uri,
String localName,
String qName)
throws SAXException
endElement in interface ContentHandlerendElement in class org.xml.sax.helpers.XMLFilterImplSAXException
public void startPrefixMapping(String prefix,
String uri)
throws SAXException
startPrefixMapping in interface ContentHandlerstartPrefixMapping in class org.xml.sax.helpers.XMLFilterImplSAXException
public void endPrefixMapping(String prefix)
throws SAXException
endPrefixMapping in interface ContentHandlerendPrefixMapping in class org.xml.sax.helpers.XMLFilterImplSAXException
public void parse(InputSource is)
throws SAXException,
IOException
parse in interface XMLReaderparse in class org.xml.sax.helpers.XMLFilterImplSAXException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||