You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2016/11/25 12:31:20 UTC

svn commit: r1771308 [3/4] - in /webservices/wss4j/trunk: integration/src/test/java/org/apache/wss4j/integration/test/kerberos/ ws-security-dom/src/main/java/org/apache/wss4j/dom/action/ ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/ ws-se...

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SecurityContextTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SecurityContextTokenTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SecurityContextTokenTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SecurityContextTokenTest.java Fri Nov 25 12:31:19 2016
@@ -64,9 +64,9 @@ public class SecurityContextTokenTest ex
             secHeader.insertSecurityHeader();
 
             WSSecSecurityContextToken sctBuilder = new WSSecSecurityContextToken(secHeader, null);
-            sctBuilder.prepare(doc, crypto);
+            sctBuilder.prepare(crypto);
 
-            sctBuilder.prependSCTElementToHeader(doc);
+            sctBuilder.prependSCTElementToHeader();
 
             String out =
                 XMLUtils.prettyDocumentToString(doc);
@@ -102,7 +102,7 @@ public class SecurityContextTokenTest ex
             secHeader.insertSecurityHeader();
 
             WSSecSecurityContextToken sctBuilder = new WSSecSecurityContextToken(secHeader, null);
-            sctBuilder.prepare(doc, crypto);
+            sctBuilder.prepare(crypto);
 
             byte[] tempSecret = WSSecurityUtil.generateNonce(16);
 
@@ -115,9 +115,9 @@ public class SecurityContextTokenTest ex
             WSSecDKEncrypt encrBuilder = new WSSecDKEncrypt(secHeader);
             encrBuilder.setSymmetricEncAlgorithm(WSConstants.AES_128);
             encrBuilder.setExternalKey(tempSecret, tokenId);
-            encrBuilder.build(doc);
+            encrBuilder.build();
 
