Package javax.xml.crypto.dsig.spec

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


    @Override
    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
        @SuppressWarnings("unchecked")
        Set<Map.Entry<String, String>> entries =
            xp.getNamespaceMap().entrySet();
        for (Map.Entry<String, String> entry : entries) {
            xpathElem.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:" +
                                     entry.getKey(),
                                     entry.getValue());
        }
View Full Code Here


                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

    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

     */
     @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

        if (ALGORITHM_PARAMETER_ELEMENT_QNAME.equals(definitionType)) {
            String name = algoElement.getAttribute(NAME_ATTRIBUTE_NAME);
            String value = algoElement.getAttribute(VALUE_ATTRIBUTE_NAME);
           
            if(name.equals("XPATH")){
                transform.setAlgorithmParameters(new XPathFilterParameterSpec(value));
            }else{
                throw new IllegalStateException("XPATH Transform must have XPATH attribute"
                        +" name and an XPATH Expression as value");
            }
        }else {
View Full Code Here

TOP

Related Classes of javax.xml.crypto.dsig.spec.XPathFilterParameterSpec

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.