/**
   * Constructor Canonicalizer
   *
   * @param algorithmURI
   * @throws InvalidCanonicalizerException
   */
  private Canonicalizer(String algorithmURI) throws InvalidCanonicalizerException {
    try {
      Class<? extends CanonicalizerSpi> implementingClass = canonicalizerHash.get(algorithmURI);

      canonicalizerSpi = implementingClass.newInstance();
      canonicalizerSpi.reset = true;
    } catch (Exception e) {
      Object exArgs[] = {algorithmURI};
      throw new InvalidCanonicalizerException(
          "signature.Canonicalizer.UnknownCanonicalizer", exArgs, e);
    }
  }
 /**
  * Returns the name of the implementing {@link CanonicalizerSpi} class
  *
  * @return the name of the implementing {@link CanonicalizerSpi} class
  */
 public String getImplementingCanonicalizerClass() {
   return canonicalizerSpi.getClass().getName();
 }
 /** Set the canonicalizer behaviour to not reset. */
 public void notReset() {
   canonicalizerSpi.reset = false;
 }
 /**
  * Canonicalizes an XPath node set.
  *
  * @param xpathNodeSet
  * @param inclusiveNamespaces
  * @return the result of the c14n.
  * @throws CanonicalizationException
  */
 public byte[] canonicalizeXPathNodeSet(Set<Node> xpathNodeSet, String inclusiveNamespaces)
     throws CanonicalizationException {
   return canonicalizerSpi.engineCanonicalizeXPathNodeSet(xpathNodeSet, inclusiveNamespaces);
 }
 /**
  * Sets the writer where the canonicalization ends. ByteArrayOutputStream if none is set.
  *
  * @param os
  */
 public void setWriter(OutputStream os) {
   canonicalizerSpi.setWriter(os);
 }
 /**
  * Canonicalizes an XPath node set.
  *
  * @param xpathNodeSet
  * @return the result of the c14n.
  * @throws CanonicalizationException
  */
 public byte[] canonicalizeXPathNodeSet(Set<Node> xpathNodeSet) throws CanonicalizationException {
   return canonicalizerSpi.engineCanonicalizeXPathNodeSet(xpathNodeSet);
 }
 /**
  * Canonicalizes the subtree rooted by <CODE>node</CODE>.
  *
  * @param node
  * @param inclusiveNamespaces
  * @return the result of the c14n.
  * @throws CanonicalizationException
  */
 public byte[] canonicalizeSubtree(Node node, String inclusiveNamespaces)
     throws CanonicalizationException {
   return canonicalizerSpi.engineCanonicalizeSubTree(node, inclusiveNamespaces);
 }
 /**
  * Canonicalizes the subtree rooted by <CODE>node</CODE>.
  *
  * @param node The node to canonicalize
  * @return the result of the c14n.
  * @throws CanonicalizationException
  */
 public byte[] canonicalizeSubtree(Node node) throws CanonicalizationException {
   return canonicalizerSpi.engineCanonicalizeSubTree(node);
 }
 /**
  * Method getIncludeComments
  *
  * @return true if the c14n respect the comments.
  */
 public boolean getIncludeComments() {
   return canonicalizerSpi.engineGetIncludeComments();
 }
 /**
  * Method getURI
  *
  * @return the URI defined for this c14n instance.
  */
 public final String getURI() {
   return canonicalizerSpi.engineGetURI();
 }