Examples of DOMStructure


Examples of javax.xml.crypto.dom.DOMStructure

     * Get the KeyValue object from the KeyInfo DOM element if it exists
     */
    private KeyValue getKeyValue(
        Element keyInfoElement
    ) throws MarshalException {
        XMLStructure keyInfoStructure = new DOMStructure(keyInfoElement);
        KeyInfo keyInfo = keyInfoFactory.unmarshalKeyInfo(keyInfoStructure);
        List<?> list = keyInfo.getContent();

        for (int i = 0; i < list.size(); i++) {
            XMLStructure xmlStructure = (XMLStructure) list.get(i);
View Full Code Here

Examples of javax.xml.crypto.dom.DOMStructure

                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "unsupportedKeyId");
            }
        }
       
        if (keyIdentifierType != WSConstants.KEY_VALUE) {
            XMLStructure structure = new DOMStructure(secRef.getElement());
            wsDocInfo.addTokenElement(secRef.getElement(), false);
            keyInfo =
                keyInfoFactory.newKeyInfo(
                    java.util.Collections.singletonList(structure), keyInfoUri
                );
View Full Code Here

Examples of javax.xml.crypto.dom.DOMStructure

                throw new WSSecurityException(WSSecurityException.FAILURE, "unsupportedKeyId");
            }
        }
       
        if (keyIdentifierType != WSConstants.KEY_VALUE) {
            XMLStructure structure = new DOMStructure(secRef.getElement());
            wsDocInfo.addTokenElement(secRef.getElement(), false);
            keyInfo =
                keyInfoFactory.newKeyInfo(
                    java.util.Collections.singletonList(structure), keyInfoUri
                );
View Full Code Here

Examples of javax.xml.crypto.dom.DOMStructure

        Document doc = TestUtils.newDocument();
        Element nc = doc.createElementNS(null, "NonCommentandus");
        nc.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "");
        nc.appendChild(doc.createComment(" Commentandum "));
        objs.add(fac.newXMLObject(Collections.singletonList
            (new DOMStructure(nc)), "object-2", null, null));

  KeyInfo  ki = kifac.newKeyInfo(Collections.singletonList
        (kifac.newKeyValue((PublicKey) VALIDATE_KEYS[1])));

        // create XMLSignature
View Full Code Here

Examples of javax.xml.crypto.dom.DOMStructure

        Document doc = db.newDocument();
  Element baz = doc.createElementNS("urn:bar", "bar:Baz");
  Comment com = doc.createComment(" comment ");
  baz.appendChild(com);
  XMLObject obj = fac.newXMLObject(Collections.singletonList
      (new DOMStructure(baz)), "to-be-signed", null, null);

  // create XMLSignature
  XMLSignature sig = fac.newXMLSignature
      (si, ki, Collections.singletonList(obj), null, null);
View Full Code Here

Examples of javax.xml.crypto.dom.DOMStructure

        Document doc = db.newDocument();
  Element baz = doc.createElementNS("urn:bar", "bar:Baz");
  Comment com = doc.createComment(" comment ");
  baz.appendChild(com);
  XMLObject obj = fac.newXMLObject(Collections.singletonList
      (new DOMStructure(baz)), "to-be-signed", null, null);

  // create XMLSignature
  XMLSignature sig = fac.newXMLSignature
      (si, ki, Collections.singletonList(obj), null, null);
View Full Code Here

Examples of javax.xml.crypto.dom.DOMStructure

                    }
                SignedDataObjectProperties.appendChild(DataObjectFormat);
            SignedProperties.appendChild(SignedDataObjectProperties);
        QualifyingProperties.appendChild(SignedProperties);

        XMLStructure content = new DOMStructure(QualifyingProperties);
        return fac.newXMLObject(Collections.singletonList(content), null, null, null);
    }
View Full Code Here

Examples of javax.xml.crypto.dom.DOMStructure

    try {
      @NotNull @NonNls String elementName = xmlDocument.getFirstChild().getNodeName();
      Reference ref = SIGNATURE_FACTORY.newReference( '#' + elementName, SIGNATURE_FACTORY.newDigestMethod( DigestMethod.SHA256, null ) );

      Node invoice = xmlDocument.getDocumentElement();
      XMLStructure content = new DOMStructure( invoice );
      XMLObject obj = SIGNATURE_FACTORY.newXMLObject( Collections.singletonList( content ), elementName, null, null );

      SignedInfo si = SIGNATURE_FACTORY.newSignedInfo( SIGNATURE_FACTORY.newCanonicalizationMethod( CanonicalizationMethod.INCLUSIVE_WITH_COMMENTS, ( C14NMethodParameterSpec ) null ),
                                                       SIGNATURE_FACTORY.newSignatureMethod( SignatureMethod.RSA_SHA1, null ), Collections.singletonList( ref ) );
View Full Code Here

Examples of javax.xml.crypto.dom.DOMStructure

       
        Reference refUt = new Reference(document);
        refUt.setURI("#" + dktId);
        secRef.setReference(refUt);
       
        XMLStructure structure = new DOMStructure(secRef.getElement());
        wsDocInfo.addTokenElement(secRef.getElement(), false);
        keyInfo =
            keyInfoFactory.newKeyInfo(
                java.util.Collections.singletonList(structure), keyInfoUri
            );
View Full Code Here

Examples of javax.xml.crypto.dom.DOMStructure

     * Get the KeyValue object from the KeyInfo DOM element if it exists
     */
    private KeyValue getKeyValue(
        Element keyInfoElement
    ) throws MarshalException {
        XMLStructure keyInfoStructure = new DOMStructure(keyInfoElement);
        KeyInfo keyInfo = keyInfoFactory.unmarshalKeyInfo(keyInfoStructure);
        List<?> list = keyInfo.getContent();

        for (int i = 0; i < list.size(); i++) {
            XMLStructure xmlStructure = (XMLStructure) list.get(i);
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.