public class XML
extends java.lang.Object
Constructor and Description |
---|
XML() |
Modifier and Type | Method and Description |
---|---|
static org.w3c.dom.Document |
getDocument(java.io.File file)
Parse an XML file to DOM
|
static org.w3c.dom.Document |
getDocument(java.io.File file,
boolean namespaceAware)
Parse an XML file to DOM
|
static org.w3c.dom.Document |
getDocument(java.io.InputStream stream)
Parse an XML coming from an input stream to DOM
|
static org.w3c.dom.Document |
getDocument(java.io.InputStream stream,
boolean namespaceAware)
Parse an XML coming from an input stream to DOM
|
static org.w3c.dom.Document |
getDocument(java.lang.String xml)
Parse an XML string content to DOM
|
static org.w3c.dom.Document |
getDocument(java.lang.String xml,
boolean namespaceAware)
Parse an XML string content to DOM
|
static javax.xml.parsers.DocumentBuilder |
newDocumentBuilder() |
static javax.xml.parsers.DocumentBuilder |
newDocumentBuilder(boolean namespaceAware) |
static javax.xml.parsers.DocumentBuilderFactory |
newDocumentBuilderFactory() |
static javax.xml.parsers.DocumentBuilderFactory |
newDocumentBuilderFactory(boolean namespaceAware) |
static java.lang.String |
serialize(org.w3c.dom.Document document)
Serialize to XML String
|
static org.w3c.dom.Document |
sign(org.w3c.dom.Document document,
java.security.interfaces.RSAPublicKey publicKey,
java.security.interfaces.RSAPrivateKey privateKey)
Sign the XML document using xmldsig.
|
static boolean |
validSignature(org.w3c.dom.Document document,
java.security.Key publicKey)
Check the xmldsig signature of the XML document.
|
public static javax.xml.parsers.DocumentBuilderFactory newDocumentBuilderFactory()
public static javax.xml.parsers.DocumentBuilderFactory newDocumentBuilderFactory(boolean namespaceAware)
public static javax.xml.parsers.DocumentBuilder newDocumentBuilder()
public static javax.xml.parsers.DocumentBuilder newDocumentBuilder(boolean namespaceAware)
public static java.lang.String serialize(org.w3c.dom.Document document)
document
- The DOM documentpublic static org.w3c.dom.Document getDocument(java.io.File file)
file
- The XML filepublic static org.w3c.dom.Document getDocument(java.io.File file, boolean namespaceAware)
file
- The XML filenamespaceAware
- whether to output XML namespace information in the returned documentpublic static org.w3c.dom.Document getDocument(java.lang.String xml)
xml
- The XML stringpublic static org.w3c.dom.Document getDocument(java.lang.String xml, boolean namespaceAware)
xml
- The XML stringnamespaceAware
- whether to output XML namespace information in the returned documentpublic static org.w3c.dom.Document getDocument(java.io.InputStream stream)
stream
- The XML streampublic static org.w3c.dom.Document getDocument(java.io.InputStream stream, boolean namespaceAware)
stream
- The XML streamnamespaceAware
- whether to output XML namespace information in the returned documentpublic static boolean validSignature(org.w3c.dom.Document document, java.security.Key publicKey)
document
- the document to testpublicKey
- the public key corresponding to the key pair the document was signed withpublic static org.w3c.dom.Document sign(org.w3c.dom.Document document, java.security.interfaces.RSAPublicKey publicKey, java.security.interfaces.RSAPrivateKey privateKey)
document
- the document to sign; it will be modified by the method.publicKey
- the public key from the key pair to sign the document.privateKey
- the private key from the key pair to sign the document.Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly