Examples of Canonicalizer20010315OmitComments


Examples of org.apache.xml.security.c14n.implementations.Canonicalizer20010315OmitComments

    }

    protected XMLSignatureInput enginePerformTransform(
        XMLSignatureInput input, OutputStream os, Transform transformObject
    ) throws CanonicalizationException {  
        Canonicalizer20010315OmitComments c14n = new Canonicalizer20010315OmitComments();
        c14n.setSecureValidation(secureValidation);
        if (os != null) {
            c14n.setWriter(os);
        }
        byte[] result = null;               
        result = c14n.engineCanonicalize(input);                                
        XMLSignatureInput output = new XMLSignatureInput(result);
        output.setSecureValidation(secureValidation);
        if (os != null) {
            output.setOutputStream(os);
        }
View Full Code Here

Examples of org.apache.xml.security.c14n.implementations.Canonicalizer20010315OmitComments

           throws IOException, CanonicalizationException,
                  InvalidCanonicalizerException, ParserConfigurationException,
                  SAXException {

      try {
         Canonicalizer20010315OmitComments c14n = new Canonicalizer20010315OmitComments();
         byte[] result = null;
         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(
View Full Code Here

Examples of org.apache.xml.security.c14n.implementations.Canonicalizer20010315OmitComments

          * without any comments.
          *
          * We don't use the factory because direct instantiation should be a
          * little bit faster...
          */
         Canonicalizer20010315OmitComments c14nizer =
            new Canonicalizer20010315OmitComments();
         ByteArrayOutputStream baos = new ByteArrayOutputStream();

         if (this._inputNodeSet.size() == 0) {

            // empty nodeset
            return new ByteArrayInputStream(baos.toByteArray());
         }

         try {
            Set nodes = this.getNodeSet();
            byte bytes[] = c14nizer.engineCanonicalizeXPathNodeSet(nodes);

            baos.write(bytes);

            /** $todo$ Clarify behavior. If isNodeSet() and we getOctetStream, do we have to this._inputOctetStream=xxx ? */

 
View Full Code Here

Examples of org.apache.xml.security.c14n.implementations.Canonicalizer20010315OmitComments

    public byte[] getBytes() throws IOException, CanonicalizationException {
        byte[] inputBytes = getBytesFromInputStream();
        if (inputBytes != null) {
            return inputBytes;
        }
        Canonicalizer20010315OmitComments c14nizer = new Canonicalizer20010315OmitComments();                 
        bytes = c14nizer.engineCanonicalize(this);        
        return bytes;
    }
View Full Code Here

Examples of org.apache.xml.security.c14n.implementations.Canonicalizer20010315OmitComments

        } else if (inputOctetStreamProxy == null) {                   
            CanonicalizerBase c14nizer = null;
            if (c14n11) {
                c14nizer = new Canonicalizer11_OmitComments();      
            } else {
                c14nizer = new Canonicalizer20010315OmitComments();      
            }
            c14nizer.setWriter(diOs);
            c14nizer.engineCanonicalize(this);
        } else {
            byte[] buffer = new byte[4 * 1024];
 
View Full Code Here

Examples of org.apache.xml.security.c14n.implementations.Canonicalizer20010315OmitComments

    public byte[] getBytes() throws IOException, CanonicalizationException {
        byte[] inputBytes = getBytesFromInputStream();
        if (inputBytes != null) {
            return inputBytes;
        }
        Canonicalizer20010315OmitComments c14nizer = new Canonicalizer20010315OmitComments();                 
        bytes = c14nizer.engineCanonicalize(this);        
        return bytes;
    }
View Full Code Here

Examples of org.apache.xml.security.c14n.implementations.Canonicalizer20010315OmitComments

        } else if (inputOctetStreamProxy == null) {                   
            CanonicalizerBase c14nizer = null;
            if (c14n11) {
                c14nizer = new Canonicalizer11_OmitComments();      
            } else {
                c14nizer = new Canonicalizer20010315OmitComments();      
            }
            c14nizer.setWriter(diOs);
            c14nizer.engineCanonicalize(this);
        } else {
            if (inputOctetStreamProxy.markSupported()) {
View Full Code Here

Examples of org.apache.xml.security.c14n.implementations.Canonicalizer20010315OmitComments

            is.reset();      
            bytes=JavaUtils.getBytesFromStream(is);
         }      
         return bytes;              
      } else if (this.isElement()) {                   
         Canonicalizer20010315OmitComments c14nizer =
             new Canonicalizer20010315OmitComments();                 
        bytes=c14nizer.engineCanonicalizeSubTree(this._subNode,this.excludeNode);        
        return bytes;
      } else if (this.isNodeSet()) {       
         /* If we have a node set but an octet stream is needed, we MUST c14nize
          * without any comments.
          *
          * We don't use the factory because direct instantiation should be a
          * little bit faster...
          */
         Canonicalizer20010315OmitComments c14nizer =
            new Canonicalizer20010315OmitComments();        

         if (this._inputNodeSet.size() == 0) {
            // empty nodeset
            return null;
         }             
         bytes = c14nizer.engineCanonicalizeXPathNodeSet(_inputNodeSet);
          return bytes;        
      }

      throw new RuntimeException(
         "getBytes() called but no input data present");
View Full Code Here

Examples of org.apache.xml.security.c14n.implementations.Canonicalizer20010315OmitComments

        }
        if (bytes!=null) {
            diOs.write(bytes);
            return;     
         }else if (this.isElement()) {                   
             Canonicalizer20010315OmitComments c14nizer =
                    new Canonicalizer20010315OmitComments();      
             c14nizer.setWriter(diOs);
            c14nizer.engineCanonicalizeSubTree(this._subNode,this.excludeNode);
            return;
          } else if (this.isNodeSet()) {       
             /* If we have a node set but an octet stream is needed, we MUST c14nize
              * without any comments.
              *
              * We don't use the factory because direct instantiation should be a
              * little bit faster...
              */
             Canonicalizer20010315OmitComments c14nizer =
                new Canonicalizer20010315OmitComments();        
             c14nizer.setWriter(diOs);
             if (this._inputNodeSet.size() == 0) {
                // empty nodeset
                return;
             }                             
             c14nizer.engineCanonicalizeXPathNodeSet(this._inputNodeSet);               
             return;            
          } else {
            InputStream is = getResetableInputStream();
            if (bytes!=null) {
                //already read write it, can be rea.
View Full Code Here

Examples of org.apache.xml.security.c14n.implementations.Canonicalizer20010315OmitComments

           _inputOctetStreamProxy=new ByteArrayInputStream(bytes);
        }
                 
         return bytes;              
      } else if (this.isElement()) {                   
         Canonicalizer20010315OmitComments c14nizer =
             new Canonicalizer20010315OmitComments();                 
        bytes=c14nizer.engineCanonicalizeSubTree(this._subNode,this.excludeNode);        
        return bytes;
      } else if (this.isNodeSet()) {       
         /* If we have a node set but an octet stream is needed, we MUST c14nize
          * without any comments.
          *
          * We don't use the factory because direct instantiation should be a
          * little bit faster...
          */
         Canonicalizer20010315OmitComments c14nizer =
            new Canonicalizer20010315OmitComments();        

         if (this._inputNodeSet.size() == 0) {
            // empty nodeset
            return null;
         }             
         bytes = c14nizer.engineCanonicalizeXPathNodeSet(_inputNodeSet);
          return bytes;        
      }

      throw new RuntimeException(
         "getBytes() called but no input data present");
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.