Package javax.xml.crypto.dsig.spec

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


    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

      }
      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

    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

      }
      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

        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

        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

        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

                            }
                            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

        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

TOP

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

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.