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 2015/11/05 15:11:54 UTC

svn commit: r1712779 - in /webservices/wss4j/trunk: ws-security-common/src/main/java/org/apache/wss4j/common/crypto/ ws-security-common/src/test/java/org/apache/wss4j/common/crypto/ ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/ ...

Author: coheigea
Date: Thu Nov  5 14:11:54 2015
New Revision: 1712779

URL: http://svn.apache.org/viewvc?rev=1712779&view=rev
Log:
Removing installing BouncyCastle by default

Modified:
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/WSProviderConfig.java
    webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/SKITest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CryptoProviderTest.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/PrincipalTest.java
    webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureTest.java

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/WSProviderConfig.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/WSProviderConfig.java?rev=1712779&r1=1712778&r2=1712779&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/WSProviderConfig.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/crypto/WSProviderConfig.java Thu Nov  5 14:11:54 2015
@@ -67,16 +67,6 @@ public final class WSProviderConfig {
                 AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
                     public Boolean run() {
                         addXMLDSigRIInternal();
-                        String bcProviderStr = 
-                            addJceProvider("BC", "org.bouncycastle.jce.provider.BouncyCastleProvider");
-                        // If we have BouncyCastle v1.49 installed then use IvParameterSpec in
-                        // Santuario. This can be removed when we pick up BouncyCastle 1.51+
-                        if (bcProviderStr != null) {
-                            Provider bcProvider = Security.getProvider(bcProviderStr);
-                            if (bcProvider.getVersion() < 1.50) {
-                                useIvParameterSpec();
-                            }
-                        }
                         return true;
                     }
                 });

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=1712779&r1=1712778&r2=1712779&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 Thu Nov  5 14:11:54 2015
@@ -21,6 +21,7 @@ package org.apache.wss4j.common.crypto;
 
 import java.io.InputStream;
 import java.security.KeyStore;
+import java.security.Security;
 import java.security.cert.X509Certificate;
 
 import org.apache.wss4j.common.crypto.Crypto;
@@ -28,6 +29,7 @@ import org.apache.wss4j.common.crypto.Cr
 import org.apache.wss4j.common.crypto.Merlin;
 import org.apache.wss4j.common.util.Loader;
 import org.apache.xml.security.utils.Base64;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
 
 /**
  * This is a test for WSS-300 - "SubjectKeyIdentifier (SKI) incorrectly calculated for 2048-bit RSA key".
@@ -80,8 +82,14 @@ public class SKITest extends org.junit.A
     
     @org.junit.Test
     public void testBouncyCastlePKCS12() throws Exception {
-        // Load the keystore
-        Crypto crypto = CryptoFactory.getInstance("alice_bouncycastle.properties");
-        assertNotNull(crypto);
+        try {
+            Security.addProvider(new BouncyCastleProvider());
+            
+            // Load the keystore
+            Crypto crypto = CryptoFactory.getInstance("alice_bouncycastle.properties");
+            assertNotNull(crypto);
+        } finally {
+            Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);
+        }
     }
 }

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=1712779&r1=1712778&r2=1712779&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 Thu Nov  5 14:11:54 2015
@@ -31,6 +31,7 @@ import org.apache.wss4j.dom.message.WSSe
 import org.apache.wss4j.dom.message.WSSecHeader;
 import org.apache.wss4j.dom.message.WSSecSignature;
 import org.apache.xml.security.utils.Base64;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.w3c.dom.Document;
 
 import javax.security.auth.callback.CallbackHandler;
@@ -38,6 +39,7 @@ import javax.xml.parsers.DocumentBuilder
 
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
+import java.security.Security;
 import java.security.cert.CertificateFactory;
 import java.security.cert.X509Certificate;
 
@@ -178,26 +180,32 @@ public class CryptoProviderTest extends
                 + "UyZ50HRroKJx1PPCE+OTO5JYPNQB2rauK63RHGGC94mY2ySCE2KP/yaWhkDJ60X2JKgnTLKUZxLP"
                 + "9IioeHVeUzGIccIicoiZR5kqaiqoEk82V81R+VA="
             );
-        CertificateFactory factory = 
-            CertificateFactory.getInstance("X.509", "BC");
-        X509Certificate cert = 
-            (X509Certificate)factory.generateCertificate(
-                new java.io.ByteArrayInputStream(certBytes)
-            );
-
-        WSSecEncrypt encrypt = new WSSecEncrypt();
-        encrypt.setUseThisCert(cert);
-        Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
-        WSSecHeader secHeader = new WSSecHeader(doc);
-        secHeader.insertSecurityHeader();
-        Document encryptedDoc = encrypt.build(doc, crypto, secHeader);
         
-        if (LOG.isDebugEnabled()) {
-            String outputString = 
-                XMLUtils.PrettyDocumentToString(encryptedDoc);
-            LOG.debug(outputString);
+        try {
+            Security.addProvider(new BouncyCastleProvider());
+            CertificateFactory factory = 
+                CertificateFactory.getInstance("X.509", "BC");
+            X509Certificate cert = 
+                (X509Certificate)factory.generateCertificate(
+                    new java.io.ByteArrayInputStream(certBytes)
+                );
+    
+            WSSecEncrypt encrypt = new WSSecEncrypt();
+            encrypt.setUseThisCert(cert);
+            Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
+            WSSecHeader secHeader = new WSSecHeader(doc);
+            secHeader.insertSecurityHeader();
+            Document encryptedDoc = encrypt.build(doc, crypto, secHeader);
+            
+            if (LOG.isDebugEnabled()) {
+                String outputString = 
+                    XMLUtils.PrettyDocumentToString(encryptedDoc);
+                LOG.debug(outputString);
+            }
+            verify(encryptedDoc);
+        } finally {
+            Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);
         }
-        verify(encryptedDoc);
         
     }
     
@@ -227,32 +235,37 @@ public class CryptoProviderTest extends
                 + "HapMIIWiJRclIAiA8Hnb0Sv/puuHYD4G4NWFdiVjRord90eZJe40NMGruRmlqIRIGGKCv+wv3E6U"
                 + "x1cWW862f5H9Eyrcocke2P+3GNAGy83vghA="
             );
-        CertificateFactory factory = 
-            CertificateFactory.getInstance("X.509", "BC");
-        X509Certificate cert = 
-            (X509Certificate)factory.generateCertificate(
-                new java.io.ByteArrayInputStream(certBytes)
-            );
-
-        WSSecEncrypt encrypt = new WSSecEncrypt();
-        encrypt.setUseThisCert(cert);
-        Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
-        WSSecHeader secHeader = new WSSecHeader(doc);
-        secHeader.insertSecurityHeader();
-        Document encryptedDoc = encrypt.build(doc, crypto, secHeader);
         
-        if (LOG.isDebugEnabled()) {
-            String outputString = 
-                XMLUtils.PrettyDocumentToString(encryptedDoc);
-            LOG.debug(outputString);
-        }
         try {
-            verify(encryptedDoc);
-            fail("Failure expected on encryption with a key that does not exist in the keystore");
-        } catch (Exception ex) {
-            // expected
+            Security.addProvider(new BouncyCastleProvider());
+            CertificateFactory factory = 
+                CertificateFactory.getInstance("X.509", "BC");
+            X509Certificate cert = 
+                (X509Certificate)factory.generateCertificate(
+                    new java.io.ByteArrayInputStream(certBytes)
+                );
+    
+            WSSecEncrypt encrypt = new WSSecEncrypt();
+            encrypt.setUseThisCert(cert);
+            Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
+            WSSecHeader secHeader = new WSSecHeader(doc);
+            secHeader.insertSecurityHeader();
+            Document encryptedDoc = encrypt.build(doc, crypto, secHeader);
+            
+            if (LOG.isDebugEnabled()) {
+                String outputString = 
+                    XMLUtils.PrettyDocumentToString(encryptedDoc);
+                LOG.debug(outputString);
+            }
+            try {
+                verify(encryptedDoc);
+                fail("Failure expected on encryption with a key that does not exist in the keystore");
+            } catch (Exception ex) {
+                // expected
+            }
+        } finally {
+            Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);
         }
-        
     }
     
     /**

Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/EncDecryptionTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/EncDecryptionTest.java?rev=1712779&r1=1712778&r2=1712779&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/EncDecryptionTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/EncDecryptionTest.java Thu Nov  5 14:11:54 2015
@@ -24,6 +24,7 @@ import java.io.InputStream;
 import java.lang.reflect.Field;
 import java.nio.charset.StandardCharsets;
 import java.security.KeyStore;
+import java.security.Security;
 import java.security.cert.X509Certificate;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -78,6 +79,7 @@ import org.apache.xml.security.stax.secu
 import org.apache.xml.security.stax.securityEvent.SecurityEvent;
 import org.apache.xml.security.stax.securityEvent.SecurityEventConstants;
 import org.apache.xml.security.utils.Base64;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
 import org.junit.Assert;
 import org.junit.Test;
 import org.w3c.dom.Document;
@@ -1826,56 +1828,61 @@ public class EncDecryptionTest extends A
      */
     @Test
     public void testKeyWrappingRSAOAEPMGF1AESGCM128Outbound() throws Exception {
-        ByteArrayOutputStream baos;
-        {
-            WSSSecurityProperties securityProperties = new WSSSecurityProperties();
-            List<WSSConstants.Action> actions = new ArrayList<WSSConstants.Action>();
-            actions.add(WSSConstants.ENCRYPT);
-            securityProperties.setActions(actions);
-            securityProperties.loadEncryptionKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
-            securityProperties.setEncryptionUser("receiver");
-            securityProperties.setEncryptionSymAlgorithm("http://www.w3.org/2009/xmlenc11#aes128-gcm");
-            securityProperties.setEncryptionKeyTransportAlgorithm("http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p");
-
-            InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
-            baos = doOutboundSecurity(securityProperties, sourceDocument);
-
-            Document document = documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray()));
-            NodeList nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_EncryptedKey.getNamespaceURI(), WSSConstants.TAG_xenc_EncryptedKey.getLocalPart());
-            Assert.assertEquals(nodeList.item(0).getParentNode().getLocalName(), WSSConstants.TAG_wsse_Security.getLocalPart());
-
-            XPathExpression xPathExpression = getXPath("/soap:Envelope/soap:Header/wsse:Security/xenc:EncryptedKey/xenc:EncryptionMethod[@Algorithm='http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p']");
-            Node node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
-            Assert.assertNotNull(node);
-
-            nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_DataReference.getNamespaceURI(), WSSConstants.TAG_xenc_DataReference.getLocalPart());
-            Assert.assertEquals(nodeList.getLength(), 1);
-
-            nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_EncryptedData.getNamespaceURI(), WSSConstants.TAG_xenc_EncryptedData.getLocalPart());
-            Assert.assertEquals(nodeList.getLength(), 1);
-
-            xPathExpression = getXPath("/soap:Envelope/soap:Body/xenc:EncryptedData/xenc:EncryptionMethod[@Algorithm='http://www.w3.org/2009/xmlenc11#aes128-gcm']");
-            node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
-            Assert.assertNotNull(node);
-
-            Assert.assertEquals(node.getParentNode().getParentNode().getLocalName(), "Body");
-            NodeList childNodes = node.getParentNode().getParentNode().getChildNodes();
-            for (int i = 0; i < childNodes.getLength(); i++) {
-                Node child = childNodes.item(i);
-                if (child.getNodeType() == Node.TEXT_NODE) {
-                    Assert.assertEquals(child.getTextContent().trim(), "");
-                } else if (child.getNodeType() == Node.ELEMENT_NODE) {
-                    Assert.assertEquals(child, nodeList.item(0));
-                } else {
-                    Assert.fail("Unexpected Node encountered");
+        try {
+            Security.addProvider(new BouncyCastleProvider());
+            ByteArrayOutputStream baos;
+            {
+                WSSSecurityProperties securityProperties = new WSSSecurityProperties();
+                List<WSSConstants.Action> actions = new ArrayList<WSSConstants.Action>();
+                actions.add(WSSConstants.ENCRYPT);
+                securityProperties.setActions(actions);
+                securityProperties.loadEncryptionKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
+                securityProperties.setEncryptionUser("receiver");
+                securityProperties.setEncryptionSymAlgorithm("http://www.w3.org/2009/xmlenc11#aes128-gcm");
+                securityProperties.setEncryptionKeyTransportAlgorithm("http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p");
+    
+                InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
+                baos = doOutboundSecurity(securityProperties, sourceDocument);
+    
+                Document document = documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray()));
+                NodeList nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_EncryptedKey.getNamespaceURI(), WSSConstants.TAG_xenc_EncryptedKey.getLocalPart());
+                Assert.assertEquals(nodeList.item(0).getParentNode().getLocalName(), WSSConstants.TAG_wsse_Security.getLocalPart());
+    
+                XPathExpression xPathExpression = getXPath("/soap:Envelope/soap:Header/wsse:Security/xenc:EncryptedKey/xenc:EncryptionMethod[@Algorithm='http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p']");
+                Node node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
+                Assert.assertNotNull(node);
+    
+                nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_DataReference.getNamespaceURI(), WSSConstants.TAG_xenc_DataReference.getLocalPart());
+                Assert.assertEquals(nodeList.getLength(), 1);
+    
+                nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_EncryptedData.getNamespaceURI(), WSSConstants.TAG_xenc_EncryptedData.getLocalPart());
+                Assert.assertEquals(nodeList.getLength(), 1);
+    
+                xPathExpression = getXPath("/soap:Envelope/soap:Body/xenc:EncryptedData/xenc:EncryptionMethod[@Algorithm='http://www.w3.org/2009/xmlenc11#aes128-gcm']");
+                node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
+                Assert.assertNotNull(node);
+    
+                Assert.assertEquals(node.getParentNode().getParentNode().getLocalName(), "Body");
+                NodeList childNodes = node.getParentNode().getParentNode().getChildNodes();
+                for (int i = 0; i < childNodes.getLength(); i++) {
+                    Node child = childNodes.item(i);
+                    if (child.getNodeType() == Node.TEXT_NODE) {
+                        Assert.assertEquals(child.getTextContent().trim(), "");
+                    } else if (child.getNodeType() == Node.ELEMENT_NODE) {
+                        Assert.assertEquals(child, nodeList.item(0));
+                    } else {
+                        Assert.fail("Unexpected Node encountered");
+                    }
                 }
             }
-        }
-
-        //done encryption; now test decryption:
-        {
-            String action = WSHandlerConstants.ENCRYPT;
-            doInboundSecurityWithWSS4J(documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray())), action);
+    
+            //done encryption; now test decryption:
+            {
+                String action = WSHandlerConstants.ENCRYPT;
+                doInboundSecurityWithWSS4J(documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray())), action);
+            }
+        } finally {
+            Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);
         }
     }
 
@@ -1927,60 +1934,65 @@ public class EncDecryptionTest extends A
     */
     @Test
     public void testKeyWrappingRSAOAEPAESGCM192SHA256Outbound() throws Exception {
-        ByteArrayOutputStream baos;
-        {
-            WSSSecurityProperties securityProperties = new WSSSecurityProperties();
-            List<WSSConstants.Action> actions = new ArrayList<WSSConstants.Action>();
-            actions.add(WSSConstants.ENCRYPT);
-            securityProperties.setActions(actions);
-            securityProperties.loadEncryptionKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
-            securityProperties.setEncryptionUser("receiver");
-            securityProperties.setEncryptionSymAlgorithm("http://www.w3.org/2009/xmlenc11#aes192-gcm");
-            securityProperties.setEncryptionKeyTransportAlgorithm("http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p");
-            securityProperties.setEncryptionKeyTransportDigestAlgorithm("http://www.w3.org/2001/04/xmlenc#sha256");
-
-            InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
-            baos = doOutboundSecurity(securityProperties, sourceDocument);
-
-            Document document = documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray()));
-            NodeList nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_EncryptedKey.getNamespaceURI(), WSSConstants.TAG_xenc_EncryptedKey.getLocalPart());
-            Assert.assertEquals(nodeList.item(0).getParentNode().getLocalName(), WSSConstants.TAG_wsse_Security.getLocalPart());
-
-            XPathExpression xPathExpression = getXPath("/soap:Envelope/soap:Header/wsse:Security/xenc:EncryptedKey/xenc:EncryptionMethod[@Algorithm='http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p']");
-            Node node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
-            Assert.assertNotNull(node);
-
-            xPathExpression = getXPath("/soap:Envelope/soap:Header/wsse:Security/xenc:EncryptedKey/xenc:EncryptionMethod/dsig:DigestMethod[@Algorithm='http://www.w3.org/2001/04/xmlenc#sha256']");
-            node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
-            Assert.assertNotNull(node);
-
-            nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_DataReference.getNamespaceURI(), WSSConstants.TAG_xenc_DataReference.getLocalPart());
-            Assert.assertEquals(nodeList.getLength(), 1);
-
-            nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_EncryptedData.getNamespaceURI(), WSSConstants.TAG_xenc_EncryptedData.getLocalPart());
-            Assert.assertEquals(nodeList.getLength(), 1);
-
-            xPathExpression = getXPath("/soap:Envelope/soap:Body/xenc:EncryptedData/xenc:EncryptionMethod[@Algorithm='http://www.w3.org/2009/xmlenc11#aes192-gcm']");
-            node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
-            Assert.assertNotNull(node);
-
-            Assert.assertEquals(node.getParentNode().getParentNode().getLocalName(), "Body");
-            NodeList childNodes = node.getParentNode().getParentNode().getChildNodes();
-            for (int i = 0; i < childNodes.getLength(); i++) {
-                Node child = childNodes.item(i);
-                if (child.getNodeType() == Node.TEXT_NODE) {
-                    Assert.assertEquals(child.getTextContent().trim(), "");
-                } else if (child.getNodeType() == Node.ELEMENT_NODE) {
-                    Assert.assertEquals(child, nodeList.item(0));
-                } else {
-                    Assert.fail("Unexpected Node encountered");
+        try {
+            Security.addProvider(new BouncyCastleProvider());
+            ByteArrayOutputStream baos;
+            {
+                WSSSecurityProperties securityProperties = new WSSSecurityProperties();
+                List<WSSConstants.Action> actions = new ArrayList<WSSConstants.Action>();
+                actions.add(WSSConstants.ENCRYPT);
+                securityProperties.setActions(actions);
+                securityProperties.loadEncryptionKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
+                securityProperties.setEncryptionUser("receiver");
+                securityProperties.setEncryptionSymAlgorithm("http://www.w3.org/2009/xmlenc11#aes192-gcm");
+                securityProperties.setEncryptionKeyTransportAlgorithm("http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p");
+                securityProperties.setEncryptionKeyTransportDigestAlgorithm("http://www.w3.org/2001/04/xmlenc#sha256");
+    
+                InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
+                baos = doOutboundSecurity(securityProperties, sourceDocument);
+    
+                Document document = documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray()));
+                NodeList nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_EncryptedKey.getNamespaceURI(), WSSConstants.TAG_xenc_EncryptedKey.getLocalPart());
+                Assert.assertEquals(nodeList.item(0).getParentNode().getLocalName(), WSSConstants.TAG_wsse_Security.getLocalPart());
+    
+                XPathExpression xPathExpression = getXPath("/soap:Envelope/soap:Header/wsse:Security/xenc:EncryptedKey/xenc:EncryptionMethod[@Algorithm='http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p']");
+                Node node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
+                Assert.assertNotNull(node);
+    
+                xPathExpression = getXPath("/soap:Envelope/soap:Header/wsse:Security/xenc:EncryptedKey/xenc:EncryptionMethod/dsig:DigestMethod[@Algorithm='http://www.w3.org/2001/04/xmlenc#sha256']");
+                node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
+                Assert.assertNotNull(node);
+    
+                nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_DataReference.getNamespaceURI(), WSSConstants.TAG_xenc_DataReference.getLocalPart());
+                Assert.assertEquals(nodeList.getLength(), 1);
+    
+                nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_EncryptedData.getNamespaceURI(), WSSConstants.TAG_xenc_EncryptedData.getLocalPart());
+                Assert.assertEquals(nodeList.getLength(), 1);
+    
+                xPathExpression = getXPath("/soap:Envelope/soap:Body/xenc:EncryptedData/xenc:EncryptionMethod[@Algorithm='http://www.w3.org/2009/xmlenc11#aes192-gcm']");
+                node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
+                Assert.assertNotNull(node);
+    
+                Assert.assertEquals(node.getParentNode().getParentNode().getLocalName(), "Body");
+                NodeList childNodes = node.getParentNode().getParentNode().getChildNodes();
+                for (int i = 0; i < childNodes.getLength(); i++) {
+                    Node child = childNodes.item(i);
+                    if (child.getNodeType() == Node.TEXT_NODE) {
+                        Assert.assertEquals(child.getTextContent().trim(), "");
+                    } else if (child.getNodeType() == Node.ELEMENT_NODE) {
+                        Assert.assertEquals(child, nodeList.item(0));
+                    } else {
+                        Assert.fail("Unexpected Node encountered");
+                    }
                 }
             }
