Class Canonicalizer20010315Excl
java.lang.Object
org.apache.xml.security.c14n.CanonicalizerSpi
org.apache.xml.security.c14n.implementations.CanonicalizerBase
org.apache.xml.security.c14n.implementations.Canonicalizer20010315Excl
- Direct Known Subclasses:
Canonicalizer20010315ExclOmitComments
,Canonicalizer20010315ExclWithComments
Implements " Exclusive XML
Canonicalization, Version 1.0 "
Credits: During restructuring of the Canonicalizer framework, Ren??
Kollmorgen from Software AG submitted an implementation of ExclC14n which
fitted into the old architecture and which based heavily on my old (and slow)
implementation of "Canonical XML". A big "thank you" to Ren?? for this.
THIS implementation is a complete rewrite of the algorithm.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionThis Set contains the names (Strings like "xmlns" or "xmlns:foo") of the inclusive namespaces.private boolean
Fields inherited from class org.apache.xml.security.c14n.implementations.CanonicalizerBase
COMPARE, NODE_AFTER_DOCUMENT_ELEMENT, NODE_BEFORE_DOCUMENT_ELEMENT, NODE_NOT_BEFORE_OR_AFTER_DOCUMENT_ELEMENT, XML, XML_LANG_URI, XMLNS, XMLNS_URI
Fields inherited from class org.apache.xml.security.c14n.CanonicalizerSpi
reset, secureValidation
-
Constructor Summary
ConstructorsConstructorDescriptionCanonicalizer20010315Excl
(boolean includeComments) Constructor Canonicalizer20010315Excl -
Method Summary
Modifier and TypeMethodDescriptionprotected void
byte[]
engineCanonicalize
(XMLSignatureInput rootNode, String inclusiveNamespaces) byte[]
engineCanonicalizeSubTree
(Node rootNode) Method engineCanonicalizeSubTree Method engineCanonicalizeSubTree C14n a node tree.byte[]
engineCanonicalizeSubTree
(Node rootNode, String inclusiveNamespaces) Method engineCanonicalizeSubTree C14n a node tree.byte[]
engineCanonicalizeSubTree
(Node rootNode, String inclusiveNamespaces, boolean propagateDefaultNamespace) Method engineCanonicalizeSubTree C14n a node tree.byte[]
engineCanonicalizeSubTree
(Node rootNode, String inclusiveNamespaces, Node excl) Method engineCanonicalizeSubTreebyte[]
engineCanonicalizeXPathNodeSet
(Set<Node> xpathNodeSet, String inclusiveNamespaces) Method engineCanonicalizeXPathNodeSet C14n a nodesetprotected void
outputAttributes
(Element element, NameSpaceSymbTable ns, Map<String, byte[]> cache) Output the attributes for this node in XPathNodeSet c14n.protected void
outputAttributesSubtree
(Element element, NameSpaceSymbTable ns, Map<String, byte[]> cache) Output the attributes for this node in a Subtree c14n.Methods inherited from class org.apache.xml.security.c14n.implementations.CanonicalizerBase
canonicalizeSubTree, canonicalizeXPathNodeSet, engineCanonicalize, engineCanonicalizeSubTree, engineCanonicalizeXPathNodeSet, getNullNode, getParentNameSpaces, getWriter, handleParent, isVisible, isVisibleDO, isVisibleInt, outputAttrToWriter, outputCommentToWriter, outputPItoWriter, outputTextToWriter, setWriter
Methods inherited from class org.apache.xml.security.c14n.CanonicalizerSpi
engineCanonicalize, engineCanonicalizeXPathNodeSet, engineCanonicalizeXPathNodeSet, engineGetIncludeComments, engineGetURI, isSecureValidation, setSecureValidation
-
Field Details
-
inclusiveNSSet
This Set contains the names (Strings like "xmlns" or "xmlns:foo") of the inclusive namespaces. -
propagateDefaultNamespace
private boolean propagateDefaultNamespace
-
-
Constructor Details
-
Canonicalizer20010315Excl
public Canonicalizer20010315Excl(boolean includeComments) Constructor Canonicalizer20010315Excl- Parameters:
includeComments
-
-
-
Method Details
-
engineCanonicalizeSubTree
Method engineCanonicalizeSubTree Method engineCanonicalizeSubTree C14n a node tree.- Overrides:
engineCanonicalizeSubTree
in classCanonicalizerBase
- Parameters:
rootNode
-- Returns:
- the c14n bytes
- Throws:
CanonicalizationException
-
engineCanonicalizeSubTree
public byte[] engineCanonicalizeSubTree(Node rootNode, String inclusiveNamespaces) throws CanonicalizationException Method engineCanonicalizeSubTree C14n a node tree.- Specified by:
engineCanonicalizeSubTree
in classCanonicalizerSpi
- Parameters:
rootNode
-inclusiveNamespaces
-- Returns:
- the c14n bytes
- Throws:
CanonicalizationException
-
engineCanonicalizeSubTree
public byte[] engineCanonicalizeSubTree(Node rootNode, String inclusiveNamespaces, boolean propagateDefaultNamespace) throws CanonicalizationException Method engineCanonicalizeSubTree C14n a node tree.- Specified by:
engineCanonicalizeSubTree
in classCanonicalizerSpi
- Parameters:
rootNode
-inclusiveNamespaces
-propagateDefaultNamespace
- If true the default namespace will be propagated to the c14n-ized root element- Returns:
- the c14n bytes
- Throws:
CanonicalizationException
-
engineCanonicalizeSubTree
public byte[] engineCanonicalizeSubTree(Node rootNode, String inclusiveNamespaces, Node excl) throws CanonicalizationException Method engineCanonicalizeSubTree- Parameters:
rootNode
-inclusiveNamespaces
-excl
- A element to exclude from the c14n process.- Returns:
- the rootNode c14n.
- Throws:
CanonicalizationException
-
engineCanonicalize
public byte[] engineCanonicalize(XMLSignatureInput rootNode, String inclusiveNamespaces) throws CanonicalizationException - Parameters:
rootNode
-inclusiveNamespaces
-- Returns:
- the rootNode c14n.
- Throws:
CanonicalizationException
-
engineCanonicalizeXPathNodeSet
public byte[] engineCanonicalizeXPathNodeSet(Set<Node> xpathNodeSet, String inclusiveNamespaces) throws CanonicalizationException Method engineCanonicalizeXPathNodeSet C14n a nodeset- Specified by:
engineCanonicalizeXPathNodeSet
in classCanonicalizerSpi
- Parameters:
xpathNodeSet
-inclusiveNamespaces
-- Returns:
- the c14n bytes
- Throws:
CanonicalizationException
-
outputAttributesSubtree
protected void outputAttributesSubtree(Element element, NameSpaceSymbTable ns, Map<String, byte[]> cache) throws CanonicalizationException, DOMException, IOExceptionDescription copied from class:CanonicalizerBase
Output the attributes for this node in a Subtree c14n.- Specified by:
outputAttributesSubtree
in classCanonicalizerBase
- Parameters:
element
-ns
-cache
-- Throws:
CanonicalizationException
DOMException
IOException
-
outputAttributes
protected void outputAttributes(Element element, NameSpaceSymbTable ns, Map<String, byte[]> cache) throws CanonicalizationException, DOMException, IOExceptionDescription copied from class:CanonicalizerBase
Output the attributes for this node in XPathNodeSet c14n.- Specified by:
outputAttributes
in classCanonicalizerBase
- Parameters:
element
-ns
-cache
-- Throws:
CanonicalizationException
DOMException
IOException
-
circumventBugIfNeeded
protected void circumventBugIfNeeded(XMLSignatureInput input) throws CanonicalizationException, ParserConfigurationException, IOException, SAXException - Specified by:
circumventBugIfNeeded
in classCanonicalizerBase
- Throws:
CanonicalizationException
ParserConfigurationException
IOException
SAXException
-