ws-wss4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wer...@apache.org
Subject svn commit: r344987 - /webservices/wss4j/trunk/src/org/apache/ws/security/processor/EncryptedKeyProcessor.java
Date Wed, 16 Nov 2005 12:14:05 GMT
Author: werner
Date: Wed Nov 16 04:14:00 2005
New Revision: 344987

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

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

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/processor/EncryptedKeyProcessor.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/processor/EncryptedKeyProcessor.java?rev=344987&r1=344986&r2=344987&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/processor/EncryptedKeyProcessor.java
(original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/processor/EncryptedKeyProcessor.java
Wed Nov 16 04:14:00 2005
@@ -373,11 +373,17 @@
         // initialize Cipher ....
         XMLCipher xmlCipher = null;
         try {
-            xmlCipher = XMLCipher.getInstance(symEncAlgo);
-            xmlCipher.init(XMLCipher.DECRYPT_MODE, symmetricKey);
-        } catch (XMLEncryptionException e) {
-            throw new WSSecurityException(WSSecurityException.UNSUPPORTED_ALGORITHM, null,
null, e);
-        }
+			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 e) {
+			throw new WSSecurityException(
+					WSSecurityException.UNSUPPORTED_ALGORITHM, null, null, e);
+		}
 
         if (content) {
             encBodyData = (Element) encBodyData.getParentNode();



---------------------------------------------------------------------
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