ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1829349 [1/2] - in /webservices/wss4j/trunk: integration/src/test/java/org/apache/wss4j/integration/test/kerberos/ parent/ ws-security-common/src/main/java/org/apache/wss4j/common/saml/ ws-security-common/src/main/java/org/apache/wss4j/com...
Date Tue, 17 Apr 2018 09:36:54 GMT
Author: coheigea
Date: Tue Apr 17 09:36:53 2018
New Revision: 1829349

URL: http://svn.apache.org/viewvc?rev=1829349&view=rev
Log:
WSS-625 - Switch to avoiding newlines in Base-64 content by default

Modified:
    webservices/wss4j/trunk/integration/src/test/java/org/apache/wss4j/integration/test/kerberos/KerberosTest.java
    webservices/wss4j/trunk/parent/pom.xml
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/BinarySecurity.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/SecurityTokenReference.java
    webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/SKITest.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecDerivedKeyBase.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncrypt.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignature.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecUsernameToken.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/DerivedKeyToken.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SignatureConfirmation.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/UsernameTokenProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSSAMLKeyInfoProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SignatureSTRParser.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/transform/STRTransformUtil.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/EncryptionUtils.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/UsernameTokenValidator.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/SecretKeyCallbackHandler.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/SecurityTestUtil.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CryptoProviderTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SecurityActionTokenTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionAlgorithmSuiteTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureAlgorithmSuiteTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SymmetricSignatureTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/UTDerivedKeyTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/UsernameTokenTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/token/BSTKerberosTest.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/BinarySecurityTokenOutputProcessor.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/DerivedKeyTokenOutputProcessor.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptedKeyOutputProcessor.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SignatureConfirmationOutputProcessor.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/UsernameTokenOutputProcessor.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureOutputProcessor.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SecurityTokenFactoryImpl.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/utils/WSSUtils.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/BinarySecurityTokenValidatorImpl.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/JAASUsernameTokenValidatorImpl.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/UsernameTokenValidatorImpl.java
    webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/EncDecryptionTest.java
    webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/ReplayTest.java
    webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/UsernameTokenTest.java
    webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/utils/SecretKeyCallbackHandler.java

Modified: webservices/wss4j/trunk/integration/src/test/java/org/apache/wss4j/integration/test/kerberos/KerberosTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/integration/src/test/java/org/apache/wss4j/integration/test/kerberos/KerberosTest.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/integration/src/test/java/org/apache/wss4j/integration/test/kerberos/KerberosTest.java (original)
+++ webservices/wss4j/trunk/integration/src/test/java/org/apache/wss4j/integration/test/kerberos/KerberosTest.java Tue Apr 17 09:36:53 2018
@@ -25,7 +25,6 @@ import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 import java.security.Principal;
 import java.util.ArrayList;
-import java.util.Base64;
 import java.util.List;
 
 import javax.crypto.SecretKey;
