Examples of DOMSignContext


Examples of javax.xml.crypto.dsig.dom.DOMSignContext

                        child = child.getNextSibling();
                    }
                    siblingElement = (Element)child;
                }
                if (siblingElement == null) {
                    signContext = new DOMSignContext(key, securityHeader);
                } else {
                    signContext = new DOMSignContext(key, securityHeader, siblingElement);
                }
            } else {
                signContext = new DOMSignContext(key, securityHeader);
            }
           
            signContext.putNamespacePrefix(WSConstants.SIG_NS, WSConstants.SIG_PREFIX);
            if (WSConstants.C14N_EXCL_OMIT_COMMENTS.equals(canonAlgo)) {
                signContext.putNamespacePrefix(
View Full Code Here

Examples of javax.xml.crypto.dsig.dom.DOMSignContext

    public void sign(XMLSignContext signContext)
  throws MarshalException, XMLSignatureException {
  if (signContext == null) {
      throw new NullPointerException("signContext cannot be null");
  }
        DOMSignContext context = (DOMSignContext) signContext;
        if (context != null) {
            marshal(context.getParent(), context.getNextSibling(),
                DOMUtils.getSignaturePrefix(context), context);
        }

  // generate references and signature value
  List allReferences = new ArrayList(si.getReferences());
View Full Code Here

Examples of javax.xml.crypto.dsig.dom.DOMSignContext

    public void sign(XMLSignContext signContext)
  throws MarshalException, XMLSignatureException {
  if (signContext == null) {
      throw new NullPointerException("signContext cannot be null");
  }
        DOMSignContext context = (DOMSignContext) signContext;
        if (context != null) {
            marshal(context.getParent(), context.getNextSibling(),
                DOMUtils.getSignaturePrefix(context), context);
        }

  // generate references and signature value
  List allReferences = new ArrayList(si.getReferences());
View Full Code Here

Examples of javax.xml.crypto.dsig.dom.DOMSignContext

    public void sign(XMLSignContext signContext)
  throws MarshalException, XMLSignatureException {
  if (signContext == null) {
      throw new NullPointerException("signContext cannot be null");
  }
        DOMSignContext context = (DOMSignContext) signContext;
        if (context != null) {
            marshal(context.getParent(), context.getNextSibling(),
                DOMUtils.getSignaturePrefix(context), context);
        }

  // generate references and signature value
  List allReferences = new ArrayList(si.getReferences());
View Full Code Here

Examples of javax.xml.crypto.dsig.dom.DOMSignContext

                        child = child.getNextSibling();
                    }
                    siblingElement = (Element)child;
                }
                if (siblingElement == null) {
                    signContext = new DOMSignContext(key, securityHeader);
                } else {
                    signContext = new DOMSignContext(key, securityHeader, siblingElement);
                }
            } else {
                signContext = new DOMSignContext(key, securityHeader);
            }
           
            signContext.putNamespacePrefix(WSConstants.SIG_NS, WSConstants.SIG_PREFIX);
            if (WSConstants.C14N_EXCL_OMIT_COMMENTS.equals(canonAlgo)) {
                signContext.putNamespacePrefix(
View Full Code Here

Examples of javax.xml.crypto.dsig.dom.DOMSignContext

                                + keyStoreInfo.getAlias());
            }

            KeyInfo ki = getKeyInfo(signFactory, keyEntry);

            DOMSignContext dsc = new DOMSignContext(keyEntry.getPrivateKey(),
                    target);

            XMLSignature signature = signFactory.newXMLSignature(si, ki);

            signature.sign(dsc);
View Full Code Here

Examples of javax.xml.crypto.dsig.dom.DOMSignContext

  for (int i = 0; i < CRYPTO_ALGS.length; i++) {
      rand.nextBytes(in);
            URIDereferencer dereferrer =
                new TestUtils.OctetStreamURIDereferencer(in);
      Document doc = TestUtils.newDocument();
      signContext = new
    DOMSignContext(TestUtils.getPrivateKey(CRYPTO_ALGS[i]), doc);
      signContext.setURIDereferencer(dereferrer);
            if (cache) {
                signContext.setProperty
                    ("javax.xml.crypto.dsig.cacheReference", Boolean.TRUE);
View Full Code Here

Examples of javax.xml.crypto.dsig.dom.DOMSignContext

      ("http://example.org/envelope", "Envelope");
  envelope.setAttributeNS
      (Constants.NamespaceSpecNS, "xmlns", "http://example.org/envelope");
  doc.appendChild(envelope);

  DOMSignContext dsc = new DOMSignContext(signingKey, envelope);

  sig.sign(dsc);

  DOMValidateContext dvc = new DOMValidateContext
      (kvks, envelope.getFirstChild());
View Full Code Here

Examples of javax.xml.crypto.dsig.dom.DOMSignContext

  notaries.appendChild(notary1);
  notaries.appendChild(notary2);
  envelope.appendChild(notaries);
  envelope.appendChild(doc.createComment(" Commentary "));

  DOMSignContext dsc = new DOMSignContext(signingKey, ys);
  dsc.setIdAttributeNS(notaries, null, "Id");

  sig.sign(dsc);

  // DOM L2 does not support the creation of DOCTYPEs, so instead
        // we insert it before the document using a StringWriter
View Full Code Here

Examples of javax.xml.crypto.dsig.dom.DOMSignContext

  Document doc = db.newDocument();

  // create XMLSignature
  XMLSignature sig = fac.newXMLSignature(si, ki);

  DOMSignContext dsc = new DOMSignContext(signingKey, doc);

  sig.sign(dsc);

/**
  System.out.println("doc is:");
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.