cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1296119 - /cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
Date Fri, 02 Mar 2012 10:37:04 GMT
Author: coheigea
Date: Fri Mar  2 10:37:03 2012
New Revision: 1296119

URL: http://svn.apache.org/viewvc?rev=1296119&view=rev
Log:
[CXF-4049] - Check external CryptoProvider from message context properties in Wss4jInInterceptor
 - Patch applied, thanks.
 - I made some changes as per my comments in the JIRA.

Modified:
    cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java

Modified: cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java?rev=1296119&r1=1296118&r2=1296119&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java
Fri Mar  2 10:37:03 2012
@@ -68,6 +68,7 @@ import org.apache.ws.security.WSSConfig;
 import org.apache.ws.security.WSSecurityEngine;
 import org.apache.ws.security.WSSecurityEngineResult;
 import org.apache.ws.security.WSSecurityException;
+import org.apache.ws.security.components.crypto.Crypto;
 import org.apache.ws.security.handler.RequestData;
 import org.apache.ws.security.handler.WSHandlerConstants;
 import org.apache.ws.security.handler.WSHandlerResult;
@@ -376,7 +377,19 @@ public class WSS4JInInterceptor extends 
      * @param reqData
      */
     protected void computeAction(SoapMessage msg, RequestData reqData) {
-        
+        //
+        // Try to get Crypto Provider from message context properties. 
+        // It gives a possibility to use external Crypto Provider 
+        //
+        Crypto encCrypto = (Crypto)msg.getContextualProperty(SecurityConstants.ENCRYPT_CRYPTO);
+        if (encCrypto != null) {
+            reqData.setEncCrypto(encCrypto);
+            reqData.setDecCrypto(encCrypto);
+        }
+        Crypto sigCrypto = (Crypto)msg.getContextualProperty(SecurityConstants.SIGNATURE_CRYPTO);
+        if (sigCrypto != null) {
+            reqData.setSigCrypto(sigCrypto);
+        }
     }
 
     protected void doResults(
@@ -657,7 +670,6 @@ public class WSS4JInInterceptor extends 
         return fault;
     }
     
-    
     static class CXFRequestData extends RequestData {
         public CXFRequestData() {
         }



Mime
View raw message