You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wss4j-dev@ws.apache.org by we...@apache.org on 2006/03/06 18:05:23 UTC

svn commit: r383585 [1/2] - in /webservices/wss4j/trunk/src/org/apache/ws/security: ./ handler/ message/ processor/ util/

Author: werner
Date: Mon Mar  6 09:05:19 2006
New Revision: 383585

URL: http://svn.apache.org/viewcvs?rev=383585&view=rev
Log:
Quite some code cleanup, re-adjust JCE provider handling, use JuiCE
if avilable (if not available it's quietly ignored). Using JuiCE gives
about 30-40% performance improvement.

Modified:
    webservices/wss4j/trunk/src/org/apache/ws/security/WSSConfig.java
    webservices/wss4j/trunk/src/org/apache/ws/security/handler/WSHandler.java
    webservices/wss4j/trunk/src/org/apache/ws/security/handler/WSS4JHandler.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSAddSignatureConfirmation.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSAddTimestamp.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSBaseMessage.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSEncryptBody.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSAddSAMLToken.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSAddUsernameToken.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecBase.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecDKEncrypt.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecDKSign.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecDerivedKeyBase.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecEncrypt.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecHeader.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecSAMLToken.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecSignatureConfirmation.java
    webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSignEnvelope.java
    webservices/wss4j/trunk/src/org/apache/ws/security/processor/DerivedKeyTokenProcessor.java
    webservices/wss4j/trunk/src/org/apache/ws/security/processor/EncryptedKeyProcessor.java
    webservices/wss4j/trunk/src/org/apache/ws/security/util/WSSecurityUtil.java

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/WSSConfig.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/WSSConfig.java?rev=383585&r1=383584&r2=383585&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/WSSConfig.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/WSSConfig.java Mon Mar  6 09:05:19 2006
@@ -31,58 +31,60 @@
 import javax.xml.namespace.QName;
 
 /**
- * WSSConfig
- * <p/>
- * Carries configuration data so the WSS4J spec compliance can be modified in
- * runtime. Configure an instance of this object only if you need WSS4J to
- * emulate certain industry clients or previous OASIS specifications for
- * WS-Security interoperability testing purposes.
- * <p/>
- * The default settings follow the latest OASIS and changing anything might
- * violate the OASIS specs.
- * <p/>
- * <b>WARNING: changing the default settings will break the compliance with the
- * latest specs.  Do this only if you know what you are doing.</b>
- * <p/>
- *
+ * WSSConfig <p/> Carries configuration data so the WSS4J spec compliance can be
+ * modified in runtime. Configure an instance of this object only if you need
+ * WSS4J to emulate certain industry clients or previous OASIS specifications
+ * for WS-Security interoperability testing purposes. <p/> The default settings
+ * follow the latest OASIS and changing anything might violate the OASIS specs.
+ * <p/> <b>WARNING: changing the default settings will break the compliance with
+ * the latest specs. Do this only if you know what you are doing.</b> <p/>
+ * 
  * @author Rami Jaamour (rjaamour@parasoft.com)
  * @author Werner Dittmann (werner@apache.org)
  */
 public class WSSConfig {
     private static Log log = LogFactory.getLog(WSSConfig.class.getName());
+
     protected static WSSConfig defaultConfig = getNewInstance();
+
     protected boolean wsiBSPCompliant = false;
+
     /**
-     * Set the timestamp precision mode.
-     * If set to <code>true</code> then use timestamps with milliseconds,
-     * otherwise omit the millisconds. As per XML Date/Time specification
-     * the default is to include the milliseconds.
+     * Set the timestamp precision mode. If set to <code>true</code> then use
+     * timestamps with milliseconds, otherwise omit the millisconds. As per XML
+     * Date/Time specification the default is to include the milliseconds.
      */
     protected boolean precisionInMilliSeconds = true;
 
     protected boolean enableSignatureConfirmation = true;
-    
+
     /**
-     * If set to true then the timestamp handling will throw an
-     * expcetion if the timestamp contains an expires element and
-     * the semantics are expired.
+     * If set to true then the timestamp handling will throw an expcetion if the
+     * timestamp contains an expires element and the semantics are expired.
      * 
-     * If set to false, not expetion will be thrown, even if the
-     * semantics are expired. 
+     * If set to false, not expetion will be thrown, even if the semantics are
+     * expired.
      */
     protected boolean timeStampStrict = true;
-    
+
     protected HashMap jceProvider = new HashMap(10);
+
     protected String jceProviderId = null;
-    
-    
-    
 
     protected WSSConfig() {
         org.apache.xml.security.Init.init();
-        if (addJceProvider("BC", "org.bouncycastle.jce.provider.BouncyCastleProvider")) {
+        /*
+         * The last provider added has precedence, that is if JuiCE can be add
+         * then WSS4J uses this provider.
+         */
+        if (addJceProvider("BC",
+                "org.bouncycastle.jce.provider.BouncyCastleProvider")) {
             setJceProviderId("BC");
         }
+        if (addJceProvider("JuiCE",
+                "org.apache.security.juice.provider.JuiCEProviderOpenSSL")) {
+            setJceProviderId("JuiCE");
+        }
         Transform.init();
         try {
             Transform.register(STRTransform.implementedTransformURI,
@@ -93,7 +95,8 @@
 
     /**
      * @return a new WSSConfig instance configured with the default values
-     *         (values identical to {@link #getDefaultWSConfig getDefaultWSConfig()})
+     *         (values identical to
+     *         {@link #getDefaultWSConfig getDefaultWSConfig()})
      */
     public static WSSConfig getNewInstance() {
         WSSConfig config = new WSSConfig();
@@ -110,7 +113,7 @@
 
     /**
      * Checks if we are in WS-I Basic Security Profile compliance mode
-     *
+     * 
      * @return TODO
      */
     public boolean isWsiBSPCompliant() {
@@ -118,9 +121,9 @@
     }
 
     /**
-     * Set the WS-I Basic Security Profile compliance mode. The default is
-     * false (dues to .Net interop problems).
-     *
+     * Set the WS-I Basic Security Profile compliance mode. The default is false
+     * (dues to .Net interop problems).
+     * 
      * @param wsiBSPCompliant
      */
     public void setWsiBSPCompliant(boolean wsiBSPCompliant) {
@@ -129,7 +132,7 @@
 
     /**
      * Checks if we need to use milliseconds in timestamps
-     *
+     * 
      * @return TODO
      */
     public boolean isPrecisionInMilliSeconds() {
@@ -138,8 +141,9 @@
 
     /**
      * Set the precision in milliseconds
-     *
-     * @param precisionInMilliSeconds TODO
+     * 
+     * @param precisionInMilliSeconds
+     *            TODO
      */
     public void setPrecisionInMilliSeconds(boolean precisionInMilliSeconds) {
         this.precisionInMilliSeconds = precisionInMilliSeconds;
@@ -153,38 +157,40 @@
     }
 
     /**
-     * @param enableSignatureConfirmation The enableSignatureConfirmation to set.
+     * @param enableSignatureConfirmation
+     *            The enableSignatureConfirmation to set.
      */
-    public void setEnableSignatureConfirmation(boolean enableSignatureConfirmation) {
+    public void setEnableSignatureConfirmation(
+            boolean enableSignatureConfirmation) {
         this.enableSignatureConfirmation = enableSignatureConfirmation;
     }
 
     /**
-	 * @return Returns if we shall throw an exception on expired request
-	 *         semantic
-	 */
-	public boolean isTimeStampStrict() {
-		return timeStampStrict;
-	}
-
-	/**
-	 * @param timeStampStrict
-	 *            If true throw an exception on expired request semantic
-	 */
-	public void setTimeStampStrict(boolean timeStampStrict) {
-		this.timeStampStrict = timeStampStrict;
-	}
-
-	/**
-	 * Lookup action
-	 * 
-	 * @param action
-	 * @return
-	 * @throws WSSecurityException
-	 */
+     * @return Returns if we shall throw an exception on expired request
+     *         semantic
+     */
+    public boolean isTimeStampStrict() {
+        return timeStampStrict;
+    }
+
+    /**
+     * @param timeStampStrict
+     *            If true throw an exception on expired request semantic
+     */
+    public void setTimeStampStrict(boolean timeStampStrict) {
+        this.timeStampStrict = timeStampStrict;
+    }
+
+    /**
+     * Lookup action
+     * 
+     * @param action
+     * @return An action class to create a security token
+     * @throws WSSecurityException
+     */
     public Action getAction(int action) throws WSSecurityException {
         String name = null;
-        switch(action) {
+        switch (action) {
         case WSConstants.UT:
             name = "org.apache.ws.security.action.UsernameTokenAction";
             break;
@@ -216,23 +222,25 @@
             name = "org.apache.ws.security.action.SignatureConfirmationAction";
             break;
         }
-        if(name == null) {
-            throw new WSSecurityException(WSSecurityException.FAILURE, "unknownAction", new Object[]{new Integer(action)});
+        if (name == null) {
+            throw new WSSecurityException(WSSecurityException.FAILURE,
+                    "unknownAction", new Object[] { new Integer(action) });
         }
         try {
-            return (Action)Loader.loadClass(name).newInstance();
+            return (Action) Loader.loadClass(name).newInstance();
         } catch (Throwable t) {
-            throw new WSSecurityException(WSSecurityException.FAILURE, "unableToLoadClass", new Object[]{name});
+            throw new WSSecurityException(WSSecurityException.FAILURE,
+                    "unableToLoadClass", new Object[] { name });
         }
     }
 
     public Processor getProcessor(QName el) throws WSSecurityException {
         String name = null;
-        if(el.equals(WSSecurityEngine.SAML_TOKEN)){
+        if (el.equals(WSSecurityEngine.SAML_TOKEN)) {
             name = "org.apache.ws.security.processor.SAMLTokenProcessor";
         } else if (el.equals(WSSecurityEngine.ENCRYPTED_KEY)) {
             name = "org.apache.ws.security.processor.EncryptedKeyProcessor";
-        } else if (el.equals(WSSecurityEngine.SIGNATURE)){
+        } else if (el.equals(WSSecurityEngine.SIGNATURE)) {
             name = "org.apache.ws.security.processor.SignatureProcessor";
         } else if (el.equals(WSSecurityEngine.timeStamp)) {
             name = "org.apache.ws.security.processor.TimestampProcessor";
@@ -246,86 +254,86 @@
             name = "org.apache.ws.security.processor.DerivedKeyTokenProcessor";
         }
 
-        if(name != null){
+        if (name != null) {
             try {
-                return (Processor)Loader.loadClass(name).newInstance();
+                return (Processor) Loader.loadClass(name).newInstance();
             } catch (Throwable t) {
-                throw new WSSecurityException(WSSecurityException.FAILURE, "unableToLoadClass", new Object[]{name});
+                throw new WSSecurityException(WSSecurityException.FAILURE,
+                        "unableToLoadClass", new Object[] { name });
             }
         }
         return null;
     }
-    
+
     private boolean loadProvider(String id, String className) {
         try {
-            Class c = Loader
-                    .loadClass(className);
+            Class c = Loader.loadClass(className);
             if (java.security.Security.getProvider(id) == null) {
                 if (log.isDebugEnabled()) {
                     log.debug("The provider " + id
                             + " had to be added to the java.security.Security");
                 }
-                int pos = 1;
-                if(id.equalsIgnoreCase("BC")) {
-                    pos = 2;
-                }
-                java.security.Security.insertProviderAt((java.security.Provider) c
-                        .newInstance(), pos);
+                java.security.Security.insertProviderAt(
+                        (java.security.Provider) c.newInstance(), 2);
             }
             return true;
         } catch (Throwable t) {
-        	return false;
+            if (log.isDebugEnabled()) {
+                log.debug("The provider " + id + " could not be added: "
+                        + t.getMessage());
+            }
+            return false;
         }
-    	
+
     }
-    
+
     /**
-	 * Add a new JCE security provider to use for WSS4J.
-	 * 
-	 * If the provider is not already known the method loads a security provider
-	 * class and adds the provider to the java security service.
-	 * 
-	 * 
-	 * @param id
-	 *            The id string of the provider
-	 * @param className
-	 *            Name of the class the implements the provider. This class
-	 *            must be a subclass of <code>java.security.Provider</code>
-	 * 
-	 * @return Returns <code>true</code> if the provider was successfully
-	 *         added, <code>false</code> otherwise.
-	 */
-	public boolean addJceProvider(String id, String className) {
-		if (jceProvider.get(id) == null && loadProvider(id, className)) {
-			jceProvider.put(id, className);
-			return true;
-		}
-		return false;
-	}
-    
-    /**
-	 * Sets the JCE provider to use in all following security operations.
-	 * 
-	 * The method checks if the provider is known. If yes it sets the provider
-	 * id and returns true. Otherwise the provider id remains unchanged and the
-	 * method returns false.
-	 * 
-	 * @param id
-	 *            is the JCE provider's id
-	 * @return Returns <code>true</code> if set, <code>false</code>
-	 *         otherwise
-	 * @see addJceProvider
-	 */
-	public boolean setJceProviderId(String id) {
-		if (jceProvider.get(id) != null) {
-			jceProviderId = id;
-			JCEMapper.setProviderId(id);
-			return true;
-		}
-		return false;
-	}
-    
+     * Add a new JCE security provider to use for WSS4J.
+     * 
+     * If the provider is not already known the method loads a security provider
+     * class and adds the provider to the java security service.
+     * 
+     * 
+     * @param id
+     *            The id string of the provider
+     * @param className
+     *            Name of the class the implements the provider. This class must
+     *            be a subclass of <code>java.security.Provider</code>
+     * 
+     * @return Returns <code>true</code> if the provider was successfully
+     *         added, <code>false</code> otherwise.
+     */
+    public boolean addJceProvider(String id, String className) {
+        if (jceProvider.get(id) == null && loadProvider(id, className)) {
+            jceProvider.put(id, className);
+            return true;
+        }
+        return false;
+    }
+
+    /**
+     * Sets the JCE provider to use in all following security operations.
+     * 
+     * The method checks if the provider is known. If yes it sets the provider
+     * id and returns true. Otherwise the provider id remains unchanged and the
+     * method returns false.
+     * 
+     * @param id
+     *            is the JCE provider's id
+     * @return Returns <code>true</code> if set, <code>false</code>
+     *         otherwise
+     * @see #addJceProvider
+     */
+    public boolean setJceProviderId(String id) {
+        if (jceProvider.get(id) != null) {
+            jceProviderId = id;
+//            JCEMapper.setProviderId(id);
+            return true;
+        }
+        return false;
+    }
+
     public String getJceProviderId() {
-    	return jceProviderId;
+        return jceProviderId;
     }
 }

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/handler/WSHandler.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/handler/WSHandler.java?rev=383585&r1=383584&r2=383585&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/handler/WSHandler.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/handler/WSHandler.java Mon Mar  6 09:05:19 2006
@@ -57,7 +57,7 @@
  */
 public abstract class WSHandler {
     public static String DONE = "done";
-    protected static Log log = LogFactory.getLog(WSHandler.class.getName());
+    private static Log log = LogFactory.getLog(WSHandler.class.getName());
     protected static final WSSecurityEngine secEngine = WSSecurityEngine.getInstance();
     protected static Hashtable cryptos = new Hashtable(5);
 

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/handler/WSS4JHandler.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/handler/WSS4JHandler.java?rev=383585&r1=383584&r2=383585&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/handler/WSS4JHandler.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/handler/WSS4JHandler.java Mon Mar  6 09:05:19 2006
@@ -61,7 +61,8 @@
  */
 public class WSS4JHandler extends WSHandler implements Handler {
     private HandlerInfo handlerInfo;
-    static Log log = LogFactory.getLog(WSS4JHandler.class.getName());
+    
+    private static Log log = LogFactory.getLog(WSS4JHandler.class.getName());
 
     private boolean doDebug = log.isDebugEnabled();;
 

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/message/WSAddSignatureConfirmation.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/message/WSAddSignatureConfirmation.java?rev=383585&r1=383584&r2=383585&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/message/WSAddSignatureConfirmation.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/message/WSAddSignatureConfirmation.java Mon Mar  6 09:05:19 2006
@@ -41,7 +41,7 @@
     /**
      * Constructor.
      * 
-     * @deprecated replaced by {@link WSSecSignatureConfirmation#constructor()}
+     * @deprecated replaced by {@link WSSecSignatureConfirmation#WSSecSignatureConfirmation()}
      */
     public WSAddSignatureConfirmation() {
     }
@@ -53,7 +53,7 @@
      *            the name of the actor of the <code>wsse:Security</code>
      *            header
      * 
-     * @deprecated replaced by {@link WSSecSignatureConfirmation#constructor()}
+     * @deprecated replaced by {@link WSSecSignatureConfirmation#WSSecSignatureConfirmation()}
      *             and {@link WSSecHeader} for actor specification.
      */
     public WSAddSignatureConfirmation(String actor) {
@@ -69,7 +69,7 @@
      * @param mu
      *            Set <code>mustUnderstand</code> to true or false
      * 
-     * @deprecated replaced by {@link WSSecSignatureConfirmation#constructor()}
+     * @deprecated replaced by {@link WSSecSignatureConfirmation#WSSecSignatureConfirmation()}
      *             and {@link WSSecHeader} for actor and mustunderstand
      *             specification.
      */

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/message/WSAddTimestamp.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/message/WSAddTimestamp.java?rev=383585&r1=383584&r2=383585&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/message/WSAddTimestamp.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/message/WSAddTimestamp.java Mon Mar  6 09:05:19 2006
@@ -41,7 +41,7 @@
     /**
      * Constructor.
      * 
-     * @deprecated replaced by {@link WSSecTimestamp#constructor()}
+     * @deprecated replaced by {@link WSSecTimestamp#WSSecTimestamp()}
      */
     public WSAddTimestamp() {
     }
@@ -53,7 +53,7 @@
      *            the name of the actor of the <code>wsse:Security</code>
      *            header
      * 
-     * @deprecated replaced by {@link WSSecTimestamp#constructor()} and
+     * @deprecated replaced by {@link WSSecTimestamp#WSSecTimestamp()} and
      *             {@link WSSecHeader} for actor specification.
      */
     public WSAddTimestamp(String actor) {
@@ -68,7 +68,7 @@
      *            header
      * @param mu
      *            Set <code>mustUnderstand</code> to true or false
-     * @deprecated replaced by {@link WSSecTimestamp#constructor()} and
+     * @deprecated replaced by {@link WSSecTimestamp#WSSecTimestamp()} and
      *             {@link WSSecHeader} for actor and mustunderstand
      *             specification.
      */

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/message/WSBaseMessage.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/message/WSBaseMessage.java?rev=383585&r1=383584&r2=383585&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/message/WSBaseMessage.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/message/WSBaseMessage.java Mon Mar  6 09:05:19 2006
@@ -60,7 +60,7 @@
     /**
      * Constructor.
      * 
-     * @deprecated replaced by {@link WSSecBase#constructor()}
+     * @deprecated replaced by {@link WSSecBase#WSSecBase()}
      */
     public WSBaseMessage() {
     }
@@ -70,7 +70,7 @@
      * 
      * @param actor
      *            The actor name of the <code>wsse:Security</code> header
-     * @deprecated replaced by {@link WSSecBase#constructor()} and
+     * @deprecated replaced by {@link WSSecBase#WSSecBase()} and
      *             {@link WSSecHeader} for actor specification.
      */
     public WSBaseMessage(String actor) {
@@ -85,7 +85,7 @@
      * @param mu
      *            Set <code>mustUnderstand</code> to true or false
      * 
-     * @deprecated replaced by {@link WSSecBase#constructor()} and
+     * @deprecated replaced by {@link WSSecBase#WSSecBase()} and
      *             {@link WSSecHeader} for actor and mustunderstand
      *             specification.
      */

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/message/WSEncryptBody.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/message/WSEncryptBody.java?rev=383585&r1=383584&r2=383585&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/message/WSEncryptBody.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/message/WSEncryptBody.java Mon Mar  6 09:05:19 2006
@@ -91,7 +91,7 @@
 
     /**
      * Constructor.
-     * @deprecated replaced by {@link WSSecEncrypt#constructor()}
+     * @deprecated replaced by {@link WSSecEncrypt#WSSecEncrypt()}
     */
     public WSEncryptBody() {
     }
@@ -103,7 +103,7 @@
      * @param actor The actor name of the <code>wsse:Security</code>
      *              header
      * 
-     * @deprecated replaced by {@link WSSecEncrypt#constructor()}
+     * @deprecated replaced by {@link WSSecEncrypt#WSSecEncrypt()}
      *             and {@link WSSecHeader} for actor specification.
      */
     public WSEncryptBody(String actor) {
@@ -117,7 +117,7 @@
      * @param actor The actor name of the <code>wsse:Security</code> header
      * @param mu    Set <code>mustUnderstand</code> to true or false
      * 
-     * @deprecated replaced by {@link WSSecEncrypt#constructor()}
+     * @deprecated replaced by {@link WSSecEncrypt#WSSecEncrypt()}
      *             and {@link WSSecHeader} for actor and mustunderstand
      *             specification.
      */
@@ -349,7 +349,7 @@
         if (tlog.isDebugEnabled()) {
             t2 = System.currentTimeMillis();
         }
-        Cipher cipher = WSSecurityUtil.getCipherInstance(keyEncAlgo, wssConfig.getJceProviderId());
+        Cipher cipher = WSSecurityUtil.getCipherInstance(keyEncAlgo);
         try {
             cipher.init(Cipher.ENCRYPT_MODE, remoteCert);
         } catch (InvalidKeyException e) {

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSAddSAMLToken.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSAddSAMLToken.java?rev=383585&r1=383584&r2=383585&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSAddSAMLToken.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSAddSAMLToken.java Mon Mar  6 09:05:19 2006
@@ -37,7 +37,7 @@
     /**
      * Constructor.
      * 
-     * @deprecated replaced by {@link WSSecSAMLToken#constructor()}
+     * @deprecated replaced by {@link WSSecSAMLToken#WSSecSAMLToken()}
      */
     public WSSAddSAMLToken() {
     }
@@ -48,7 +48,7 @@
      *
      * @param actor the name of the actor of the <code>wsse:Security</code>
      *              header
-     * @deprecated replaced by {@link WSSecSAMLToken#constructor()}
+     * @deprecated replaced by {@link WSSecSAMLToken#WSSecSAMLToken()}
      *             and {@link WSSecHeader} for actor specification.
      */
     public WSSAddSAMLToken(String actor) {
@@ -63,7 +63,7 @@
      *              header
      * @param mu    Set <code>mustUnderstand</code> to true or false
      * 
-     * @deprecated replaced by {@link WSSecSAMLToken#constructor()}
+     * @deprecated replaced by {@link WSSecSAMLToken#WSSecSAMLToken()}
      *             and {@link WSSecHeader} for actor and mustunderstand
      *             specification.
      */

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSAddUsernameToken.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSAddUsernameToken.java?rev=383585&r1=383584&r2=383585&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSAddUsernameToken.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSAddUsernameToken.java Mon Mar  6 09:05:19 2006
@@ -42,7 +42,7 @@
     /**
      * Constructor.
      * 
-     * @deprecated replaced by {@link WSSecUsernameToken#constructor()}
+     * @deprecated replaced by {@link WSSecUsernameToken#WSSecUsernameToken()}
      */
     public WSSAddUsernameToken() {
     }
@@ -52,7 +52,7 @@
      * <p/>
      *
      * @param actor the name of the actor of the <code>wsse:Security</code> header
-     * @deprecated replaced by {@link WSSecUsernameToken#constructor()}
+     * @deprecated replaced by {@link WSSecUsernameToken#WSSecUsernameToken()}
      *             and {@link WSSecHeader} for actor specification.
      */
     public WSSAddUsernameToken(String actor) {
@@ -65,7 +65,7 @@
      *
      * @param actor The name of the actor of the <code>wsse:Security</code> header
      * @param mu    Set <code>mustUnderstand</code> to true or false
-     * @deprecated replaced by {@link WSSecUsernameToken#constructor()}
+     * @deprecated replaced by {@link WSSecUsernameToken#WSSecUsernameToken()}
      *             and {@link WSSecHeader} for actor and mustunderstand
      *             specification.
      */

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecBase.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecBase.java?rev=383585&r1=383584&r2=383585&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecBase.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecBase.java Mon Mar  6 09:05:19 2006
@@ -68,9 +68,13 @@
 	}
 
 	/**
-	 * Sets which key identifier to use. <p/> Defines the key identifier type to
-	 * use in the {@link WSSignEnvelope#build(Document, Crypto) signature} or
-	 * the {@link WSEncryptBody#build(Document, Crypto) ecnryption} function to
+	 * Sets which key identifier to use. 
+     * 
+     * <p/> 
+     * 
+     * Defines the key identifier type to
+	 * use in the {@link WSSecSignature#prepare(Document, Crypto, WSSecHeader) method} or
+	 * the {@link WSSecEncrypt#prepare(Document, Crypto) method} function to
 	 * set up the key identification elements.
 	 * 
 	 * @param keyIdType

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecDKEncrypt.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecDKEncrypt.java?rev=383585&r1=383584&r2=383585&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecDKEncrypt.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecDKEncrypt.java Mon Mar  6 09:05:19 2006
@@ -84,12 +84,7 @@
         
         XMLCipher xmlCipher = null;
         try {
-            String provider = wssConfig.getJceProviderId();
-            if (provider == null) {
-                xmlCipher = XMLCipher.getInstance(symEncAlgo);
-            } else {
-                xmlCipher = XMLCipher.getProviderInstance(symEncAlgo, provider);
-            }
+            xmlCipher = XMLCipher.getInstance(symEncAlgo);
         } catch (XMLEncryptionException e3) {
             throw new WSSecurityException(
                     WSSecurityException.UNSUPPORTED_ALGORITHM, null, null, e3);

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecDKSign.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecDKSign.java?rev=383585&r1=383584&r2=383585&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecDKSign.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecDKSign.java Mon Mar  6 09:05:19 2006
@@ -251,7 +251,7 @@
             throws WSSecurityException {
         Transforms transforms = null;
 
-        Element envelope = document.getDocumentElement();
+        Element envel = document.getDocumentElement();
 
         for (int part = 0; part < references.size(); part++) {
             WSEncryptionPart encPart = (WSEncryptionPart) references.get(part);
@@ -308,10 +308,10 @@
                 } else if (elemName.equals("Assertion")) { // Assertion
 
                     String id = null;
-                    id = SAMLUtil.getAssertionId(envelope, elemName, nmSpace);
+                    id = SAMLUtil.getAssertionId(envel, elemName, nmSpace);
 
                     Element body = (Element) WSSecurityUtil.findElement(
-                            envelope, elemName, nmSpace);
+                            envel, elemName, nmSpace);
                     if (body == null) {
                         throw new WSSecurityException(
                                 WSSecurityException.FAILURE, "noEncElement",
@@ -332,7 +332,7 @@
 
                 } else {
                     Element body = (Element) WSSecurityUtil.findElement(
-                            envelope, elemName, nmSpace);
+                            envel, elemName, nmSpace);
                     if (body == null) {
                         throw new WSSecurityException(
                                 WSSecurityException.FAILURE, "noEncElement",

Modified: webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecDerivedKeyBase.java
URL: http://svn.apache.org/viewcvs/webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecDerivedKeyBase.java?rev=383585&r1=383584&r2=383585&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecDerivedKeyBase.java (original)
+++ webservices/wss4j/trunk/src/org/apache/ws/security/message/WSSecDerivedKeyBase.java Mon Mar  6 09:05:19 2006
@@ -191,8 +191,7 @@
         remoteCert = certs[0];
         
         String certUri = "EncCertId-" + remoteCert.hashCode();
-        Cipher cipher = WSSecurityUtil.getCipherInstance(keyEncAlgo, wssConfig
-                .getJceProviderId());
+        Cipher cipher = WSSecurityUtil.getCipherInstance(keyEncAlgo);
         try {
             cipher.init(Cipher.ENCRYPT_MODE, remoteCert);
         } catch (InvalidKeyException e) {



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