@@ -409,7 +408,7 @@ public class KerberosTest {
         sign.setSecretKey(keyData);
 
         byte[] digestBytes = KeyUtils.generateDigest(bst.getToken());
-        sign.setCustomTokenId(Base64.getMimeEncoder().encodeToString(digestBytes));
+        sign.setCustomTokenId(org.apache.xml.security.utils.XMLUtils.encodeToString(digestBytes));
 
         Document signedDoc = sign.build(null);
 
@@ -633,7 +632,7 @@ public class KerberosTest {
         builder.setCustomReferenceValue(WSConstants.WSS_KRB_KI_VALUE_TYPE);
 
         byte[] digestBytes = KeyUtils.generateDigest(bst.getToken());
-        builder.setEncKeyId(Base64.getMimeEncoder().encodeToString(digestBytes));
+        builder.setEncKeyId(org.apache.xml.security.utils.XMLUtils.encodeToString(digestBytes));
 
         Document encryptedDoc = builder.build(null);
 
@@ -882,7 +881,7 @@ public class KerberosTest {
             sign.setSecretKey(keyData);
 
             byte[] digestBytes = KeyUtils.generateDigest(bst.getToken());
-            sign.setCustomTokenId(Base64.getMimeEncoder().encodeToString(digestBytes));
+            sign.setCustomTokenId(org.apache.xml.security.utils.XMLUtils.encodeToString(digestBytes));
 
             sign.build(null);
 
@@ -1144,7 +1143,7 @@ public class KerberosTest {
             builder.setCustomReferenceValue(WSConstants.WSS_KRB_KI_VALUE_TYPE);
 
             byte[] digestBytes = KeyUtils.generateDigest(bst.getToken());
-            builder.setEncKeyId(Base64.getMimeEncoder().encodeToString(digestBytes));
+            builder.setEncKeyId(org.apache.xml.security.utils.XMLUtils.encodeToString(digestBytes));
 
             builder.build(null);
 

Modified: webservices/wss4j/trunk/parent/pom.xml
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/parent/pom.xml?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/parent/pom.xml (original)
+++ webservices/wss4j/trunk/parent/pom.xml Tue Apr 17 09:36:53 2018
@@ -48,7 +48,7 @@
         <wsdl4j.version>1.6.3</wsdl4j.version>
         <xalan.version>2.7.2</xalan.version>
         <xz.version>1.8</xz.version>
-        <xmlsec.version>2.1.1</xmlsec.version>
+        <xmlsec.version>2.1.2-SNAPSHOT</xmlsec.version>
         <xmlunit.version>1.6</xmlunit.version>
         
         <!-- OSGi related properties -->

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/saml/SamlAssertionWrapper.java Tue Apr 17 09:36:53 2018
@@ -23,7 +23,6 @@ import java.security.PrivateKey;
 import java.security.cert.X509Certificate;
 import java.time.Instant;
 import java.util.ArrayList;
-import java.util.Base64;
 import java.util.List;
 
 import javax.security.auth.callback.CallbackHandler;
@@ -783,7 +782,7 @@ public class SamlAssertionWrapper {
                     XMLUtils.getNextElement(signedInfoElem.getNextSibling());
                 if (signatureValueElement != null) {
                     String base64Input = XMLUtils.getFullTextChildrenFromElement(signatureValueElement);
-                    return Base64.getMimeDecoder().decode(base64Input);
+                    return XMLUtils.decode(base64Input);
                 }
             }
         }

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/BinarySecurity.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/BinarySecurity.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/BinarySecurity.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/BinarySecurity.java Tue Apr 17 09:36:53 2018
@@ -22,7 +22,6 @@ package org.apache.wss4j.common.token;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.util.Arrays;
-import java.util.Base64;
 import java.util.UUID;
 
 import org.apache.wss4j.common.WSS4JConstants;
@@ -200,7 +199,7 @@ public class BinarySecurity {
             return null;
         }
 
-        return Base64.getMimeDecoder().decode(text);
+        return org.apache.xml.security.utils.XMLUtils.decode(text);
     }
 
     /**
@@ -237,7 +236,7 @@ public class BinarySecurity {
             }
         } else {
             Text node = getFirstNode();
-            node.setData(Base64.getMimeEncoder().encodeToString(data));
+            node.setData(org.apache.xml.security.utils.XMLUtils.encodeToString(data));
             setRawToken(data);
         }
     }
@@ -257,7 +256,7 @@ public class BinarySecurity {
             throw new IllegalArgumentException("data == null");
         }
         Text node = getFirstNode();
-        node.setData(Base64.getMimeEncoder().encodeToString(data));
+        node.setData(org.apache.xml.security.utils.XMLUtils.encodeToString(data));
     }
 
     /**

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/SecurityTokenReference.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/SecurityTokenReference.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/SecurityTokenReference.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/token/SecurityTokenReference.java Tue Apr 17 09:36:53 2018
@@ -23,7 +23,6 @@ import java.math.BigInteger;
 import java.security.cert.CertificateEncodingException;
 import java.security.cert.X509Certificate;
 import java.util.Arrays;
-import java.util.Base64;
 
 import javax.xml.namespace.QName;
 
@@ -191,7 +190,7 @@ public class SecurityTokenReference {
                 WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE, e, "encodeError"
             );
         }
-        Text text = doc.createTextNode(Base64.getMimeEncoder().encodeToString(data));
+        Text text = doc.createTextNode(org.apache.xml.security.utils.XMLUtils.encodeToString(data));
 
         createKeyIdentifier(doc, X509_V3_TYPE, text, true);
     }
@@ -224,7 +223,7 @@ public class SecurityTokenReference {
         }
         byte[] data = skiCrypto.getSKIBytesFromCert(cert);
 
-        Text text = doc.createTextNode(Base64.getMimeEncoder().encodeToString(data));
+        Text text = doc.createTextNode(org.apache.xml.security.utils.XMLUtils.encodeToString(data));
         createKeyIdentifier(doc, SKI_URI, text, true);
     }
 
@@ -250,7 +249,7 @@ public class SecurityTokenReference {
         }
         try {
             byte[] encodedBytes = KeyUtils.generateDigest(encodedCert);
-            Text text = doc.createTextNode(Base64.getMimeEncoder().encodeToString(encodedBytes));
+            Text text = doc.createTextNode(org.apache.xml.security.utils.XMLUtils.encodeToString(encodedBytes));
             createKeyIdentifier(doc, THUMB_URI, text, true);
         } catch (WSSecurityException e1) {
             throw new WSSecurityException(
@@ -334,7 +333,7 @@ public class SecurityTokenReference {
         } else if (THUMB_URI.equals(value)) {
             String text = XMLUtils.getElementText(getFirstElement());
             if (text != null) {
-                byte[] thumb = Base64.getMimeDecoder().decode(text);
+                byte[] thumb = org.apache.xml.security.utils.XMLUtils.decode(text);
 
                 CryptoType cryptoType = new CryptoType(CryptoType.TYPE.THUMBPRINT_SHA1);
                 cryptoType.setBytes(thumb);
@@ -397,7 +396,7 @@ public class SecurityTokenReference {
         }
         String text = XMLUtils.getElementText(getFirstElement());
         if (text != null) {
-            skiBytes = Base64.getMimeDecoder().decode(text);
+            skiBytes = org.apache.xml.security.utils.XMLUtils.decode(text);
         }
         return skiBytes;
     }

Modified: webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/SKITest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/SKITest.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/SKITest.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/SKITest.java Tue Apr 17 09:36:53 2018
@@ -23,7 +23,6 @@ import java.io.InputStream;
 import java.security.KeyStore;
 import java.security.Security;
 import java.security.cert.X509Certificate;
-import java.util.Base64;
 
 import org.apache.wss4j.common.util.Loader;
 import org.bouncycastle.jce.provider.BouncyCastleProvider;
@@ -56,7 +55,7 @@ public class SKITest extends org.junit.A
 
         byte[] skiBytes = crypto.getSKIBytesFromCert(certs[0]);
         String knownBase64Encoding = "VPWiTCLlm0OwNWTwrnRTUF3qcIk=";
-        assertTrue(knownBase64Encoding.equals(Base64.getMimeEncoder().encodeToString(skiBytes)));
+        assertTrue(knownBase64Encoding.equals(org.apache.xml.security.utils.XMLUtils.encodeToString(skiBytes)));
     }
 
     @Test
@@ -77,7 +76,7 @@ public class SKITest extends org.junit.A
 
         byte[] skiBytes = crypto.getSKIBytesFromCert(certs[0]);
         String knownBase64Encoding = "tgkZUMZ461ZSA1nZkBu6E5GDxLM=";
-        assertTrue(knownBase64Encoding.equals(Base64.getMimeEncoder().encodeToString(skiBytes)));
+        assertTrue(knownBase64Encoding.equals(org.apache.xml.security.utils.XMLUtils.encodeToString(skiBytes)));
     }
 
     @Test

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecDerivedKeyBase.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecDerivedKeyBase.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecDerivedKeyBase.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecDerivedKeyBase.java Tue Apr 17 09:36:53 2018
@@ -21,7 +21,6 @@ package org.apache.wss4j.dom.message;
 
 import java.nio.charset.StandardCharsets;
 import java.security.cert.X509Certificate;
-import java.util.Base64;
 
 import javax.crypto.SecretKey;
 
@@ -38,6 +37,7 @@ import org.apache.wss4j.dom.WSConstants;
 import org.apache.wss4j.dom.message.token.DerivedKeyToken;
 import org.apache.wss4j.dom.message.token.KerberosSecurity;
 import org.apache.wss4j.dom.util.WSSecurityUtil;
+import org.apache.xml.security.utils.XMLUtils;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
@@ -223,7 +223,7 @@ public abstract class WSSecDerivedKeyBas
 
         dkt.setOffset(offset);
         dkt.setLength(length);
-        dkt.setNonce(Base64.getMimeEncoder().encodeToString(nonce));
+        dkt.setNonce(XMLUtils.encodeToString(nonce));
         dkt.setID(dktId);
 
         if (strElem == null) {

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncrypt.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncrypt.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncrypt.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncrypt.java Tue Apr 17 09:36:53 2018
@@ -21,7 +21,6 @@ package org.apache.wss4j.dom.message;
 
 import java.security.cert.X509Certificate;
 import java.util.ArrayList;
-import java.util.Base64;
 import java.util.List;
 
 import javax.crypto.KeyGenerator;
@@ -322,7 +321,7 @@ public class WSSecEncrypt extends WSSecE
                 secToken.setKeyIdentifierEncKeySHA1(customReferenceValue);
             } else {
                 byte[] encodedBytes = KeyUtils.generateDigest(encryptedEphemeralKey);
-                secToken.setKeyIdentifierEncKeySHA1(Base64.getMimeEncoder().encodeToString(encodedBytes));
+                secToken.setKeyIdentifierEncKeySHA1(org.apache.xml.security.utils.XMLUtils.encodeToString(encodedBytes));
             }
             secToken.addTokenType(WSConstants.WSS_ENC_KEY_VALUE_TYPE);
             keyInfo.addUnknownElement(secToken.getElement());
@@ -376,7 +375,7 @@ public class WSSecEncrypt extends WSSecE
                 secToken.setKeyIdentifierEncKeySHA1(customReferenceValue);
             } else {
                 byte[] encodedBytes = KeyUtils.generateDigest(encryptedEphemeralKey);
-                secToken.setKeyIdentifierEncKeySHA1(Base64.getMimeEncoder().encodeToString(encodedBytes));
+                secToken.setKeyIdentifierEncKeySHA1(org.apache.xml.security.utils.XMLUtils.encodeToString(encodedBytes));
             }
             secToken.addTokenType(WSConstants.WSS_ENC_KEY_VALUE_TYPE);
             keyInfo.addUnknownElement(secToken.getElement());

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignature.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignature.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignature.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignature.java Tue Apr 17 09:36:53 2018
@@ -24,7 +24,6 @@ import java.security.Provider;
 import java.security.cert.CertificateEncodingException;
 import java.security.cert.X509Certificate;
 import java.util.ArrayList;
-import java.util.Base64;
 import java.util.Collections;
 import java.util.List;
 
@@ -256,7 +255,7 @@ public class WSSecSignature extends WSSe
                     secRef.setKeyIdentifierEncKeySHA1(encrKeySha1value);
                 } else {
                     byte[] digestBytes = KeyUtils.generateDigest(secretKey);
-                    secRef.setKeyIdentifierEncKeySHA1(Base64.getMimeEncoder().encodeToString(digestBytes));
+                    secRef.setKeyIdentifierEncKeySHA1(org.apache.xml.security.utils.XMLUtils.encodeToString(digestBytes));
                 }
                 secRef.addTokenType(WSConstants.WSS_ENC_KEY_VALUE_TYPE);
                 break;

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=1829349&r1=1829348&r2=1829349&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 Tue Apr 17 09:36:53 2018
@@ -21,8 +21,6 @@ package org.apache.wss4j.dom.message;
 
 import org.apache.wss4j.dom.WSConstants;
 
-import java.util.Base64;
-
 import org.apache.wss4j.common.ext.WSSecurityException;
 import org.apache.wss4j.common.util.UsernameTokenUtil;
 import org.apache.wss4j.common.util.WSCurrentTimeSource;
@@ -120,7 +118,8 @@ public class WSSecUsernameToken extends
             return null;
         }
         if (passwordsAreEncoded) {
-            return UsernameTokenUtil.generateDerivedKey(Base64.getMimeDecoder().decode(password), saltValue, iteration);
+            return UsernameTokenUtil.generateDerivedKey(org.apache.xml.security.utils.XMLUtils.decode(password),
+                                                        saltValue, iteration);
         } else {
             return UsernameTokenUtil.generateDerivedKey(password, saltValue, iteration);
         }

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/DerivedKeyToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/DerivedKeyToken.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/DerivedKeyToken.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/DerivedKeyToken.java Tue Apr 17 09:36:53 2018
@@ -20,7 +20,6 @@
 package org.apache.wss4j.dom.message.token;
 
 import java.security.Principal;
-import java.util.Base64;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.Map.Entry;
@@ -541,7 +540,7 @@ public class DerivedKeyToken {
      */
     public byte[] deriveKey(int length, byte[] secret) throws WSSecurityException {
         try {
-            byte[] nonce = Base64.getMimeDecoder().decode(getNonce());
+            byte[] nonce = org.apache.xml.security.utils.XMLUtils.decode(getNonce());
             return DerivedKeyUtils.deriveKey(getAlgorithm(), getLabel(), length, secret, nonce, getOffset());
         } catch (Exception e) {
             throw new WSSecurityException(

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SignatureConfirmation.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SignatureConfirmation.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SignatureConfirmation.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SignatureConfirmation.java Tue Apr 17 09:36:53 2018
@@ -20,7 +20,6 @@
 package org.apache.wss4j.dom.message.token;
 
 import java.util.Arrays;
-import java.util.Base64;
 
 import org.apache.wss4j.dom.WSConstants;
 import org.apache.wss4j.common.bsp.BSPEnforcer;
@@ -59,7 +58,7 @@ public class SignatureConfirmation {
 
         String sv = element.getAttributeNS(null, SC_VALUE_ATTR);
         if (sv != null) {
-            signatureValue = Base64.getMimeDecoder().decode(sv);
+            signatureValue = org.apache.xml.security.utils.XMLUtils.decode(sv);
         }
     }
 
@@ -79,7 +78,7 @@ public class SignatureConfirmation {
             );
         XMLUtils.setNamespace(element, WSConstants.WSSE11_NS, WSConstants.WSSE11_PREFIX);
         if (signVal != null) {
-            String sv = Base64.getMimeEncoder().encodeToString(signVal);
+            String sv = org.apache.xml.security.utils.XMLUtils.encodeToString(signVal);
             element.setAttributeNS(null, SC_VALUE_ATTR, sv);
         }
     }

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java Tue Apr 17 09:36:53 2018
@@ -28,7 +28,6 @@ import java.time.ZonedDateTime;
 import java.time.format.DateTimeFormatter;
 import java.time.format.DateTimeParseException;
 import java.util.Arrays;
-import java.util.Base64;
 import java.util.List;
 
 import javax.security.auth.callback.Callback;
@@ -301,7 +300,7 @@ public class UsernameToken {
             return;
         }
         elementNonce = doc.createElementNS(WSConstants.WSSE_NS, "wsse:" + WSConstants.NONCE_LN);
-        elementNonce.appendChild(doc.createTextNode(Base64.getMimeEncoder().encodeToString(nonceValue)));
+        elementNonce.appendChild(doc.createTextNode(org.apache.xml.security.utils.XMLUtils.encodeToString(nonceValue)));
         elementNonce.setAttributeNS(null, "EncodingType", BASE64_ENCODING);
         element.appendChild(elementNonce);
     }
@@ -325,7 +324,7 @@ public class UsernameToken {
                 WSConstants.WSU_NS, WSConstants.WSU_PREFIX + ":" + WSConstants.CREATED_LN
             );
         Instant currentTime = timeSource.now();
-        
+
         DateTimeFormatter formatter = DateUtil.getDateTimeFormatter(milliseconds);
         elementCreated.appendChild(doc.createTextNode(currentTime.atZone(ZoneOffset.UTC).format(formatter)));
         element.appendChild(elementCreated);
@@ -352,7 +351,7 @@ public class UsernameToken {
                 WSConstants.WSSE11_NS, WSConstants.WSSE11_PREFIX + ":" + WSConstants.SALT_LN
             );
         XMLUtils.setNamespace(element, WSConstants.WSSE11_NS, WSConstants.WSSE11_PREFIX);
-        elementSalt.appendChild(doc.createTextNode(Base64.getMimeEncoder().encodeToString(saltValue)));
+        elementSalt.appendChild(doc.createTextNode(org.apache.xml.security.utils.XMLUtils.encodeToString(saltValue)));
         element.appendChild(elementSalt);
         return saltValue;
     }
@@ -450,7 +449,7 @@ public class UsernameToken {
     public byte[] getSalt() throws WSSecurityException {
         String salt = XMLUtils.getElementText(elementSalt);
         if (salt != null) {
-            return Base64.getMimeDecoder().decode(salt);
+            return org.apache.xml.security.utils.XMLUtils.decode(salt);
         }
         return null;
     }
@@ -510,7 +509,8 @@ public class UsernameToken {
         try {
             if (hashed) {
                 if (passwordsAreEncoded) {
-                    node.setData(doPasswordDigest(getNonce(), getCreated(), Base64.getMimeDecoder().decode(pwd)));
+                    node.setData(doPasswordDigest(getNonce(), getCreated(),
+                                                  org.apache.xml.security.utils.XMLUtils.decode(pwd)));
                 } else {
                     node.setData(doPasswordDigest(getNonce(), getCreated(), pwd));
                 }
@@ -567,7 +567,7 @@ public class UsernameToken {
     public static String doPasswordDigest(String nonce, String created, byte[] password) {
         String passwdDigest = null;
         try {
-            byte[] b1 = nonce != null ? Base64.getMimeDecoder().decode(nonce) : new byte[0];
+            byte[] b1 = nonce != null ? org.apache.xml.security.utils.XMLUtils.decode(nonce) : new byte[0];
             byte[] b2 = created != null ? created.getBytes(StandardCharsets.UTF_8) : new byte[0];
             byte[] b3 = password;
             byte[] b4 = new byte[b1.length + b2.length + b3.length];
@@ -581,7 +581,7 @@ public class UsernameToken {
             System.arraycopy(b3, 0, b4, offset, b3.length);
 
             byte[] digestBytes = KeyUtils.generateDigest(b4);
-            passwdDigest = Base64.getMimeEncoder().encodeToString(digestBytes);
+            passwdDigest = org.apache.xml.security.utils.XMLUtils.encodeToString(digestBytes);
         } catch (Exception e) {
             LOG.debug(e.getMessage(), e);
         }
@@ -678,7 +678,8 @@ public class UsernameToken {
         int iteration = getIteration();
         byte[] salt = getSalt();
         if (passwordsAreEncoded) {
-            return UsernameTokenUtil.generateDerivedKey(Base64.getMimeDecoder().decode(rawPassword), salt, iteration);
+            return UsernameTokenUtil.generateDerivedKey(org.apache.xml.security.utils.XMLUtils.decode(rawPassword),
+                                                        salt, iteration);
         } else {
             return UsernameTokenUtil.generateDerivedKey(rawPassword, salt, iteration);
         }
@@ -706,7 +707,7 @@ public class UsernameToken {
             new WSUsernameTokenPrincipalImpl(getName(), isHashed());
         String nonce = getNonce();
         if (nonce != null) {
-            principal.setNonce(Base64.getMimeDecoder().decode(nonce));
+            principal.setNonce(org.apache.xml.security.utils.XMLUtils.decode(nonce));
         }
         principal.setPassword(getPassword());
         principal.setCreatedTime(getCreated());

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java Tue Apr 17 09:36:53 2018
@@ -30,7 +30,6 @@ import java.time.Duration;
 import java.time.Instant;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Base64;
 import java.util.List;
 import java.util.Map;
 
@@ -442,7 +441,7 @@ public class SignatureProcessor implemen
                     if (xopURI != null) {
                         // Store the bytes in the attachment to calculate the signature
                         byte[] attachmentBytes = WSSecurityUtil.getBytesFromAttachment(xopURI, data);
-                        String encodedBytes = Base64.getMimeEncoder().encodeToString(attachmentBytes);
+                        String encodedBytes = org.apache.xml.security.utils.XMLUtils.encodeToString(attachmentBytes);
 
                         Node newCipherValueChild =
                             includeElement.getOwnerDocument().createTextNode(encodedBytes);

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/UsernameTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/UsernameTokenProcessor.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/UsernameTokenProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/UsernameTokenProcessor.java Tue Apr 17 09:36:53 2018
@@ -20,7 +20,6 @@
 package org.apache.wss4j.dom.processor;
 
 import java.time.Instant;
-import java.util.Base64;
 import java.util.List;
 
 import org.apache.wss4j.common.principal.SAMLTokenPrincipalImpl;
@@ -34,6 +33,7 @@ import org.apache.wss4j.dom.handler.Requ
 import org.apache.wss4j.dom.message.token.UsernameToken;
 import org.apache.wss4j.dom.validate.Credential;
 import org.apache.wss4j.dom.validate.Validator;
+import org.apache.xml.security.utils.XMLUtils;
 
 public class UsernameTokenProcessor implements Processor {
     private static final org.slf4j.Logger LOG =
@@ -97,7 +97,7 @@ public class UsernameTokenProcessor impl
                 WSUsernameTokenPrincipalImpl principal =
                     new WSUsernameTokenPrincipalImpl(token.getName(), token.isHashed());
                 if (token.getNonce() != null) {
-                    principal.setNonce(Base64.getMimeDecoder().decode(token.getNonce()));
+                    principal.setNonce(XMLUtils.decode(token.getNonce()));
                 }
                 principal.setPassword(token.getPassword());
                 principal.setCreatedTime(token.getCreated());

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSSAMLKeyInfoProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSSAMLKeyInfoProcessor.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSSAMLKeyInfoProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSSAMLKeyInfoProcessor.java Tue Apr 17 09:36:53 2018
@@ -20,7 +20,6 @@
 package org.apache.wss4j.dom.saml;
 
 import java.security.Principal;
-import java.util.Base64;
 import java.util.List;
 
 import javax.xml.namespace.QName;
@@ -43,6 +42,7 @@ import org.apache.wss4j.dom.str.STRParse
 import org.apache.wss4j.dom.str.STRParserParameters;
 import org.apache.wss4j.dom.str.STRParserResult;
 import org.apache.wss4j.dom.str.SignatureSTRParser;
+import org.apache.xml.security.utils.XMLUtils;
 
 /**
  * This interface allows the user to plug in custom ways of processing a SAML KeyInfo.
@@ -87,7 +87,7 @@ public class WSSSAMLKeyInfoProcessor imp
                     return new SAMLKeyInfo(secret);
                 } else if (el.equals(BINARY_SECRET) || el.equals(BINARY_SECRET_05_12)) {
                     Text txt = (Text)node.getFirstChild();
-                    return new SAMLKeyInfo(Base64.getMimeDecoder().decode(txt.getData()));
+                    return new SAMLKeyInfo(XMLUtils.decode(txt.getData()));
                 } else if (SecurityTokenReference.STR_QNAME.equals(el)) {
                     STRParserParameters parameters = new STRParserParameters();
                     parameters.setData(data);

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SignatureSTRParser.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SignatureSTRParser.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SignatureSTRParser.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SignatureSTRParser.java Tue Apr 17 09:36:53 2018
@@ -23,7 +23,6 @@ import java.security.Principal;
 import java.security.cert.CertificateEncodingException;
 import java.security.cert.X509Certificate;
 import java.util.Arrays;
-import java.util.Base64;
 import java.util.List;
 
 import javax.xml.namespace.QName;
@@ -214,7 +213,7 @@ public class SignatureSTRParser implemen
                         if (certs != null) {
                             try {
                                 byte[] digest = KeyUtils.generateDigest(certs[0].getEncoded());
-                                if (Arrays.equals(Base64.getMimeDecoder().decode(kiValue), digest)) {
+                                if (Arrays.equals(org.apache.xml.security.utils.XMLUtils.decode(kiValue), digest)) {
                                     parserResult.setPrincipal((Principal)bstResult.get(WSSecurityEngineResult.TAG_PRINCIPAL));
                                     foundCerts = certs;
                                     break;

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/transform/STRTransformUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/transform/STRTransformUtil.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/transform/STRTransformUtil.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/transform/STRTransformUtil.java Tue Apr 17 09:36:53 2018
@@ -21,7 +21,6 @@ package org.apache.wss4j.dom.transform;
 
 import java.security.cert.CertificateEncodingException;
 import java.security.cert.X509Certificate;
-import java.util.Base64;
 
 import org.apache.wss4j.common.ext.WSSecurityException;
 import org.apache.wss4j.common.token.Reference;
@@ -129,7 +128,7 @@ public final class STRTransformUtil {
         if (secRefEncType != null) {
             elem.setAttributeNS(null, "EncodingType", secRefEncType);
         }
-        Text certText = doc.createTextNode(Base64.getMimeEncoder().encodeToString(data)); // no line wrap
+        Text certText = doc.createTextNode(org.apache.xml.security.utils.XMLUtils.encodeToString(data)); // no line wrap
         elem.appendChild(certText);
         return elem;
     }

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/EncryptionUtils.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/EncryptionUtils.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/EncryptionUtils.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/EncryptionUtils.java Tue Apr 17 09:36:53 2018
@@ -54,7 +54,6 @@ import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.security.NoSuchAlgorithmException;
-import java.util.Base64;
 import java.util.List;
 
 public final class EncryptionUtils {
@@ -557,6 +556,6 @@ public final class EncryptionUtils {
         if (text == null) {
             return null;
         }
-        return Base64.getMimeDecoder().decode(text);
+        return org.apache.xml.security.utils.XMLUtils.decode(text);
     }
 }

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java Tue Apr 17 09:36:53 2018
@@ -52,7 +52,6 @@ import java.lang.reflect.Method;
 import java.net.URLDecoder;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
-import java.util.Base64;
 import java.util.Collections;
 import java.util.List;
 
@@ -445,7 +444,7 @@ public final class WSSecurityUtil {
      * @return a Text node containing the base64 encoded data
      */
     public static Text createBase64EncodedTextNode(Document doc, byte[] data) {
-        return doc.createTextNode(Base64.getMimeEncoder().encodeToString(data));
+        return doc.createTextNode(org.apache.xml.security.utils.XMLUtils.encodeToString(data));
     }
 
     public static SOAPConstants getSOAPConstants(Element startElement) {
@@ -599,7 +598,7 @@ public final class WSSecurityUtil {
                 // Retrieve the attachment bytes
                 byte[] attachmentBytes =
                     WSSecurityUtil.getBytesFromAttachment(xopURI, attachmentCallbackHandler, removeAttachments);
-                String encodedBytes = Base64.getMimeEncoder().encodeToString(attachmentBytes);
+                String encodedBytes = org.apache.xml.security.utils.XMLUtils.encodeToString(attachmentBytes);
 
                 Node encodedChild =
                     includeElement.getOwnerDocument().createTextNode(encodedBytes);

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/UsernameTokenValidator.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/UsernameTokenValidator.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/UsernameTokenValidator.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/UsernameTokenValidator.java Tue Apr 17 09:36:53 2018
@@ -20,7 +20,6 @@
 package org.apache.wss4j.dom.validate;
 
 import java.io.IOException;
-import java.util.Base64;
 
 import javax.security.auth.callback.Callback;
 import javax.security.auth.callback.UnsupportedCallbackException;
@@ -30,6 +29,7 @@ import org.apache.wss4j.common.ext.WSPas
 import org.apache.wss4j.common.ext.WSSecurityException;
 import org.apache.wss4j.dom.handler.RequestData;
 import org.apache.wss4j.dom.message.token.UsernameToken;
+import org.apache.xml.security.utils.XMLUtils;
 
 /**
  * This class validates a processed UsernameToken, extracted from the Credential passed to
@@ -168,7 +168,7 @@ public class UsernameTokenValidator impl
             String passDigest;
             if (passwordsAreEncoded) {
                 passDigest = UsernameToken.doPasswordDigest(nonce, createdTime,
-                                                            Base64.getMimeDecoder().decode(origPassword));
+                                                            XMLUtils.decode(origPassword));
             } else {
                 passDigest = UsernameToken.doPasswordDigest(nonce, createdTime, origPassword);
             }

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/SecretKeyCallbackHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/SecretKeyCallbackHandler.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/SecretKeyCallbackHandler.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/SecretKeyCallbackHandler.java Tue Apr 17 09:36:53 2018
@@ -22,13 +22,13 @@ package org.apache.wss4j.dom.common;
 import org.apache.wss4j.common.ext.WSPasswordCallback;
 import org.apache.wss4j.common.ext.WSSecurityException;
 import org.apache.wss4j.common.util.KeyUtils;
+import org.apache.xml.security.utils.XMLUtils;
 
 import javax.security.auth.callback.Callback;
 import javax.security.auth.callback.CallbackHandler;
 import javax.security.auth.callback.UnsupportedCallbackException;
 
 import java.io.IOException;
-import java.util.Base64;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -67,7 +67,7 @@ public class SecretKeyCallbackHandler im
     public void setOutboundSecret(byte[] secret) throws WSSecurityException {
         outboundSecret = secret;
         byte[] encodedBytes = KeyUtils.generateDigest(outboundSecret);
-        String identifier = Base64.getMimeEncoder().encodeToString(encodedBytes);
+        String identifier = XMLUtils.encodeToString(encodedBytes);
         addSecretKey(identifier, outboundSecret);
     }
 }

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/SecurityTestUtil.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/SecurityTestUtil.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/SecurityTestUtil.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/SecurityTestUtil.java Tue Apr 17 09:36:53 2018
@@ -19,12 +19,12 @@
 package org.apache.wss4j.dom.common;
 
 import java.io.File;
-import java.util.Base64;
 
 import org.apache.wss4j.common.cache.ReplayCache;
 import org.apache.wss4j.common.cache.ReplayCacheFactory;
 import org.apache.wss4j.common.ext.WSSecurityException;
 import org.apache.wss4j.dom.util.WSSecurityUtil;
+import org.apache.xml.security.utils.XMLUtils;
 
 /**
  * A utility class for security tests
@@ -51,7 +51,7 @@ public final class SecurityTestUtil {
 
     public static ReplayCache createCache(String key) throws WSSecurityException {
         ReplayCacheFactory replayCacheFactory = ReplayCacheFactory.newInstance();
-        String cacheKey = key + Base64.getEncoder().encodeToString(WSSecurityUtil.generateNonce(10));
+        String cacheKey = key + XMLUtils.encodeToString(WSSecurityUtil.generateNonce(10));
         return replayCacheFactory.newReplayCache(cacheKey, null);
     }
 }

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=1829349&r1=1829348&r2=1829349&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 Tue Apr 17 09:36:53 2018
@@ -43,7 +43,6 @@ import java.io.InputStream;
 import java.security.Security;
 import java.security.cert.CertificateFactory;
 import java.security.cert.X509Certificate;
-import java.util.Base64;
 
 /**
  * This is a test for WSS-86 - "CryptoBase.splitAndTrim does not take into account the format of a
@@ -166,7 +165,7 @@ public class CryptoProviderTest extends
         // keytool -export -rfc -keystore wss86.keystore -alias wss86 -file wss86.cer
         //
         byte[] certBytes =
-            Base64.getMimeDecoder().decode(
+            org.apache.xml.security.utils.XMLUtils.decode(
                 "MIIDqTCCApGgAwIBAgIEePiYTTANBgkqhkiG9w0BAQsFADCBhDELMAkGA1UEBhMCREUxDzANBgNV"
                 + "BAgTBkJheWVybjEPMA0GA1UEBxMGTXVuaWNoMQ8wDQYDVQQKEwZBcGFjaGUxDjAMBgNVBAsTBVdT"
                 + "UzRKMQ8wDQYDVQQDEwZXZXJuZXIxITAfBgkqhkiG9w0BCQEWEldlcm5lckBleGFtcGxlLmNvbTAe"
@@ -224,7 +223,7 @@ public class CryptoProviderTest extends
     @Test
     public void testBadInterop() throws Exception {
         byte[] certBytes =
-            Base64.getMimeDecoder().decode(
+            org.apache.xml.security.utils.XMLUtils.decode(
                 "MIIDNDCCAp2gAwIBAgIBEDANBgkqhkiG9w0BAQQFADBmMQswCQYDVQQGEwJERTEPMA0GA1UECBMG"
                 + "QmF5ZXJuMQ8wDQYDVQQHEwZNdW5pY2gxDTALBgNVBAoTBEhvbWUxFTATBgNVBAsTDEFwYWNoZSBX"
                 + "U1M0SjEPMA0GA1UEAxMGV2VybmVyMB4XDTA4MDQwNDE5MzIxOFoXDTEwMDQwNDE5MzIxOFowYTEL"

Modified: webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SecurityActionTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SecurityActionTokenTest.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SecurityActionTokenTest.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SecurityActionTokenTest.java Tue Apr 17 09:36:53 2018
@@ -20,7 +20,6 @@
 package org.apache.wss4j.dom.handler;
 
 import java.util.ArrayList;
-import java.util.Base64;
 import java.util.Collections;
 import java.util.List;
 
@@ -150,7 +149,7 @@ public class SecurityActionTokenTest ext
 
         SecretKeyCallbackHandler secretKeyCallbackHandler = new SecretKeyCallbackHandler();
         byte[] encodedBytes = KeyUtils.generateDigest(keyData);
-        String identifier = Base64.getMimeEncoder().encodeToString(encodedBytes);
+        String identifier = org.apache.xml.security.utils.XMLUtils.encodeToString(encodedBytes);
         secretKeyCallbackHandler.addSecretKey(identifier, keyData);
 
         verify(doc, secretKeyCallbackHandler);
@@ -247,7 +246,7 @@ public class SecurityActionTokenTest ext
 
         SecretKeyCallbackHandler secretKeyCallbackHandler = new SecretKeyCallbackHandler();
         byte[] encodedBytes = KeyUtils.generateDigest(keyData);
-        String identifier = Base64.getMimeEncoder().encodeToString(encodedBytes);
+        String identifier = org.apache.xml.security.utils.XMLUtils.encodeToString(encodedBytes);
         secretKeyCallbackHandler.addSecretKey(identifier, keyData);
 
         verify(doc, secretKeyCallbackHandler);
@@ -360,7 +359,7 @@ public class SecurityActionTokenTest ext
 
         SecretKeyCallbackHandler secretKeyCallbackHandler = new SecretKeyCallbackHandler();
         byte[] encodedBytes = KeyUtils.generateDigest(keyData);
-        String identifier = Base64.getMimeEncoder().encodeToString(encodedBytes);
+        String identifier = org.apache.xml.security.utils.XMLUtils.encodeToString(encodedBytes);
         secretKeyCallbackHandler.addSecretKey(identifier, keyData);
 
         verify(doc, secretKeyCallbackHandler);
@@ -455,7 +454,7 @@ public class SecurityActionTokenTest ext
 
         SecretKeyCallbackHandler secretKeyCallbackHandler = new SecretKeyCallbackHandler();
         byte[] encodedBytes = KeyUtils.generateDigest(keyData);
-        String identifier = Base64.getMimeEncoder().encodeToString(encodedBytes);
+        String identifier = org.apache.xml.security.utils.XMLUtils.encodeToString(encodedBytes);
         secretKeyCallbackHandler.addSecretKey(identifier, keyData);
 
         CombinedCallbackHandler combinedCallbackHandler =
@@ -595,7 +594,7 @@ public class SecurityActionTokenTest ext
 
         SecretKeyCallbackHandler secretKeyCallbackHandler = new SecretKeyCallbackHandler();
         byte[] encodedBytes = KeyUtils.generateDigest(keyData);
-        String identifier = Base64.getMimeEncoder().encodeToString(encodedBytes);
+        String identifier = org.apache.xml.security.utils.XMLUtils.encodeToString(encodedBytes);
         secretKeyCallbackHandler.addSecretKey(identifier, keyData);
 
         verify(doc, secretKeyCallbackHandler);

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=1829349&r1=1829348&r2=1829349&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 Tue Apr 17 09:36:53 2018
@@ -19,8 +19,6 @@
 
 package org.apache.wss4j.dom.message;
 
-import java.util.Base64;
-
 import javax.crypto.KeyGenerator;
 import javax.crypto.SecretKey;
 
@@ -240,7 +238,7 @@ public class EncryptionAlgorithmSuiteTes
         }
 
         byte[] encodedBytes = KeyUtils.generateDigest(keyData);
-        String identifier = Base64.getMimeEncoder().encodeToString(encodedBytes);
+        String identifier = org.apache.xml.security.utils.XMLUtils.encodeToString(encodedBytes);
         SecretKeyCallbackHandler secretKeyCallbackHandler = new SecretKeyCallbackHandler();
         secretKeyCallbackHandler.addSecretKey(identifier, keyData);
 

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=1829349&r1=1829348&r2=1829349&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 Tue Apr 17 09:36:53 2018
@@ -21,7 +21,6 @@ package org.apache.wss4j.dom.message;
 
 import java.security.cert.X509Certificate;
 import java.util.ArrayList;
-import java.util.Base64;
 import java.util.Collections;
 
 import javax.crypto.KeyGenerator;
@@ -397,7 +396,7 @@ public class EncryptionTest extends org.
         Document encryptedDoc = builder.build(crypto);
 
         byte[] encodedBytes = KeyUtils.generateDigest(keyData);
-        String identifier = Base64.getMimeEncoder().encodeToString(encodedBytes);
+        String identifier = org.apache.xml.security.utils.XMLUtils.encodeToString(encodedBytes);
         secretKeyCallbackHandler.addSecretKey(identifier, keyData);
 
         String outputString =
@@ -433,7 +432,7 @@ public class EncryptionTest extends org.
         Document encryptedDoc = builder.build(crypto);
 
         byte[] encodedBytes = KeyUtils.generateDigest(keyData);
-        String identifier = Base64.getMimeEncoder().encodeToString(encodedBytes);
+        String identifier = org.apache.xml.security.utils.XMLUtils.encodeToString(encodedBytes);
         secretKeyCallbackHandler.addSecretKey(identifier, keyData);
 
         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=1829349&r1=1829348&r2=1829349&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 Tue Apr 17 09:36:53 2018
@@ -20,7 +20,6 @@
 package org.apache.wss4j.dom.message;
 
 import java.util.ArrayList;
-import java.util.Base64;
 import java.util.List;
 
 import javax.crypto.KeyGenerator;
@@ -163,7 +162,7 @@ public class SignatureAlgorithmSuiteTest
         }
 
         byte[] encodedBytes = KeyUtils.generateDigest(keyData);
-        String identifier = Base64.getMimeEncoder().encodeToString(encodedBytes);
+        String identifier = org.apache.xml.security.utils.XMLUtils.encodeToString(encodedBytes);
         SecretKeyCallbackHandler secretKeyCallbackHandler = new SecretKeyCallbackHandler();
         secretKeyCallbackHandler.addSecretKey(identifier, keyData);
 

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=1829349&r1=1829348&r2=1829349&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 Tue Apr 17 09:36:53 2018
@@ -20,7 +20,6 @@
 package org.apache.wss4j.dom.message;
 
 import java.io.IOException;
-import java.util.Base64;
 import java.util.Collections;
 
 import javax.crypto.KeyGenerator;
@@ -107,7 +106,7 @@ public class SymmetricSignatureTest exte
         Document signedDoc = sign.build(crypto);
 
         byte[] encodedBytes = KeyUtils.generateDigest(keyData);
-        String identifier = Base64.getMimeEncoder().encodeToString(encodedBytes);
+        String identifier = org.apache.xml.security.utils.XMLUtils.encodeToString(encodedBytes);
         secretKeyCallbackHandler.addSecretKey(identifier, keyData);
 
         if (LOG.isDebugEnabled()) {

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=1829349&r1=1829348&r2=1829349&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 Tue Apr 17 09:36:53 2018
@@ -22,7 +22,6 @@ package org.apache.wss4j.dom.message;
 import java.nio.charset.StandardCharsets;
 import java.security.MessageDigest;
 import java.util.Arrays;
-import java.util.Base64;
 import java.util.Collections;
 
 import javax.security.auth.callback.CallbackHandler;
@@ -108,7 +107,8 @@ public class UTDerivedKeyTest extends or
         assertTrue(derivedKey.length == 20);
 
         // "c2VjdXJpdHk=" is the Base64 encoding of "security"
-        derivedKey = UsernameTokenUtil.generateDerivedKey(Base64.getMimeDecoder().decode("c2VjdXJpdHk="), salt, 500);
+        derivedKey = UsernameTokenUtil.generateDerivedKey(org.apache.xml.security.utils.XMLUtils.decode("c2VjdXJpdHk="),
+                                                          salt, 500);
         assertTrue(derivedKey.length == 20);
     }
 
@@ -121,9 +121,9 @@ public class UTDerivedKeyTest extends or
         // The SHA-1 of the password is known as a password equivalent in the UsernameToken specification.
         byte[] passwordHash = MessageDigest.getInstance("SHA-1").digest(password.getBytes(StandardCharsets.UTF_8));
 
-        byte[] salt = Base64.getMimeDecoder().decode("LKpycbfgRzwDnBz6kkhAAQ==");
+        byte[] salt = org.apache.xml.security.utils.XMLUtils.decode("LKpycbfgRzwDnBz6kkhAAQ==");
         int iteration = 1049;
-        byte[] expectedDerivedKey = Base64.getMimeDecoder().decode("C7Ll/OY4TECb6hZuMMiX/5hzszo=");
+        byte[] expectedDerivedKey = org.apache.xml.security.utils.XMLUtils.decode("C7Ll/OY4TECb6hZuMMiX/5hzszo=");
         byte[] derivedKey = UsernameTokenUtil.generateDerivedKey(passwordHash, salt, iteration);
         assertTrue("the derived key is not as expected", Arrays.equals(expectedDerivedKey, derivedKey));
     }
@@ -190,8 +190,8 @@ public class UTDerivedKeyTest extends or
 
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setPasswordsAreEncoded(true);
-        builder.setUserInfo("bob",
-                            Base64.getMimeEncoder().encodeToString(MessageDigest.getInstance("SHA-1").digest("security".getBytes(StandardCharsets.UTF_8))));
+        byte[] bytes = MessageDigest.getInstance("SHA-1").digest("security".getBytes(StandardCharsets.UTF_8));
+        builder.setUserInfo("bob", org.apache.xml.security.utils.XMLUtils.encodeToString(bytes));
         builder.addDerivedKey(false, null, 1000);
         builder.prepare();
 
@@ -392,8 +392,8 @@ public class UTDerivedKeyTest extends or
 
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setPasswordsAreEncoded(true);
-        builder.setUserInfo("bob",
-                            Base64.getMimeEncoder().encodeToString(MessageDigest.getInstance("SHA-1").digest("security".getBytes(StandardCharsets.UTF_8))));
+        byte[] bytes = MessageDigest.getInstance("SHA-1").digest("security".getBytes(StandardCharsets.UTF_8));
+        builder.setUserInfo("bob", org.apache.xml.security.utils.XMLUtils.encodeToString(bytes));
         builder.addDerivedKey(true, null, 1000);
         builder.prepare();
 

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=1829349&r1=1829348&r2=1829349&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 Tue Apr 17 09:36:53 2018
@@ -25,7 +25,6 @@ import java.security.MessageDigest;
 import java.time.Instant;
 import java.time.ZoneOffset;
 import java.time.ZonedDateTime;
-import java.util.Base64;
 import java.util.Collections;
 
 import javax.security.auth.callback.Callback;
@@ -184,8 +183,8 @@ public class UsernameTokenTest extends o
 
         WSSecUsernameToken builder = new WSSecUsernameToken(secHeader);
         builder.setPasswordsAreEncoded(true);
-        builder.setUserInfo("wernerd",
-                            Base64.getMimeEncoder().encodeToString(MessageDigest.getInstance("SHA-1").digest("verySecret".getBytes(StandardCharsets.UTF_8))));
+        byte[] bytes = MessageDigest.getInstance("SHA-1").digest("verySecret".getBytes(StandardCharsets.UTF_8));
+        builder.setUserInfo("wernerd", org.apache.xml.security.utils.XMLUtils.encodeToString(bytes));
         LOG.info("Before adding UsernameToken PW Digest....");
         Document signedDoc = builder.build();
 
@@ -468,7 +467,7 @@ public class UsernameTokenTest extends o
         MessageDigest sha = MessageDigest.getInstance("MD5");
         sha.reset();
         sha.update(password);
-        String passwdDigest = Base64.getMimeEncoder().encodeToString(sha.digest());
+        String passwdDigest = org.apache.xml.security.utils.XMLUtils.encodeToString(sha.digest());
 
         builder.setUserInfo("wernerd", passwdDigest);
         LOG.info("Before adding UsernameToken PW Text....");

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=1829349&r1=1829348&r2=1829349&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 Tue Apr 17 09:36:53 2018
@@ -51,7 +51,6 @@ import javax.security.auth.callback.Call
 import javax.xml.crypto.dsig.SignatureMethod;
 
 import java.util.Arrays;
-import java.util.Base64;
 
 /**
  * This is a test for the Kerberos Token Profile 1.1
@@ -318,7 +317,7 @@ public class BSTKerberosTest extends org
         sign.setCustomTokenValueType(WSConstants.WSS_KRB_KI_VALUE_TYPE);
 
         byte[] digestBytes = KeyUtils.generateDigest(keyData);
-        sign.setCustomTokenId(Base64.getMimeEncoder().encodeToString(digestBytes));
+        sign.setCustomTokenId(org.apache.xml.security.utils.XMLUtils.encodeToString(digestBytes));
         sign.setSecretKey(keyData);
 
         Document signedDoc = sign.build(crypto);
@@ -398,7 +397,7 @@ public class BSTKerberosTest extends org
         builder.setCustomReferenceValue(WSConstants.WSS_KRB_KI_VALUE_TYPE);
 
         byte[] digestBytes = KeyUtils.generateDigest(keyData);
-        builder.setEncKeyId(Base64.getMimeEncoder().encodeToString(digestBytes));
+        builder.setEncKeyId(org.apache.xml.security.utils.XMLUtils.encodeToString(digestBytes));
 
         Document encryptedDoc = builder.build(crypto);
 

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/SAMLTokenInputHandler.java Tue Apr 17 09:36:53 2018
@@ -22,7 +22,6 @@ import java.security.Key;
 import java.security.PublicKey;
 import java.security.cert.X509Certificate;
 import java.util.ArrayList;
-import java.util.Base64;
 import java.util.Deque;
 import java.util.Iterator;
 import java.util.List;
@@ -344,7 +343,7 @@ public class SAMLTokenInputHandler exten
                     Key key = super.getKey(algorithmURI, algorithmUsage, correlationID);
                     if (key == null) {
                         String algoFamily = JCEAlgorithmMapper.getJCEKeyAlgorithmFromURI(algorithmURI);
-                        key = new SecretKeySpec(Base64.getMimeDecoder().decode(stringBuilder.toString()), algoFamily);
+                        key = new SecretKeySpec(XMLUtils.decode(stringBuilder.toString()), algoFamily);
                         setSecretKey(algorithmURI, key);
                     }
                     return key;

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/BinarySecurityTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/BinarySecurityTokenOutputProcessor.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/BinarySecurityTokenOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/BinarySecurityTokenOutputProcessor.java Tue Apr 17 09:36:53 2018
@@ -19,7 +19,6 @@
 package org.apache.wss4j.stax.impl.processor.output;
 
 import java.util.ArrayList;
-import java.util.Base64;
 import java.util.List;
 
 import javax.xml.namespace.QName;
@@ -39,6 +38,7 @@ import org.apache.xml.security.stax.ext.
 import org.apache.xml.security.stax.impl.securityToken.GenericOutboundSecurityToken;
 import org.apache.xml.security.stax.securityToken.OutboundSecurityToken;
 import org.apache.xml.security.stax.securityToken.SecurityTokenProvider;
+import org.apache.xml.security.utils.XMLUtils;
 
 public class BinarySecurityTokenOutputProcessor extends AbstractOutputProcessor {
 
@@ -170,7 +170,7 @@ public class BinarySecurityTokenOutputPr
                     attributes.add(createAttribute(WSSConstants.ATT_WSU_ID, securityToken.getId()));
                     createStartElementAndOutputAsEvent(subOutputProcessorChain, headerElementName, false, attributes);
                     createCharactersAndOutputAsEvent(subOutputProcessorChain,
-                            Base64.getMimeEncoder().encodeToString(
+                            XMLUtils.encodeToString(
                                 ((KerberosClientSecurityToken)securityToken).getTicket())
                     );
                     createEndElementAndOutputAsEvent(subOutputProcessorChain, headerElementName);

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/DerivedKeyTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/DerivedKeyTokenOutputProcessor.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/DerivedKeyTokenOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/DerivedKeyTokenOutputProcessor.java Tue Apr 17 09:36:53 2018
@@ -22,7 +22,6 @@ import java.nio.charset.StandardCharsets
 import java.security.Key;
 import java.security.cert.X509Certificate;
 import java.util.ArrayList;
-import java.util.Base64;
 import java.util.List;
 
 import javax.crypto.spec.SecretKeySpec;
@@ -50,6 +49,7 @@ import org.apache.xml.security.stax.impl
 import org.apache.xml.security.stax.securityToken.OutboundSecurityToken;
 import org.apache.xml.security.stax.securityToken.SecurityToken;
 import org.apache.xml.security.stax.securityToken.SecurityTokenProvider;
+import org.apache.xml.security.utils.XMLUtils;
 
 public class DerivedKeyTokenOutputProcessor extends AbstractOutputProcessor {
 
@@ -178,7 +178,7 @@ public class DerivedKeyTokenOutputProces
             outputProcessorChain.getSecurityContext().registerSecurityTokenProvider(wsuIdDKT, derivedKeysecurityTokenProvider);
             FinalDerivedKeyTokenOutputProcessor finalDerivedKeyTokenOutputProcessor =
                     new FinalDerivedKeyTokenOutputProcessor(derivedKeySecurityToken, offset, length,
-                                                            Base64.getMimeEncoder().encodeToString(nonce),
+                                                            XMLUtils.encodeToString(nonce),
                                                             ((WSSSecurityProperties)getSecurityProperties()).isUse200512Namespace(),
                                                             wrappingSecurityToken.getSha1Identifier());
             finalDerivedKeyTokenOutputProcessor.setXMLSecurityProperties(getSecurityProperties());

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptedKeyOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptedKeyOutputProcessor.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptedKeyOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/EncryptedKeyOutputProcessor.java Tue Apr 17 09:36:53 2018
@@ -28,7 +28,6 @@ import java.security.cert.X509Certificat
 import java.security.spec.AlgorithmParameterSpec;
 import java.security.spec.MGF1ParameterSpec;
 import java.util.ArrayList;
-import java.util.Base64;
 import java.util.List;
 
 import javax.crypto.Cipher;
@@ -58,6 +57,7 @@ import org.apache.xml.security.stax.impl
 import org.apache.xml.security.stax.impl.util.IDGenerator;
 import org.apache.xml.security.stax.securityToken.OutboundSecurityToken;
 import org.apache.xml.security.stax.securityToken.SecurityTokenProvider;
+import org.apache.xml.security.utils.XMLUtils;
 
 public class EncryptedKeyOutputProcessor extends AbstractOutputProcessor {
 
@@ -241,7 +241,7 @@ public class EncryptedKeyOutputProcessor
                     if (oaepParams != null) {
                         createStartElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_xenc_OAEPparams,
                                                            false, null);
-                        createCharactersAndOutputAsEvent(subOutputProcessorChain, Base64.getMimeEncoder().encodeToString(oaepParams));
+                        createCharactersAndOutputAsEvent(subOutputProcessorChain, XMLUtils.encodeToString(oaepParams));
                         createEndElementAndOutputAsEvent(subOutputProcessorChain, XMLSecurityConstants.TAG_xenc_OAEPparams);
                     }
 
@@ -331,7 +331,7 @@ public class EncryptedKeyOutputProcessor
                     }
 
                     createCharactersAndOutputAsEvent(subOutputProcessorChain,
-                                                     Base64.getMimeEncoder().encodeToString(encryptedEphemeralKey));
+                                                     XMLUtils.encodeToString(encryptedEphemeralKey));
 
                 } catch (NoSuchPaddingException | NoSuchAlgorithmException
                     | InvalidKeyException | IllegalBlockSizeException

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SignatureConfirmationOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SignatureConfirmationOutputProcessor.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SignatureConfirmationOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/SignatureConfirmationOutputProcessor.java Tue Apr 17 09:36:53 2018
@@ -19,7 +19,6 @@
 package org.apache.wss4j.stax.impl.processor.output;
 
 import java.util.ArrayList;
-import java.util.Base64;
 import java.util.List;
 
 import javax.xml.namespace.QName;
@@ -37,6 +36,7 @@ import org.apache.xml.security.stax.impl
 import org.apache.xml.security.stax.securityEvent.SecurityEvent;
 import org.apache.xml.security.stax.securityEvent.SecurityEventConstants;
 import org.apache.xml.security.stax.securityEvent.SignatureValueSecurityEvent;
+import org.apache.xml.security.utils.XMLUtils;
 
 public class SignatureConfirmationOutputProcessor extends AbstractOutputProcessor {
 
@@ -72,7 +72,7 @@ public class SignatureConfirmationOutput
                     List<XMLSecAttribute> attributes = new ArrayList<>(2);
                     attributes.add(createAttribute(WSSConstants.ATT_WSU_ID, IDGenerator.generateID(null)));
                     String base64SigValue =
-                        Base64.getMimeEncoder().encodeToString(signatureValueSecurityEvent.getSignatureValue());
+                        XMLUtils.encodeToString(signatureValueSecurityEvent.getSignatureValue());
                     attributes.add(createAttribute(WSSConstants.ATT_NULL_VALUE, base64SigValue));
                     createStartElementAndOutputAsEvent(subOutputProcessorChain, headerElementName, true, attributes);
                     createEndElementAndOutputAsEvent(subOutputProcessorChain, headerElementName);

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/UsernameTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/UsernameTokenOutputProcessor.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/UsernameTokenOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/UsernameTokenOutputProcessor.java Tue Apr 17 09:36:53 2018
@@ -33,6 +33,7 @@ import org.apache.xml.security.stax.ext.
 import org.apache.xml.security.stax.impl.util.IDGenerator;
 import org.apache.xml.security.stax.securityToken.OutboundSecurityToken;
 import org.apache.xml.security.stax.securityToken.SecurityTokenProvider;
+import org.apache.xml.security.utils.XMLUtils;
 
 import javax.security.auth.callback.CallbackHandler;
 import javax.xml.namespace.QName;
@@ -41,7 +42,6 @@ import javax.xml.stream.XMLStreamExcepti
 import java.time.Instant;
 import java.time.ZoneOffset;
 import java.util.ArrayList;
-import java.util.Base64;
 import java.util.List;
 
 public class UsernameTokenOutputProcessor extends AbstractOutputProcessor {
@@ -211,7 +211,7 @@ public class UsernameTokenOutputProcesso
 
                 if (salt != null) {
                     createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_WSSE11_SALT, true, null);
-                    createCharactersAndOutputAsEvent(subOutputProcessorChain, Base64.getMimeEncoder().encodeToString(this.salt));
+                    createCharactersAndOutputAsEvent(subOutputProcessorChain, XMLUtils.encodeToString(this.salt));
                     createEndElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_WSSE11_SALT);
 
                     if (iterations > 0) {
@@ -226,7 +226,7 @@ public class UsernameTokenOutputProcesso
                     attributes.add(createAttribute(WSSConstants.ATT_NULL_ENCODING_TYPE, WSSConstants.SOAPMESSAGE_NS10_BASE64_ENCODING));
                     createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_WSSE_NONCE, false, attributes);
                     createCharactersAndOutputAsEvent(subOutputProcessorChain,
-                                                    Base64.getMimeEncoder().encodeToString(this.nonceValue));
+                                                    XMLUtils.encodeToString(this.nonceValue));
                     createEndElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_WSSE_NONCE);
                 }
 

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureOutputProcessor.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureOutputProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/output/WSSSignatureOutputProcessor.java Tue Apr 17 09:36:53 2018
@@ -22,7 +22,6 @@ import java.io.BufferedInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.ArrayList;
-import java.util.Base64;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -53,6 +52,7 @@ import org.apache.xml.security.stax.impl
 import org.apache.xml.security.stax.impl.processor.output.AbstractSignatureOutputProcessor;
 import org.apache.xml.security.stax.impl.util.DigestOutputStream;
 import org.apache.xml.security.stax.impl.util.IDGenerator;
+import org.apache.xml.security.utils.XMLUtils;
 
 public class WSSSignatureOutputProcessor extends AbstractSignatureOutputProcessor {
 
@@ -219,7 +219,7 @@ public class WSSSignatureOutputProcessor
                         throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_SIGNATURE, e);
                     }
 
-                    String calculatedDigest = Base64.getMimeEncoder().encodeToString(digestOutputStream.getDigestValue());
+                    String calculatedDigest = XMLUtils.encodeToString(digestOutputStream.getDigestValue());
                     LOG.debug("Calculated Digest: {}", calculatedDigest);
 
                     signaturePartDef.setDigestValue(calculatedDigest);

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SecurityTokenFactoryImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SecurityTokenFactoryImpl.java?rev=1829349&r1=1829348&r2=1829349&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SecurityTokenFactoryImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/SecurityTokenFactoryImpl.java Tue Apr 17 09:36:53 2018
@@ -29,7 +29,6 @@ import java.security.cert.CertificateEnc
 import java.security.cert.X509Certificate;
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.Base64;
 import java.util.List;
 
 import javax.security.auth.callback.CallbackHandler;
@@ -67,6 +66,7 @@ import org.apache.xml.security.stax.impl
 import org.apache.xml.security.stax.securityToken.InboundSecurityToken;
 import org.apache.xml.security.stax.securityToken.SecurityTokenFactory;
 import org.apache.xml.security.stax.securityToken.SecurityTokenProvider;
+import org.apache.xml.security.utils.XMLUtils;
 
 /**
  * Factory to create InboundSecurityToken Objects from keys in XML
@@ -253,7 +253,7 @@ public class SecurityTokenFactoryImpl ex
 
         byte[] binaryContent = null;
         if (WSSConstants.SOAPMESSAGE_NS10_BASE64_ENCODING.equals(encodingType)) {
-            binaryContent = Base64.getMimeDecoder().decode(keyIdentifierType.getValue());
+            binaryContent = XMLUtils.decode(keyIdentifierType.getValue());
         } else if (!WSSConstants.NS_SAML10_TYPE.equals(valueType) && !WSSConstants.NS_SAML20_TYPE.equals(valueType)) {
             if (encodingType == null) {
                 ((WSInboundSecurityContext) inboundSecurityContext).handleBSPRule(BSPRule.R3070);



Mime
View raw message