-            sctBuilder.prependSCTElementToHeader(doc);
+            sctBuilder.prependSCTElementToHeader();
 
             if (LOG.isDebugEnabled()) {
                 String out = XMLUtils.prettyDocumentToString(doc);
@@ -152,7 +152,7 @@ public class SecurityContextTokenTest ex
 
             WSSecSecurityContextToken sctBuilder = new WSSecSecurityContextToken(secHeader, null);
             sctBuilder.setWscVersion(ConversationConstants.VERSION_05_12);
-            sctBuilder.prepare(doc, crypto);
+            sctBuilder.prepare(crypto);
 
             byte[] tempSecret = WSSecurityUtil.generateNonce(16);
 
@@ -165,9 +165,9 @@ public class SecurityContextTokenTest ex
             WSSecDKSign sigBuilder = new WSSecDKSign(secHeader);
             sigBuilder.setExternalKey(tempSecret, tokenId);
             sigBuilder.setSignatureAlgorithm(WSConstants.HMAC_SHA1);
-            sigBuilder.build(doc);
+            sigBuilder.build();
 
-            sctBuilder.prependSCTElementToHeader(doc);
+            sctBuilder.prependSCTElementToHeader();
 
             if (LOG.isDebugEnabled()) {
                 String out = XMLUtils.prettyDocumentToString(doc);
@@ -201,7 +201,7 @@ public class SecurityContextTokenTest ex
             secHeader.insertSecurityHeader();
 
             WSSecSecurityContextToken sctBuilder = new WSSecSecurityContextToken(secHeader, null);
-            sctBuilder.prepare(doc, crypto);
+            sctBuilder.prepare(crypto);
 
             byte[] tempSecret = WSSecurityUtil.generateNonce(16);
 
@@ -213,9 +213,9 @@ public class SecurityContextTokenTest ex
             sigBuilder.setExternalKey(tempSecret, sctBuilder.getIdentifier());
             sigBuilder.setTokenIdDirectId(true);
             sigBuilder.setSignatureAlgorithm(WSConstants.HMAC_SHA1);
-            sigBuilder.build(doc);
+            sigBuilder.build();
 
-            sctBuilder.prependSCTElementToHeader(doc);
+            sctBuilder.prependSCTElementToHeader();
 
             if (LOG.isDebugEnabled()) {
                 LOG.debug("DKT Absolute");
@@ -239,7 +239,7 @@ public class SecurityContextTokenTest ex
             secHeader.insertSecurityHeader();
 
             WSSecSecurityContextToken sctBuilder = new WSSecSecurityContextToken(secHeader, null);
-            sctBuilder.prepare(doc, crypto);
+            sctBuilder.prepare(crypto);
 
             byte[] tempSecret = WSSecurityUtil.generateNonce(16);
 
@@ -252,15 +252,15 @@ public class SecurityContextTokenTest ex
             WSSecDKSign sigBuilder = new WSSecDKSign(secHeader);
             sigBuilder.setExternalKey(tempSecret, tokenId);
             sigBuilder.setSignatureAlgorithm(WSConstants.HMAC_SHA1);
-            sigBuilder.build(doc);
+            sigBuilder.build();
 
             // Derived key encryption
             WSSecDKEncrypt encrBuilder = new WSSecDKEncrypt(secHeader);
             encrBuilder.setSymmetricEncAlgorithm(WSConstants.AES_128);
             encrBuilder.setExternalKey(tempSecret, tokenId);
-            encrBuilder.build(doc);
+            encrBuilder.build();
 
-            sctBuilder.prependSCTElementToHeader(doc);
+            sctBuilder.prependSCTElementToHeader();
 
             if (LOG.isDebugEnabled()) {
                 String out = XMLUtils.prettyDocumentToString(doc);
@@ -282,7 +282,7 @@ public class SecurityContextTokenTest ex
             secHeader.insertSecurityHeader();
 
             WSSecSecurityContextToken sctBuilder = new WSSecSecurityContextToken(secHeader, null);
-            sctBuilder.prepare(doc, crypto);
+            sctBuilder.prepare(crypto);
 
             byte[] tempSecret = WSSecurityUtil.generateNonce(16);
 
@@ -295,15 +295,15 @@ public class SecurityContextTokenTest ex
             WSSecDKEncrypt encrBuilder = new WSSecDKEncrypt(secHeader);
             encrBuilder.setSymmetricEncAlgorithm(WSConstants.AES_128);
             encrBuilder.setExternalKey(tempSecret, tokenId);
-            encrBuilder.build(doc);
+            encrBuilder.build();
 
             // Derived key signature
             WSSecDKSign sigBuilder = new WSSecDKSign(secHeader);
             sigBuilder.setExternalKey(tempSecret, tokenId);
             sigBuilder.setSignatureAlgorithm(WSConstants.HMAC_SHA1);
-            sigBuilder.build(doc);
+            sigBuilder.build();
 
-            sctBuilder.prependSCTElementToHeader(doc);
+            sctBuilder.prependSCTElementToHeader();
 
             if (LOG.isDebugEnabled()) {
                 String out = XMLUtils.prettyDocumentToString(doc);
@@ -330,7 +330,7 @@ public class SecurityContextTokenTest ex
             secHeader.insertSecurityHeader();
 
             WSSecSecurityContextToken sctBuilder = new WSSecSecurityContextToken(secHeader, null);
-            sctBuilder.prepare(doc, crypto);
+            sctBuilder.prepare(crypto);
 
             byte[] tempSecret = WSSecurityUtil.generateNonce(16);
 
@@ -345,9 +345,9 @@ public class SecurityContextTokenTest ex
             builder.setCustomTokenValueType(WSConstants.WSC_SCT);
             builder.setCustomTokenId(tokenId);
             builder.setSignatureAlgorithm(SignatureMethod.HMAC_SHA1);
-            builder.build(doc, crypto);
+            builder.build(crypto);
 
-            sctBuilder.prependSCTElementToHeader(doc);
+            sctBuilder.prependSCTElementToHeader();
 
             if (LOG.isDebugEnabled()) {
                 LOG.debug("SCT sign");

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureAKITest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureAKITest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureAKITest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureAKITest.java Fri Nov 25 12:31:19 2016
@@ -67,7 +67,7 @@ public class SignatureAKITest extends or
         builder.setUserInfo("wss40", "security");
         builder.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
         Crypto signingCrypto = CryptoFactory.getInstance("wss40.properties");
-        Document signedDoc = builder.build(doc, signingCrypto);
+        Document signedDoc = builder.build(signingCrypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -94,7 +94,7 @@ public class SignatureAKITest extends or
         builder.setUserInfo("wss40", "security");
         builder.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
         Crypto signingCrypto = CryptoFactory.getInstance("wss40.properties");
-        Document signedDoc = builder.build(doc, signingCrypto);
+        Document signedDoc = builder.build(signingCrypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureAlgorithmSuiteTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureAlgorithmSuiteTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureAlgorithmSuiteTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureAlgorithmSuiteTest.java Fri Nov 25 12:31:19 2016
@@ -79,7 +79,7 @@ public class SignatureAlgorithmSuiteTest
         builder.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
         builder.setSignatureAlgorithm(WSConstants.RSA_SHA1);
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -115,7 +115,7 @@ public class SignatureAlgorithmSuiteTest
         builder.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
         builder.setSignatureAlgorithm(WSConstants.DSA);
 
-        Document signedDoc = builder.build(doc, dsaCrypto);
+        Document signedDoc = builder.build(dsaCrypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -154,7 +154,7 @@ public class SignatureAlgorithmSuiteTest
         builder.setSecretKey(keyData);
         builder.setSignatureAlgorithm(SignatureMethod.HMAC_SHA1);
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -218,7 +218,7 @@ public class SignatureAlgorithmSuiteTest
         builder.setSignatureAlgorithm(WSConstants.RSA_SHA1);
         builder.setSigCanonicalization(WSConstants.C14N_EXCL_WITH_COMMENTS);
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -252,7 +252,7 @@ public class SignatureAlgorithmSuiteTest
         builder.setSignatureAlgorithm(WSConstants.RSA_SHA1);
         builder.setDigestAlgo(WSConstants.SHA256);
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCRLTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCRLTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCRLTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCRLTest.java Fri Nov 25 12:31:19 2016
@@ -97,7 +97,7 @@ public class SignatureCRLTest extends or
         sign.setUserInfo("wss40rev", "security");
         sign.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -131,7 +131,7 @@ public class SignatureCRLTest extends or
         sign.setUserInfo("wss40rev", "security");
         sign.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -169,7 +169,7 @@ public class SignatureCRLTest extends or
         sign.setUserInfo("wss40rev", "security");
         sign.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCertConstraintsTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCertConstraintsTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCertConstraintsTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCertConstraintsTest.java Fri Nov 25 12:31:19 2016
@@ -73,7 +73,7 @@ public class SignatureCertConstraintsTes
         builder.setUserInfo("wss40", "security");
         builder.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message with BST key identifier:");
@@ -109,7 +109,7 @@ public class SignatureCertConstraintsTes
         builder.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
         builder.setUseSingleCertificate(false);
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message with BST key identifier:");

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCertTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCertTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCertTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCertTest.java Fri Nov 25 12:31:19 2016
@@ -101,7 +101,7 @@ public class SignatureCertTest extends o
         sign.setUserInfo("wss40", "security");
         sign.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -139,7 +139,7 @@ public class SignatureCertTest extends o
         sign.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
         sign.setUseSingleCertificate(false);
 
-        Document signedDoc = sign.build(doc, clientCrypto);
+        Document signedDoc = sign.build(clientCrypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -177,7 +177,7 @@ public class SignatureCertTest extends o
         sign.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
         sign.setUseSingleCertificate(false);
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -215,7 +215,7 @@ public class SignatureCertTest extends o
         sign.setUserInfo("wss40", "security");
         sign.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -247,7 +247,7 @@ public class SignatureCertTest extends o
         sign.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
 
         Document signedDoc =
-            sign.build(doc, CryptoFactory.getInstance("wss40badca.properties"));
+            sign.build(CryptoFactory.getInstance("wss40badca.properties"));
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -325,7 +325,7 @@ public class SignatureCertTest extends o
         sign.setUserInfo("wss40exp", "security");
         sign.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
 
-        Document signedDoc = sign.build(doc, clientCrypto);
+        Document signedDoc = sign.build(clientCrypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -364,7 +364,7 @@ public class SignatureCertTest extends o
         sign.setUserInfo("wss40exp", "security");
         sign.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
 
-        Document signedDoc = sign.build(doc, clientCrypto);
+        Document signedDoc = sign.build(clientCrypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureEncryptionTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureEncryptionTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureEncryptionTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureEncryptionTest.java Fri Nov 25 12:31:19 2016
@@ -110,7 +110,7 @@ public class SignatureEncryptionTest ext
         sign.setUserInfo("wss40", "security");
         LOG.info("Before Encryption....");
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Encryption....");
@@ -119,7 +119,7 @@ public class SignatureEncryptionTest ext
             LOG.debug(outputString);
         }
 
-        Document encryptedSignedDoc = sign.build(encryptedDoc, crypto);
+        Document encryptedSignedDoc = sign.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Signing....");
@@ -159,7 +159,7 @@ public class SignatureEncryptionTest ext
                     "Element");
         encrypt.getParts().add(part);
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Encryption....");
@@ -175,7 +175,7 @@ public class SignatureEncryptionTest ext
                     "Element");
         sign.getParts().add(signPart);
 
-        Document encryptedSignedDoc = sign.build(encryptedDoc, crypto);
+        Document encryptedSignedDoc = sign.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Signing....");
@@ -238,8 +238,8 @@ public class SignatureEncryptionTest ext
         sign.setUserInfo("wss40", "security");
         LOG.info("Before Encryption....");
 
-        Document signedDoc = sign.build(doc, crypto);
-        Document encryptedSignedDoc = encrypt.build(signedDoc, crypto);
+        sign.build(crypto);
+        Document encryptedSignedDoc = encrypt.build(crypto);
         LOG.info("After Encryption....");
         verify(encryptedSignedDoc);
     }
@@ -269,8 +269,8 @@ public class SignatureEncryptionTest ext
                 "");
         encrypt.getParts().add(encP);
 
-        Document signedDoc = sign.build(doc, crypto);
-        Document encryptedSignedDoc = encrypt.build(signedDoc, crypto);
+        sign.build(crypto);
+        Document encryptedSignedDoc = encrypt.build(crypto);
         LOG.info("WSS198");
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -306,8 +306,8 @@ public class SignatureEncryptionTest ext
 
         LOG.info("Before Sign/Encryption....");
 
-        Document signedDoc = sign.build(doc, crypto);
-        Document encryptedSignedDoc = encrypt.build(signedDoc, crypto);
+        sign.build(crypto);
+        Document encryptedSignedDoc = encrypt.build(crypto);
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed and encrypted message with IssuerSerial key identifier (both), 3DES:");
             String outputString =
@@ -337,7 +337,7 @@ public class SignatureEncryptionTest ext
         encrKey.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
         encrKey.setUserInfo("wss40", "security");
         encrKey.setSymmetricEncAlgorithm(WSConstants.AES_192);
-        encrKey.prepare(doc, crypto);
+        encrKey.prepare(crypto);
 
         WSSecEncrypt encrypt = new WSSecEncrypt(secHeader);
         encrypt.setEncKeyId(encrKey.getId());
@@ -353,8 +353,8 @@ public class SignatureEncryptionTest ext
         sign.setCustomTokenValueType(WSConstants.WSS_ENC_KEY_VALUE_TYPE);
         sign.setSignatureAlgorithm(SignatureMethod.HMAC_SHA1);
 
-        Document signedDoc = sign.build(doc, crypto);
-        Document encryptedSignedDoc = encrypt.build(signedDoc, crypto);
+        sign.build(crypto);
+        Document encryptedSignedDoc = encrypt.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed and encrypted message with IssuerSerial key identifier (both), 3DES:");
@@ -469,8 +469,8 @@ public class SignatureEncryptionTest ext
         sign.setUserInfo("wss40", "security");
         LOG.info("Before Encryption....");
 
-        Document signedDoc = sign.build(doc, crypto);
-        Document encryptedSignedDoc = encrypt.build(signedDoc, crypto);
+        sign.build(crypto);
+        Document encryptedSignedDoc = encrypt.build(crypto);
         
         LOG.info("After Encryption....");
         verify(encryptedSignedDoc);

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureIssuerCertConstraintsTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureIssuerCertConstraintsTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureIssuerCertConstraintsTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureIssuerCertConstraintsTest.java Fri Nov 25 12:31:19 2016
@@ -73,7 +73,7 @@ public class SignatureIssuerCertConstrai
         builder.setUserInfo("wss40", "security");
         builder.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message with BST key identifier:");
@@ -109,7 +109,7 @@ public class SignatureIssuerCertConstrai
         builder.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
         builder.setUseSingleCertificate(false);
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message with BST key identifier:");

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureKeyValueTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureKeyValueTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureKeyValueTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureKeyValueTest.java Fri Nov 25 12:31:19 2016
@@ -70,7 +70,7 @@ public class SignatureKeyValueTest exten
         WSSecSignature builder = new WSSecSignature(secHeader);
         builder.setUserInfo("wss40", "security");
         builder.setKeyIdentifierType(WSConstants.KEY_VALUE);
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         String outputString =
             XMLUtils.prettyDocumentToString(signedDoc);
@@ -114,7 +114,7 @@ public class SignatureKeyValueTest exten
         builder.setUserInfo("wss86", "security");
         builder.setKeyIdentifierType(WSConstants.KEY_VALUE);
         Document signedDoc =
-            builder.build(doc, CryptoFactory.getInstance("wss86.properties"));
+            builder.build(CryptoFactory.getInstance("wss86.properties"));
 
         String outputString =
             XMLUtils.prettyDocumentToString(signedDoc);
@@ -149,7 +149,7 @@ public class SignatureKeyValueTest exten
         WSSecSignature builder = new WSSecSignature(secHeader);
         builder.setUserInfo("wss40DSA", "security");
         builder.setKeyIdentifierType(WSConstants.KEY_VALUE);
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         String outputString =
             XMLUtils.prettyDocumentToString(signedDoc);

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignaturePartsTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignaturePartsTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignaturePartsTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignaturePartsTest.java Fri Nov 25 12:31:19 2016
@@ -114,7 +114,7 @@ public class SignaturePartsTest extends
                 "");
         sign.getParts().add(encP);
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -180,7 +180,7 @@ public class SignaturePartsTest extends
             );
         sign.getParts().add(encP);
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -217,7 +217,7 @@ public class SignaturePartsTest extends
             );
         sign.getParts().add(encP);
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -254,7 +254,7 @@ public class SignaturePartsTest extends
         sign.getParts().add(encP);
 
         try {
-            sign.build(doc, crypto);
+            sign.build(crypto);
             fail("Failure expected on not signing a required element");
         } catch (WSSecurityException ex) {
             assertTrue(ex.getErrorCode() == WSSecurityException.ErrorCode.FAILED_SIGNATURE);
@@ -305,7 +305,7 @@ public class SignaturePartsTest extends
         //
         // set up for keyHolder
         //
-        Document signedDoc = wsSign.build(doc, userCrypto, samlAssertion, null, null, null);
+        Document signedDoc = wsSign.build(userCrypto, samlAssertion, null, null, null);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed SAML message (key holder):");
@@ -364,7 +364,7 @@ public class SignaturePartsTest extends
         sign.getParts().add(encP);
 
         try {
-            sign.build(doc, crypto);
+            sign.build(crypto);
             fail("Failure expected on a bad localname");
         } catch (WSSecurityException ex) {
             assertTrue(ex.getErrorCode() == WSSecurityException.ErrorCode.FAILED_SIGNATURE);
@@ -392,7 +392,7 @@ public class SignaturePartsTest extends
         sign.getParts().add(encP);
 
         try {
-            sign.build(doc, crypto);
+            sign.build(crypto);
             fail("Failure expected on a bad namespace");
         } catch (WSSecurityException ex) {
             assertTrue(ex.getErrorCode() == WSSecurityException.ErrorCode.FAILED_SIGNATURE);
@@ -428,7 +428,7 @@ public class SignaturePartsTest extends
                 "");
         sign.getParts().add(encP2);
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -496,7 +496,7 @@ public class SignaturePartsTest extends
         encP.setElement(bodyElement);
         sign.getParts().add(encP);
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -539,7 +539,7 @@ public class SignaturePartsTest extends
                 "");
         sign.getParts().add(encP);
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
 
         String outputString =
             XMLUtils.prettyDocumentToString(signedDoc);

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureTest.java Fri Nov 25 12:31:19 2016
@@ -91,7 +91,7 @@ public class SignatureTest extends org.j
         builder.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
         LOG.info("Before Signing IS....");
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message with IssuerSerial key identifier:");
@@ -123,7 +123,7 @@ public class SignatureTest extends org.j
         builder.setIncludeSignatureToken(true);
         LOG.info("Before Signing IS....");
         
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message with IssuerSerial key identifier:");
@@ -159,8 +159,8 @@ public class SignatureTest extends org.j
         WSSecSignature builder = new WSSecSignature(secHeader);
         builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
 
-        Document signedDoc = builder.build(doc, crypto);
-        Document signedDoc1 = builder.build(signedDoc, crypto);
+        builder.build(crypto);
+        Document signedDoc1 = builder.build(crypto);
         verify(signedDoc1);
     }
 
@@ -179,7 +179,7 @@ public class SignatureTest extends org.j
         WSSecSignature builder = new WSSecSignature(secHeader);
         builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
         LOG.info("Before Signing....");
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Signing....");
@@ -207,7 +207,7 @@ public class SignatureTest extends org.j
         builder.setSigCanonicalization(WSConstants.C14N_OMIT_COMMENTS);
         builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
         LOG.info("Before Signing....");
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Signing....");
@@ -249,7 +249,7 @@ public class SignatureTest extends org.j
         builder.setAddInclusivePrefixes(true);
         builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
         LOG.info("Before Signing....");
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Signing....");
@@ -277,7 +277,7 @@ public class SignatureTest extends org.j
         builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
         builder.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
         LOG.info("Before Signing....");
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Signing....");
@@ -316,7 +316,7 @@ public class SignatureTest extends org.j
         LOG.info("Before Signing....");
 
         Crypto pkiCrypto = CryptoFactory.getInstance("wss40.properties");
-        Document signedDoc = builder.build(doc, pkiCrypto);
+        Document signedDoc = builder.build(pkiCrypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("After PKI Signing....");
@@ -345,7 +345,7 @@ public class SignatureTest extends org.j
         builder.setKeyIdentifierType(WSConstants.X509_KEY_IDENTIFIER);
         LOG.info("Before Signing....");
         
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Signing....");
@@ -385,7 +385,7 @@ public class SignatureTest extends org.j
         builder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER);
         LOG.info("Before Signing ThumbprintSHA1....");
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message with ThumbprintSHA1 key identifier:");
@@ -418,7 +418,7 @@ public class SignatureTest extends org.j
         builder.setIncludeSignatureToken(true);
         LOG.info("Before Signing ThumbprintSHA1....");
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message with ThumbprintSHA1 key identifier:");
@@ -456,8 +456,8 @@ public class SignatureTest extends org.j
         builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
         builder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER);
 
-        Document signedDoc = builder.build(doc, crypto);
-        Document signedDoc1 = builder.build(signedDoc, crypto);
+        builder.build(crypto);
+        Document signedDoc1 = builder.build(crypto);
         verify(signedDoc1);
     }
 
@@ -481,7 +481,7 @@ public class SignatureTest extends org.j
 
         WSSecTimestamp timestamp = new WSSecTimestamp(secHeader);
         timestamp.setTimeToLive(300);
-        Document createdDoc = timestamp.build(doc);
+        timestamp.build();
 
         WSEncryptionPart encP =
             new WSEncryptionPart(
@@ -490,7 +490,7 @@ public class SignatureTest extends org.j
                 "");
         builder.getParts().add(encP);
 
-        Document signedDoc = builder.build(createdDoc, crypto);
+        Document signedDoc = builder.build(crypto);
         Element secHeaderElement = secHeader.getSecurityHeaderElement();
         Node timestampNode =
             secHeaderElement.getElementsByTagNameNS(WSConstants.WSU_NS, "Timestamp").item(0);
@@ -527,7 +527,7 @@ public class SignatureTest extends org.j
         builder.setDigestAlgo("http://www.w3.org/2001/04/xmlenc#sha256");
         LOG.info("Before Signing IS....");
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message with IssuerSerial key identifier:");
@@ -601,7 +601,7 @@ public class SignatureTest extends org.j
         WSSecSignature builder = new WSSecSignature(secHeader);
         builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
         LOG.info("Before Signing....");
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         // Add a comment node as the first node element
         Node firstChild = signedDoc.getFirstChild();
@@ -632,7 +632,7 @@ public class SignatureTest extends org.j
 
         WSSecTimestamp timestamp = new WSSecTimestamp(secHeader);
         timestamp.setTimeToLive(300);
-        Document createdDoc = timestamp.build(doc);
+        timestamp.build();
 
         WSSecSignature builder = new WSSecSignature(secHeader);
         builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
@@ -644,7 +644,7 @@ public class SignatureTest extends org.j
                 "");
         builder.getParts().add(encP);
 
-        builder.prepare(createdDoc, crypto);
+        builder.prepare(crypto);
 
         List<javax.xml.crypto.dsig.Reference> referenceList =
             builder.addReferencesToSign(builder.getParts());
@@ -679,7 +679,7 @@ public class SignatureTest extends org.j
 
         Node textNode = doc.createTextNode("This is a text node");
         secHeaderElement.appendChild(textNode);
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message with text node:");
@@ -711,7 +711,7 @@ public class SignatureTest extends org.j
         secRef.setReference(ref);
         builder.setSecurityTokenReference(secRef);
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -738,7 +738,7 @@ public class SignatureTest extends org.j
         builder.setUserInfo(passwordCrypto.getDefaultX509Identifier(), null);
         builder.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
         LOG.info("Before Signing IS....");
-        Document signedDoc = builder.build(doc, passwordCrypto);
+        Document signedDoc = builder.build(passwordCrypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message with IssuerSerial key identifier:");
@@ -925,7 +925,7 @@ public class SignatureTest extends org.j
         WSSecSignature builder = new WSSecSignature(secHeader);
         builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
         LOG.info("Before Signing....");
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         // Add a comment node
         Element body = WSSecurityUtil.findBodyElement(signedDoc);

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignedBSTTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignedBSTTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignedBSTTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignedBSTTest.java Fri Nov 25 12:31:19 2016
@@ -107,7 +107,7 @@ public class SignedBSTTest extends org.j
 
         sign.setCustomTokenId(bst.getID());
         sign.setCustomTokenValueType(bst.getValueType());
-        sign.prepare(doc, crypto);
+        sign.prepare(crypto);
 
         List<javax.xml.crypto.dsig.Reference> referenceList =
             sign.addReferencesToSign(sign.getParts());

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SymmetricSignatureTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SymmetricSignatureTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SymmetricSignatureTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SymmetricSignatureTest.java Fri Nov 25 12:31:19 2016
@@ -104,7 +104,7 @@ public class SymmetricSignatureTest exte
         sign.setSecretKey(keyData);
         sign.setSignatureAlgorithm(SignatureMethod.HMAC_SHA1);
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
 
         byte[] encodedBytes = KeyUtils.generateDigest(keyData);
         String identifier = Base64.getMimeEncoder().encodeToString(encodedBytes);
@@ -136,7 +136,7 @@ public class SymmetricSignatureTest exte
         encrKey.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
         encrKey.setUserInfo("wss40", "security");
         encrKey.setSymmetricEncAlgorithm(WSConstants.AES_192);
-        encrKey.prepare(doc, crypto);
+        encrKey.prepare(crypto);
 
         WSSecSignature sign = new WSSecSignature(secHeader);
         sign.setKeyIdentifierType(WSConstants.CUSTOM_SYMM_SIGNING);
@@ -145,7 +145,7 @@ public class SymmetricSignatureTest exte
         sign.setSignatureAlgorithm(SignatureMethod.HMAC_SHA1);
         sign.setCustomTokenValueType(WSConstants.WSS_ENC_KEY_VALUE_TYPE);
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
         encrKey.prependToHeader();
 
         if (LOG.isDebugEnabled()) {
@@ -177,7 +177,7 @@ public class SymmetricSignatureTest exte
         encrKey.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
         encrKey.setUserInfo("wss40", "security");
         encrKey.setSymmetricEncAlgorithm(WSConstants.AES_192);
-        encrKey.prepare(doc, crypto);
+        encrKey.prepare(crypto);
 
         WSSecEncrypt encrypt = new WSSecEncrypt(secHeader);
         encrypt.setEncKeyId(encrKey.getId());
@@ -193,8 +193,8 @@ public class SymmetricSignatureTest exte
         sign.setSecretKey(encrKey.getEphemeralKey());
         sign.setSignatureAlgorithm(SignatureMethod.HMAC_SHA1);
 
-        Document signedDoc = sign.build(doc, crypto);
-        Document encryptedSignedDoc = encrypt.build(signedDoc, crypto);
+        sign.build(crypto);
+        Document encryptedSignedDoc = encrypt.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed and encrypted message with IssuerSerial key identifier (both), 3DES:");

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/TimestampTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/TimestampTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/TimestampTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/TimestampTest.java Fri Nov 25 12:31:19 2016
@@ -71,7 +71,7 @@ public class TimestampTest extends org.j
 
         WSSecTimestamp timestamp = new WSSecTimestamp(secHeader);
         timestamp.setTimeToLive(300);
-        Document createdDoc = timestamp.build(doc);
+        Document createdDoc = timestamp.build();
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -109,7 +109,7 @@ public class TimestampTest extends org.j
 
         WSSecTimestamp timestamp = new WSSecTimestamp(secHeader);
         timestamp.setTimeToLive(0);
-        Document createdDoc = timestamp.build(doc);
+        Document createdDoc = timestamp.build();
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -139,7 +139,7 @@ public class TimestampTest extends org.j
 
         WSSecTimestamp timestamp = new WSSecTimestamp(secHeader);
         timestamp.setTimeToLive(0);
-        Document createdDoc = timestamp.build(doc);
+        Document createdDoc = timestamp.build();
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -186,7 +186,7 @@ public class TimestampTest extends org.j
 
         WSSecTimestamp timestamp = new WSSecTimestamp(secHeader);
         timestamp.setTimeToLive(-1);
-        Document createdDoc = timestamp.build(doc);
+        Document createdDoc = timestamp.build();
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -215,7 +215,7 @@ public class TimestampTest extends org.j
         secHeader.insertSecurityHeader();
 
         WSSecTimestamp timestamp = new WSSecTimestamp(secHeader);
-        Document createdDoc = timestamp.build(doc);
+        Document createdDoc = timestamp.build();
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -400,11 +400,11 @@ public class TimestampTest extends org.j
 
         WSSecTimestamp timestamp = new WSSecTimestamp(secHeader);
         timestamp.setTimeToLive(300);
-        Document createdDoc = timestamp.build(doc);
+        Document createdDoc = timestamp.build();
 
         timestamp = new WSSecTimestamp(secHeader);
         timestamp.setTimeToLive(60);
-        createdDoc = timestamp.build(doc);
+        createdDoc = timestamp.build();
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -815,7 +815,7 @@ public class TimestampTest extends org.j
         };
         timestamp.setWsTimeSource(spoofedTimeSource);
 
-        Document createdDoc = timestamp.build(doc);
+        Document createdDoc = timestamp.build();
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -844,7 +844,7 @@ public class TimestampTest extends org.j
         WSSecTimestamp timestamp = new WSSecTimestamp(secHeader);
         timestamp.setPrecisionInMilliSeconds(false);
         timestamp.setTimeToLive(300);
-        Document createdDoc = timestamp.build(doc);
+        Document createdDoc = timestamp.build();
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -874,7 +874,7 @@ public class TimestampTest extends org.j
 
             WSSecTimestamp timestamp = new WSSecTimestamp(secHeader);
             timestamp.setTimeToLive(300);
-            Document createdDoc = timestamp.build(doc);
+            Document createdDoc = timestamp.build();
 
             //
             // Do some processing

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/UTDerivedKeyTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/UTDerivedKeyTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/UTDerivedKeyTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/UTDerivedKeyTest.java Fri Nov 25 12:31:19 2016
@@ -140,7 +140,7 @@ public class UTDerivedKeyTest extends or
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setUserInfo("bob", "security");
         builder.addDerivedKey(false, null, 1000);
-        builder.prepare(doc);
+        builder.prepare();
 
         byte[] derivedKey = builder.getDerivedKey();
         assertTrue(derivedKey.length == 20);
@@ -154,7 +154,7 @@ public class UTDerivedKeyTest extends or
         encrBuilder.setSymmetricEncAlgorithm(WSConstants.AES_128);
         encrBuilder.setExternalKey(derivedKey, tokenIdentifier);
         encrBuilder.setCustomValueType(WSConstants.WSS_USERNAME_TOKEN_VALUE_TYPE);
-        Document encryptedDoc = encrBuilder.build(doc);
+        Document encryptedDoc = encrBuilder.build();
 
         builder.prependToHeader();
 
@@ -193,7 +193,7 @@ public class UTDerivedKeyTest extends or
         builder.setUserInfo("bob", 
                             Base64.getMimeEncoder().encodeToString(MessageDigest.getInstance("SHA-1").digest("security".getBytes(StandardCharsets.UTF_8))));
         builder.addDerivedKey(false, null, 1000);
-        builder.prepare(doc);
+        builder.prepare();
 
         byte[] derivedKey = builder.getDerivedKey();
         assertTrue(derivedKey.length == 20);
@@ -206,7 +206,7 @@ public class UTDerivedKeyTest extends or
         encrBuilder.setSymmetricEncAlgorithm(WSConstants.AES_128);
         encrBuilder.setExternalKey(derivedKey, tokenIdentifier);
         encrBuilder.setCustomValueType(WSConstants.WSS_USERNAME_TOKEN_VALUE_TYPE);
-        Document encryptedDoc = encrBuilder.build(doc);
+        Document encryptedDoc = encrBuilder.build();
 
         builder.prependToHeader();
 
@@ -243,7 +243,7 @@ public class UTDerivedKeyTest extends or
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setUserInfo("bob", "security");
         builder.addDerivedKey(false, null, 1000);
-        builder.prepare(doc);
+        builder.prepare();
 
         byte[] derivedKey = builder.getDerivedKey();
         derivedKey[5] = 'z';
@@ -259,7 +259,7 @@ public class UTDerivedKeyTest extends or
         encrBuilder.setSymmetricEncAlgorithm(WSConstants.AES_128);
         encrBuilder.setExternalKey(derivedKey, tokenIdentifier);
         encrBuilder.setCustomValueType(WSConstants.WSS_USERNAME_TOKEN_VALUE_TYPE);
-        Document encryptedDoc = encrBuilder.build(doc);
+        Document encryptedDoc = encrBuilder.build();
 
         builder.prependToHeader();
 
@@ -295,7 +295,7 @@ public class UTDerivedKeyTest extends or
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setUserInfo("colm", "security");
         builder.addDerivedKey(false, null, 1000);
-        builder.prepare(doc);
+        builder.prepare();
 
         byte[] derivedKey = builder.getDerivedKey();
         assertTrue(derivedKey.length == 20);
@@ -309,7 +309,7 @@ public class UTDerivedKeyTest extends or
         encrBuilder.setSymmetricEncAlgorithm(WSConstants.AES_128);
         encrBuilder.setExternalKey(derivedKey, tokenIdentifier);
         encrBuilder.setCustomValueType(WSConstants.WSS_USERNAME_TOKEN_VALUE_TYPE);
-        Document encryptedDoc = encrBuilder.build(doc);
+        Document encryptedDoc = encrBuilder.build();
 
         builder.prependToHeader();
 
@@ -344,7 +344,7 @@ public class UTDerivedKeyTest extends or
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setUserInfo("bob", "security");
         builder.addDerivedKey(true, null, 1000);
-        builder.prepare(doc);
+        builder.prepare();
 
         byte[] derivedKey = builder.getDerivedKey();
         assertTrue(derivedKey.length == 20);
@@ -358,7 +358,7 @@ public class UTDerivedKeyTest extends or
         sigBuilder.setExternalKey(derivedKey, tokenIdentifier);
         sigBuilder.setSignatureAlgorithm(WSConstants.HMAC_SHA1);
         sigBuilder.setCustomValueType(WSConstants.WSS_USERNAME_TOKEN_VALUE_TYPE);
-        Document signedDoc = sigBuilder.build(doc);
+        Document signedDoc = sigBuilder.build();
 
         builder.prependToHeader();
 
@@ -395,7 +395,7 @@ public class UTDerivedKeyTest extends or
         builder.setUserInfo("bob", 
                             Base64.getMimeEncoder().encodeToString(MessageDigest.getInstance("SHA-1").digest("security".getBytes(StandardCharsets.UTF_8))));
         builder.addDerivedKey(true, null, 1000);
-        builder.prepare(doc);
+        builder.prepare();
 
         byte[] derivedKey = builder.getDerivedKey();
         assertTrue(derivedKey.length == 20);
@@ -409,7 +409,7 @@ public class UTDerivedKeyTest extends or
         sigBuilder.setExternalKey(derivedKey, tokenIdentifier);
         sigBuilder.setSignatureAlgorithm(WSConstants.HMAC_SHA1);
         sigBuilder.setCustomValueType(WSConstants.WSS_USERNAME_TOKEN_VALUE_TYPE);
-        Document signedDoc = sigBuilder.build(doc);
+        Document signedDoc = sigBuilder.build();
 
         builder.prependToHeader();
 
@@ -453,7 +453,7 @@ public class UTDerivedKeyTest extends or
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setUserInfo("bob", "security");
         builder.addDerivedKey(true, null, 1000);
-        builder.prepare(doc);
+        builder.prepare();
 
         byte[] derivedKey = builder.getDerivedKey();
         if (derivedKey[5] != 12) {
@@ -472,7 +472,7 @@ public class UTDerivedKeyTest extends or
         sigBuilder.setExternalKey(derivedKey, tokenIdentifier);
         sigBuilder.setSignatureAlgorithm(WSConstants.HMAC_SHA1);
         sigBuilder.setCustomValueType(WSConstants.WSS_USERNAME_TOKEN_VALUE_TYPE);
-        Document signedDoc = sigBuilder.build(doc);
+        Document signedDoc = sigBuilder.build();
 
         builder.prependToHeader();
 
@@ -503,7 +503,7 @@ public class UTDerivedKeyTest extends or
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setUserInfo("colm", "security");
         builder.addDerivedKey(true, null, 1000);
-        builder.prepare(doc);
+        builder.prepare();
 
         byte[] derivedKey = builder.getDerivedKey();
         assertTrue(derivedKey.length == 20);
@@ -517,7 +517,7 @@ public class UTDerivedKeyTest extends or
         sigBuilder.setExternalKey(derivedKey, tokenIdentifier);
         sigBuilder.setSignatureAlgorithm(WSConstants.HMAC_SHA1);
         sigBuilder.setCustomValueType(WSConstants.WSS_USERNAME_TOKEN_VALUE_TYPE);
-        Document signedDoc = sigBuilder.build(doc);
+        Document signedDoc = sigBuilder.build();
 
         builder.prependToHeader();
 
@@ -562,7 +562,7 @@ public class UTDerivedKeyTest extends or
         encrBuilder.setSymmetricEncAlgorithm(WSConstants.AES_128);
         encrBuilder.setExternalKey(derivedKey, usernameToken.getID());
         encrBuilder.setCustomValueType(WSConstants.WSS_USERNAME_TOKEN_VALUE_TYPE);
-        Document encryptedDoc = encrBuilder.build(doc);
+        Document encryptedDoc = encrBuilder.build();
 
         WSSecurityUtil.prependChildElement(
             secHeader.getSecurityHeaderElement(), usernameToken.getElement()
@@ -611,7 +611,7 @@ public class UTDerivedKeyTest extends or
         encrBuilder.setSymmetricEncAlgorithm(WSConstants.AES_128);
         encrBuilder.setExternalKey(derivedKey, usernameToken.getID());
         encrBuilder.setCustomValueType(WSConstants.WSS_USERNAME_TOKEN_VALUE_TYPE);
-        Document encryptedDoc = encrBuilder.build(doc);
+        Document encryptedDoc = encrBuilder.build();
 
         WSSecurityUtil.prependChildElement(
             secHeader.getSecurityHeaderElement(), usernameToken.getElement()
@@ -661,7 +661,7 @@ public class UTDerivedKeyTest extends or
         encrBuilder.setSymmetricEncAlgorithm(WSConstants.AES_128);
         encrBuilder.setExternalKey(derivedKey, usernameToken.getID());
         encrBuilder.setCustomValueType(WSConstants.WSS_USERNAME_TOKEN_VALUE_TYPE);
-        Document encryptedDoc = encrBuilder.build(doc);
+        Document encryptedDoc = encrBuilder.build();
 
         WSSecurityUtil.prependChildElement(
             secHeader.getSecurityHeaderElement(), usernameToken.getElement()
@@ -710,7 +710,7 @@ public class UTDerivedKeyTest extends or
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setUserInfo("bob", "security");
         builder.addDerivedKey(false, null, 1000);
-        builder.prepare(doc);
+        builder.prepare();
 
         byte[] derivedKey = builder.getDerivedKey();
         assertTrue(derivedKey.length == 20);
@@ -724,7 +724,7 @@ public class UTDerivedKeyTest extends or
         encrBuilder.setSymmetricEncAlgorithm(WSConstants.AES_128);
         encrBuilder.setExternalKey(derivedKey, tokenIdentifier);
         encrBuilder.setCustomValueType(WSConstants.WSS_SAML_TOKEN_TYPE);
-        Document encryptedDoc = encrBuilder.build(doc);
+        Document encryptedDoc = encrBuilder.build();
 
         builder.prependToHeader();
 
@@ -773,7 +773,7 @@ public class UTDerivedKeyTest extends or
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setUserInfo("bob", "security");
         builder.addDerivedKey(false, null, 1000);
-        builder.prepare(doc);
+        builder.prepare();
 
         byte[] derivedKey = builder.getDerivedKey();
         assertTrue(derivedKey.length == 20);
@@ -792,7 +792,7 @@ public class UTDerivedKeyTest extends or
         );
         encrBuilder.setExternalKey(derivedKey, strEncKey.getElement());
 
-        Document encryptedDoc = encrBuilder.build(doc);
+        Document encryptedDoc = encrBuilder.build();
 
         builder.prependToHeader();
 

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/UTSignatureTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/UTSignatureTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/UTSignatureTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/UTSignatureTest.java Fri Nov 25 12:31:19 2016
@@ -77,7 +77,7 @@ public class UTSignatureTest extends org
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setUserInfo("bob", "security");
         builder.addDerivedKey(true, null, 1000);
-        builder.prepare(doc);
+        builder.prepare();
 
         WSSecSignature sign = new WSSecSignature(secHeader);
         sign.setCustomTokenValueType(WSConstants.USERNAMETOKEN_NS + "#UsernameToken");
@@ -86,7 +86,7 @@ public class UTSignatureTest extends org
         sign.setKeyIdentifierType(WSConstants.CUSTOM_SYMM_SIGNING);
         sign.setSignatureAlgorithm(WSConstants.HMAC_SHA1);
 
-        Document signedDoc = sign.build(doc, null);
+        Document signedDoc = sign.build(null);
         builder.prependToHeader();
 
         String outputString =
@@ -128,7 +128,7 @@ public class UTSignatureTest extends org
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setUserInfo("colm", "security");
         builder.addDerivedKey(true, null, 1000);
-        builder.prepare(doc);
+        builder.prepare();
 
         WSSecSignature sign = new WSSecSignature(secHeader);
         sign.setCustomTokenValueType(WSConstants.USERNAMETOKEN_NS + "#UsernameToken");
@@ -137,7 +137,7 @@ public class UTSignatureTest extends org
         sign.setKeyIdentifierType(WSConstants.CUSTOM_SYMM_SIGNING);
         sign.setSignatureAlgorithm(WSConstants.HMAC_SHA1);
 
-        Document signedDoc = sign.build(doc, null);
+        Document signedDoc = sign.build(null);
         builder.prependToHeader();
 
         String outputString =

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/UsernameTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/UsernameTokenTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/UsernameTokenTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/UsernameTokenTest.java Fri Nov 25 12:31:19 2016
@@ -133,7 +133,7 @@ public class UsernameTokenTest extends o
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setUserInfo("wernerd", "verySecret");
         LOG.info("Before adding UsernameToken PW Digest....");
-        Document signedDoc = builder.build(doc);
+        Document signedDoc = builder.build();
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Message with UserNameToken PW Digest:");
@@ -186,7 +186,7 @@ public class UsernameTokenTest extends o
         builder.setUserInfo("wernerd", 
                             Base64.getMimeEncoder().encodeToString(MessageDigest.getInstance("SHA-1").digest("verySecret".getBytes(StandardCharsets.UTF_8))));
         LOG.info("Before adding UsernameToken PW Digest....");
-        Document signedDoc = builder.build(doc);
+        Document signedDoc = builder.build();
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Message with UserNameToken PW Digest:");
@@ -216,7 +216,7 @@ public class UsernameTokenTest extends o
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setUserInfo("badusername", "verySecret");
         LOG.info("Before adding UsernameToken PW Digest....");
-        Document signedDoc = builder.build(doc);
+        Document signedDoc = builder.build();
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Message with UserNameToken PW Digest:");
@@ -248,7 +248,7 @@ public class UsernameTokenTest extends o
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setUserInfo("wernerd", "verySecre");
         LOG.info("Before adding UsernameToken PW Digest....");
-        Document signedDoc = builder.build(doc);
+        Document signedDoc = builder.build();
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Message with UserNameToken PW Digest:");
@@ -278,7 +278,7 @@ public class UsernameTokenTest extends o
         
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setUserInfo("wernerd", "verySecret");
-        Document signedDoc = builder.build(doc);
+        Document signedDoc = builder.build();
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -435,7 +435,7 @@ public class UsernameTokenTest extends o
         builder.setPasswordType(WSConstants.PASSWORD_TEXT);
         builder.setUserInfo("wernerd", "verySecret");
         LOG.info("Before adding UsernameToken PW Text....");
-        Document signedDoc = builder.build(doc);
+        Document signedDoc = builder.build();
         if (LOG.isDebugEnabled()) {
             LOG.debug("Message with UserNameToken PW Text:");
             String outputString =
@@ -477,7 +477,7 @@ public class UsernameTokenTest extends o
 
         builder.setUserInfo("wernerd", passwdDigest);
         LOG.info("Before adding UsernameToken PW Text....");
-        Document signedDoc = builder.build(doc);
+        Document signedDoc = builder.build();
         if (LOG.isDebugEnabled()) {
             LOG.debug("Message with UserNameToken PW Text:");
             String outputString =
@@ -499,7 +499,7 @@ public class UsernameTokenTest extends o
         builder.setPasswordType(WSConstants.PASSWORD_TEXT);
         builder.setUserInfo("wernerd", "verySecre");
         LOG.info("Before adding UsernameToken PW Text....");
-        Document signedDoc = builder.build(doc);
+        Document signedDoc = builder.build();
         if (LOG.isDebugEnabled()) {
             LOG.debug("Message with UserNameToken PW Text:");
             String outputString =
@@ -581,7 +581,7 @@ public class UsernameTokenTest extends o
         builder.setPasswordType(null);
         builder.setUserInfo("nopassuser", null);
         LOG.info("Before adding UsernameToken with no password....");
-        Document signedDoc = builder.build(doc);
+        Document signedDoc = builder.build();
         if (LOG.isDebugEnabled()) {
             String outputString =
                 XMLUtils.prettyDocumentToString(signedDoc);
@@ -609,7 +609,7 @@ public class UsernameTokenTest extends o
         builder.setPasswordType(WSConstants.PASSWORD_TEXT);
         builder.setUserInfo("emptyuser", "");
         LOG.info("Before adding UsernameToken with an empty password....");
-        Document signedDoc = builder.build(doc);
+        Document signedDoc = builder.build();
         if (LOG.isDebugEnabled()) {
             String outputString =
                 XMLUtils.prettyDocumentToString(signedDoc);
@@ -650,7 +650,7 @@ public class UsernameTokenTest extends o
         builder.setPasswordType("RandomType");
         builder.setUserInfo("wernerd", "verySecret");
 
-        Document signedDoc = builder.build(doc);
+        Document signedDoc = builder.build();
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Message with UserNameToken PW Text:");
@@ -682,7 +682,7 @@ public class UsernameTokenTest extends o
         builder.setPasswordType("RandomType");
         builder.setUserInfo("wernerd", "verySecret");
 
-        Document signedDoc = builder.build(doc);
+        Document signedDoc = builder.build();
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Message with UserNameToken PW custom type:");
@@ -719,7 +719,7 @@ public class UsernameTokenTest extends o
         builder.setPasswordType(WSConstants.PASSWORD_DIGEST);
         builder.setUserInfo("wernerd", "BAD_PASSWORD");
 
-        Document utDoc = builder.build(doc);
+        Document utDoc = builder.build();
 
         //
         // Manually find the Nonce node and set the content to null
@@ -763,7 +763,7 @@ public class UsernameTokenTest extends o
         builder.setPasswordType(WSConstants.PASSWORD_DIGEST);
         builder.setUserInfo("wernerd", "BAD_PASSWORD");
 
-        Document utDoc = builder.build(doc);
+        Document utDoc = builder.build();
         //
         // Manually find the Created node and set the content to null
         //
@@ -803,7 +803,7 @@ public class UsernameTokenTest extends o
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setUserInfo("wernerd", "verySecret");
         LOG.info("Before adding UsernameToken PW Digest....");
-        Document signedDoc = builder.build(doc);
+        Document signedDoc = builder.build();
         String outputString =
             XMLUtils.prettyDocumentToString(signedDoc);
         assertTrue(outputString.contains("EncodingType"));
@@ -914,7 +914,7 @@ public class UsernameTokenTest extends o
         builder.setPasswordType(WSConstants.PASSWORD_DIGEST);
         builder.setUserInfo("wernerd", "verySecret");
 
-        Document utDoc = builder.build(doc);
+        Document utDoc = builder.build();
 
         //
         // Manually find the Nonce node and duplicate it
@@ -958,7 +958,7 @@ public class UsernameTokenTest extends o
         builder.setPasswordType(WSConstants.PASSWORD_DIGEST);
         builder.setUserInfo("wernerd", "verySecret");
 
-        Document utDoc = builder.build(doc);
+        Document utDoc = builder.build();
 
         //
         // Manually find the Created node and duplicate it
@@ -1002,7 +1002,7 @@ public class UsernameTokenTest extends o
         builder.setPasswordType(WSConstants.PASSWORD_DIGEST);
         builder.setUserInfo("wernerd", "verySecret");
 
-        Document utDoc = builder.build(doc);
+        Document utDoc = builder.build();
 
         //
         // Manually find the Nonce node and duplicate it
@@ -1046,7 +1046,7 @@ public class UsernameTokenTest extends o
         builder.setPasswordType(WSConstants.PASSWORD_DIGEST);
         builder.setUserInfo("wernerd", "verySecret");
 
-        Document utDoc = builder.build(doc);
+        Document utDoc = builder.build();
 
         //
         // Manually find the Nonce node and duplicate it
@@ -1131,7 +1131,7 @@ public class UsernameTokenTest extends o
         };
 
         builder.setWsTimeSource(spoofedTimeSource);
-        Document signedDoc = builder.build(doc);
+        Document signedDoc = builder.build();
 
         if (LOG.isDebugEnabled()) {
             String outputString =

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/XOPAttachmentTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/XOPAttachmentTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/XOPAttachmentTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/XOPAttachmentTest.java Fri Nov 25 12:31:19 2016
@@ -123,7 +123,7 @@ public class XOPAttachmentTest extends o
         encrypt.setAttachmentCallbackHandler(attachmentCallbackHandler);
         List<Attachment> encryptedAttachments = attachmentCallbackHandler.getResponseAttachments();
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         // Find the SOAP Body + replace with a xop:Include to the attachment!
         Element soapBody = WSSecurityUtil.findBodyElement(encryptedDoc);
@@ -203,7 +203,7 @@ public class XOPAttachmentTest extends o
 
         encrypt.getParts().add(new WSEncryptionPart("Body", "http://schemas.xmlsoap.org/soap/envelope/", "Content"));
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         List<Attachment> encryptedAttachments = outboundAttachmentCallback.getResponseAttachments();
         assertNotNull(encryptedAttachments);
@@ -239,7 +239,7 @@ public class XOPAttachmentTest extends o
         builder.setAttachmentCallbackHandler(outboundAttachmentCallback);
         builder.setStoreBytesInAttachment(true);
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         List<Attachment> signedAttachments = outboundAttachmentCallback.getResponseAttachments();
         assertNotNull(signedAttachments);
@@ -272,7 +272,7 @@ public class XOPAttachmentTest extends o
         builder.setAttachmentCallbackHandler(outboundAttachmentCallback);
         builder.setStoreBytesInAttachment(true);
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         List<Attachment> signedAttachments = outboundAttachmentCallback.getResponseAttachments();
         assertNotNull(signedAttachments);
@@ -310,7 +310,7 @@ public class XOPAttachmentTest extends o
         encrypt.getParts().add(new WSEncryptionPart("Body", "http://schemas.xmlsoap.org/soap/envelope/", "Content"));
         encrypt.getParts().add(encP);
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         List<Attachment> encryptedAttachments = outboundAttachmentCallback.getResponseAttachments();
         assertNotNull(encryptedAttachments);
@@ -348,7 +348,7 @@ public class XOPAttachmentTest extends o
         encrypt.getParts().add(new WSEncryptionPart("Body", "http://schemas.xmlsoap.org/soap/envelope/", "Content"));
         encrypt.getParts().add(encP);
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         List<Attachment> encryptedAttachments = outboundAttachmentCallback.getResponseAttachments();
         assertNotNull(encryptedAttachments);
@@ -379,7 +379,7 @@ public class XOPAttachmentTest extends o
         encrKeyBuilder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER);
         encrKeyBuilder.setAttachmentCallbackHandler(outboundAttachmentCallback);
         encrKeyBuilder.setStoreBytesInAttachment(true);
-        encrKeyBuilder.prepare(doc, crypto);
+        encrKeyBuilder.prepare(crypto);
 
         //Key information from the EncryptedKey
         byte[] ek = encrKeyBuilder.getEphemeralKey();
@@ -391,7 +391,7 @@ public class XOPAttachmentTest extends o
         encrBuilder.setExternalKey(ek, tokenIdentifier);
         encrBuilder.setAttachmentCallbackHandler(outboundAttachmentCallback);
         encrBuilder.setStoreBytesInAttachment(true);
-        Document encryptedDoc = encrBuilder.build(doc);
+        Document encryptedDoc = encrBuilder.build();
 
         encrKeyBuilder.prependToHeader();
         encrKeyBuilder.prependBSTElementToHeader();
@@ -429,7 +429,7 @@ public class XOPAttachmentTest extends o
         encrKeyBuilder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER);
         encrKeyBuilder.setAttachmentCallbackHandler(outboundAttachmentCallback);
         encrKeyBuilder.setStoreBytesInAttachment(true);
-        encrKeyBuilder.prepare(doc, crypto);
+        encrKeyBuilder.prepare(crypto);
 
         //Key information from the EncryptedKey
         byte[] ek = encrKeyBuilder.getEphemeralKey();
@@ -441,7 +441,7 @@ public class XOPAttachmentTest extends o
         sigBuilder.setSignatureAlgorithm(WSConstants.HMAC_SHA1);
         sigBuilder.setAttachmentCallbackHandler(outboundAttachmentCallback);
         sigBuilder.setStoreBytesInAttachment(true);
-        Document signedDoc = sigBuilder.build(doc);
+        Document signedDoc = sigBuilder.build();
 
         encrKeyBuilder.prependToHeader();
         encrKeyBuilder.prependBSTElementToHeader();
@@ -478,7 +478,7 @@ public class XOPAttachmentTest extends o
         builder.setAttachmentCallbackHandler(outboundAttachmentCallback);
         builder.setStoreBytesInAttachment(true);
         builder.getParts().add(new WSEncryptionPart("Body", "http://schemas.xmlsoap.org/soap/envelope/", "Content"));
-        builder.build(doc, crypto);
+        builder.build(crypto);
 
         WSSecEncrypt encrypt = new WSSecEncrypt(secHeader);
         encrypt.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
@@ -488,7 +488,7 @@ public class XOPAttachmentTest extends o
         encrypt.setStoreBytesInAttachment(true);
         encrypt.getParts().add(new WSEncryptionPart("Body", "http://schemas.xmlsoap.org/soap/envelope/", "Content"));
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         List<Attachment> encryptedAttachments = outboundAttachmentCallback.getResponseAttachments();
         assertNotNull(encryptedAttachments);

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/token/BSTKerberosTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/token/BSTKerberosTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/token/BSTKerberosTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/token/BSTKerberosTest.java Fri Nov 25 12:31:19 2016
@@ -129,7 +129,7 @@ public class BSTKerberosTest extends org
             new WSEncryptionPart(bst.getID());
         sign.getParts().add(encP);
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -159,7 +159,7 @@ public class BSTKerberosTest extends org
 
         WSSecTimestamp timestamp = new WSSecTimestamp(secHeader);
         timestamp.setTimeToLive(600);
-        timestamp.build(doc);
+        timestamp.build();
 
         WSSecSignature sign = new WSSecSignature(secHeader);
         sign.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
@@ -168,7 +168,7 @@ public class BSTKerberosTest extends org
         sign.getParts().add(new WSEncryptionPart(bst.getID()));
         sign.getParts().add(new WSEncryptionPart(timestamp.getId()));
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -280,7 +280,7 @@ public class BSTKerberosTest extends org
         sign.setCustomTokenId(bst.getID());
         sign.setSecretKey(keyData);
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -321,7 +321,7 @@ public class BSTKerberosTest extends org
         sign.setCustomTokenId(Base64.getMimeEncoder().encodeToString(digestBytes));
         sign.setSecretKey(keyData);
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -359,7 +359,7 @@ public class BSTKerberosTest extends org
         builder.setEncryptSymmKey(false);
         builder.setCustomReferenceValue(AP_REQ);
         builder.setEncKeyId(bst.getID());
-        Document encryptedDoc = builder.build(doc, crypto);
+        Document encryptedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -400,7 +400,7 @@ public class BSTKerberosTest extends org
         byte[] digestBytes = KeyUtils.generateDigest(keyData);
         builder.setEncKeyId(Base64.getMimeEncoder().encodeToString(digestBytes));
 
-        Document encryptedDoc = builder.build(doc, crypto);
+        Document encryptedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/misc/FaultCodeTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/misc/FaultCodeTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/misc/FaultCodeTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/misc/FaultCodeTest.java Fri Nov 25 12:31:19 2016
@@ -77,7 +77,7 @@ public class FaultCodeTest extends org.j
         WSSecEncrypt builder = new WSSecEncrypt(secHeader);
         builder.setUserInfo("wss40", "security");
         builder.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
-        Document encryptedDoc = builder.build(doc, crypto);
+        Document encryptedDoc = builder.build(crypto);
 
         try {
             verify(encryptedDoc);
@@ -121,7 +121,7 @@ public class FaultCodeTest extends org.j
         WSSecTimestamp builder = new WSSecTimestamp(secHeader);
         builder.setTimeToLive(-1);
 
-        Document timestampedDoc = builder.build(doc);
+        Document timestampedDoc = builder.build();
 
         try {
             verify(timestampedDoc);
@@ -149,7 +149,7 @@ public class FaultCodeTest extends org.j
         builder.addNonce();
         builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
 
-        Document timestampedDoc = builder.build(doc);
+        Document timestampedDoc = builder.build();
 
         try {
             verify(timestampedDoc);
@@ -177,7 +177,7 @@ public class FaultCodeTest extends org.j
         builder.addNonce();
         builder.setUserInfo(null, "security");
 
-        builder.build(doc);
+        builder.build();
 
         try {
             new UsernameToken(doc.getDocumentElement(), false, new BSPEnforcer());

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/misc/PrincipalTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/misc/PrincipalTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/misc/PrincipalTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/misc/PrincipalTest.java Fri Nov 25 12:31:19 2016
@@ -83,7 +83,7 @@ public class PrincipalTest extends org.j
         
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setUserInfo("wernerd", "verySecret");
-        Document signedDoc = builder.build(doc);
+        Document signedDoc = builder.build();
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -116,7 +116,7 @@ public class PrincipalTest extends org.j
         
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setUserInfo("wernerd", "verySecret");
-        Document signedDoc = builder.build(doc);
+        Document signedDoc = builder.build();
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -152,7 +152,7 @@ public class PrincipalTest extends org.j
 
         WSSecSAMLToken wsSign = new WSSecSAMLToken(secHeader);
 
-        Document unsignedDoc = wsSign.build(doc, samlAssertion);
+        Document unsignedDoc = wsSign.build(samlAssertion);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -195,7 +195,7 @@ public class PrincipalTest extends org.j
         
         WSSecSAMLToken wsSign = new WSSecSAMLToken(secHeader);
 
-        Document unsignedDoc = wsSign.build(doc, samlAssertion);
+        Document unsignedDoc = wsSign.build(samlAssertion);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -239,7 +239,7 @@ public class PrincipalTest extends org.j
         
         WSSecSAMLToken wsSign = new WSSecSAMLToken(secHeader);
 
-        Document unsignedDoc = wsSign.build(doc, samlAssertion);
+        Document unsignedDoc = wsSign.build(samlAssertion);
 
         if (LOG.isDebugEnabled()) {
             String outputString =

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/processor/EncryptedKeyDataRefTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/processor/EncryptedKeyDataRefTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/processor/EncryptedKeyDataRefTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/processor/EncryptedKeyDataRefTest.java Fri Nov 25 12:31:19 2016
@@ -93,7 +93,7 @@ public class EncryptedKeyDataRefTest ext
         /*
          * Prepare the Encrypt object with the token, setup data structure
          */
-        builder.prepare(doc, crypto);
+        builder.prepare(crypto);
 
         /*
          * Set up the parts structure to encrypt the body

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/processor/ReferenceListDataRefTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/processor/ReferenceListDataRefTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/processor/ReferenceListDataRefTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/processor/ReferenceListDataRefTest.java Fri Nov 25 12:31:19 2016
@@ -93,7 +93,7 @@ public class ReferenceListDataRefTest ex
         /*
          * Prepare the Encrypt object with the token, setup data structure
          */
-        builder.prepare(doc, crypto);
+        builder.prepare(crypto);
 
         /*
          * Set up the parts structure to encrypt the body

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlAlgorithmSuiteTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlAlgorithmSuiteTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlAlgorithmSuiteTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlAlgorithmSuiteTest.java Fri Nov 25 12:31:19 2016
@@ -81,7 +81,7 @@ public class SamlAlgorithmSuiteTest exte
         secHeader.insertSecurityHeader();
         
         WSSecSAMLToken wsSign = new WSSecSAMLToken(secHeader);
-        Document signedDoc = wsSign.build(doc, samlAssertion);
+        Document signedDoc = wsSign.build(samlAssertion);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -125,7 +125,7 @@ public class SamlAlgorithmSuiteTest exte
         
         WSSecSAMLToken wsSign = new WSSecSAMLToken(secHeader);
 
-        Document signedDoc = wsSign.build(doc, samlAssertion);
+        Document signedDoc = wsSign.build(samlAssertion);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -169,7 +169,7 @@ public class SamlAlgorithmSuiteTest exte
         
         WSSecSAMLToken wsSign = new WSSecSAMLToken(secHeader);
 
-        Document signedDoc = wsSign.build(doc, samlAssertion);
+        Document signedDoc = wsSign.build(samlAssertion);
 
         if (LOG.isDebugEnabled()) {
             String outputString =

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlAuthnTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlAuthnTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlAuthnTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlAuthnTest.java Fri Nov 25 12:31:19 2016
@@ -170,7 +170,7 @@ public class SamlAuthnTest extends org.j
 
         WSSecSAMLToken wsSign = new WSSecSAMLToken(secHeader);
 
-        Document unsignedDoc = wsSign.build(doc, samlAssertion);
+        Document unsignedDoc = wsSign.build(samlAssertion);
 
         if (LOG.isDebugEnabled()) {
             String outputString =