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 [2/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/main/java/org/apache/wss4j/dom/message/WSSecTimestamp.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecTimestamp.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecTimestamp.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecTimestamp.java Fri Nov 25 12:31:19 2016
@@ -45,6 +45,10 @@ public class WSSecTimestamp extends WSSe
     public WSSecTimestamp(WSSecHeader securityHeader) {
         super(securityHeader);
     }
+    
+    public WSSecTimestamp(Document doc) {
+        super(doc);
+    }
 
     /**
      * Set the time to live. This is the time difference in seconds between the
@@ -64,11 +68,9 @@ public class WSSecTimestamp extends WSSe
      * relevant information was set. Before calling <code>prepare()</code> the
      * parameter such as <code>timeToLive</code> can be set if the default
      * value is not suitable.
-     *
-     * @param doc The SOAP envelope as W3C document
      */
-    public void prepare(Document doc) {
-        ts = new Timestamp(precisionInMilliSeconds, doc, wsTimeSource, timeToLive);
+    public void prepare() {
+        ts = new Timestamp(precisionInMilliSeconds, getDocument(), wsTimeSource, timeToLive);
         String tsId = getIdAllocator().createId("TS-", ts);
         ts.setID(tsId);
     }
@@ -92,17 +94,16 @@ public class WSSecTimestamp extends WSSe
      * A complete <code>Timestamp</code> is constructed and added to the
      * <code>wsse:Security</code> header.
      *
-     * @param doc The SOAP envelope as W3C document
      * @return Document with Timestamp added
      * @throws Exception
      */
-    public Document build(Document doc) {
+    public Document build() {
         LOG.debug("Begin add timestamp...");
 
-        prepare(doc);
+        prepare();
         prependToHeader();
 
-        return doc;
+        return getDocument();
     }
 
     /**

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecUsernameToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecUsernameToken.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecUsernameToken.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecUsernameToken.java Fri Nov 25 12:31:19 2016
@@ -56,6 +56,10 @@ public class WSSecUsernameToken extends
     public WSSecUsernameToken(WSSecHeader securityHeader) {
         super(securityHeader);
     }
+    
+    public WSSecUsernameToken(Document doc) {
+        super(doc);
+    }
 
     /**
      * Defines how to construct the password element of the
@@ -160,24 +164,22 @@ public class WSSecUsernameToken extends
      * <code>prepare()</code> all parameters such as user, password,
      * passwordType etc. must be set. A complete <code>UsernameToken</code> is
      * constructed.
-     *
-     * @param doc The SOAP envelope as W3C document
      */
-    public void prepare(Document doc) {
-        ut = new UsernameToken(precisionInMilliSeconds, doc, wsTimeSource, passwordType);
+    public void prepare() {
+        ut = new UsernameToken(precisionInMilliSeconds, getDocument(), wsTimeSource, passwordType);
         ut.setPasswordsAreEncoded(passwordsAreEncoded);
         ut.setName(user);
         if (useDerivedKey) {
-            saltValue = ut.addSalt(doc, saltValue, useMac);
-            ut.addIteration(doc, iteration);
+            saltValue = ut.addSalt(getDocument(), saltValue, useMac);
+            ut.addIteration(getDocument(), iteration);
         } else {
             ut.setPassword(password);
         }
         if (nonce) {
-            ut.addNonce(doc);
+            ut.addNonce(getDocument());
         }
         if (created) {
-            ut.addCreated(precisionInMilliSeconds, wsTimeSource, doc);
+            ut.addCreated(precisionInMilliSeconds, wsTimeSource, getDocument());
         }
         ut.setID(getIdAllocator().createId("UsernameToken-", ut));
     }
@@ -216,16 +218,15 @@ public class WSSecUsernameToken extends
      * <code>UsernameToken</code> is constructed and added to the
      * <code>wsse:Security</code> header.
      *
-     * @param doc The SOAP envelope as W3C document
      * @return Document with UsernameToken added
      */
-    public Document build(Document doc) {
+    public Document build() {
         LOG.debug("Begin add username token...");
 
-        prepare(doc);
+        prepare();
         prependToHeader();
 
-        return doc;
+        return getDocument();
     }
 
     /**

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSecSignatureSAML.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSecSignatureSAML.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSecSignatureSAML.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSecSignatureSAML.java Fri Nov 25 12:31:19 2016
@@ -80,6 +80,11 @@ public class WSSecSignatureSAML extends
         super(securityHeader);
         doDebug = LOG.isDebugEnabled();
     }
+    
+    public WSSecSignatureSAML(Document doc) {
+        super(doc);
+        doDebug = LOG.isDebugEnabled();
+    }
 
     /**
      * Builds a signed soap envelope with SAML token.
@@ -88,8 +93,6 @@ public class WSSecSignatureSAML extends
      * defined parameters for certificate handling the signature elements are
      * constructed and inserted into the <code>wsse:Signature</code>
      *
-     * @param doc
-     *            The unsigned SOAP envelope as <code>Document</code>
      * @param uCrypto
      *            The user's Crypto instance
      * @param samlAssertion
@@ -105,14 +108,14 @@ public class WSSecSignatureSAML extends
      * @throws WSSecurityException
      */
     public Document build(
-        Document doc, Crypto uCrypto, SamlAssertionWrapper samlAssertion,
+        Crypto uCrypto, SamlAssertionWrapper samlAssertion,
         Crypto iCrypto, String iKeyName, String iKeyPW
     ) throws WSSecurityException {
 
-        prepare(doc, uCrypto, samlAssertion, iCrypto, iKeyName, iKeyPW);
+        prepare(uCrypto, samlAssertion, iCrypto, iKeyName, iKeyPW);
 
         if (getParts().isEmpty()) {
-            getParts().add(WSSecurityUtil.getDefaultEncryptionPart(doc));
+            getParts().add(WSSecurityUtil.getDefaultEncryptionPart(getDocument()));
         } else {
             for (WSEncryptionPart part : getParts()) {
                 if ("STRTransform".equals(part.getName()) && part.getId() == null) {
@@ -127,7 +130,7 @@ public class WSSecSignatureSAML extends
         //
         if (secRefID != null) {
             String soapNamespace =
-                WSSecurityUtil.getSOAPNamespace(doc.getDocumentElement());
+                WSSecurityUtil.getSOAPNamespace(getDocument().getDocumentElement());
             WSEncryptionPart encP =
                 new WSEncryptionPart("STRTransform", soapNamespace, "Content");
             encP.setId(secRefID);
@@ -152,7 +155,7 @@ public class WSSecSignatureSAML extends
             prependBSTElementToHeader();
         }
 
-        return doc;
+        return getDocument();
     }
 
     /**
@@ -166,8 +169,6 @@ public class WSSecSignatureSAML extends
      * This method does not add the Signature element to the security header.
      * See <code>prependSignatureElementToHeader()</code> method.
      *
-     * @param doc
-     *            The SOAP envelope as <code>Document</code>
      * @param uCrypto
      *            The user's Crypto instance
      * @param samlAssertion
@@ -182,7 +183,7 @@ public class WSSecSignatureSAML extends
      * @throws WSSecurityException
      */
     public void prepare(
-        Document doc, Crypto uCrypto, SamlAssertionWrapper samlAssertion, Crypto iCrypto,
+        Crypto uCrypto, SamlAssertionWrapper samlAssertion, Crypto iCrypto,
         String iKeyName, String iKeyPW
     ) throws WSSecurityException {
 
@@ -192,11 +193,10 @@ public class WSSecSignatureSAML extends
 
         userCrypto = uCrypto;
         issuerCrypto = iCrypto;
-        document = doc;
         issuerKeyName = iKeyName;
         issuerKeyPW = iKeyPW;
 
-        samlToken = samlAssertion.toDOM(doc);
+        samlToken = samlAssertion.toDOM(getDocument());
 
         //
         // Get some information about the SAML token content. This controls how
@@ -216,7 +216,7 @@ public class WSSecSignatureSAML extends
         // Gather some info about the document to process and store it for
         // retrieval
         //
-        wsDocInfo = new WSDocInfo(doc);
+        wsDocInfo = new WSDocInfo(getDocument());
 
 
         X509Certificate[] certs = null;
@@ -311,7 +311,7 @@ public class WSSecSignatureSAML extends
         }
 
         keyInfoUri = getIdAllocator().createSecureId("KeyId-", keyInfo);
-        SecurityTokenReference secRef = new SecurityTokenReference(doc);
+        SecurityTokenReference secRef = new SecurityTokenReference(getDocument());
         strUri = getIdAllocator().createSecureId("STRId-", secRef);
         secRef.setID(strUri);
         setSecurityTokenReference(secRef);
@@ -330,12 +330,12 @@ public class WSSecSignatureSAML extends
         //
         try {
             if (senderVouches) {
-                secRefSaml = new SecurityTokenReference(doc);
+                secRefSaml = new SecurityTokenReference(getDocument());
                 secRefID = getIdAllocator().createSecureId("STRSAMLId-", secRefSaml);
                 secRefSaml.setID(secRefID);
 
                 if (useDirectReferenceToAssertion) {
-                    Reference ref = new Reference(doc);
+                    Reference ref = new Reference(getDocument());
                     ref.setURI("#" + samlAssertion.getId());
                     if (samlAssertion.getSaml1() != null) {
                         ref.setValueType(WSConstants.WSS_SAML_KI_VALUE_TYPE);
@@ -345,7 +345,7 @@ public class WSSecSignatureSAML extends
                     }
                     secRefSaml.setReference(ref);
                 } else {
-                    Element keyId = doc.createElementNS(WSConstants.WSSE_NS, "wsse:KeyIdentifier");
+                    Element keyId = getDocument().createElementNS(WSConstants.WSSE_NS, "wsse:KeyIdentifier");
                     String valueType = null;
                     if (samlAssertion.getSaml1() != null) {
                         valueType = WSConstants.WSS_SAML_KI_VALUE_TYPE;
@@ -357,7 +357,7 @@ public class WSSecSignatureSAML extends
                     keyId.setAttributeNS(
                         null, "ValueType", valueType
                     );
-                    keyId.appendChild(doc.createTextNode(samlAssertion.getId()));
+                    keyId.appendChild(getDocument().createTextNode(samlAssertion.getId()));
                     Element elem = secRefSaml.getElement();
                     elem.appendChild(keyId);
                 }
@@ -370,22 +370,21 @@ public class WSSecSignatureSAML extends
         }
 
         X509Certificate cert = certs != null ? certs[0] : null;
-        configureKeyInfo(doc, secRef, cert, iCrypto != null ? iCrypto : uCrypto, 
-            samlAssertion);
+        configureKeyInfo(secRef, cert, iCrypto != null ? iCrypto : uCrypto, samlAssertion);
 
         wsDocInfo.addTokenElement(samlToken, false);
     }
     
     private void configureKeyInfo(
-        Document doc, SecurityTokenReference secRef, X509Certificate cert,
+        SecurityTokenReference secRef, X509Certificate cert,
         Crypto crypto, SamlAssertionWrapper samlAssertion
     ) throws WSSecurityException {
         if (senderVouches) {
             switch (keyIdentifierType) {
             case WSConstants.BST_DIRECT_REFERENCE:
-                Reference ref = new Reference(doc);
+                Reference ref = new Reference(getDocument());
                 ref.setURI("#" + certUri);
-                BinarySecurity binarySecurity = new X509Security(doc);
+                BinarySecurity binarySecurity = new X509Security(getDocument());
                 ((X509Security) binarySecurity).setX509Certificate(cert);
                 binarySecurity.setID(certUri);
                 bstToken = binarySecurity.getElement();
@@ -410,8 +409,8 @@ public class WSSecSignatureSAML extends
                 final String issuer = cert.getIssuerDN().getName();
                 final java.math.BigInteger serialNumber = cert.getSerialNumber();
                 final DOMX509IssuerSerial domIssuerSerial =
-                        new DOMX509IssuerSerial(document, issuer, serialNumber);
-                final DOMX509Data domX509Data = new DOMX509Data(document, domIssuerSerial);
+                        new DOMX509IssuerSerial(getDocument(), issuer, serialNumber);
+                final DOMX509Data domX509Data = new DOMX509Data(getDocument(), domIssuerSerial);
                 secRef.setUnknownElement(domX509Data.getElement());
                 break;
 
@@ -421,7 +420,7 @@ public class WSSecSignatureSAML extends
                 );
             }
         } else if (useDirectReferenceToAssertion) {
-            Reference ref = new Reference(doc);
+            Reference ref = new Reference(getDocument());
             ref.setURI("#" + samlAssertion.getId());
             if (samlAssertion.getSaml1() != null) {
                 ref.setValueType(WSConstants.WSS_SAML_KI_VALUE_TYPE);
@@ -431,7 +430,7 @@ public class WSSecSignatureSAML extends
             }
             secRef.setReference(ref);
         } else {
-            Element keyId = doc.createElementNS(WSConstants.WSSE_NS, "wsse:KeyIdentifier");
+            Element keyId = getDocument().createElementNS(WSConstants.WSSE_NS, "wsse:KeyIdentifier");
             String valueType = null;
             if (samlAssertion.getSaml1() != null) {
                 valueType = WSConstants.WSS_SAML_KI_VALUE_TYPE;
@@ -443,7 +442,7 @@ public class WSSecSignatureSAML extends
             keyId.setAttributeNS(
                 null, "ValueType", valueType
             );
-            keyId.appendChild(doc.createTextNode(samlAssertion.getId()));
+            keyId.appendChild(getDocument().createTextNode(samlAssertion.getId()));
             Element elem = secRef.getElement();
             elem.appendChild(keyId);
         }

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/AbstractSAMLCallbackHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/AbstractSAMLCallbackHandler.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/AbstractSAMLCallbackHandler.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/AbstractSAMLCallbackHandler.java Fri Nov 25 12:31:19 2016
@@ -212,10 +212,10 @@ public abstract class AbstractSAMLCallba
             Document doc = docBuilder.newDocument();
 
             // Create an Encrypted Key
-            WSSecEncryptedKey encrKey = new WSSecEncryptedKey(null);
+            WSSecEncryptedKey encrKey = new WSSecEncryptedKey(doc);
             encrKey.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
             encrKey.setUseThisCert(certs[0]);
-            encrKey.prepare(doc, null);
+            encrKey.prepare(null);
             ephemeralKey = encrKey.getEphemeralKey();
             Element encryptedKeyElement = encrKey.getEncryptedKeyElement();
 

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/CustomAction.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/CustomAction.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/CustomAction.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/CustomAction.java Fri Nov 25 12:31:19 2016
@@ -34,7 +34,6 @@ public class CustomAction implements Act
     execute(
         WSHandler handler,
         SecurityActionToken action,
-        org.w3c.dom.Document doc,
         RequestData reqData
     ) throws WSSecurityException {
         //

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CertificateStoreTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CertificateStoreTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CertificateStoreTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CertificateStoreTest.java Fri Nov 25 12:31:19 2016
@@ -84,7 +84,7 @@ public class CertificateStoreTest extend
         sign.setUserInfo("wss40", "security");
         sign.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
 
-        Document signedDoc = sign.build(doc, senderCrypto);
+        Document signedDoc = sign.build(senderCrypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -116,7 +116,7 @@ public class CertificateStoreTest extend
         sign.setUserInfo("wss40", "security");
         sign.setKeyIdentifierType(WSConstants.X509_KEY_IDENTIFIER);
 
-        Document signedDoc = sign.build(doc, senderCrypto);
+        Document signedDoc = sign.build(senderCrypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -154,7 +154,7 @@ public class CertificateStoreTest extend
         sign.setUserInfo("wss40", "security");
         sign.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
 
-        Document signedDoc = sign.build(doc, senderCrypto);
+        Document signedDoc = sign.build(senderCrypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -188,7 +188,7 @@ public class CertificateStoreTest extend
         sign.setUserInfo("wss40", "security");
         sign.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER);
 
-        Document signedDoc = sign.build(doc, senderCrypto);
+        Document signedDoc = sign.build(senderCrypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -222,7 +222,7 @@ public class CertificateStoreTest extend
         sign.setUserInfo("wss40", "security");
         sign.setKeyIdentifierType(WSConstants.SKI_KEY_IDENTIFIER);
 
-        Document signedDoc = sign.build(doc, senderCrypto);
+        Document signedDoc = sign.build(senderCrypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -257,7 +257,7 @@ public class CertificateStoreTest extend
         sign.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
         sign.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
 
-        Document signedDoc = sign.build(doc, CryptoFactory.getInstance());
+        Document signedDoc = sign.build(CryptoFactory.getInstance());
 
         if (LOG.isDebugEnabled()) {
             String outputString =

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CryptoProviderTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CryptoProviderTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CryptoProviderTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CryptoProviderTest.java Fri Nov 25 12:31:19 2016
@@ -88,7 +88,7 @@ public class CryptoProviderTest extends
         sign.setUserInfo("wss86", "security");
         sign.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -112,7 +112,7 @@ public class CryptoProviderTest extends
         sign.setUserInfo("wss86", "security");
         sign.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
 
         String outputString = XMLUtils.prettyDocumentToString(signedDoc);
         outputString =
@@ -140,7 +140,7 @@ public class CryptoProviderTest extends
         sign.setUserInfo("wss86", "security");
         sign.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
 
         String outputString = XMLUtils.prettyDocumentToString(signedDoc);
         outputString =
@@ -201,7 +201,7 @@ public class CryptoProviderTest extends
             
             WSSecEncrypt encrypt = new WSSecEncrypt(secHeader);
             encrypt.setUseThisCert(cert);
-            Document encryptedDoc = encrypt.build(doc, crypto);
+            Document encryptedDoc = encrypt.build(crypto);
 
             if (LOG.isDebugEnabled()) {
                 String outputString =
@@ -257,7 +257,7 @@ public class CryptoProviderTest extends
             
             WSSecEncrypt encrypt = new WSSecEncrypt(secHeader);
             encrypt.setUseThisCert(cert);
-            Document encryptedDoc = encrypt.build(doc, crypto);
+            Document encryptedDoc = encrypt.build(crypto);
 
             if (LOG.isDebugEnabled()) {
                 String outputString =

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CryptoTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CryptoTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CryptoTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CryptoTest.java Fri Nov 25 12:31:19 2016
@@ -111,7 +111,7 @@ public class CryptoTest extends org.juni
         keyStore.load(input, "security".toCharArray());
         input.close();
         ((Merlin)crypto).setKeyStore(keyStore);
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         // Load the truststore
         Crypto processCrypto = new Merlin();

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CustomActionProcessorTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CustomActionProcessorTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CustomActionProcessorTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CustomActionProcessorTest.java Fri Nov 25 12:31:19 2016
@@ -75,7 +75,7 @@ public class CustomActionProcessorTest e
         builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
         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:");
@@ -121,7 +121,7 @@ public class CustomActionProcessorTest e
         builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
         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:");

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CustomTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CustomTokenTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CustomTokenTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CustomTokenTest.java Fri Nov 25 12:31:19 2016
@@ -64,9 +64,9 @@ public class CustomTokenTest extends org
         dbf.setNamespaceAware(true);
         Document timestampDoc = dbf.newDocumentBuilder().newDocument();
 
-        WSSecTimestamp timestamp = new WSSecTimestamp(null);
+        WSSecTimestamp timestamp = new WSSecTimestamp(timestampDoc);
         timestamp.setTimeToLive(300);
-        timestamp.prepare(timestampDoc);
+        timestamp.prepare();
         Element timestampElement = timestamp.getElement();
 
         final WSSConfig cfg = WSSConfig.getNewInstance();

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/AttachmentTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/AttachmentTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/AttachmentTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/AttachmentTest.java Fri Nov 25 12:31:19 2016
@@ -117,7 +117,7 @@ public class AttachmentTest extends Asse
         builder.setAttachmentCallbackHandler(attachmentCallbackHandler);
 
         LOG.info("Before Signing....");
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Signing....");
@@ -163,7 +163,7 @@ public class AttachmentTest extends Asse
         builder.setAttachmentCallbackHandler(attachmentCallbackHandler);
 
         LOG.info("Before Signing....");
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Signing....");
@@ -220,7 +220,7 @@ public class AttachmentTest extends Asse
         builder.setAttachmentCallbackHandler(attachmentCallbackHandler);
 
         LOG.info("Before Signing....");
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Signing....");
@@ -266,7 +266,7 @@ public class AttachmentTest extends Asse
         builder.setAttachmentCallbackHandler(attachmentCallbackHandler);
 
         LOG.info("Before Signing....");
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Signing....");
@@ -330,7 +330,7 @@ public class AttachmentTest extends Asse
         builder.setAttachmentCallbackHandler(attachmentCallbackHandler);
 
         LOG.info("Before Signing....");
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Signing....");
@@ -381,7 +381,7 @@ public class AttachmentTest extends Asse
         encrypt.setAttachmentCallbackHandler(attachmentCallbackHandler);
         List<Attachment> encryptedAttachments = attachmentCallbackHandler.getResponseAttachments();
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString = XMLUtils.prettyDocumentToString(encryptedDoc);
@@ -441,7 +441,7 @@ public class AttachmentTest extends Asse
         encrypt.setAttachmentCallbackHandler(attachmentCallbackHandler);
         List<Attachment> encryptedAttachments = attachmentCallbackHandler.getResponseAttachments();
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString = XMLUtils.prettyDocumentToString(encryptedDoc);
@@ -500,7 +500,7 @@ public class AttachmentTest extends Asse
         encrypt.setAttachmentCallbackHandler(attachmentCallbackHandler);
         List<Attachment> encryptedAttachments = attachmentCallbackHandler.getResponseAttachments();
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString = XMLUtils.prettyDocumentToString(encryptedDoc);
@@ -555,7 +555,7 @@ public class AttachmentTest extends Asse
         encrypt.setAttachmentCallbackHandler(attachmentCallbackHandler);
         List<Attachment> encryptedAttachments = attachmentCallbackHandler.getResponseAttachments();
 
-        encrypt.prepare(doc, crypto);
+        encrypt.prepare(crypto);
         Element refs = encrypt.encrypt();
         encrypt.addAttachmentEncryptedDataElements();
         encrypt.addExternalRefElement(refs);
@@ -620,7 +620,7 @@ public class AttachmentTest extends Asse
         encrypt.setAttachmentCallbackHandler(attachmentCallbackHandler);
         List<Attachment> encryptedAttachments = attachmentCallbackHandler.getResponseAttachments();
 
-        encrypt.prepare(doc, crypto);
+        encrypt.prepare(crypto);
         encrypt.encrypt();
         encrypt.addAttachmentEncryptedDataElements();
         //encrypt.addExternalRefElement(refs);
@@ -684,7 +684,7 @@ public class AttachmentTest extends Asse
         encrypt.setAttachmentCallbackHandler(attachmentCallbackHandler);
         List<Attachment> encryptedAttachments = attachmentCallbackHandler.getResponseAttachments();
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         Assert.assertEquals(1, encryptedAttachments.get(0).getHeaders().size());
 
@@ -732,7 +732,7 @@ public class AttachmentTest extends Asse
         encrypt.setAttachmentCallbackHandler(attachmentCallbackHandler);
         List<Attachment> encryptedAttachments = attachmentCallbackHandler.getResponseAttachments();
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString = XMLUtils.prettyDocumentToString(encryptedDoc);
@@ -792,7 +792,7 @@ public class AttachmentTest extends Asse
         encrypt.setAttachmentCallbackHandler(attachmentCallbackHandler);
         List<Attachment> encryptedAttachments = attachmentCallbackHandler.getResponseAttachments();
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString = XMLUtils.prettyDocumentToString(encryptedDoc);
@@ -844,7 +844,7 @@ public class AttachmentTest extends Asse
             new AttachmentCallbackHandler(Collections.singletonList(attachment));
         signature.setAttachmentCallbackHandler(attachmentCallbackHandler);
 
-        doc = signature.build(doc, crypto);
+        doc = signature.build(crypto);
 
         WSSecEncrypt encrypt = new WSSecEncrypt(secHeader);
         encrypt.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
@@ -856,7 +856,7 @@ public class AttachmentTest extends Asse
         encrypt.setAttachmentCallbackHandler(attachmentCallbackHandler);
         List<Attachment> encryptedAttachments = attachmentCallbackHandler.getResponseAttachments();
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString = XMLUtils.prettyDocumentToString(encryptedDoc);
@@ -922,7 +922,7 @@ public class AttachmentTest extends Asse
             }
         });
 
-        doc = signature.build(doc, crypto);
+        doc = signature.build(crypto);
 
         WSSecEncrypt encrypt = new WSSecEncrypt(secHeader);
         encrypt.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
@@ -945,7 +945,7 @@ public class AttachmentTest extends Asse
             }
         });
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString = XMLUtils.prettyDocumentToString(encryptedDoc);
@@ -1010,7 +1010,7 @@ public class AttachmentTest extends Asse
         encrypt.setAttachmentCallbackHandler(attachmentCallbackHandler);
         List<Attachment> encryptedAttachments = attachmentCallbackHandler.getResponseAttachments();
 
-        doc = encrypt.build(doc, crypto);
+        doc = encrypt.build(crypto);
 
         WSSecSignature signature = new WSSecSignature(secHeader);
         signature.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
@@ -1020,7 +1020,7 @@ public class AttachmentTest extends Asse
         signature.setAttachmentCallbackHandler(attachmentCallbackHandler);
         encryptedAttachments = attachmentCallbackHandler.getResponseAttachments();
 
-        doc = signature.build(doc, crypto);
+        doc = signature.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString = XMLUtils.prettyDocumentToString(doc);
@@ -1087,7 +1087,7 @@ public class AttachmentTest extends Asse
             }
         });
 
-        doc = encrypt.build(doc, crypto);
+        doc = encrypt.build(crypto);
 
         WSSecSignature signature = new WSSecSignature(secHeader);
         signature.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
@@ -1109,7 +1109,7 @@ public class AttachmentTest extends Asse
             }
         });
 
-        doc = signature.build(doc, crypto);
+        doc = signature.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString = XMLUtils.prettyDocumentToString(doc);

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/CertErrorTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/CertErrorTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/CertErrorTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/CertErrorTest.java Fri Nov 25 12:31:19 2016
@@ -55,7 +55,7 @@ public class CertErrorTest extends org.j
         WSSecSignature builder = new WSSecSignature(secHeader);
         builder.setUserInfo("bob", "security");
         try {
-            builder.build(doc, CryptoFactory.getInstance());
+            builder.build(CryptoFactory.getInstance());
             fail("Expected failure on a bad username");
         } catch (WSSecurityException ex) {
             String expectedError = "No certificates for user \"bob\" were found for signature";
@@ -75,7 +75,7 @@ public class CertErrorTest extends org.j
         WSSecEncrypt builder = new WSSecEncrypt(secHeader);
         builder.setUserInfo("alice");
         try {
-            builder.build(doc, CryptoFactory.getInstance());
+            builder.build(CryptoFactory.getInstance());
             fail("Expected failure on a bad username");
         } catch (WSSecurityException ex) {
             String expectedError = "No certificates for user \"alice\" were found for encryption";

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/DerivedKeyTest.java Fri Nov 25 12:31:19 2016
@@ -74,7 +74,7 @@ public class DerivedKeyTest extends org.
         WSSecEncryptedKey encrKeyBuilder = new WSSecEncryptedKey(secHeader);
         encrKeyBuilder.setUserInfo("wss40");
         encrKeyBuilder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER);
-        encrKeyBuilder.prepare(doc, crypto);
+        encrKeyBuilder.prepare(crypto);
 
         //Key information from the EncryptedKey
         byte[] ek = encrKeyBuilder.getEphemeralKey();
@@ -84,7 +84,7 @@ public class DerivedKeyTest extends org.
         WSSecDKEncrypt encrBuilder = new WSSecDKEncrypt(secHeader);
         encrBuilder.setSymmetricEncAlgorithm(WSConstants.AES_128);
         encrBuilder.setExternalKey(ek, tokenIdentifier);
-        Document encryptedDoc = encrBuilder.build(doc);
+        Document encryptedDoc = encrBuilder.build();
 
         encrKeyBuilder.prependToHeader();
         encrKeyBuilder.prependBSTElementToHeader();
@@ -112,7 +112,7 @@ public class DerivedKeyTest extends org.
         WSSecEncryptedKey encrKeyBuilder = new WSSecEncryptedKey(secHeader);
         encrKeyBuilder.setUserInfo("wss40");
         encrKeyBuilder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER);
-        encrKeyBuilder.prepare(doc, crypto);
+        encrKeyBuilder.prepare(crypto);
 
         //Key information from the EncryptedKey
         byte[] ek = encrKeyBuilder.getEphemeralKey();
@@ -122,7 +122,7 @@ public class DerivedKeyTest extends org.
         WSSecDKEncrypt encrBuilder = new WSSecDKEncrypt(secHeader);
         encrBuilder.setSymmetricEncAlgorithm(WSConstants.AES_128);
         encrBuilder.setExternalKey(ek, tokenIdentifier);
-        Document encryptedDoc = encrBuilder.build(doc);
+        Document encryptedDoc = encrBuilder.build();
 
         encrKeyBuilder.prependToHeader();
         encrKeyBuilder.prependBSTElementToHeader();
@@ -146,7 +146,7 @@ public class DerivedKeyTest extends org.
         WSSecEncryptedKey encrKeyBuilder = new WSSecEncryptedKey(secHeader);
         encrKeyBuilder.setUserInfo("wss40");
         encrKeyBuilder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER);
-        encrKeyBuilder.prepare(doc, crypto);
+        encrKeyBuilder.prepare(crypto);
 
         //Key information from the EncryptedKey
         byte[] ek = encrKeyBuilder.getEphemeralKey();
@@ -156,7 +156,7 @@ public class DerivedKeyTest extends org.
         WSSecDKSign sigBuilder = new WSSecDKSign(secHeader);
         sigBuilder.setExternalKey(ek, tokenIdentifier);
         sigBuilder.setSignatureAlgorithm(WSConstants.HMAC_SHA1);
-        /* Document signedDoc = */ sigBuilder.build(doc);
+        /* Document signedDoc = */ sigBuilder.build();
 
         encrKeyBuilder.prependToHeader();
         encrKeyBuilder.prependBSTElementToHeader();
@@ -199,7 +199,7 @@ public class DerivedKeyTest extends org.
         java.security.Key key = crypto.getPrivateKey("wss40", "security");
         sigBuilder.setExternalKey(key.getEncoded(), secToken.getElement());
         sigBuilder.setSignatureAlgorithm(WSConstants.HMAC_SHA1);
-        sigBuilder.build(doc);
+        sigBuilder.build();
 
         sigBuilder.prependDKElementToHeader();
 
@@ -240,7 +240,7 @@ public class DerivedKeyTest extends org.
         java.security.Key key = crypto.getPrivateKey("wss40", "security");
         sigBuilder.setExternalKey(key.getEncoded(), secToken.getElement());
         sigBuilder.setSignatureAlgorithm(WSConstants.HMAC_SHA1);
-        sigBuilder.build(doc);
+        sigBuilder.build();
 
         sigBuilder.prependDKElementToHeader();
 
@@ -269,7 +269,7 @@ public class DerivedKeyTest extends org.
         WSSecEncryptedKey encrKeyBuilder = new WSSecEncryptedKey(secHeader);
         encrKeyBuilder.setUserInfo("wss40");
         encrKeyBuilder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER);
-        encrKeyBuilder.prepare(doc, crypto);
+        encrKeyBuilder.prepare(crypto);
 
         //Key information from the EncryptedKey
         byte[] ek = encrKeyBuilder.getEphemeralKey();
@@ -280,13 +280,13 @@ public class DerivedKeyTest extends org.
         sigBuilder.setExternalKey(ek, tokenIdentifier);
         sigBuilder.setSignatureAlgorithm(WSConstants.HMAC_SHA1);
         LOG.info("Before HMAC-SHA1 signature");
-        Document signedDoc = sigBuilder.build(doc);
+        sigBuilder.build();
 
         //Derived key signature
         WSSecDKEncrypt encrBuilder = new WSSecDKEncrypt(secHeader);
         encrBuilder.setSymmetricEncAlgorithm(WSConstants.AES_128);
         encrBuilder.setExternalKey(ek, tokenIdentifier);
-        Document signedEncryptedDoc = encrBuilder.build(signedDoc);
+        Document signedEncryptedDoc = encrBuilder.build();
 
         encrKeyBuilder.prependToHeader();
         encrKeyBuilder.prependBSTElementToHeader();
@@ -310,7 +310,7 @@ public class DerivedKeyTest extends org.
         WSSecEncryptedKey encrKeyBuilder = new WSSecEncryptedKey(secHeader);
         encrKeyBuilder.setUserInfo("wss40");
         encrKeyBuilder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER);
-        encrKeyBuilder.prepare(doc, crypto);
+        encrKeyBuilder.prepare(crypto);
 
         //Key information from the EncryptedKey
         byte[] ek = encrKeyBuilder.getEphemeralKey();
@@ -320,14 +320,14 @@ public class DerivedKeyTest extends org.
         WSSecDKEncrypt encrBuilder = new WSSecDKEncrypt(secHeader);
         encrBuilder.setSymmetricEncAlgorithm(WSConstants.AES_128);
         encrBuilder.setExternalKey(ek, tokenIdentifier);
-        encrBuilder.build(doc);
+        encrBuilder.build();
 
         //Derived key signature
         WSSecDKSign sigBuilder = new WSSecDKSign(secHeader);
         sigBuilder.setExternalKey(ek, tokenIdentifier);
         sigBuilder.setSignatureAlgorithm(WSConstants.HMAC_SHA1);
         LOG.info("Before HMAC-SHA1 signature");
-        Document encryptedSignedDoc = sigBuilder.build(doc);
+        Document encryptedSignedDoc = sigBuilder.build();
 
         encrKeyBuilder.prependToHeader();
         encrKeyBuilder.prependBSTElementToHeader();

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptedDataInHeaderTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptedDataInHeaderTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptedDataInHeaderTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptedDataInHeaderTest.java Fri Nov 25 12:31:19 2016
@@ -70,7 +70,7 @@ public class EncryptedDataInHeaderTest e
 
         WSSecTimestamp timestamp = new WSSecTimestamp(secHeader);
         timestamp.setTimeToLive(300);
-        timestamp.build(doc);
+        timestamp.build();
 
         WSSecEncrypt encrypt = new WSSecEncrypt(secHeader);
         encrypt.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
@@ -88,7 +88,7 @@ public class EncryptedDataInHeaderTest e
             );
         encrypt.getParts().add(encP);
 
-        encrypt.prepare(doc, crypto);
+        encrypt.prepare(crypto);
         encrypt.prependToHeader();
 
         // Append Reference List to security header

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionAlgorithmSuiteTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionAlgorithmSuiteTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionAlgorithmSuiteTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionAlgorithmSuiteTest.java Fri Nov 25 12:31:19 2016
@@ -75,7 +75,7 @@ public class EncryptionAlgorithmSuiteTes
         builder.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
         builder.setSymmetricEncAlgorithm(WSConstants.TRIPLE_DES);
 
-        Document encryptedDoc = builder.build(doc, crypto);
+        Document encryptedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -113,7 +113,7 @@ public class EncryptionAlgorithmSuiteTes
         builder.setSymmetricEncAlgorithm(WSConstants.TRIPLE_DES);
         builder.setKeyEncAlgo(WSConstants.KEYTRANSPORT_RSA15);
 
-        Document encryptedDoc = builder.build(doc, wssCrypto);
+        Document encryptedDoc = builder.build(wssCrypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -150,7 +150,7 @@ public class EncryptionAlgorithmSuiteTes
         builder.setSymmetricEncAlgorithm(WSConstants.TRIPLE_DES);
         builder.setKeyEncAlgo(WSConstants.KEYTRANSPORT_RSA15);
 
-        Document encryptedDoc = builder.build(doc, wssCrypto);
+        Document encryptedDoc = builder.build(wssCrypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -192,7 +192,7 @@ public class EncryptionAlgorithmSuiteTes
         builder.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
         builder.setSymmetricEncAlgorithm(WSConstants.AES_128);
 
-        Document encryptedDoc = builder.build(doc, wssCrypto);
+        Document encryptedDoc = builder.build(wssCrypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -231,7 +231,7 @@ public class EncryptionAlgorithmSuiteTes
         builder.setSymmetricKey(key);
         builder.setEncryptSymmKey(false);
 
-        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/message/EncryptionGCMTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionGCMTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionGCMTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionGCMTest.java Fri Nov 25 12:31:19 2016
@@ -89,7 +89,7 @@ public class EncryptionGCMTest extends o
         builder.setUserInfo("wss40");
         builder.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
         builder.setSymmetricEncAlgorithm(WSConstants.AES_128_GCM);
-        Document encryptedDoc = builder.build(doc, crypto);
+        Document encryptedDoc = builder.build(crypto);
 
         String outputString =
             XMLUtils.prettyDocumentToString(encryptedDoc);
@@ -111,7 +111,7 @@ public class EncryptionGCMTest extends o
         builder.setUserInfo("wss40");
         builder.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
         builder.setSymmetricEncAlgorithm(WSConstants.AES_256_GCM);
-        Document encryptedDoc = builder.build(doc, crypto);
+        Document encryptedDoc = builder.build(crypto);
 
         String outputString =
             XMLUtils.prettyDocumentToString(encryptedDoc);
@@ -136,7 +136,7 @@ public class EncryptionGCMTest extends o
         builder.setKeyEncAlgo(WSConstants.KEYTRANSPORT_RSAOAEP_XENC11);
         builder.setDigestAlgorithm(WSConstants.SHA256);
         builder.setMGFAlgorithm(WSConstants.MGF_SHA256);
-        Document encryptedDoc = builder.build(doc, crypto);
+        Document encryptedDoc = builder.build(crypto);
 
         String outputString =
                 XMLUtils.prettyDocumentToString(encryptedDoc);

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionPartsTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionPartsTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionPartsTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionPartsTest.java Fri Nov 25 12:31:19 2016
@@ -109,7 +109,7 @@ public class EncryptionPartsTest extends
                 "");
         encrypt.getParts().add(encP);
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -167,7 +167,7 @@ public class EncryptionPartsTest extends
             );
         encrypt.getParts().add(encP);
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -204,7 +204,7 @@ public class EncryptionPartsTest extends
             );
         encrypt.getParts().add(encP);
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -241,7 +241,7 @@ public class EncryptionPartsTest extends
         encrypt.getParts().add(encP);
 
         try {
-            encrypt.build(doc, crypto);
+            encrypt.build(crypto);
             fail("Failure expected on not encrypting a required element");
         } catch (WSSecurityException ex) {
             assertTrue(ex.getErrorCode() == WSSecurityException.ErrorCode.FAILURE);
@@ -270,7 +270,7 @@ public class EncryptionPartsTest extends
                 "Header");
         encrypt.getParts().add(encP);
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         String outputString =
             XMLUtils.prettyDocumentToString(encryptedDoc);
@@ -318,7 +318,7 @@ public class EncryptionPartsTest extends
                 "Header");
         encrypt.getParts().add(encP);
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         String outputString =
             XMLUtils.prettyDocumentToString(encryptedDoc);
@@ -366,7 +366,7 @@ public class EncryptionPartsTest extends
         encrypt.getParts().add(encP);
 
         try {
-            encrypt.build(doc, crypto);
+            encrypt.build(crypto);
             fail("Failure expected on a bad localname");
         } catch (WSSecurityException ex) {
             assertTrue(ex.getErrorCode() == WSSecurityException.ErrorCode.FAILURE);
@@ -395,7 +395,7 @@ public class EncryptionPartsTest extends
         encrypt.getParts().add(encP);
 
         try {
-            encrypt.build(doc, crypto);
+            encrypt.build(crypto);
             fail("Failure expected on a bad namespace");
         } catch (WSSecurityException ex) {
             assertTrue(ex.getErrorCode() == WSSecurityException.ErrorCode.FAILURE);
@@ -432,7 +432,7 @@ public class EncryptionPartsTest extends
                 "");
         encrypt.getParts().add(encP2);
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -499,7 +499,7 @@ public class EncryptionPartsTest extends
         encP.setElement(bodyElement);
         encrypt.getParts().add(encP);
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         String outputString =
             XMLUtils.prettyDocumentToString(encryptedDoc);
@@ -542,7 +542,7 @@ public class EncryptionPartsTest extends
                 "");
         encrypt.getParts().add(encP);
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         String outputString =
             XMLUtils.prettyDocumentToString(encryptedDoc);

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionTest.java Fri Nov 25 12:31:19 2016
@@ -120,7 +120,7 @@ public class EncryptionTest extends org.
         builder.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
         builder.setSymmetricEncAlgorithm(WSConstants.TRIPLE_DES);
         LOG.info("Before Encryption Triple DES....");
-        Document encryptedDoc = builder.build(doc, crypto);
+        Document encryptedDoc = builder.build(crypto);
         LOG.info("After Encryption Triple DES....");
 
         String outputString =
@@ -156,7 +156,7 @@ public class EncryptionTest extends org.
         builder.getParts().add(encP);
 
         LOG.info("Before Encryption AES 128/RSA-15....");
-        encryptedDoc = builder.build(doc, crypto);
+        encryptedDoc = builder.build(crypto);
         LOG.info("After Encryption AES 128/RSA-15....");
         outputString =
             XMLUtils.prettyDocumentToString(encryptedDoc);
@@ -203,7 +203,7 @@ public class EncryptionTest extends org.
         builder.setKeyEncAlgo(WSConstants.KEYTRANSPORT_RSAOAEP);
 
         LOG.info("Before Encryption Triple DES/RSA-OAEP....");
-        Document encryptedDoc = builder.build(doc, crypto);
+        Document encryptedDoc = builder.build(crypto);
         LOG.info("After Encryption Triple DES/RSA-OAEP....");
 
         String outputString =
@@ -243,7 +243,7 @@ public class EncryptionTest extends org.
         assertNotNull(certs);
         builder.setUseThisPublicKey(certs[0].getPublicKey());
         
-        Document encryptedDoc = builder.build(doc, crypto);
+        Document encryptedDoc = builder.build(crypto);
 
         String outputString =
             XMLUtils.prettyDocumentToString(encryptedDoc);
@@ -280,7 +280,7 @@ public class EncryptionTest extends org.
         encrypt.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e");
         LOG.info("Before Encryption....");
 
-        Document encryptedDoc = encrypt.build(doc, encCrypto);
+        Document encryptedDoc = encrypt.build(encCrypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("After the first encryption:");
@@ -289,7 +289,7 @@ public class EncryptionTest extends org.
             LOG.debug(outputString);
         }
 
-        Document encryptedEncryptedDoc = encrypt.build(encryptedDoc, encCrypto);
+        Document encryptedEncryptedDoc = encrypt.build(encCrypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("After the second encryption:");
@@ -321,7 +321,7 @@ public class EncryptionTest extends org.
         builder.setKeyIdentifierType(WSConstants.THUMBPRINT_IDENTIFIER);
 
         LOG.info("Before Encrypting ThumbprintSHA1....");
-        Document encryptedDoc = builder.build(doc, encCrypto);
+        Document encryptedDoc = builder.build(encCrypto);
 
         String outputString =
             XMLUtils.prettyDocumentToString(encryptedDoc);
@@ -362,7 +362,7 @@ public class EncryptionTest extends org.
         builder.setKeyIdentifierType(WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER);
 
         LOG.info("Before Encrypting EncryptedKeySHA1....");
-        Document encryptedDoc = builder.build(doc, encCrypto);
+        Document encryptedDoc = builder.build(encCrypto);
 
         String outputString =
             XMLUtils.prettyDocumentToString(encryptedDoc);
@@ -394,7 +394,7 @@ public class EncryptionTest extends org.
         builder.setEncryptSymmKey(false);
 
         LOG.info("Before Encrypting EncryptedKeySHA1....");
-        Document encryptedDoc = builder.build(doc, crypto);
+        Document encryptedDoc = builder.build(crypto);
 
         byte[] encodedBytes = KeyUtils.generateDigest(keyData);
         String identifier = Base64.getMimeEncoder().encodeToString(encodedBytes);
@@ -430,7 +430,7 @@ public class EncryptionTest extends org.
         builder.setEncryptSymmKey(false);
 
         LOG.info("Before Encrypting EncryptedKeySHA1....");
-        Document encryptedDoc = builder.build(doc, crypto);
+        Document encryptedDoc = builder.build(crypto);
 
         byte[] encodedBytes = KeyUtils.generateDigest(keyData);
         String identifier = Base64.getMimeEncoder().encodeToString(encodedBytes);
@@ -514,7 +514,7 @@ public class EncryptionTest extends org.
         /*
          * 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
@@ -583,7 +583,7 @@ public class EncryptionTest extends org.
         /*
          * 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
@@ -652,7 +652,7 @@ public class EncryptionTest extends org.
         builder.setUserInfo("wss40");
         builder.setKeyIdentifierType(WSConstants.SKI_KEY_IDENTIFIER);
         builder.setSymmetricEncAlgorithm(WSConstants.AES_128);
-        builder.prepare(doc, crypto);
+        builder.prepare(crypto);
         builder.setEmbedEncryptedKey(true);
 
         SOAPConstants soapConstants = WSSecurityUtil.getSOAPConstants(doc
@@ -694,7 +694,7 @@ public class EncryptionTest extends org.
         builder.setDigestAlgorithm(WSConstants.SHA256);
 
         LOG.info("Before Encryption Triple DES/RSA-OAEP....");
-        Document encryptedDoc = builder.build(doc, crypto);
+        Document encryptedDoc = builder.build(crypto);
         LOG.info("After Encryption Triple DES/RSA-OAEP....");
 
         String outputString =
@@ -728,7 +728,7 @@ public class EncryptionTest extends org.
         LOG.info("Before Encryption Triple DES/RSA-OAEP....");
 
         Crypto regexpCrypto = CryptoFactory.getInstance("regexp.properties");
-        Document encryptedDoc = builder.build(doc, regexpCrypto);
+        Document encryptedDoc = builder.build(regexpCrypto);
         LOG.info("After Encryption Triple DES/RSA-OAEP....");
 
         String outputString =

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/ModifiedRequestTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/ModifiedRequestTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/ModifiedRequestTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/ModifiedRequestTest.java Fri Nov 25 12:31:19 2016
@@ -110,7 +110,7 @@ public class ModifiedRequestTest extends
                 "");
         builder.getParts().add(encP);
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         //
         // Replace the signed element with a modified element, and move the original
@@ -165,7 +165,7 @@ public class ModifiedRequestTest extends
                 "");
         builder.getParts().add(encP);
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         //
         // Replace the signed element with a modified element, and move the original
@@ -240,8 +240,7 @@ public class ModifiedRequestTest extends
 
         Document signedDoc =
             wsSign.build(
-                doc, null, samlAssertion, crypto, "16c73ab6-b892-458f-abf5-2f875f74882e",
-                "security"
+                 null, samlAssertion, crypto, "16c73ab6-b892-458f-abf5-2f875f74882e", "security"
             );
         Element assertionElement = (Element) samlAssertion.getElement().cloneNode(true);
         assertionElement.removeChild(assertionElement.getFirstChild());
@@ -275,7 +274,7 @@ public class ModifiedRequestTest extends
 
         WSSecUsernameToken usernameToken = new WSSecUsernameToken(secHeader);
         usernameToken.setUserInfo("wss86", "security");
-        Document createdDoc = usernameToken.build(doc);
+        usernameToken.build();
 
         WSSecSignature builder = new WSSecSignature(secHeader);
         builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
@@ -287,7 +286,7 @@ public class ModifiedRequestTest extends
                 "");
         builder.getParts().add(encP);
 
-        builder.prepare(createdDoc, crypto);
+        builder.prepare(crypto);
 
         List<javax.xml.crypto.dsig.Reference> referenceList =
             builder.addReferencesToSign(builder.getParts());
@@ -330,7 +329,7 @@ public class ModifiedRequestTest extends
         builder.setSymmetricEncAlgorithm(WSConstants.TRIPLE_DES);
 
         Crypto wssCrypto = CryptoFactory.getInstance("wss40.properties");
-        Document encryptedDoc = builder.build(doc, wssCrypto);
+        Document encryptedDoc = builder.build(wssCrypto);
 
         Element body = WSSecurityUtil.findBodyElement(doc);
         Element encryptionMethod =
@@ -367,7 +366,7 @@ public class ModifiedRequestTest extends
         builder.setSymmetricEncAlgorithm(WSConstants.TRIPLE_DES);
 
         Crypto wssCrypto = CryptoFactory.getInstance("wss40.properties");
-        Document encryptedDoc = builder.build(doc, wssCrypto);
+        Document encryptedDoc = builder.build(wssCrypto);
 
         Element body = WSSecurityUtil.findBodyElement(doc);
         Element cipherValue =
@@ -419,7 +418,7 @@ public class ModifiedRequestTest extends
 
         WSSecTimestamp timestamp = new WSSecTimestamp(secHeader);
         timestamp.setTimeToLive(300);
-        timestamp.build(doc);
+        timestamp.build();
 
         WSEncryptionPart encP =
             new WSEncryptionPart(
@@ -428,7 +427,7 @@ public class ModifiedRequestTest extends
                 "");
         builder.getParts().add(encP);
 
-        Document encryptedDoc = builder.build(doc, wssCrypto);
+        Document encryptedDoc = builder.build(wssCrypto);
 
         Element securityHeader =
             WSSecurityUtil.getSecurityHeader(encryptedDoc, "");
@@ -479,7 +478,7 @@ public class ModifiedRequestTest extends
         builder.setSymmetricEncAlgorithm(WSConstants.TRIPLE_DES);
 
         Crypto wssCrypto = CryptoFactory.getInstance("wss40.properties");
-        Document encryptedDoc = builder.build(doc, wssCrypto);
+        Document encryptedDoc = builder.build(wssCrypto);
 
         Element encryptedKey =
             XMLUtils.findElement(doc.getDocumentElement(), "EncryptedKey", WSConstants.ENC_NS);
@@ -529,7 +528,7 @@ public class ModifiedRequestTest extends
 
         WSSecTimestamp timestamp = new WSSecTimestamp(secHeader);
         timestamp.setTimeToLive(300);
-        Document createdDoc = timestamp.build(doc);
+        timestamp.build();
 
         WSEncryptionPart encP =
             new WSEncryptionPart(
@@ -538,7 +537,7 @@ public class ModifiedRequestTest extends
                 "");
         builder.getParts().add(encP);
 
-        Document signedDoc = builder.build(createdDoc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         // Modify the Created text of the Timestamp element
         Element timestampElement = timestamp.getElement();
@@ -581,7 +580,7 @@ public class ModifiedRequestTest extends
         builder.setUserInfo("wss40", "security");
 
         Crypto wss40Crypto = CryptoFactory.getInstance("wss40.properties");
-        Document signedDoc = builder.build(doc, wss40Crypto);
+        Document signedDoc = builder.build(wss40Crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -609,7 +608,7 @@ public class ModifiedRequestTest extends
         WSSecSignature builder = new WSSecSignature(secHeader);
         builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         // Modify the Signature element
         Element signatureElement = builder.getSignatureElement();

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/NoSoapPrefixSignatureTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/NoSoapPrefixSignatureTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/NoSoapPrefixSignatureTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/NoSoapPrefixSignatureTest.java Fri Nov 25 12:31:19 2016
@@ -64,7 +64,7 @@ public class NoSoapPrefixSignatureTest e
         sign.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "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/PasswordEncryptorTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/PasswordEncryptorTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/PasswordEncryptorTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/PasswordEncryptorTest.java Fri Nov 25 12:31:19 2016
@@ -92,7 +92,7 @@ public class PasswordEncryptorTest exten
         builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
         builder.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -143,7 +143,7 @@ public class PasswordEncryptorTest exten
         builder.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
         builder.setKeyEncAlgo(WSConstants.KEYTRANSPORT_RSAOAEP);
 
-        Document encryptedDoc = builder.build(doc, crypto);
+        Document encryptedDoc = builder.build(crypto);
 
         String outputString =
             XMLUtils.prettyDocumentToString(encryptedDoc);

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/PasswordTypeTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/PasswordTypeTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/PasswordTypeTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/PasswordTypeTest.java Fri Nov 25 12:31:19 2016
@@ -62,7 +62,7 @@ public class PasswordTypeTest extends or
         
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setUserInfo("wernerd", "verySecret");
-        Document signedDoc = builder.build(doc);
+        Document signedDoc = builder.build();
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Message with UserNameToken PW Digest:");
@@ -115,7 +115,7 @@ public class PasswordTypeTest extends or
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setPasswordType(WSConstants.PASSWORD_TEXT);
         builder.setUserInfo("wernerd", "verySecret");
-        Document signedDoc = builder.build(doc);
+        Document signedDoc = builder.build();
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Message with UserNameToken PW Text:");

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/ReplayTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/ReplayTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/ReplayTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/ReplayTest.java Fri Nov 25 12:31:19 2016
@@ -79,7 +79,7 @@ public class ReplayTest extends org.juni
 
         WSSecTimestamp timestamp = new WSSecTimestamp(secHeader);
         timestamp.setTimeToLive(300);
-        Document createdDoc = timestamp.build(doc);
+        Document createdDoc = timestamp.build();
 
         WSSecSignature builder = new WSSecSignature(secHeader);
         builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
@@ -90,7 +90,7 @@ public class ReplayTest extends org.juni
                 "Timestamp", WSConstants.WSU_NS, "");
         builder.getParts().add(encP);
 
-        builder.prepare(createdDoc, crypto);
+        builder.prepare(crypto);
 
         List<javax.xml.crypto.dsig.Reference> referenceList =
             builder.addReferencesToSign(builder.getParts());
@@ -130,7 +130,7 @@ public class ReplayTest extends org.juni
 
         WSSecTimestamp timestamp = new WSSecTimestamp(secHeader);
         timestamp.setTimeToLive(300);
-        Document createdDoc = timestamp.build(doc);
+        Document createdDoc = timestamp.build();
 
         WSSecSignature builder = new WSSecSignature(secHeader);
         builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
@@ -141,7 +141,7 @@ public class ReplayTest extends org.juni
                 "Timestamp", WSConstants.WSU_NS, "");
         builder.getParts().add(encP);
 
-        builder.prepare(createdDoc, crypto);
+        builder.prepare(crypto);
 
         List<javax.xml.crypto.dsig.Reference> referenceList =
             builder.addReferencesToSign(builder.getParts());
@@ -184,7 +184,7 @@ public class ReplayTest extends org.juni
 
         WSSecTimestamp timestamp = new WSSecTimestamp(secHeader);
         timestamp.setTimeToLive(300);
-        Document createdDoc = timestamp.build(doc);
+        Document createdDoc = timestamp.build();
 
         WSSecSignature builder = new WSSecSignature(secHeader);
         builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
@@ -195,7 +195,7 @@ public class ReplayTest extends org.juni
                 "Timestamp", WSConstants.WSU_NS, "");
         builder.getParts().add(encP);
 
-        builder.build(createdDoc, crypto);
+        builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -230,7 +230,7 @@ public class ReplayTest extends org.juni
 
         WSSecTimestamp timestamp = new WSSecTimestamp(secHeader);
         timestamp.setTimeToLive(300);
-        Document createdDoc = timestamp.build(doc);
+        Document createdDoc = timestamp.build();
 
         WSSecSignature builder = new WSSecSignature(secHeader);
         builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
@@ -241,7 +241,7 @@ public class ReplayTest extends org.juni
                 "Timestamp", WSConstants.WSU_NS, "");
         builder.getParts().add(encP);
 
-        builder.build(createdDoc, crypto);
+        builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -279,7 +279,7 @@ public class ReplayTest extends org.juni
 
         WSSecTimestamp timestamp = new WSSecTimestamp(secHeader);
         timestamp.setTimeToLive(0);
-        Document createdDoc = timestamp.build(doc);
+        Document createdDoc = timestamp.build();
 
         WSSecSignature builder = new WSSecSignature(secHeader);
         builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
@@ -290,7 +290,7 @@ public class ReplayTest extends org.juni
                 "Timestamp", WSConstants.WSU_NS, "");
         builder.getParts().add(encP);
 
-        builder.prepare(createdDoc, crypto);
+        builder.prepare(crypto);
 
         List<javax.xml.crypto.dsig.Reference> referenceList =
             builder.addReferencesToSign(builder.getParts());
@@ -330,7 +330,7 @@ public class ReplayTest extends org.juni
 
         WSSecTimestamp timestamp = new WSSecTimestamp(secHeader);
         timestamp.setTimeToLive(0);
-        Document createdDoc = timestamp.build(doc);
+        Document createdDoc = timestamp.build();
 
         WSSecSignature builder = new WSSecSignature(secHeader);
         builder.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
@@ -341,7 +341,7 @@ public class ReplayTest extends org.juni
                 "Timestamp", WSConstants.WSU_NS, "");
         builder.getParts().add(encP);
 
-        builder.prepare(createdDoc, crypto);
+        builder.prepare(crypto);
 
         List<javax.xml.crypto.dsig.Reference> referenceList =
             builder.addReferencesToSign(builder.getParts());
@@ -384,7 +384,7 @@ public class ReplayTest extends org.juni
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setUserInfo("wernerd", "verySecret");
 
-        Document signedDoc = builder.build(doc);
+        Document signedDoc = builder.build();
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -419,7 +419,7 @@ public class ReplayTest extends org.juni
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setUserInfo("wernerd", "verySecret");
 
-        Document signedDoc = builder.build(doc);
+        Document signedDoc = builder.build();
 
         if (LOG.isDebugEnabled()) {
             String outputString =
@@ -476,7 +476,7 @@ public class ReplayTest extends org.juni
 
         WSSecSAMLToken wsSign = new WSSecSAMLToken(secHeader);
 
-        Document unsignedDoc = wsSign.build(doc, samlAssertion);
+        Document unsignedDoc = wsSign.build(samlAssertion);
 
         if (LOG.isDebugEnabled()) {
             String outputString = XMLUtils.prettyDocumentToString(unsignedDoc);
@@ -531,7 +531,7 @@ public class ReplayTest extends org.juni
 
         WSSecSAMLToken wsSign = new WSSecSAMLToken(secHeader);
 
-        Document unsignedDoc = wsSign.build(doc, samlAssertion);
+        Document unsignedDoc = wsSign.build(samlAssertion);
 
         String outputString =
             XMLUtils.prettyDocumentToString(unsignedDoc);

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/RequireSignedEncryptedDataElementsTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/RequireSignedEncryptedDataElementsTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/RequireSignedEncryptedDataElementsTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/RequireSignedEncryptedDataElementsTest.java Fri Nov 25 12:31:19 2016
@@ -297,7 +297,7 @@ public class RequireSignedEncryptedDataE
         sign.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
         LOG.info("Before Encryption....");
 
-        Document encryptedDoc = encrypt.build(doc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Encryption....");
@@ -306,7 +306,7 @@ public class RequireSignedEncryptedDataE
             LOG.debug(outputString);
         }
 
-        Document encryptedSignedDoc = sign.build(encryptedDoc, crypto);
+        Document encryptedSignedDoc = sign.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Signing....");
@@ -328,7 +328,7 @@ public class RequireSignedEncryptedDataE
         sign.setUserInfo("16c73ab6-b892-458f-abf5-2f875f74882e", "security");
         LOG.info("Before Encryption....");
 
-        Document signedDoc = sign.build(doc, crypto);
+        Document signedDoc = sign.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Signing....");
@@ -337,7 +337,7 @@ public class RequireSignedEncryptedDataE
             LOG.debug(outputString);
         }
 
-        Document encryptedDoc = encrypt.build(signedDoc, crypto);
+        Document encryptedDoc = encrypt.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("After Encryption....");

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SKISignatureTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SKISignatureTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SKISignatureTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SKISignatureTest.java Fri Nov 25 12:31:19 2016
@@ -73,7 +73,7 @@ public class SKISignatureTest extends or
 
         LOG.info("Before SigningDSA_SKIDirect....");
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message with DSA_SKI key identifier:");
@@ -116,7 +116,7 @@ public class SKISignatureTest extends or
 
         LOG.info("Before SigningDSA_Autodetect....");
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message with DSA_Autodetect:");
@@ -150,7 +150,7 @@ public class SKISignatureTest extends or
 
         LOG.info("Before SigningRSA_Autodetect....");
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message with RSA Autodetect:");

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/STRSignatureTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/STRSignatureTest.java?rev=1771308&r1=1771307&r2=1771308&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/STRSignatureTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/STRSignatureTest.java Fri Nov 25 12:31:19 2016
@@ -93,7 +93,7 @@ public class STRSignatureTest extends or
 
         LOG.info("Before Signing STR DirectReference....");
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message with STR DirectReference key identifier:");
@@ -139,13 +139,13 @@ public class STRSignatureTest extends or
 
         WSSecTimestamp timestamp = new WSSecTimestamp(secHeader);
         timestamp.setTimeToLive(600);
-        timestamp.build(doc);
+        timestamp.build();
         builder.getParts().add(new WSEncryptionPart(timestamp.getId()));
 
         builder.setKeyIdentifierType(WSConstants.BST_DIRECT_REFERENCE);
 
         LOG.info("Before Signing STR DirectReference....");
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message with STR DirectReference key identifier:");
@@ -198,7 +198,7 @@ public class STRSignatureTest extends or
 
         LOG.info("Before Signing STR IS....");
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message with STR IssuerSerial key identifier:");
@@ -250,7 +250,7 @@ public class STRSignatureTest extends or
 
         LOG.info("Before Signing STR SKI....");
 
-        Document signedDoc = builder.build(doc, crypto);
+        Document signedDoc = builder.build(crypto);
 
         if (LOG.isDebugEnabled()) {
             LOG.debug("Signed message with STR SKI key identifier:");