Examples of newReference()


Examples of com.sun.xml.ws.security.opt.crypto.jaxb.JAXBSignatureFactory.newReference()

           
            transformList.add(tr1);
            transformList.add(tr2);
           
            final String uri = "#" + "uuid-" + UUID.randomUUID().toString();
            final Reference ref = signatureFactory.newReference(uri,digestMethod,transformList, null, null);
           
            // Create the SignedInfo
            final SignedInfo signedInfo = signatureFactory.newSignedInfo(canonicalMethod,signatureMethod,Collections.singletonList(ref));
           
            KeyValue keyValue;
View Full Code Here

Examples of javax.xml.crypto.dsig.XMLSignatureFactory.newReference()

        // Create a Reference to the enveloped document (in this case,
        // you are signing the whole document, so a URI of "" signifies
        // that, and also specify the SHA1 digest algorithm and
        // the ENVELOPED Transform.
        ref = fac.newReference
         ("", fac.newDigestMethod(DigestMethod.SHA1, null),
          Collections.singletonList
           (fac.newTransform
            (Transform.ENVELOPED, (TransformParameterSpec) null)),
             null, null);
View Full Code Here

Examples of javax.xml.crypto.dsig.XMLSignatureFactory.newReference()

     // Create a Reference to the enveloped document (in this case,
     // you are signing the whole document, so a URI of "" signifies
     // that, and also specify the SHA1 digest algorithm and
     // the ENVELOPED Transform.
     Reference ref = fac.newReference
      ("", fac.newDigestMethod(DigestMethod.SHA1, null),
       Collections.singletonList
        (fac.newTransform
         (Transform.ENVELOPED, (TransformParameterSpec) null)),
          null, null);
View Full Code Here

Examples of javax.xml.crypto.dsig.XMLSignatureFactory.newReference()

            DigestMethod method = signFactory.newDigestMethod(
                    DigestMethod.SHA1, null);
            Transform transform = signFactory.newTransform(
                    Transform.ENVELOPED,
                    (TransformParameterSpec) null);
            Reference ref = signFactory.newReference('#' + refId, method,
                    Collections.singletonList(transform), null, null);

            CanonicalizationMethod canonMethod = signFactory
                    .newCanonicalizationMethod(
                            CanonicalizationMethod.EXCLUSIVE,
View Full Code Here

Examples of javax.xml.crypto.dsig.XMLSignatureFactory.newReference()

                    (TransformParameterSpec) null);
            Transform transform2 = signFactory.newTransform(
                    CanonicalizationMethod.EXCLUSIVE,
                    (TransformParameterSpec) null);

            Reference ref = signFactory.newReference('#' + refId, method,
                    Arrays.asList(transform1, transform2), null, null);
 
            CanonicalizationMethod canonMethod = signFactory
                    .newCanonicalizationMethod(
                            CanonicalizationMethod.EXCLUSIVE,
View Full Code Here

Examples of javax.xml.crypto.dsig.XMLSignatureFactory.newReference()

            final List envelopedTransform = Collections
                .singletonList(sigFactory.newTransform(Transform.ENVELOPED,
                    (TransformParameterSpec) null));

            final Reference ref = sigFactory.newReference("", sigFactory
                .newDigestMethod(DigestMethod.SHA1, null), envelopedTransform,
                null, null);

            // Create the SignatureMethod based on the type of key
            SignatureMethod signatureMethod;
View Full Code Here

Examples of javax.xml.crypto.dsig.XMLSignatureFactory.newReference()

            DigestMethod method = signFactory.newDigestMethod(
                    DigestMethod.SHA1, null);
            Transform transform = signFactory.newTransform(
                    Transform.ENVELOPED,
                    (TransformParameterSpec) null);
            Reference ref = signFactory.newReference('#' + refId, method,
                    Collections.singletonList(transform), null, null);

            CanonicalizationMethod canonMethod = signFactory
                    .newCanonicalizationMethod(
                            CanonicalizationMethod.EXCLUSIVE,
View Full Code Here

Examples of javax.xml.crypto.dsig.XMLSignatureFactory.newReference()

                    (TransformParameterSpec) null);
            Transform transform2 = signFactory.newTransform(
                    CanonicalizationMethod.EXCLUSIVE,
                    (TransformParameterSpec) null);

            Reference ref = signFactory.newReference('#' + refId, method,
                    Arrays.asList(transform1, transform2), null, null);
 
            CanonicalizationMethod canonMethod = signFactory
                    .newCanonicalizationMethod(
                            CanonicalizationMethod.EXCLUSIVE,
View Full Code Here

Examples of javax.xml.crypto.dsig.XMLSignatureFactory.newReference()

    }

    private static void signDocument(final Document doc, final PrivateKey privateKey) throws Exception {
        final XMLSignatureFactory xsf = XMLSignatureFactory.getInstance("DOM");

        final Reference ref = xsf.newReference(
                "",
                xsf.newDigestMethod(DigestMethod.SHA256, null),
                Collections.singletonList(xsf.newTransform(Transform.ENVELOPED, (TransformParameterSpec) null)),
                null,
                null);
View Full Code Here

Examples of javax.xml.crypto.dsig.XMLSignatureFactory.newReference()

      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));
 
      for (EbMSDataSource dataSource : dataSources)
        references.add(signFactory.newReference("cid:" + dataSource.getContentId(),sha1DigestMethod,Collections.emptyList(),null,null,DigestUtils.sha(IOUtils.toByteArray(dataSource.getInputStream()))));
 
      SignedInfo signedInfo = signFactory.newSignedInfo(signFactory.newCanonicalizationMethod(CanonicalizationMethod.INCLUSIVE,(C14NMethodParameterSpec)null),signFactory.newSignatureMethod(SignatureMethod.RSA_SHA1,null),references);
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.