Package org.apache.xml.security.signature

Examples of org.apache.xml.security.signature.XMLSignatureInput


         if (input.isOctetStream()) {
            result = c14n.engineCanonicalize(input.getBytes());
         } else {
            result = c14n.engineCanonicalizeXPathNodeSet(input.getNodeSet());
         }
         return new XMLSignatureInput(result);
      } catch (ParserConfigurationException ex) {
         Object[] exArgs = { ex.getMessage() };
         CanonicalizationException cex = new CanonicalizationException(
            "c14n.Canonicalizer.ParserConfigurationException", exArgs);
View Full Code Here


                    .isDescendantOrSelf(signatureElement, inputNode)) {
               resultSet.add(inputNode);
            }
         }

         XMLSignatureInput result = new XMLSignatureInput(resultSet,
                                       input.getCachedXPathAPI());

         return result;
      } catch (IOException ex) {
         throw new TransformationException("empty", ex);
View Full Code Here

             } else {
               // cat.debug("Not added " + org.apache.xml.security.c14n.implementations.Canonicalizer20010315.getXPath(currentNode));
            }
         }

         XMLSignatureInput result = new XMLSignatureInput(resultNodes,
                                       input.getCachedXPathAPI());

         result.setSourceURI(input.getSourceURI());

         return result;
      } catch (TransformerException ex) {
         throw new TransformationException("empty", ex);
      } catch (DOMException ex) {
View Full Code Here

         Canonicalizer20010315ExclWithComments c14n =
            new Canonicalizer20010315ExclWithComments();

         if (input.isOctetStream()) {
            return new XMLSignatureInput(c14n
               .engineCanonicalize(input.getBytes()));
         } else {
            if (inclusiveNamespaces == null) {
               return new XMLSignatureInput(c14n
                  .engineCanonicalizeXPathNodeSet(input.getNodeSet()));
            } else {
               return new XMLSignatureInput(c14n
                  .engineCanonicalizeXPathNodeSet(input
                     .getNodeSet(), inclusiveNamespaces
                     .getInclusiveNamespaces()));
            }
         }
View Full Code Here

             *
             */
            process(treewalker);
         }

         XMLSignatureInput result = new XMLSignatureInput(resultSet,
                                       input.getCachedXPathAPI());

         result.setSourceURI(input.getSourceURI());

         return result;
      } catch (TransformerException ex) {
         throw new TransformationException("empty", ex);
      } catch (DOMException ex) {
View Full Code Here

            if (this._F.contains(n)) {
               resultSet.add(n);
            }
         }

         XMLSignatureInput result = new XMLSignatureInput(resultSet,
                                       input.getCachedXPathAPI());


         result.setSourceURI(input.getSourceURI());

         long end = System.currentTimeMillis();

         return result;
      } catch (TransformerException ex) {
View Full Code Here

         Canonicalizer20010315ExclOmitComments c14n =
            new Canonicalizer20010315ExclOmitComments();

         if (input.isOctetStream()) {
            return new XMLSignatureInput(c14n
               .engineCanonicalize(input.getBytes()));
         } else {
            if (inclusiveNamespaces == null) {
               return new XMLSignatureInput(c14n
                  .engineCanonicalizeXPathNodeSet(input.getNodeSet()));
            } else {
               return new XMLSignatureInput(c14n
                  .engineCanonicalizeXPathNodeSet(input
                     .getNodeSet(), inclusiveNamespaces
                     .getInclusiveNamespaces()));
            }
         }
View Full Code Here

         if (input.isOctetStream()) {
            result = c14n.engineCanonicalize(input.getBytes());
         } else {
            result = c14n.engineCanonicalizeXPathNodeSet(input.getNodeSet());
         }
         return new XMLSignatureInput(result);
      } catch (ParserConfigurationException ex) {
         Object[] exArgs = { ex.getMessage() };
         CanonicalizationException cex = new CanonicalizationException(
            "c14n.Canonicalizer.ParserConfigurationException", exArgs);
View Full Code Here

      if (input.isOctetStream()) {
         try {
            byte[] base64Bytes = input.getBytes();
            byte[] decodedBytes = Base64.decode(base64Bytes);

            return new XMLSignatureInput(
               new ByteArrayInputStream(decodedBytes));
         } catch (Base64DecodingException ex) {
            throw new TransformationException("empty", ex);
         }
      } else {
         try {
            Document doc =
               DocumentBuilderFactory.newInstance().newDocumentBuilder()
                  .parse(input.getOctetStream());
            DocumentTraversal dt = ((DocumentTraversal) doc);
            Node rootNode = (Node) doc;

            // we accept all nodes
            NodeFilter nodefilter =
               new org.apache.xml.security.c14n.helper.AlwaysAcceptNodeFilter();
            TreeWalker treewalker = dt.createTreeWalker(rootNode,
                                                        NodeFilter.SHOW_ALL,
                                                        nodefilter, true);
            StringBuffer sb = new StringBuffer();

            process(treewalker, sb);

            byte[] decodedBytes = Base64.decode(sb.toString());

            return new XMLSignatureInput(
               new ByteArrayInputStream(decodedBytes));
         } catch (ParserConfigurationException e) {
            throw new TransformationException("c14n.Canonicalizer.Exception",
                                              e);
         } catch (SAXException e) {
View Full Code Here

                  .selectNodeList(selectedElem, Canonicalizer
                     .XPATH_C14N_WITH_COMMENTS_SINGLE_NODE);*/
         }
     

      XMLSignatureInput result = new XMLSignatureInput(resultNode);

      result.setMIMEType("text/xml");
      if (BaseURI != null && BaseURI.length() > 0) {
    result.setSourceURI(BaseURI.concat(uri.getNodeValue()));     
      } else {
    result.setSourceURI(uri.getNodeValue());     
      }

      return result;
   }
View Full Code Here

TOP

Related Classes of org.apache.xml.security.signature.XMLSignatureInput

Copyright © 2018 www.massapicom. 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.