Package com.sun.org.apache.xml.internal.security.signature

Examples of com.sun.org.apache.xml.internal.security.signature.XMLSignatureInput


         }
         StringBuffer sb=new StringBuffer();
         traverseElement((Element)el,sb);
         if (os==null) {
                byte[] decodedBytes = Base64.decode(sb.toString());
                return new XMLSignatureInput(decodedBytes);
         }
                Base64.decode(sb.toString(),os);
            XMLSignatureInput output=new XMLSignatureInput((byte[])null);
            output.setOutputStream(os);
            return output;

      }
      if (input.isOctetStream() || input.isNodeSet()) {


        if (os==null) {
            byte[] base64Bytes = input.getBytes();
            byte[] decodedBytes = Base64.decode(base64Bytes);
            return new XMLSignatureInput(decodedBytes);
         }
        if (input.isByteArray() || input.isNodeSet()) {
               Base64.decode(input.getBytes(),os);
        } else {
            Base64.decode(new BufferedInputStream(input.getOctetStreamReal())
                    ,os);
        }
            XMLSignatureInput output=new XMLSignatureInput((byte[])null);
            output.setOutputStream(os);
            return output;


      }

         try {
            //Exceptional case there is current not text case testing this(Before it was a
                    //a common case).
            Document doc =
               DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(
                  input.getOctetStream());

            Element rootNode = doc.getDocumentElement();
            StringBuffer sb = new StringBuffer();
            traverseElement(rootNode,sb);
            byte[] decodedBytes = Base64.decode(sb.toString());

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


         if (baos==null) {
            ByteArrayOutputStream baos1 = new ByteArrayOutputStream();
            StreamResult outputTarget = new StreamResult(baos1);
            transformer.transform(xmlSource, outputTarget);
            return new XMLSignatureInput(baos1.toByteArray());
         }
         StreamResult outputTarget = new StreamResult(baos);

         transformer.transform(xmlSource, outputTarget);
         XMLSignatureInput output=new XMLSignatureInput((byte[])null);
         output.setOutputStream(baos);
         return output;
      } catch (XMLSecurityException ex) {
         Object exArgs[] = { ex.getMessage() };

         throw new TransformationException("generic.EmptyMessage", exArgs, ex);
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

         }

         log.log(java.util.logging.Level.FINE, "Fetched " + summarized + " bytes from URI "
                   + uriNew.toString());

         XMLSignatureInput result = new XMLSignatureInput(baos.toByteArray());

         // XMLSignatureInput result = new XMLSignatureInput(inputStream);
         result.setSourceURI(uriNew.toString());
         result.setMIMEType(mimeType);

         // switch off proxy usage
         if (useProxy && switchBackProxy) {
            System.setProperty("http.proxySet", oldProxySet);
            System.setProperty("http.proxyHost", oldProxyHost);
View Full Code Here

        String fileName =
           ResolverLocalFilesystem
              .translateUriToFilename(uriNewNoFrag.toString());
        FileInputStream inputStream = new FileInputStream(fileName);
        XMLSignatureInput result = new XMLSignatureInput(inputStream);

        result.setSourceURI(uriNew.toString());

        return result;
     } catch (Exception e) {
        throw new ResourceResolverException("generic.EmptyMessage", e, uri,
                                            BaseURI);
View Full Code Here

         }
         if (log.isLoggable(java.util.logging.Level.FINE))
                log.log(java.util.logging.Level.FINE, "Try to catch an Element with ID " + id + " and Element was " + selectedElem);
      }

      XMLSignatureInput result = new XMLSignatureInput(selectedElem);
      result.setExcludeComments(true);

      //log.log(java.util.logging.Level.FINE, "We return a nodeset with " + resultSet.size() + " nodes");
      result.setMIMEType("text/xml");
          result.setSourceURI((BaseURI != null) ? BaseURI.concat(uri.getNodeValue()) :
                  uri.getNodeValue());
      return result;
   }
View Full Code Here

    * @param filename
     * @throws FileNotFoundException
     * @throws IOException
     */
   public ResolverAnonymous(String filename) throws FileNotFoundException, IOException {
      this._input = new XMLSignatureInput(new FileInputStream(filename));
   }
View Full Code Here

   /**
    * @param is
     */
   public ResolverAnonymous(InputStream is) {
      this._input = new XMLSignatureInput(is);
   }
View Full Code Here

         if (os!=null) {
                c14n.setWriter(os);
         }
         byte[] result = null;
         result=c14n.engineCanonicalize(input);
         XMLSignatureInput output=new XMLSignatureInput(result);
         if (os!=null) {
            output.setOutputStream(os);
         }
         return output;
   }
View Full Code Here

        if (os != null) {
            c14n.setWriter(os);
        }
        byte[] result = null;
        result = c14n.engineCanonicalize(input);
        XMLSignatureInput output = new XMLSignatureInput(result);
        if (os != null) {
            output.setOutputStream(os);
        }
        return output;
    }
View Full Code Here

TOP

Related Classes of com.sun.org.apache.xml.internal.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.