Package org.apache.xml.security.utils.resolver

Examples of org.apache.xml.security.utils.resolver.ResourceResolver


    */
   static private XMLSignatureInput resolveInput(RetrievalMethod rm,String BaseURI) throws XMLSecurityException{
       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.debug("We have Transforms");
        resource = transforms.performTransforms(resource);
          }     
      return resource;
View Full Code Here


    */
   static private XMLSignatureInput resolveInput(RetrievalMethod rm,String BaseURI) throws XMLSecurityException{
       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.debug("We have Transforms");
        resource = transforms.performTransforms(resource);
          }     
      return resource;
View Full Code Here

            URI = null;
         } else {
            URI = URIAttr.getNodeValue();
         }

         ResourceResolver resolver = ResourceResolver.getInstance(URIAttr,
            this._baseURI, this._manifest._perManifestResolvers);

         if (resolver == null) {
            Object exArgs[] = { URI };

            throw new ReferenceNotInitializedException(
               "signature.Verification.Reference.NoInput", exArgs);
         }

         resolver.addProperties(this._manifest._resolverProperties);

         XMLSignatureInput input = resolver.resolve(URIAttr, this._baseURI);
                 

         return input;
      catch (ResourceResolverException ex) {
         throw new ReferenceNotInitializedException("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);
      }
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);
      }
View Full Code Here

      if (resolverSpi == null) {
        return;
      }
      if (_perManifestResolvers==null)
            _perManifestResolvers = new ArrayList();
      this._perManifestResolvers.add(new ResourceResolver(resolverSpi));
     
   }
View Full Code Here

            URI = null;
         } else {
            URI = URIAttr.getNodeValue();
         }

         ResourceResolver resolver = ResourceResolver.getInstance(URIAttr,
            this._baseURI, this._manifest._perManifestResolvers);

         if (resolver == null) {
            Object exArgs[] = { URI };

            throw new ReferenceNotInitializedException(
               "signature.Verification.Reference.NoInput", exArgs);
         }

         resolver.addProperties(this._manifest._resolverProperties);

         XMLSignatureInput input = resolver.resolve(URIAttr, this._baseURI);
                 

         return input;
      catch (ResourceResolverException ex) {
         throw new ReferenceNotInitializedException("empty", ex);
View Full Code Here

    Document doc=DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();   
    Attr uri=doc.createAttribute("id");
    uri.setNodeValue("urn:ddd:uuu");
    ((Element)doc.createElement("test")).setAttributeNode(uri);
    try {
      ResourceResolver resolver=ResourceResolver.getInstance(uri, null);     
      fail("No exception throw, but resolver found:"+resolver);
    } catch (ResourceResolverException e) {
     
    }
  }
View Full Code Here

    ((Element)doc.createElement("test")).setAttributeNode(uri);
    Attr uri1=doc.createAttribute("id");
    uri1.setNodeValue("!!!test=2");
    doc.createElement("test1").setAttributeNode(uri1);
    ResourceResolver.registerAtStart(OldResourceResolverSpi.class.getName());
    ResourceResolver resolver=ResourceResolver.getInstance(uri, "test");
    ResourceResolver resolver1=ResourceResolver.getInstance(uri1, "test1");
    ResourceResolver resolver2=ResourceResolver.getInstance(uri1, "test2");
   
    resolver2.resolve(uri1, "test2");   
    resolver.resolve(uri, "test");
    resolver1.resolve(uri1, "test1");
   
   
  };
View Full Code Here

  ResourceResolver.registerAtStart(className);
  Document doc =
        DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
  Attr uriAttr = doc.createAttribute("URI");
  uriAttr.setValue("http://www.apache.org");
  ResourceResolver res =
      ResourceResolver.getInstance(uriAttr, "http://www.apache.org");
  try {
      uriAttr.setValue("http://xmldsig.pothole.com/xml-stylesheet.txt");
      res.resolve(uriAttr, null);
  } catch (Exception e) {
      e.printStackTrace();
      fail(uriAttr.getValue()
    + " should be resolvable by the OfflineResolver");
  }
  try {
      uriAttr.setValue("http://www.apache.org");
      res.resolve(uriAttr, null);
      fail(uriAttr.getValue()
    + " should not be resolvable by the OfflineResolver");
  } catch (Exception e) { }
    }
View Full Code Here

TOP

Related Classes of org.apache.xml.security.utils.resolver.ResourceResolver

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.