-        }
-        //done encryption; now test decryption:
-        {
-            String action = WSHandlerConstants.ENCRYPT;
-            doInboundSecurityWithWSS4J(documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray())), action);
+            //done encryption; now test decryption:
+            {
+                String action = WSHandlerConstants.ENCRYPT;
+                doInboundSecurityWithWSS4J(documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray())), action);
+            }
+        } finally {
+            Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);
         }
     }
 
@@ -2037,65 +2049,71 @@ public class EncDecryptionTest extends A
      */
     @Test
     public void testKeyWrappingRSAOAEPAES192GCMSHA384MGF1sha384Outbound() throws Exception {
-        ByteArrayOutputStream baos;
-        {
-            WSSSecurityProperties securityProperties = new WSSSecurityProperties();
-            List<WSSConstants.Action> actions = new ArrayList<WSSConstants.Action>();
-            actions.add(WSSConstants.ENCRYPT);
-            securityProperties.setActions(actions);
-            securityProperties.loadEncryptionKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
-            securityProperties.setEncryptionUser("receiver");
-            securityProperties.setEncryptionSymAlgorithm("http://www.w3.org/2009/xmlenc11#aes192-gcm");
-            securityProperties.setEncryptionKeyTransportAlgorithm("http://www.w3.org/2009/xmlenc11#rsa-oaep");
-            securityProperties.setEncryptionKeyTransportDigestAlgorithm("http://www.w3.org/2001/04/xmldsig-more#sha384");
-            securityProperties.setEncryptionKeyTransportMGFAlgorithm("http://www.w3.org/2009/xmlenc11#mgf1sha384");
-
-            InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
-            baos = doOutboundSecurity(securityProperties, sourceDocument);
-
-            Document document = documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray()));
-            NodeList nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_EncryptedKey.getNamespaceURI(), WSSConstants.TAG_xenc_EncryptedKey.getLocalPart());
-            Assert.assertEquals(nodeList.item(0).getParentNode().getLocalName(), WSSConstants.TAG_wsse_Security.getLocalPart());
-
-            XPathExpression xPathExpression = getXPath("/soap:Envelope/soap:Header/wsse:Security/xenc:EncryptedKey/xenc:EncryptionMethod[@Algorithm='http://www.w3.org/2009/xmlenc11#rsa-oaep']");
-            Node node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
-            Assert.assertNotNull(node);
-
-            xPathExpression = getXPath("/soap:Envelope/soap:Header/wsse:Security/xenc:EncryptedKey/xenc:EncryptionMethod/dsig:DigestMethod[@Algorithm='http://www.w3.org/2001/04/xmldsig-more#sha384']");
-            node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
-            Assert.assertNotNull(node);
-
-            xPathExpression = getXPath("/soap:Envelope/soap:Header/wsse:Security/xenc:EncryptedKey/xenc:EncryptionMethod/xenc11:MGF[@Algorithm='http://www.w3.org/2009/xmlenc11#mgf1sha384']");
-            node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
-            Assert.assertNotNull(node);
+        try {
+            Security.addProvider(new BouncyCastleProvider());
 
-            nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_DataReference.getNamespaceURI(), WSSConstants.TAG_xenc_DataReference.getLocalPart());
-            Assert.assertEquals(nodeList.getLength(), 1);
-
-            nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_EncryptedData.getNamespaceURI(), WSSConstants.TAG_xenc_EncryptedData.getLocalPart());
-            Assert.assertEquals(nodeList.getLength(), 1);
-
-            xPathExpression = getXPath("/soap:Envelope/soap:Body/xenc:EncryptedData/xenc:EncryptionMethod[@Algorithm='http://www.w3.org/2009/xmlenc11#aes192-gcm']");
-            node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
-            Assert.assertNotNull(node);
-
-            Assert.assertEquals(node.getParentNode().getParentNode().getLocalName(), "Body");
-            NodeList childNodes = node.getParentNode().getParentNode().getChildNodes();
-            for (int i = 0; i < childNodes.getLength(); i++) {
-                Node child = childNodes.item(i);
-                if (child.getNodeType() == Node.TEXT_NODE) {
-                    Assert.assertEquals(child.getTextContent().trim(), "");
-                } else if (child.getNodeType() == Node.ELEMENT_NODE) {
-                    Assert.assertEquals(child, nodeList.item(0));
-                } else {
-                    Assert.fail("Unexpected Node encountered");
+            ByteArrayOutputStream baos;
+            {
+                WSSSecurityProperties securityProperties = new WSSSecurityProperties();
+                List<WSSConstants.Action> actions = new ArrayList<WSSConstants.Action>();
+                actions.add(WSSConstants.ENCRYPT);
+                securityProperties.setActions(actions);
+                securityProperties.loadEncryptionKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
+                securityProperties.setEncryptionUser("receiver");
+                securityProperties.setEncryptionSymAlgorithm("http://www.w3.org/2009/xmlenc11#aes192-gcm");
+                securityProperties.setEncryptionKeyTransportAlgorithm("http://www.w3.org/2009/xmlenc11#rsa-oaep");
+                securityProperties.setEncryptionKeyTransportDigestAlgorithm("http://www.w3.org/2001/04/xmldsig-more#sha384");
+                securityProperties.setEncryptionKeyTransportMGFAlgorithm("http://www.w3.org/2009/xmlenc11#mgf1sha384");
+
+                InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
+                baos = doOutboundSecurity(securityProperties, sourceDocument);
+
+                Document document = documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray()));
+                NodeList nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_EncryptedKey.getNamespaceURI(), WSSConstants.TAG_xenc_EncryptedKey.getLocalPart());
+                Assert.assertEquals(nodeList.item(0).getParentNode().getLocalName(), WSSConstants.TAG_wsse_Security.getLocalPart());
+
+                XPathExpression xPathExpression = getXPath("/soap:Envelope/soap:Header/wsse:Security/xenc:EncryptedKey/xenc:EncryptionMethod[@Algorithm='http://www.w3.org/2009/xmlenc11#rsa-oaep']");
+                Node node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
+                Assert.assertNotNull(node);
+
+                xPathExpression = getXPath("/soap:Envelope/soap:Header/wsse:Security/xenc:EncryptedKey/xenc:EncryptionMethod/dsig:DigestMethod[@Algorithm='http://www.w3.org/2001/04/xmldsig-more#sha384']");
+                node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
+                Assert.assertNotNull(node);
+
+                xPathExpression = getXPath("/soap:Envelope/soap:Header/wsse:Security/xenc:EncryptedKey/xenc:EncryptionMethod/xenc11:MGF[@Algorithm='http://www.w3.org/2009/xmlenc11#mgf1sha384']");
+                node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
+                Assert.assertNotNull(node);
+
+                nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_DataReference.getNamespaceURI(), WSSConstants.TAG_xenc_DataReference.getLocalPart());
+                Assert.assertEquals(nodeList.getLength(), 1);
+
+                nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_EncryptedData.getNamespaceURI(), WSSConstants.TAG_xenc_EncryptedData.getLocalPart());
+                Assert.assertEquals(nodeList.getLength(), 1);
+
+                xPathExpression = getXPath("/soap:Envelope/soap:Body/xenc:EncryptedData/xenc:EncryptionMethod[@Algorithm='http://www.w3.org/2009/xmlenc11#aes192-gcm']");
+                node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
+                Assert.assertNotNull(node);
+
+                Assert.assertEquals(node.getParentNode().getParentNode().getLocalName(), "Body");
+                NodeList childNodes = node.getParentNode().getParentNode().getChildNodes();
+                for (int i = 0; i < childNodes.getLength(); i++) {
+                    Node child = childNodes.item(i);
+                    if (child.getNodeType() == Node.TEXT_NODE) {
+                        Assert.assertEquals(child.getTextContent().trim(), "");
+                    } else if (child.getNodeType() == Node.ELEMENT_NODE) {
+                        Assert.assertEquals(child, nodeList.item(0));
+                    } else {
+                        Assert.fail("Unexpected Node encountered");
+                    }
                 }
             }
