Package org.apache.ws.security.message

Examples of org.apache.ws.security.message.WSEncryptBody.build()


//                (Element) (doc
//                    .getElementsByTagNameNS(
//                        WSConstants.WSSE_NS,
//                        "RequestedProofToken")
//                    .item(0)));
            wsEncrypt.build(doc, crypto);
            this.sharedSecret = wsEncrypt.getEncryptionKey().getEncoded();
        } catch (WSSecurityException e) {
            e.printStackTrace();
        }
        log.debug("RequestedProofToken :: Decryption Done");
View Full Code Here


        wsEncrypt.setUseThisCert(reqData.getEncCert());
        if (reqData.getEncryptParts().size() > 0) {
            wsEncrypt.setParts(reqData.getEncryptParts());
        }
        try {
            wsEncrypt.build(doc, reqData.getEncCrypto());
        } catch (WSSecurityException e) {
            throw new WSSecurityException("WSHandler: Encryption: error during message processing"
                    + e);
        }
    }
View Full Code Here

//                (Element) (doc
//                    .getElementsByTagNameNS(
//                        WSConstants.WSSE_NS,
//                        "RequestedProofToken")
//                    .item(0)));
            wsEncrypt.build(doc, crypto);
            this.sharedSecret = wsEncrypt.getEncryptionKey().getEncoded();
        } catch (WSSecurityException e) {
            e.printStackTrace();
        }
        log.debug("RequestedProofToken :: Decryption Done");
View Full Code Here

         wsEncrypt.setParts(parts)
       
         wsEncrypt.setSymmetricEncAlgorithm(symAlgo);
        
        try {
            wsEncrypt.build(doc, null);
        } catch (WSSecurityException e) {
          e.printStackTrace();
            throw new ConversationException("ConversationManager :: Encryption: error during message processing");
        }
View Full Code Here

         wsEncrypt.setParts(parts)
       
         wsEncrypt.setSymmetricEncAlgorithm(symAlgo);
        
        try {
            wsEncrypt.build(doc, null);
        } catch (WSSecurityException e) {
          e.printStackTrace();
            throw new ConversationException("ConversationManager :: Encryption: error during message processing");
        }
View Full Code Here

        wsEncrypt.setUseThisCert(reqData.encCert);
        if (reqData.encryptParts.size() > 0) {
            wsEncrypt.setParts(reqData.encryptParts);
        }
        try {
            wsEncrypt.build(doc, reqData.encCrypto);
        } catch (WSSecurityException e) {
            throw new AxisFault("WSDoAllSender: Encryption: error during message processing"
                    + e);
        }
    }
View Full Code Here

        SOAPEnvelope envelope = null;
        WSEncryptBody encrypt = new WSEncryptBody();
        encrypt.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e");
        log.info("Before Encryption....");
        Document doc = unsignedEnvelope.getAsDocument();
        Document encryptedDoc = encrypt.build(doc, crypto);
        Document encryptedEncryptedDoc = encrypt.build(encryptedDoc, crypto);

        /*
         * convert the resulting document into a message first. The toSOAPMessage()
         * mehtod performs the necessary c14n call to properly set up the signed
View Full Code Here

        WSEncryptBody encrypt = new WSEncryptBody();
        encrypt.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e");
        log.info("Before Encryption....");
        Document doc = unsignedEnvelope.getAsDocument();
        Document encryptedDoc = encrypt.build(doc, crypto);
        Document encryptedEncryptedDoc = encrypt.build(encryptedDoc, crypto);

        /*
         * convert the resulting document into a message first. The toSOAPMessage()
         * mehtod performs the necessary c14n call to properly set up the signed
         * document and convert it into a SOAP message. After that we extract it
View Full Code Here

        WSSignEnvelope sign = new WSSignEnvelope();
        encrypt.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e");
        sign.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
        log.info("Before Encryption....");
        Document doc = unsignedEnvelope.getAsDocument();
        Document encryptedDoc = encrypt.build(doc, crypto);
        Document encryptedSignedDoc = sign.build(encryptedDoc, crypto);
        /*
         * convert the resulting document into a message first. The toSOAPMessage()
         * mehtod performs the necessary c14n call to properly set up the signed
         * document and convert it into a SOAP message. After that we extract it
View Full Code Here

        wsEncrypt.setKeyIdentifierType(WSConstants.EMBED_SECURITY_TOKEN_REF);
        wsEncrypt.setSecurityTokenReference(secRef);
        wsEncrypt.setKey(key);

        //Step 4 :: Encrypting using the key.
        Document encDoc = wsEncrypt.build(doc, crypto);

        /*
         * convert the resulting document into a message first. The toSOAPMessage()
         * mehtod performs the necessary c14n call to properly set up the signed
         * document and convert it into a SOAP message. After that we extract it
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.