Package org.apache.xml.security.c14n

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


        Canonicalizer canon =
            Canonicalizer.getInstance(Canonicalizer.ALGO_ID_C14N_WITH_COMMENTS);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        canon.setWriter(baos);
        canon.notReset();
        canon.canonicalizeSubtree(e);
        baos.close();
        String before = baos.toString("UTF-8");

  byte[] serialized = baos.toByteArray();
        EncryptedData encryptedData = cipher.encryptData
View Full Code Here


  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  Canonicalizer c14n = Canonicalizer.getInstance
      (Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS);

  byte[] serBytes = c14n.canonicalizeSubtree(n);
  baos.write(serBytes);
  baos.close();

  return baos.toString("UTF-8");
View Full Code Here

      boolean weCatchedTheRelativeNS = false;

      try {
         Canonicalizer c14n =
            Canonicalizer.getInstance(Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS);
         c14n.canonicalizeSubtree(doc);

      } catch (CanonicalizationException cex) {

         // if we reach this point - good.
         log.debug("We catched the C14nEx, that's good: " + cex.getMessage());
View Full Code Here

      Canonicalizer c14n = Canonicalizer.getInstance(c14nURI);
      byte c14nBytes[] = null;

      if (xpath == null) {
         c14nBytes = c14n.canonicalizeSubtree(doc);
      } else {
         CachedXPathAPI xpathAPI = new CachedXPathAPI();
         NodeList nl = null;

         if (xpath instanceof String) {
View Full Code Here

      Canonicalizer c14n = Canonicalizer.getInstance(c14nURI);
      byte c14nBytes[] = null;

      if (xpath == null) {
         c14nBytes = c14n.canonicalizeSubtree(doc);
      } else {
         CachedXPathAPI xpathAPI = new CachedXPathAPI();
         NodeList nl = null;

         if (xpath instanceof String) {
View Full Code Here

      boolean weCatchedTheRelativeNS = false;

      try {
         Canonicalizer c14n =
            Canonicalizer.getInstance(Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS);
         c14n.canonicalizeSubtree(doc);

      } catch (CanonicalizationException cex) {

         // if we reach this point - good.
         log.debug("We catched the C14nEx, that's good: " + cex.getMessage());
View Full Code Here

            .getInstance("http://www.w3.org/TR/2001/REC-xml-c14n-20010315");
      Element nscontext = XMLUtils.createDSctx(doc, "ds", Constants.SignatureSpecNS);

      Node signedInfo = XPathAPI.selectSingleNode(doc, "//ds:SignedInfo",
                                                  nscontext);
      byte outputBytes[] = c14n.canonicalizeSubtree(signedInfo);

      if (outputBytes != null) {
         System.out.println(new String(outputBytes));
      }
   }
View Full Code Here

        Canonicalizer canon =
            Canonicalizer.getInstance(Canonicalizer.ALGO_ID_C14N_WITH_COMMENTS);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        canon.setWriter(baos);
        canon.notReset();
        canon.canonicalizeSubtree(e);
        baos.close();
        String before = baos.toString("UTF-8");

        EncryptedData encryptedData = cipher.encryptData
            (d, EncryptionConstants.TYPE_ELEMENT,
View Full Code Here

    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    Canonicalizer c14n = Canonicalizer.getInstance
      (Canonicalizer.ALGO_ID_C14N_OMIT_COMMENTS);

    byte[] serBytes = c14n.canonicalizeSubtree(n);
    baos.write(serBytes);
    baos.close();

    return baos.toString("UTF-8");
View Full Code Here

        Canonicalizer canon =
            Canonicalizer.getInstance(Canonicalizer.ALGO_ID_C14N_WITH_COMMENTS);
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        canon.setWriter(baos);
        canon.notReset();
        canon.canonicalizeSubtree(e);
        baos.close();
        String before = baos.toString("UTF-8");

  byte[] serialized = baos.toByteArray();
        EncryptedData encryptedData = cipher.encryptData
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.