-        }
-        //done encryption; now test decryption:
-        {
-            String action = WSHandlerConstants.ENCRYPT;
-            doInboundSecurityWithWSS4J_1(documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray())), action);
+            //done encryption; now test decryption:
+            {
+                String action = WSHandlerConstants.ENCRYPT;
+                doInboundSecurityWithWSS4J_1(documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray())), action);
+            }
+        } finally {
+            Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);
         }
     }
 
@@ -2157,70 +2175,75 @@ public class EncDecryptionTest extends A
 
     @Test
     public void testKeyWrappingRSAOAEPAESGCM192SHA384MGF1SHA384PSourceOutbound() throws Exception {
-        ByteArrayOutputStream baos;
-        {
-            WSSSecurityProperties securityProperties = new WSSSecurityProperties();
-            List<WSSConstants.Action> actions = new ArrayList<WSSConstants.Action>();
-            actions.add(WSSConstants.ENCRYPT);
-            securityProperties.setActions(actions);
-            securityProperties.loadEncryptionKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
-            securityProperties.setEncryptionUser("receiver");
-            securityProperties.setEncryptionSymAlgorithm("http://www.w3.org/2009/xmlenc11#aes192-gcm");
-            securityProperties.setEncryptionKeyTransportAlgorithm("http://www.w3.org/2009/xmlenc11#rsa-oaep");
-            securityProperties.setEncryptionKeyTransportDigestAlgorithm("http://www.w3.org/2001/04/xmldsig-more#sha384");
-            securityProperties.setEncryptionKeyTransportMGFAlgorithm("http://www.w3.org/2009/xmlenc11#mgf1sha384");
-            securityProperties.setEncryptionKeyTransportOAEPParams(Base64.decode("ZHVtbXkxMjM=".getBytes(StandardCharsets.UTF_8)));
-
-            InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
-            baos = doOutboundSecurity(securityProperties, sourceDocument);
-
-            Document document = documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray()));
-            NodeList nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_EncryptedKey.getNamespaceURI(), WSSConstants.TAG_xenc_EncryptedKey.getLocalPart());
-            Assert.assertEquals(nodeList.item(0).getParentNode().getLocalName(), WSSConstants.TAG_wsse_Security.getLocalPart());
-
-            XPathExpression xPathExpression = getXPath("/soap:Envelope/soap:Header/wsse:Security/xenc:EncryptedKey/xenc:EncryptionMethod[@Algorithm='http://www.w3.org/2009/xmlenc11#rsa-oaep']");
-            Node node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
-            Assert.assertNotNull(node);
-
-            xPathExpression = getXPath("/soap:Envelope/soap:Header/wsse:Security/xenc:EncryptedKey/xenc:EncryptionMethod/xenc:OAEPparams");
-            node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
-            Assert.assertNotNull(node);
-
-            xPathExpression = getXPath("/soap:Envelope/soap:Header/wsse:Security/xenc:EncryptedKey/xenc:EncryptionMethod/dsig:DigestMethod[@Algorithm='http://www.w3.org/2001/04/xmldsig-more#sha384']");
-            node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
-            Assert.assertNotNull(node);
-
-            xPathExpression = getXPath("/soap:Envelope/soap:Header/wsse:Security/xenc:EncryptedKey/xenc:EncryptionMethod/xenc11:MGF[@Algorithm='http://www.w3.org/2009/xmlenc11#mgf1sha384']");
-            node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
-            Assert.assertNotNull(node);
-
-            nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_DataReference.getNamespaceURI(), WSSConstants.TAG_xenc_DataReference.getLocalPart());
-            Assert.assertEquals(nodeList.getLength(), 1);
-
-            nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_EncryptedData.getNamespaceURI(), WSSConstants.TAG_xenc_EncryptedData.getLocalPart());
-            Assert.assertEquals(nodeList.getLength(), 1);
-
-            xPathExpression = getXPath("/soap:Envelope/soap:Body/xenc:EncryptedData/xenc:EncryptionMethod[@Algorithm='http://www.w3.org/2009/xmlenc11#aes192-gcm']");
-            node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
-            Assert.assertNotNull(node);
-
-            Assert.assertEquals(node.getParentNode().getParentNode().getLocalName(), "Body");
-            NodeList childNodes = node.getParentNode().getParentNode().getChildNodes();
-            for (int i = 0; i < childNodes.getLength(); i++) {
-                Node child = childNodes.item(i);
-                if (child.getNodeType() == Node.TEXT_NODE) {
-                    Assert.assertEquals(child.getTextContent().trim(), "");
-                } else if (child.getNodeType() == Node.ELEMENT_NODE) {
-                    Assert.assertEquals(child, nodeList.item(0));
-                } else {
-                    Assert.fail("Unexpected Node encountered");
+        try {
+            Security.addProvider(new BouncyCastleProvider());
+            ByteArrayOutputStream baos;
+            {
+                WSSSecurityProperties securityProperties = new WSSSecurityProperties();
+                List<WSSConstants.Action> actions = new ArrayList<WSSConstants.Action>();
+                actions.add(WSSConstants.ENCRYPT);
+                securityProperties.setActions(actions);
+                securityProperties.loadEncryptionKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
+                securityProperties.setEncryptionUser("receiver");
+                securityProperties.setEncryptionSymAlgorithm("http://www.w3.org/2009/xmlenc11#aes192-gcm");
+                securityProperties.setEncryptionKeyTransportAlgorithm("http://www.w3.org/2009/xmlenc11#rsa-oaep");
+                securityProperties.setEncryptionKeyTransportDigestAlgorithm("http://www.w3.org/2001/04/xmldsig-more#sha384");
+                securityProperties.setEncryptionKeyTransportMGFAlgorithm("http://www.w3.org/2009/xmlenc11#mgf1sha384");
+                securityProperties.setEncryptionKeyTransportOAEPParams(Base64.decode("ZHVtbXkxMjM=".getBytes(StandardCharsets.UTF_8)));
+    
+                InputStream sourceDocument = this.getClass().getClassLoader().getResourceAsStream("testdata/plain-soap-1.1.xml");
+                baos = doOutboundSecurity(securityProperties, sourceDocument);
+    
+                Document document = documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray()));
+                NodeList nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_EncryptedKey.getNamespaceURI(), WSSConstants.TAG_xenc_EncryptedKey.getLocalPart());
+                Assert.assertEquals(nodeList.item(0).getParentNode().getLocalName(), WSSConstants.TAG_wsse_Security.getLocalPart());
+    
+                XPathExpression xPathExpression = getXPath("/soap:Envelope/soap:Header/wsse:Security/xenc:EncryptedKey/xenc:EncryptionMethod[@Algorithm='http://www.w3.org/2009/xmlenc11#rsa-oaep']");
+                Node node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
+                Assert.assertNotNull(node);
+    
+                xPathExpression = getXPath("/soap:Envelope/soap:Header/wsse:Security/xenc:EncryptedKey/xenc:EncryptionMethod/xenc:OAEPparams");
+                node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
+                Assert.assertNotNull(node);
+    
+                xPathExpression = getXPath("/soap:Envelope/soap:Header/wsse:Security/xenc:EncryptedKey/xenc:EncryptionMethod/dsig:DigestMethod[@Algorithm='http://www.w3.org/2001/04/xmldsig-more#sha384']");
+                node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
+                Assert.assertNotNull(node);
+    
+                xPathExpression = getXPath("/soap:Envelope/soap:Header/wsse:Security/xenc:EncryptedKey/xenc:EncryptionMethod/xenc11:MGF[@Algorithm='http://www.w3.org/2009/xmlenc11#mgf1sha384']");
+                node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
+                Assert.assertNotNull(node);
+    
+                nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_DataReference.getNamespaceURI(), WSSConstants.TAG_xenc_DataReference.getLocalPart());
+                Assert.assertEquals(nodeList.getLength(), 1);
+    
+                nodeList = document.getElementsByTagNameNS(WSSConstants.TAG_xenc_EncryptedData.getNamespaceURI(), WSSConstants.TAG_xenc_EncryptedData.getLocalPart());
+                Assert.assertEquals(nodeList.getLength(), 1);
+    
+                xPathExpression = getXPath("/soap:Envelope/soap:Body/xenc:EncryptedData/xenc:EncryptionMethod[@Algorithm='http://www.w3.org/2009/xmlenc11#aes192-gcm']");
+                node = (Node) xPathExpression.evaluate(document, XPathConstants.NODE);
+                Assert.assertNotNull(node);
+    
+                Assert.assertEquals(node.getParentNode().getParentNode().getLocalName(), "Body");
+                NodeList childNodes = node.getParentNode().getParentNode().getChildNodes();
+                for (int i = 0; i < childNodes.getLength(); i++) {
+                    Node child = childNodes.item(i);
+                    if (child.getNodeType() == Node.TEXT_NODE) {
+                        Assert.assertEquals(child.getTextContent().trim(), "");
+                    } else if (child.getNodeType() == Node.ELEMENT_NODE) {
+                        Assert.assertEquals(child, nodeList.item(0));
+                    } else {
+                        Assert.fail("Unexpected Node encountered");
+                    }
                 }
             }
