org.apache.xml.security.c14n.implementations
Class Canonicalizer20010315Excl

java.lang.Object
  extended by org.apache.xml.security.c14n.CanonicalizerSpi
      extended by org.apache.xml.security.c14n.implementations.CanonicalizerBase
          extended by org.apache.xml.security.c14n.implementations.Canonicalizer20010315Excl
Direct Known Subclasses:
Canonicalizer20010315ExclOmitComments, Canonicalizer20010315ExclWithComments

public abstract class Canonicalizer20010315Excl
extends CanonicalizerBase

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.

Version:
$Revision: 1558567 $
Author:
Christian Geuer-Pollmann
See Also:
XML Canonicalization, Version 1.0

Field Summary
 
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, XMLNS
 
Fields inherited from class org.apache.xml.security.c14n.CanonicalizerSpi
reset, secureValidation
 
Constructor Summary
Canonicalizer20010315Excl(boolean includeComments)
          Constructor Canonicalizer20010315Excl
 
Method Summary
protected  void circumventBugIfNeeded(XMLSignatureInput input)
           
 byte[] engineCanonicalize(XMLSignatureInput rootNode, String inclusiveNamespaces)
           
 byte[] engineCanonicalizeSubTree(Node rootNode)
          Method engineCanonicalizeSubTree
 byte[] engineCanonicalizeSubTree(Node rootNode, String inclusiveNamespaces)
          Method engineCanonicalizeSubTree
 byte[] engineCanonicalizeSubTree(Node rootNode, String inclusiveNamespaces, boolean propagateDefaultNamespace)
          Method engineCanonicalizeSubTree
 byte[] engineCanonicalizeSubTree(Node rootNode, String inclusiveNamespaces, Node excl)
          Method engineCanonicalizeSubTree
 byte[] engineCanonicalizeXPathNodeSet(Set<Node> xpathNodeSet, String inclusiveNamespaces)
          Method engineCanonicalizeXPathNodeSet
protected  Iterator<Attr> handleAttributes(Element element, NameSpaceSymbTable ns)
          Obtain the attributes to output for this node in XPathNodeSet c14n.
protected  Iterator<Attr> handleAttributesSubtree(Element element, NameSpaceSymbTable ns)
          Obtain the attributes to output 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, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Canonicalizer20010315Excl

public Canonicalizer20010315Excl(boolean includeComments)
Constructor Canonicalizer20010315Excl

Parameters:
includeComments -
Method Detail

engineCanonicalizeSubTree

public byte[] engineCanonicalizeSubTree(Node rootNode)
                                 throws CanonicalizationException
Method engineCanonicalizeSubTree

Overrides:
engineCanonicalizeSubTree in class CanonicalizerBase
Parameters:
rootNode -
Returns:
the c14n bytes
Throws:
CanonicalizationException

engineCanonicalizeSubTree

public byte[] engineCanonicalizeSubTree(Node rootNode,
                                        String inclusiveNamespaces)
                                 throws CanonicalizationException
Method engineCanonicalizeSubTree

Specified by:
engineCanonicalizeSubTree in class CanonicalizerSpi
Parameters:
rootNode -
inclusiveNamespaces -
Returns:
the c14n bytes
Throws:
CanonicalizationException

engineCanonicalizeSubTree

public byte[] engineCanonicalizeSubTree(Node rootNode,
                                        String inclusiveNamespaces,
                                        boolean propagateDefaultNamespace)
                                 throws CanonicalizationException
Method engineCanonicalizeSubTree

Specified by:
engineCanonicalizeSubTree in class CanonicalizerSpi
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

Specified by:
engineCanonicalizeXPathNodeSet in class CanonicalizerSpi
Parameters:
xpathNodeSet -
inclusiveNamespaces -
Returns:
the c14n bytes
Throws:
CanonicalizationException

handleAttributesSubtree

protected Iterator<Attr> handleAttributesSubtree(Element element,
                                                 NameSpaceSymbTable ns)
                                          throws CanonicalizationException
Description copied from class: CanonicalizerBase
Obtain the attributes to output for this node in a Subtree c14n.

Returns:
the attributes nodes to output.
Throws:
CanonicalizationException

handleAttributes

protected final Iterator<Attr> handleAttributes(Element element,
                                                NameSpaceSymbTable ns)
                                         throws CanonicalizationException
Description copied from class: CanonicalizerBase
Obtain the attributes to output for this node in XPathNodeSet c14n.

Parameters:
element -
Returns:
the attributes nodes to output.
Throws:
CanonicalizationException

circumventBugIfNeeded

protected void circumventBugIfNeeded(XMLSignatureInput input)
                              throws CanonicalizationException,
                                     ParserConfigurationException,
                                     IOException,
                                     SAXException
Throws:
CanonicalizationException
ParserConfigurationException
IOException
SAXException


Copyright © 2000–2014 The Apache Software Foundation. All rights reserved.