ws-wss4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wer...@apache.org
Subject svn commit: r345242 - /webservices/wss4j/trunk/src/org/apache/ws/security/processor/ReferenceListProcessor.java
Date Thu, 17 Nov 2005 14:15:04 GMT
Author: werner
Date: Thu Nov 17 06:14:58 2005
New Revision: 345242

URL: http://svn.apache.org/viewcvs?rev=345242&view=rev
Log:
Use the provider defined/set in WSConfig to decrypt XML data.

Modified:
    webservices/wss4j/trunk/src/org/apache/ws/security/processor/ReferenceListProcessor.java

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/processor/ReferenceListProcessor.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/processor/ReferenceListProcessor.java?rev=345242&r1=345241&r2=345242&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/processor/ReferenceListProcessor.java
(original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/processor/ReferenceListProcessor.java
Thu Nov 17 06:14:58 2005
@@ -38,11 +38,14 @@
 
 public class ReferenceListProcessor implements Processor {
     private static Log log = LogFactory.getLog(ReferenceListProcessor.class.getName());
+    
+    WSSConfig wssConfig = null;    
 
     public void handleToken(Element elem, Crypto crypto, Crypto decCrypto, CallbackHandler
cb, WSDocInfo wsDocInfo, Vector returnResults, WSSConfig wsc) throws WSSecurityException {
         if (log.isDebugEnabled()) {
             log.debug("Found reference list element");
         }
+        wssConfig = wsc;        
         if (cb == null) {
             throw new WSSecurityException(WSSecurityException.FAILURE,
                     "noCallback");
@@ -119,8 +122,13 @@
         // initialize Cipher ....
         XMLCipher xmlCipher = null;
         try {
-            xmlCipher = XMLCipher.getInstance(symEncAlgo);
-            xmlCipher.init(XMLCipher.DECRYPT_MODE, symmetricKey);
+			String provider = wssConfig.getJceProviderId();
+			if (provider == null) {
+				xmlCipher = XMLCipher.getInstance(symEncAlgo);
+			} else {
+				xmlCipher = XMLCipher.getProviderInstance(symEncAlgo, provider);
+			}
+			xmlCipher.init(XMLCipher.DECRYPT_MODE, symmetricKey);
         } catch (XMLEncryptionException e1) {
             throw new WSSecurityException(WSSecurityException.UNSUPPORTED_ALGORITHM, null,
null, e1);
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: wss4j-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: wss4j-dev-help@ws.apache.org


Mime
View raw message