cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1444862 - /cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java
Date Mon, 11 Feb 2013 16:58:05 GMT
Author: coheigea
Date: Mon Feb 11 16:58:05 2013
New Revision: 1444862

URL: http://svn.apache.org/r1444862
Log:
Simplifying Crypto configuration

Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java?rev=1444862&r1=1444861&r2=1444862&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/PolicyBasedWSS4JInInterceptor.java
Mon Feb 11 16:58:05 2013
@@ -113,7 +113,7 @@ public class PolicyBasedWSS4JInIntercept
         super(true);
     }
     
-    private static Properties getProps(Object o, String propsKey, URL propsURL, SoapMessage
message) {
+    private static Properties getProps(Object o, URL propsURL, SoapMessage message) {
         Properties properties = null;
         if (o instanceof Properties) {
             properties = (Properties)o;
@@ -365,16 +365,14 @@ public class PolicyBasedWSS4JInIntercept
             encrCrypto = (Crypto)e;
         } else if (e != null) {
             URL propsURL = getPropertiesFileURL(e, message);
-            String propsKey = e.toString();
-            if (propsURL != null) {
-                propsKey = propsURL.getPath();
-            }
-            Properties props = getProps(e, propsKey, propsURL, message);
-            encrCrypto = CryptoFactory.getInstance(props);
-            
-            EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
-            synchronized (info) {
-                info.setProperty(SecurityConstants.ENCRYPT_CRYPTO, encrCrypto);
+            Properties props = getProps(e, propsURL, message);
+            if (props != null) {
+                encrCrypto = CryptoFactory.getInstance(props);
+                
+                EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
+                synchronized (info) {
+                    info.setProperty(SecurityConstants.ENCRYPT_CRYPTO, encrCrypto);
+                }
             }
         }
         return encrCrypto;
@@ -386,16 +384,14 @@ public class PolicyBasedWSS4JInIntercept
             signCrypto = (Crypto)s;
         } else if (s != null) {
             URL propsURL = getPropertiesFileURL(s, message);
-            String propsKey = s.toString();
-            if (propsURL != null) {
-                propsKey = propsURL.getPath();
-            }
-            Properties props = getProps(s, propsKey, propsURL, message);
-            signCrypto = CryptoFactory.getInstance(props);
-            
-            EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
-            synchronized (info) {
-                info.setProperty(SecurityConstants.SIGNATURE_CRYPTO, signCrypto);
+            Properties props = getProps(s, propsURL, message);
+            if (props != null) {
+                signCrypto = CryptoFactory.getInstance(props);
+                
+                EndpointInfo info = message.getExchange().get(Endpoint.class).getEndpointInfo();
+                synchronized (info) {
+                    info.setProperty(SecurityConstants.SIGNATURE_CRYPTO, signCrypto);
+                }
             }
         }
         return signCrypto;



Mime
View raw message