-        }
-        //done encryption; now test decryption:
-        {
-            String action = WSHandlerConstants.ENCRYPT;
-            doInboundSecurityWithWSS4J_1(documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray())), action);
+            //done encryption; now test decryption:
+            {
+                String action = WSHandlerConstants.ENCRYPT;
+                doInboundSecurityWithWSS4J_1(documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray())), action);
+            }
+        } finally {
+            Security.removeProvider(BouncyCastleProvider.PROVIDER_NAME);
         }
     }
 

Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/PrincipalTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/PrincipalTest.java?rev=1712779&r1=1712778&r2=1712779&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/PrincipalTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/PrincipalTest.java Thu Nov  5 14:11:54 2015
@@ -308,8 +308,7 @@ public class PrincipalTest extends Abstr
         //
         if ("IBM Corporation".equals(System.getProperty("java.vendor"))
             || System.getProperty("java.version") != null
-                &&  (System.getProperty("java.version").startsWith("1.8")
-                    || System.getProperty("java.version").startsWith("1.6"))) {
+                && System.getProperty("java.version").startsWith("1.8")) {
             return;
         }
 

Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureTest.java?rev=1712779&r1=1712778&r2=1712779&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/SignatureTest.java Thu Nov  5 14:11:54 2015
@@ -1440,8 +1440,7 @@ public class SignatureTest extends Abstr
         //
         if ("IBM Corporation".equals(System.getProperty("java.vendor"))
             || System.getProperty("java.version") != null
-                &&  (System.getProperty("java.version").startsWith("1.8")
-                    || System.getProperty("java.version").startsWith("1.6"))) {
+                && System.getProperty("java.version").startsWith("1.8")) {
             return;
         }