Examples of encryptForRef()


Examples of org.apache.ws.security.message.WSSecEncrypt.encryptForRef()

       
        Document doc = element.getOwnerDocument();
        doc.appendChild(element);
                                
        builder.prepare(element.getOwnerDocument(), stsProperties.getEncryptionCrypto());
        builder.encryptForRef(null, Collections.singletonList(encryptionPart));
       
        return doc.getDocumentElement();
    }
   
    /**
 
View Full Code Here

Examples of org.apache.ws.security.message.WSSecEncrypt.encryptForRef()

        WSEncryptionPart encP =
            new WSEncryptionPart(
                "add", "http://ws.apache.org/counter/counter_port_type", "Element"
            );
        parts.add(encP);
        Element refElement = builder.encryptForRef(null, parts);
        builder.addInternalRefElement(refElement);
        builder.appendToHeader(secHeader);

        String outputString =
            org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(doc);
View Full Code Here

Examples of org.apache.ws.security.message.WSSecEncrypt.encryptForRef()

        WSEncryptionPart encP =
            new WSEncryptionPart(
                "add", "http://ws.apache.org/counter/counter_port_type", "Element"
            );
        parts.add(encP);
        Element refElement = builder.encryptForRef(null, parts);
        builder.addInternalRefElement(refElement);
        builder.appendToHeader(secHeader);

        String outputString =
            org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(doc);
View Full Code Here

Examples of org.apache.ws.security.message.WSSecEncrypt.encryptForRef()

        WSEncryptionPart encP =
            new WSEncryptionPart(
                "add", "http://ws.apache.org/counter/counter_port_type", "Element"
            );
        parts.add(encP);
        Element refElement = builder.encryptForRef(null, parts);
        builder.addInternalRefElement(refElement);
        builder.appendToHeader(secHeader);

        String outputString =
            org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(doc);
View Full Code Here

Examples of org.apache.wss4j.dom.message.WSSecEncrypt.encryptForRef()

                  
                    if (encr.getBSTTokenId() != null) {
                        encr.prependBSTElementToHeader(secHeader);
                    }
                  
                    Element refList = encr.encryptForRef(null, encrParts);
                    List<Element> attachments = encr.getAttachmentEncryptedDataElements();
                    if (atEnd) {
                        this.insertBeforeBottomUp(refList);
                        if (attachments != null) {
                            for (Element attachment : attachments) {
View Full Code Here

Examples of org.apache.wss4j.dom.message.WSSecEncrypt.encryptForRef()

                   
                    Element encryptedKeyElement = encr.getEncryptedKeyElement();
                    List<Element> attachments = encr.getAttachmentEncryptedDataElements();
                    //Encrypt, get hold of the ref list and add it
                    if (externalRef) {
                        Element refList = encr.encryptForRef(null, encrParts);
                        insertBeforeBottomUp(refList);
                        if (attachments != null) {
                            for (Element attachment : attachments) {
                                this.insertBeforeBottomUp(attachment);
                            }
View Full Code Here

Examples of org.apache.wss4j.dom.message.WSSecEncrypt.encryptForRef()

                                this.insertBeforeBottomUp(attachment);
                            }
                        }
                        this.addEncryptedKeyElement(encryptedKeyElement);
                    } else {
                        Element refList = encr.encryptForRef(null, encrParts);
                        this.addEncryptedKeyElement(encryptedKeyElement);
                       
                        // Add internal refs
                        encryptedKeyElement.appendChild(refList);
                        if (attachments != null) {
View Full Code Here

Examples of org.apache.wss4j.dom.message.WSSecEncrypt.encryptForRef()

            WSEncryptionPart encP =
                    new WSEncryptionPart(
                            "add", "http://ws.apache.org/counter/counter_port_type", "Element"
                    );
            parts.add(encP);
            Element refElement = builder.encryptForRef(null, parts);
            builder.addInternalRefElement(refElement);
            builder.appendToHeader(secHeader);

            javax.xml.transform.Transformer transformer = TRANSFORMER_FACTORY.newTransformer();
            transformer.transform(new DOMSource(doc), new StreamResult(baos));
View Full Code Here

Examples of org.apache.wss4j.dom.message.WSSecEncrypt.encryptForRef()

             WSEncryptionPart encP =
                     new WSEncryptionPart(
                             "add", "http://ws.apache.org/counter/counter_port_type", "Element"
                     );
             parts.add(encP);
             Element refElement = builder.encryptForRef(null, parts);
             builder.addInternalRefElement(refElement);
             builder.appendToHeader(secHeader);

             javax.xml.transform.Transformer transformer = TRANSFORMER_FACTORY.newTransformer();
             transformer.transform(new DOMSource(doc), new StreamResult(baos));
View Full Code Here

Examples of org.apache.wss4j.dom.message.WSSecEncrypt.encryptForRef()

            WSEncryptionPart bst = new WSEncryptionPart("BinarySecurityToken", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "Element");
            WSEncryptionPart def = new WSEncryptionPart("definitions", "http://schemas.xmlsoap.org/wsdl/", "Element");
            List<WSEncryptionPart> encryptionParts = new ArrayList<WSEncryptionPart>();
            encryptionParts.add(bst);
            encryptionParts.add(def);
            Element ref = builder.encryptForRef(null, encryptionParts);
            ref.removeChild(ref.getElementsByTagNameNS("http://www.w3.org/2001/04/xmlenc#", "DataReference").item(0));
            builder.addExternalRefElement(ref, secHeader);
            builder.prependToHeader(secHeader);

            javax.xml.transform.Transformer transformer = TRANSFORMER_FACTORY.newTransformer();
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.