Examples of XPathFilterParameterSpec


Examples of javax.xml.crypto.dsig.spec.XPathFilterParameterSpec

        transformXPath.setParameterSpec(params);
        return transformXPath;
    }

    public static XPathFilterParameterSpec getXpathFilter(String xpath, Map<String, String> namespaceMap) {
        XPathFilterParameterSpec params = namespaceMap == null ? new XPathFilterParameterSpec(xpath) : new XPathFilterParameterSpec(xpath,
                namespaceMap);
        return params;
    }
View Full Code Here

Examples of javax.xml.crypto.dsig.spec.XPathFilterParameterSpec

          String prefix = attr.getPrefix();
          if (prefix != null && prefix.equals("xmlns")) {
              namespaceMap.put(attr.getLocalName(), attr.getValue());
          }
      }
      this.params = new XPathFilterParameterSpec(xPath, namespaceMap);
  } else {
      this.params = new XPathFilterParameterSpec(xPath);
  }
    }
View Full Code Here

Examples of javax.xml.crypto.dsig.spec.XPathFilterParameterSpec

    public void marshalParams(XMLStructure parent, XMLCryptoContext context)
        throws MarshalException {

  super.marshalParams(parent, context);
  XPathFilterParameterSpec xp =
      (XPathFilterParameterSpec) getParameterSpec();
  Element xpathElem = DOMUtils.createElement
      (ownerDoc, "XPath", XMLSignature.XMLNS,
       DOMUtils.getSignaturePrefix(context));
  xpathElem.appendChild(ownerDoc.createTextNode(xp.getXPath()));

  // add namespace attributes, if necessary
  Iterator i = xp.getNamespaceMap().entrySet().iterator();
  while (i.hasNext()) {
      Map.Entry entry = (Map.Entry) i.next();
      xpathElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:"
    + (String) entry.getKey(), (String) entry.getValue());
  }
View Full Code Here

Examples of javax.xml.crypto.dsig.spec.XPathFilterParameterSpec

  Transform tm;
  for (int i = 0; i < TRANSFORM_ALGOS.length; i++) {
      String algo = TRANSFORM_ALGOS[i];
      TransformParameterSpec params = null;
      if (algo.equals(Transform.XPATH)) {
    params = new XPathFilterParameterSpec("xPath");
      } else if (algo.equals(Transform.XPATH2)) {
    params = new XPathFilter2ParameterSpec
        (Collections.singletonList(new XPathType
      ("xPath2", XPathType.Filter.INTERSECT)));
      } else if (algo.equals(Transform.XSLT)) {
View Full Code Here

Examples of javax.xml.crypto.dsig.spec.XPathFilterParameterSpec

  Transform tm;
  for (int i = 0; i < TRANSFORM_ALGOS.length; i++) {
      String algo = TRANSFORM_ALGOS[i];
      TransformParameterSpec params = null;
      if (algo.equals(Transform.XPATH)) {
    params = new XPathFilterParameterSpec("xPath");
      } else if (algo.equals(Transform.XPATH2)) {
    params = new XPathFilter2ParameterSpec
        (Collections.singletonList(new XPathType
      ("xPath2", XPathType.Filter.INTERSECT)));
      } else if (algo.equals(Transform.XSLT)) {
View Full Code Here

Examples of javax.xml.crypto.dsig.spec.XPathFilterParameterSpec

  Transform tm;
  for (int i = 0; i < TRANSFORM_ALGOS.length; i++) {
      String algo = TRANSFORM_ALGOS[i];
      TransformParameterSpec params = null;
      if (algo.equals(Transform.XPATH)) {
    params = new XPathFilterParameterSpec("xPath");
      } else if (algo.equals(Transform.XPATH2)) {
    params = new XPathFilter2ParameterSpec
        (Collections.singletonList(new XPathType
      ("xPath2", XPathType.Filter.INTERSECT)));
      } else if (algo.equals(Transform.XSLT)) {
View Full Code Here

Examples of javax.xml.crypto.dsig.spec.XPathFilterParameterSpec

  Transform tm;
  for (int i = 0; i < TRANSFORM_ALGOS.length; i++) {
      String algo = TRANSFORM_ALGOS[i];
      TransformParameterSpec params = null;
      if (algo.equals(Transform.XPATH)) {
    params = new XPathFilterParameterSpec("xPath");
      } else if (algo.equals(Transform.XPATH2)) {
    params = new XPathFilter2ParameterSpec
        (Collections.singletonList(new XPathType
      ("xPath2", XPathType.Filter.INTERSECT)));
      } else if (algo.equals(Transform.XSLT)) {
View Full Code Here

Examples of javax.xml.crypto.dsig.spec.XPathFilterParameterSpec

 
      List<Transform> transforms = new ArrayList<Transform>();
      transforms.add(signFactory.newTransform(Transform.ENVELOPED,(TransformParameterSpec)null));
      Map<String,String> m = new HashMap<String,String>();
      m.put("soap","http://schemas.xmlsoap.org/soap/envelope/");
      transforms.add(signFactory.newTransform(Transform.XPATH,new XPathFilterParameterSpec("not(ancestor-or-self::node()[@soap:actor=\"urn:oasis:names:tc:ebxml-msg:service:nextMSH\"]|ancestor-or-self::node()[@soap:actor=\"http://schemas.xmlsoap.org/soap/actor/next\"])",m)));
      transforms.add(signFactory.newTransform(CanonicalizationMethod.INCLUSIVE,(TransformParameterSpec)null));
 
      List<Reference> references = new ArrayList<Reference>();
      references.add(signFactory.newReference("",sha1DigestMethod,transforms,null,null));
 
View Full Code Here

Examples of javax.xml.crypto.dsig.spec.XPathFilterParameterSpec

     */
     @SuppressWarnings("unchecked")
    public void addCanonicalizationParams(AlgorithmParameterSpec algoSpec,HashMap paramList){
        //TODO::FixMe:  Fill this appropriately.
        if(algoSpec instanceof XPathFilterParameterSpec){
            XPathFilterParameterSpec spec = (XPathFilterParameterSpec)algoSpec;
            paramList.put("XPATH",spec.getXPath());
        }else if(algoSpec instanceof XPathFilter2ParameterSpec){
            XPathFilter2ParameterSpec spec = (XPathFilter2ParameterSpec)algoSpec;
            paramList.put("XPATH2",spec.getXPathList());
        }
    }
View Full Code Here

Examples of javax.xml.crypto.dsig.spec.XPathFilterParameterSpec

        if (xpath == null) {
            throw new IllegalArgumentException("xpath is null");
        }
        XmlSignatureTransform transformXPath = new XmlSignatureTransform();
        transformXPath.setAlgorithm(Transform.XPATH);
        XPathFilterParameterSpec params = getXpathFilter(xpath, namespaceMap);
        transformXPath.setParameterSpec(params);
        return transformXPath;
    }
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.