Class CanonicalizerPhysical


  • public class CanonicalizerPhysical
    extends CanonicalizerBase
    Serializes the physical representation of the subtree. All the attributes present in the subtree are emitted. The attributes are sorted within an element, with the namespace declarations appearing before the regular attributes. This algorithm is not a true canonicalization since equivalent subtrees may produce different output. It is therefore unsuitable for digital signatures. This same property makes it ideal for XML Encryption Syntax and Processing, because the decrypted XML content will share the same physical representation as the original XML content that was encrypted.
    • Constructor Detail

      • CanonicalizerPhysical

        public CanonicalizerPhysical()
        Constructor Canonicalizer20010315
    • Method Detail

      • engineCanonicalizeXPathNodeSet

        public void engineCanonicalizeXPathNodeSet​(java.util.Set<org.w3c.dom.Node> xpathNodeSet,
                                                   java.lang.String inclusiveNamespaces,
                                                   java.io.OutputStream writer)
                                            throws CanonicalizationException
        Always throws a CanonicalizationException.
        Specified by:
        engineCanonicalizeXPathNodeSet in class CanonicalizerSpi
        Parameters:
        xpathNodeSet -
        inclusiveNamespaces -
        writer - OutputStream to write the canonicalization result
        Throws:
        CanonicalizationException - always
      • engineCanonicalizeSubTree

        public void engineCanonicalizeSubTree​(org.w3c.dom.Node rootNode,
                                              java.lang.String inclusiveNamespaces,
                                              boolean propagateDefaultNamespace,
                                              java.io.OutputStream writer)
                                       throws CanonicalizationException
        Always throws a CanonicalizationException.
        Specified by:
        engineCanonicalizeSubTree in class CanonicalizerSpi
        Parameters:
        rootNode -
        inclusiveNamespaces -
        writer - OutputStream to write the canonicalization result
        propagateDefaultNamespace - If true the default namespace will be propagated to the c14n-ized root element
        Throws:
        CanonicalizationException
      • engineGetURI

        public final java.lang.String engineGetURI()
        Returns the URI of this engine.
        Specified by:
        engineGetURI in class CanonicalizerSpi
        Returns:
        the URI
      • outputPItoWriter

        protected void outputPItoWriter​(org.w3c.dom.ProcessingInstruction currentPI,
                                        java.io.OutputStream writer,
                                        int position)
                                 throws java.io.IOException
        Description copied from class: CanonicalizerBase
        Outputs a PI to the internal Writer.
        Overrides:
        outputPItoWriter in class CanonicalizerBase
        writer - where to write the things
        Throws:
        java.io.IOException
      • outputCommentToWriter

        protected void outputCommentToWriter​(org.w3c.dom.Comment currentComment,
                                             java.io.OutputStream writer,
                                             int position)
                                      throws java.io.IOException
        Description copied from class: CanonicalizerBase
        Method outputCommentToWriter
        Overrides:
        outputCommentToWriter in class CanonicalizerBase
        writer - writer where to write the things
        Throws:
        java.io.IOException