Examples of prependToHeader()


Examples of org.apache.ws.security.message.WSSecEncryptedKey.prependToHeader()

         WSSecDKSign sigBuilder = new WSSecDKSign();
         sigBuilder.setExternalKey(ek, tokenIdentifier);
         sigBuilder.setSignatureAlgorithm(XMLSignature.ALGO_ID_MAC_HMAC_SHA1);
         /* Document signedDoc = */ sigBuilder.build(doc, secHeader);
        
         encrKeyBuilder.prependToHeader(secHeader);
         encrKeyBuilder.prependBSTElementToHeader(secHeader);
        
         if (LOG.isDebugEnabled()) {
             LOG.debug("Encrypted message: 3DES  + DerivedKeys");
             String outputString =
View Full Code Here

Examples of org.apache.ws.security.message.WSSecEncryptedKey.prependToHeader()

        WSSecDKEncrypt encrBuilder = new WSSecDKEncrypt();
        encrBuilder.setSymmetricEncAlgorithm(WSConstants.AES_128);
        encrBuilder.setExternalKey(ek, tokenIdentifier);
        Document signedEncryptedDoc = encrBuilder.build(signedDoc, secHeader);

        encrKeyBuilder.prependToHeader(secHeader);
        encrKeyBuilder.prependBSTElementToHeader(secHeader);

        if (LOG.isDebugEnabled()) {
            LOG.debug("Encrypted message: 3DES  + DerivedKeys");
            String outputString =
View Full Code Here

Examples of org.apache.ws.security.message.WSSecEncryptedKey.prependToHeader()

         sigBuilder.setExternalKey(ek, tokenIdentifier);
         sigBuilder.setSignatureAlgorithm(XMLSignature.ALGO_ID_MAC_HMAC_SHA1);
         LOG.info("Before HMAC-SHA1 signature");
         Document encryptedSignedDoc = sigBuilder.build(doc, secHeader);
        
         encrKeyBuilder.prependToHeader(secHeader);
         encrKeyBuilder.prependBSTElementToHeader(secHeader);
        
         if (LOG.isDebugEnabled()) {
             LOG.debug("Encrypted message: 3DES  + DerivedKeys");
             String outputString =
View Full Code Here

Examples of org.apache.ws.security.message.WSSecSignature.prependToHeader()

       */
      /*
       * Prepend Signature to the supporting tokens that sign the primary
       * signature
       */
      iniSignature.prependToHeader(secHeader);
      /*
       * This prepends a possible initiator token to the security header
       */
      iniSignature.prependBSTElementToHeader(secHeader);
      /*
 
View Full Code Here

Examples of org.apache.ws.security.message.WSSecSignature.prependToHeader()

        sign.prepare(doc, null, reqData.getSecHeader());

        // prepend in this order: first the Signature Element and then the
        // UsernameToken Element. This way the server gets the UsernameToken
        // first, can check it and are prepared to compute the Signature key. 
        sign.prependToHeader(reqData.getSecHeader());
        builder.prependToHeader(reqData.getSecHeader());

        Vector parts = null;
        if (reqData.getSignatureParts().size() > 0) {
            parts = reqData.getSignatureParts();
View Full Code Here

Examples of org.apache.ws.security.message.WSSecTimestamp.prependToHeader()

       * Now we are ready to per Signature processing.
       *
       * First the primary Signature then supporting tokens (Signatures)
       * that sign the primary Signature.
       */
      timestamp.prependToHeader(secHeader);

      iniSignature.addReferencesToSign(sigParts, secHeader);
      iniSignature.computeSignature();
      Element internRef = recEncrypt.encryptForInternalRef(null,
          encPartsInternal);
View Full Code Here

Examples of org.apache.ws.security.message.WSSecUsernameToken.prependToHeader()

            reqData.getSignatureValues().add(sign.getSignatureValue());
        } catch (WSSecurityException e) {
            throw new WSSecurityException("WSHandler: Error during Signatur with UsernameToken secret"
                    + e);
        }
        builder.prependToHeader(reqData.getSecHeader());
    }
}
View Full Code Here

Examples of org.apache.ws.security.message.WSSecUsernameToken.prependToHeader()

        sign.setKeyIdentifierType(WSConstants.UT_SIGNING);
        sign.setSignatureAlgorithm(XMLSignature.ALGO_ID_MAC_HMAC_SHA1);
        log.info("Before signing....");
        sign.build(doc, null, secHeader);
        log.info("Before adding UsernameToken PW Text....");
        builder.prependToHeader(secHeader);
        Document signedDoc = doc;
        Message signedMsg = (Message) SOAPUtil.toSOAPMessage(signedDoc);
        if (log.isDebugEnabled()) {
            log.debug("Message with UserNameToken PW Text:");
            XMLUtils.PrettyElementToWriter(signedMsg.getSOAPEnvelope().getAsDOM(), new PrintWriter(System.out));
View Full Code Here

Examples of org.apache.ws.security.message.WSSecUsernameToken.prependToHeader()

        WSSecDKEncrypt encrBuilder = new WSSecDKEncrypt();
        encrBuilder.setSymmetricEncAlgorithm(WSConstants.AES_128);
        encrBuilder.setExternalKey(derivedKey, tokenIdentifier);
        Document encryptedDoc = encrBuilder.build(doc, secHeader);
       
        builder.prependToHeader(secHeader);
       
        String outputString =
            org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);
        assertTrue(outputString.indexOf("wsse:Username") != -1);
        assertTrue(outputString.indexOf("wsse:Password") == -1);
View Full Code Here

Examples of org.apache.ws.security.message.WSSecUsernameToken.prependToHeader()

        WSSecDKEncrypt encrBuilder = new WSSecDKEncrypt();
        encrBuilder.setSymmetricEncAlgorithm(WSConstants.AES_128);
        encrBuilder.setExternalKey(derivedKey, tokenIdentifier);
        Document encryptedDoc = encrBuilder.build(doc, secHeader);
       
        builder.prependToHeader(secHeader);
       
        String outputString =
            org.apache.ws.security.util.XMLUtils.PrettyDocumentToString(encryptedDoc);
        assertTrue(outputString.indexOf("wsse:Username") != -1);
        assertTrue(outputString.indexOf("wsse:Password") == -1);
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.