Examples of ExcC14NParameterSpec


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

            C14NMethodParameterSpec c14nSpec = null;
            if (getWsConfig().isAddInclusivePrefixes()
                && canonAlgo.equals(WSConstants.C14N_EXCL_OMIT_COMMENTS)) {
                List<String> prefixes =
                    getInclusivePrefixes(secHeader.getSecurityHeader(), false);
                c14nSpec = new ExcC14NParameterSpec(prefixes);
            }
           
           c14nMethod = signatureFactory.newCanonicalizationMethod(canonAlgo, c14nSpec);
        } catch (Exception ex) {
            LOG.error("", ex);
View Full Code Here

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

            C14NMethodParameterSpec c14nSpec = null;
            if (getWsConfig().isAddInclusivePrefixes()
                && canonAlgo.equals(WSConstants.C14N_EXCL_OMIT_COMMENTS)) {
                List<String> prefixes =
                    getInclusivePrefixes(secHeader.getSecurityHeader(), false);
                c14nSpec = new ExcC14NParameterSpec(prefixes);
            }
           
           c14nMethod = signatureFactory.newCanonicalizationMethod(canonAlgo, c14nSpec);
        } catch (Exception ex) {
            LOG.error("", ex);
View Full Code Here

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

            C14NMethodParameterSpec c14nSpec = null;
            if (getWsConfig().isAddInclusivePrefixes()
                && canonAlgo.equals(WSConstants.C14N_EXCL_OMIT_COMMENTS)) {
                List<String> prefixes =
                    getInclusivePrefixes(secHeader.getSecurityHeader(), false);
                c14nSpec = new ExcC14NParameterSpec(prefixes);
            }
           
           c14nMethod = signatureFactory.newCanonicalizationMethod(canonAlgo, c14nSpec);
        } catch (Exception ex) {
            LOG.error("", ex);
View Full Code Here

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

    @org.junit.Test
    public void testIsFeatureSupported() throws Exception {
        CanonicalizationMethod cm;
        for (int i = 0; i < C14N_ALGOS.length; i++) {
            String algo = C14N_ALGOS[i];
            ExcC14NParameterSpec params = null;
            if (i >= 2) {
                params = new ExcC14NParameterSpec();
            }
            cm = factory.newCanonicalizationMethod(algo, params);
            try {
                cm.isFeatureSupported(null);
                fail("Should raise a NPE for null feature");
View Full Code Here

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

            }
            if (algo.equals(CanonicalizationMethod.EXCLUSIVE_WITH_COMMENTS) ||
                algo.equals(CanonicalizationMethod.EXCLUSIVE)) {
                cm = factory.newCanonicalizationMethod
                    (CanonicalizationMethod.EXCLUSIVE,
                     new ExcC14NParameterSpec());
                AlgorithmParameterSpec aps = cm.getParameterSpec();
                assertNotNull(aps);
                assertTrue(aps instanceof ExcC14NParameterSpec)
            }
        }
View Full Code Here

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

        try {
            C14NMethodParameterSpec c14nSpec = null;
            if (getWsConfig().isWsiBSPCompliant() && canonAlgo.equals(WSConstants.C14N_EXCL_OMIT_COMMENTS)) {
                List<String> prefixes =
                    getInclusivePrefixes(secHeader.getSecurityHeader(), false);
                c14nSpec = new ExcC14NParameterSpec(prefixes);
            }
           
           c14nMethod = signatureFactory.newCanonicalizationMethod(canonAlgo, c14nSpec);
        } catch (Exception ex) {
            log.error("", ex);
View Full Code Here

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

            end = prefixListAttr.indexOf(' ', begin);
        }
        if (begin <= prefixListAttr.length()) {
            prefixList.add(prefixListAttr.substring(begin));
        }
        this.params = new ExcC14NParameterSpec(prefixList);
    }
View Full Code Here

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

            eElem.setAttributeNS("http://www.w3.org/2000/xmlns/",
                                   "xmlns:" + prefix,
                                   CanonicalizationMethod.EXCLUSIVE);
        }

        ExcC14NParameterSpec params = (ExcC14NParameterSpec)spec;
        StringBuffer prefixListAttr = new StringBuffer("");
        @SuppressWarnings("unchecked")
        List<String> prefixList = params.getPrefixList();
        for (int i = 0, size = prefixList.size(); i < size; i++) {
            prefixListAttr.append(prefixList.get(i));
            if (i < size - 1) {
                prefixListAttr.append(" ");
            }
View Full Code Here

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

        try {
            C14NMethodParameterSpec c14nSpec = null;
            if (getWsConfig().isWsiBSPCompliant() && canonAlgo.equals(WSConstants.C14N_EXCL_OMIT_COMMENTS)) {
                List<String> prefixes =
                    getInclusivePrefixes(secHeader.getSecurityHeader(), false);
                c14nSpec = new ExcC14NParameterSpec(prefixes);
            }
           
           c14nMethod = signatureFactory.newCanonicalizationMethod(canonAlgo, c14nSpec);
        } catch (Exception ex) {
            log.error("", ex);
View Full Code Here

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

                            }
                            element = callbackLookup.getElement(idToSign, null, false);
                        }
                        if (wssConfig.isWsiBSPCompliant()) {
                            List<String> prefixes = getInclusivePrefixes(element);
                            transformSpec = new ExcC14NParameterSpec(prefixes);
                        }
                        transform =
                            signatureFactory.newTransform(
                                WSConstants.C14N_EXCL_OMIT_COMMENTS,
                                transformSpec
                            );
                    }
                    if (element != null) {
                        wsDocInfo.addTokenElement(element, false);
                    }
                    javax.xml.crypto.dsig.Reference reference =
                        signatureFactory.newReference(
                            "#" + idToSign,
                            digestMethod,
                            Collections.singletonList(transform),
                            null,
                            null
                        );
                    referenceList.add(reference);
                } else {
                    String nmSpace = encPart.getNamespace();
                    List<Element> elementsToSign = null;
                    if (element != null) {
                        elementsToSign = Collections.singletonList(element);
                    } else {
                        if (callbackLookup == null) {
                            callbackLookup = new DOMCallbackLookup(doc);
                        }
                        elementsToSign =
                            WSSecurityUtil.findElements(encPart, callbackLookup, doc);
                    }
                    if (elementsToSign == null || elementsToSign.size() == 0) {
                        throw new WSSecurityException(
                            WSSecurityException.FAILURE,
                            "noEncElement",
                            new Object[] {nmSpace + ", " + elemName}
                        );
                    }
                    for (Element elementToSign : elementsToSign) {
                        TransformParameterSpec transformSpec = null;
                        if (wssConfig.isWsiBSPCompliant()) {
                            List<String> prefixes = getInclusivePrefixes(elementToSign);
                            transformSpec = new ExcC14NParameterSpec(prefixes);
                        }
                        Transform transform =
                            signatureFactory.newTransform(
                                WSConstants.C14N_EXCL_OMIT_COMMENTS,
                                transformSpec
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.