Examples of canonicalizeXPathNodeSet()


Examples of org.apache.xml.security.c14n.Canonicalizer.canonicalizeXPathNodeSet()

      XMLUtils.circumventBug2650(doc);

      NodeList nodes = xpathAPI.selectNodeList(doc, xpath, nscontext);
      Canonicalizer c14n =
         Canonicalizer.getInstance(Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS);
      byte c14nBytes[] = c14n.canonicalizeXPathNodeSet(nodes);
      InputStream refStream = resolver.resolveEntity(null,
                                 fileRef).getByteStream();
      byte refBytes[] = JavaUtils.getBytesFromStream(refStream);
      boolean equal = java.security.MessageDigest.isEqual(refBytes, c14nBytes);
View Full Code Here

Examples of org.apache.xml.security.c14n.Canonicalizer.canonicalizeXPathNodeSet()

      //XMLUtils.circumventBug2650(doc);

      NodeList nodes =
         xpathAPI.selectNodeList(doc, "(//*[local-name()='included'] | //@*[parent::node()[local-name()='included']])");
      byte result[] = c14nizer.canonicalizeXPathNodeSet(nodes);
      byte defined[] = definedOutput.getBytes();

      return java.security.MessageDigest.isEqual(defined, result);
   }

View Full Code Here

Examples of org.apache.xml.security.c14n.Canonicalizer.canonicalizeXPathNodeSet()

            String xpathStr = ((Text) xpathElement.getFirstChild()).getData();

            nl = xpathAPI.selectNodeList(doc, xpathStr, xpathElement);
         }

         c14nBytes = c14n.canonicalizeXPathNodeSet(nl);
      }

      // org.xml.sax.InputSource refIs = resolver.resolveEntity(null, fileRef);
      // byte refBytes[] = JavaUtils.getBytesFromStream(refIs.getByteStream());
      byte refBytes[] = JavaUtils.getBytesFromFile(fileRef);
View Full Code Here

Examples of org.apache.xml.security.c14n.Canonicalizer.canonicalizeXPathNodeSet()

      XMLUtils.circumventBug2650(doc);

      NodeList nodes = xpathAPI.selectNodeList(doc, xpath, nscontext);
      Canonicalizer c14n =
         Canonicalizer.getInstance(Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS);
      byte c14nBytes[] = c14n.canonicalizeXPathNodeSet(nodes);
      InputStream refStream = resolver.resolveEntity(null,
                                 fileRef).getByteStream();
      byte refBytes[] = JavaUtils.getBytesFromStream(refStream);
      boolean equal = JavaUtils.binaryCompare(refBytes, c14nBytes);
View Full Code Here

Examples of org.apache.xml.security.c14n.Canonicalizer.canonicalizeXPathNodeSet()

      XMLUtils.circumventBug2650(doc);

      NodeList nodes =
         xpathAPI.selectNodeList(doc, "(//*[local-name()='included'] | //@*[parent::node()[local-name()='included']])");
      byte result[] = c14nizer.canonicalizeXPathNodeSet(nodes);
      byte defined[] = definedOutput.getBytes();

      if (writeResultsToFile) {
         File fileD = new File("defined.txt");
         FileOutputStream fd = new FileOutputStream(fileD);
View Full Code Here

Examples of org.apache.xml.security.c14n.Canonicalizer.canonicalizeXPathNodeSet()

            String xpathStr = ((Text) xpathElement.getFirstChild()).getData();

            nl = xpathAPI.selectNodeList(doc, xpathStr, xpathElement);
         }

         c14nBytes = c14n.canonicalizeXPathNodeSet(nl);
      }

      // org.xml.sax.InputSource refIs = resolver.resolveEntity(null, fileRef);
      // byte refBytes[] = JavaUtils.getBytesFromStream(refIs.getByteStream());
      byte refBytes[] = JavaUtils.getBytesFromFile(fileRef);
View Full Code Here

Examples of org.apache.xml.security.c14n.Canonicalizer.canonicalizeXPathNodeSet()

            String xpathStr = ((Text) xpathElement.getFirstChild()).getData();

            nl = xpathAPI.selectNodeList(doc, xpathStr, xpathElement);
         }

         c14nBytes = c14n.canonicalizeXPathNodeSet(nl);
      }

      // org.xml.sax.InputSource refIs = resolver.resolveEntity(null, fileRef);
      // byte refBytes[] = JavaUtils.getBytesFromStream(refIs.getByteStream());
      byte refBytes[] = JavaUtils.getBytesFromFile(fileRef);
View Full Code Here

Examples of org.apache.xml.security.c14n.Canonicalizer.canonicalizeXPathNodeSet()

         Canonicalizer.getInstance(Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS);
      CachedXPathAPI xpathAPI = new CachedXPathAPI();
      XMLUtils.circumventBug2650(doc);
      NodeList nodes =
         xpathAPI.selectNodeList(doc, "(//*[local-name()='included'] | //@*)");
      byte result[] = c14nizer.canonicalizeXPathNodeSet(nodes);
      byte defined[] = definedOutput.getBytes();

      if (writeResultsToFile) {
         File fileD = new File("defined.txt");
         FileOutputStream fd = new FileOutputStream(fileD);
View Full Code Here

Examples of org.apache.xml.security.c14n.Canonicalizer.canonicalizeXPathNodeSet()

        xPath.setNamespaceContext(namespaceContext);

        NodeList nodes = (NodeList)xPath.evaluate(xpath, doc, XPathConstants.NODESET);
        Canonicalizer c14n =
            Canonicalizer.getInstance(Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS);
        byte c14nBytes[] = c14n.canonicalizeXPathNodeSet(nodes);
        InputStream refStream = resolver.resolveEntity(null,
                                                       fileRef).getByteStream();
        byte refBytes[] = JavaUtils.getBytesFromStream(refStream);
        assertEquals(new String(refBytes),new String(c14nBytes));
    }
View Full Code Here

Examples of org.apache.xml.security.c14n.Canonicalizer.canonicalizeXPathNodeSet()

        String xpath =
            "(//*[local-name()='included'] | //@*[parent::node()[local-name()='included']])";
        NodeList nodes =
            (NodeList)xPath.evaluate(xpath, doc, XPathConstants.NODESET);

        byte result[] = c14nizer.canonicalizeXPathNodeSet(nodes);
        byte defined[] = definedOutput.getBytes();
        assertEquals(definedOutput, new String(result));
        return java.security.MessageDigest.isEqual(defined, result);
    }

View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.