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

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


        if (os!=null) {
           c14n.setWriter( os);
        }
        byte []result;
        result =c14n.engineCanonicalize(input, inclusiveNamespaces);
        XMLSignatureInput output=new XMLSignatureInput(result);

        return output;
     } catch (XMLSecurityException ex) {
        throw new CanonicalizationException("empty", ex);
     }
View Full Code Here


     */
    public XMLSignatureInput performTransform(XMLSignatureInput input)
         throws IOException, CanonicalizationException,
                InvalidCanonicalizerException, TransformationException {

        XMLSignatureInput result = null;

        try {
            result = transformSpi.enginePerformTransform(input, this);
        } catch (ParserConfigurationException ex) {
            Object exArgs[] = { this.getURI(), "ParserConfigurationException" };
View Full Code Here

     */
    public XMLSignatureInput performTransform(XMLSignatureInput input,
        OutputStream os) throws IOException, CanonicalizationException,
        InvalidCanonicalizerException, TransformationException {

        XMLSignatureInput result = null;

        try {
            result = transformSpi.enginePerformTransform(input, os, this);
        } catch (ParserConfigurationException ex) {
            Object exArgs[] = { this.getURI(), "ParserConfigurationException" };
View Full Code Here

            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

      try {
                   //Create a retrieval method over the given element
                   RetrievalMethod rm = new RetrievalMethod(element, BaseURI);
               String type = rm.getType();
                   XMLSignatureInput resource=resolveInput(rm,BaseURI);
           if (RetrievalMethod.TYPE_RAWX509.equals(type)) {
                //a raw certificate, direct parsing is done!
                X509Certificate cert=getRawCertificate(resource);
                                if (cert != null) {
                                 return cert.getPublicKey();
View Full Code Here

           }

           try {
         RetrievalMethod rm = new RetrievalMethod(element, BaseURI);
                 String type = rm.getType();
                 XMLSignatureInput resource=resolveInput(rm,BaseURI);
                 if (RetrievalMethod.TYPE_RAWX509.equals(type)) {
                X509Certificate cert=getRawCertificate(resource);
            return cert;
                 }
                 Element e = obtainRefrenceElement(resource);
View Full Code Here

       Attr uri = rm.getURIAttr();
           //Apply the trnasforms
       Transforms transforms = rm.getTransforms();
       ResourceResolver resRes = ResourceResolver.getInstance(uri, BaseURI);
       if (resRes != null) {
          XMLSignatureInput resource = resRes.resolve(uri, BaseURI);
          if (transforms != null) {
                  log.log(java.util.logging.Level.FINE, "We have Transforms");
                          resource = transforms.performTransforms(resource);
          }
                  return resource;
View Full Code Here

                        // Need to wrap the uri in an Attribute node so that we can
                        // Pass to the resource resolvers

                        Attr uriAttr = cr.getURIAsAttr();
                        XMLSignatureInput input = null;

                        try {
                                ResourceResolver resolver =
                                        ResourceResolver.getInstance(uriAttr, null);
                                input = resolver.resolve(uriAttr, null);
                        } catch (ResourceResolverException ex) {
                                throw new XMLEncryptionException("empty", ex);
                        }

                        if (input != null) {
                                if (logger.isLoggable(java.util.logging.Level.FINE))                                     logger.log(java.util.logging.Level.FINE, "Managed to resolve URI \"" + cr.getURI() + "\"");
                        }
                        else {
                                if (logger.isLoggable(java.util.logging.Level.FINE))                                     logger.log(java.util.logging.Level.FINE, "Failed to resolve URI \"" + cr.getURI() + "\"");
                        }

                        // Lets see if there are any transforms
                        Transforms transforms = cr.getTransforms();
                        if (transforms != null) {
                                if (logger.isLoggable(java.util.logging.Level.FINE))                                  logger.log(java.util.logging.Level.FINE, "Have transforms in cipher reference");
                                try {
                                    com.sun.org.apache.xml.internal.security.transforms.Transforms dsTransforms =
                                                transforms.getDSTransforms();
                                    input =     dsTransforms.performTransforms(input);
                                } catch (TransformationException ex) {
                                        throw new XMLEncryptionException("empty", ex);
                                }
                        }

                        try {
                                return input.getBytes();
                        }
                        catch (IOException ex) {
                                throw new XMLEncryptionException("empty", ex);
                        } catch (CanonicalizationException ex) {
                                throw new XMLEncryptionException("empty", ex);
View Full Code Here

        try {
            String baseURI = context.getBaseURI();
            ResourceResolver apacheResolver =
                ResourceResolver.getInstance(uriAttr, baseURI);
            XMLSignatureInput in = apacheResolver.resolve(uriAttr, baseURI);
            if (in.isOctetStream()) {
                return new ApacheOctetStreamData(in);
            } else {
                return new ApacheNodeSetData(in);
            }
        } catch (Exception e) {
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

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.