Package org.apache.xml.security.transforms

Examples of org.apache.xml.security.transforms.Transforms


            try {
                for (int part = 0; part < references.size(); part++) {
                    final WSEncryptionPart encPart = (WSEncryptionPart) references.get(part);

                    final String elemName = encPart.getName();
                    final Transforms transforms = new Transforms(document);

                    if (elemName != null && "ExternalSTRTransform".equals(encPart.getNamespace())) {
                        final Element ctx = this.createSTRParameter(document);
                        transforms.addTransform(STRTransform.implementedTransformURI, ctx);
                        this.sig.addDocument("#" + elemName, transforms, this.getDigestAlgo());
                    } else {
                        unalteredReferences.add(encPart);
                    }
                }
View Full Code Here


                    String uri = siRef.getURI();
                    if (uri != null && !"".equals(uri)) {
                       
                        Element se = null;
                        try {
                            Transforms transforms = siRef.getTransforms();
                            for (int j = 0; j < transforms.getLength(); j++) {
                                Transform transform = transforms.item(j);
                                // We have some transforming to do before we can
                                // determine the protected element.
                                if (STRTransform.implementedTransformURI
                                        .equals(transform.getURI())) {
                                   
View Full Code Here

      obj.appendChild(doc.importNode(elem, true));
      String id = "_Object_InformationCard";
      obj.setId(id);
      sig.appendObject(obj);

      Transforms transforms = new Transforms(doc);
      transforms.addTransform(Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS);

      sig.addDocument("#" + id, transforms, Constants.ALGO_ID_DIGEST_SHA1);

      if (this.certChain != null && this.certChain.length > 0) {
        sig.addKeyInfo(certChain);
View Full Code Here

        try {
            XMLSignature signature = new XMLSignature(signElement
                    .getOwnerDocument(), "", xmlSignatureAlgorithm,
                    Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);

            Transforms transforms = new Transforms(signElement
                    .getOwnerDocument());
            transforms
                    .addTransform(Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS);
            signature.addDocument(elementRefId, transforms,
                    MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA1);

            signature.sign(signKey);
View Full Code Here

                    XMLSignature.ALGO_ID_SIGNATURE_RSA_SHA1,
                    Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);

            signElement.appendChild(signature.getElement());

            Transforms transforms = new Transforms(signElement
                    .getOwnerDocument());

            transforms.addTransform(Transforms.TRANSFORM_ENVELOPED_SIGNATURE);
            transforms
                    .addTransform(Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS);

            signature.addDocument(elementRefId, transforms,
                    MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA1);
View Full Code Here

                    keyBindingAuthSignature = new XMLSignature(
                            ((Element) prototypeKeyBindingElement)
                                    .getOwnerDocument(), "",
                            XMLSignature.ALGO_ID_MAC_HMAC_SHA1,
                            Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
                    Transforms transforms = new Transforms(
                            ((Element) prototypeKeyBindingElement)
                                    .getOwnerDocument());
                    transforms
                            .addTransform(Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS);
                    keyBindingAuthSignature.addDocument(
                            prototypeKeyBindingRefId, transforms,
                            MessageDigestAlgorithm.ALGO_ID_DIGEST_SHA1);
                    keyBindingAuthSignature.sign(key);
View Full Code Here

          Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
   
    // add all the transforms to the signature
    String[] oTransforms =
      new String[] { Transforms.TRANSFORM_ENVELOPED_SIGNATURE, Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS };
    Transforms oTrans = new Transforms(oSig.getDocument());
    for (int i = 0; i < oTransforms.length; i++)
    {
      oTrans.addTransform(oTransforms[i]);
    }
    oSig.addDocument("#" + sID, oTrans);
   
    // now finally sign the thing
    oSig.sign(oKey);
View Full Code Here

      "Cannot verify the signature. Reference URI did not match ID");
    }
   
    // check that the transforms are ok
    boolean bEnvelopedFound = false;
    Transforms oTransforms = oRef.getTransforms();
    for (int i = 0; i < oTransforms.getLength(); i++)
    {
      String sTransform = oTransforms.item(i).getURI();
      if (Transforms.TRANSFORM_ENVELOPED_SIGNATURE.equals(sTransform))
      {
        // mark that we got the required transform
        bEnvelopedFound = true;
      }
View Full Code Here

          Canonicalizer.ALGO_ID_C14N_EXCL_OMIT_COMMENTS);
   
    // add all the transforms to the signature
    String[] oTransforms =
      new String[] { Transforms.TRANSFORM_ENVELOPED_SIGNATURE, Transforms.TRANSFORM_C14N_EXCL_OMIT_COMMENTS };
    Transforms oTrans = new Transforms(oSig.getDocument());
    for (int i = 0; i < oTransforms.length; i++)
    {
      oTrans.addTransform(oTransforms[i]);
    }
    oSig.addDocument("#" + sID, oTrans);
   
    // now finally sign the thing
    oSig.sign(oKey);
View Full Code Here

      "Cannot verify the signature. Reference URI did not match ID");
    }
   
    // check that the transforms are ok
    boolean bEnvelopedFound = false;
    Transforms oTransforms = oRef.getTransforms();
    for (int i = 0; i < oTransforms.getLength(); i++)
    {
      String sTransform = oTransforms.item(i).getURI();
      if (Transforms.TRANSFORM_ENVELOPED_SIGNATURE.equals(sTransform))
      {
        // mark that we got the required transform
        bEnvelopedFound = true;
      }
View Full Code Here

TOP

Related Classes of org.apache.xml.security.transforms.Transforms

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.