ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gi...@apache.org
Subject svn commit: r1463243 [1/3] - in /webservices/wss4j/trunk: ws-security-common/src/main/java/org/apache/wss4j/common/principal/ ws-security-common/src/main/java/org/apache/wss4j/common/spnego/ ws-security-common/src/main/java/org/apache/wss4j/common/util...
Date Mon, 01 Apr 2013 18:28:40 GMT
Author: giger
Date: Mon Apr  1 18:28:38 2013
New Revision: 1463243

URL: http://svn.apache.org/r1463243
Log:
cleanups

Modified:
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/principal/SAMLTokenPrincipal.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/principal/SAMLTokenPrincipalImpl.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/principal/UsernameTokenPrincipal.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/principal/WSUsernameTokenPrincipalImpl.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/spnego/SpnegoTokenContext.java
    webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/Loader.java
    webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/X509NameTokenizerTest.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSSConfig.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSSecurityEngineResult.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SignatureConfirmationAction.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/cache/MemoryReplayCache.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandlerConstants.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncrypt.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncryptedKey.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSAMLToken.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignature.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignatureBase.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/BinarySecurity.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/DOMX509Data.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/DOMX509IssuerSerial.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/DerivedKeyToken.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/KerberosSecurity.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/Reference.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SecurityContextToken.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SecurityTokenReference.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SignatureConfirmation.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/Timestamp.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/X509Security.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SecurityContextTokenProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/UsernameTokenProcessor.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/X509Util.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSecSignatureSAML.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/DerivedKeyTokenSTRParser.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/EncryptedKeySTRParser.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SecurityTokenRefSTRParser.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SignatureSTRParser.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/transform/STRTransform.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/transform/STRTransformProvider.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/StringUtil.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/util/WSSecurityUtil.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/KerberosTokenValidator.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/SignatureTrustValidator.java
    webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/validate/TimestampValidator.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/common/SecretKeyCallbackHandler.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/components/crypto/CryptoTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CallbackRefTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/CustomActionProcessorTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/ResultsOrderTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SignatureConfirmationTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/SignatureUTAliasTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/handler/WSHandlerGetPasswordTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/CertErrorTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionCRLTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionGCMTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionPartsTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/EncryptionTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/PasswordTypeTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureCertTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureEncryptionTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureKeyValueTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignaturePartsTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SignatureTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/SymmetricSignatureTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/TestMessageTransformer.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/UTDerivedKeyTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/UTSignatureTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/UTWseSignatureTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/UsernameTokenTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/token/DerivedKeyTokenTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/token/ReferenceTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/message/token/SecurityTokenReferenceTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/processor/EncryptedKeyDataRefTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/processor/ReferenceListDataRefTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlConditionsTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlReferenceTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenDerivedTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenSVTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SamlTokenTest.java
    webservices/wss4j/trunk/ws-security-dom/src/test/java/org/apache/wss4j/dom/saml/SignedSamlTokenHOKTest.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/WSSec.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/processor/input/WSSSignatureInputHandler.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/impl/securityToken/UsernameSecurityTokenImpl.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/securityToken/UsernameSecurityToken.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/JAASUsernameTokenValidatorImpl.java
    webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/UsernameTokenValidatorImpl.java
    webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AbstractTestBase.java
    webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/InteroperabilityTest.java

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/principal/SAMLTokenPrincipal.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/principal/SAMLTokenPrincipal.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/principal/SAMLTokenPrincipal.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/principal/SAMLTokenPrincipal.java Mon Apr  1 18:28:38 2013
@@ -23,7 +23,7 @@ import org.apache.wss4j.common.saml.Saml
 import java.security.Principal;
 
 public interface SAMLTokenPrincipal extends Principal {
-    //todo rename me to getSamlAssertionWrapper?
+
     SamlAssertionWrapper getToken();
 
     String getName();

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/principal/SAMLTokenPrincipalImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/principal/SAMLTokenPrincipalImpl.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/principal/SAMLTokenPrincipalImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/principal/SAMLTokenPrincipalImpl.java Mon Apr  1 18:28:38 2013
@@ -38,7 +38,6 @@ public class SAMLTokenPrincipalImpl impl
         this.name = samlAssertion.getSubjectName();
     }
 
-    //todo rename me?
     @Override
     public SamlAssertionWrapper getToken() {
         return samlAssertion;

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/principal/UsernameTokenPrincipal.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/principal/UsernameTokenPrincipal.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/principal/UsernameTokenPrincipal.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/principal/UsernameTokenPrincipal.java Mon Apr  1 18:28:38 2013
@@ -26,9 +26,7 @@ public interface UsernameTokenPrincipal 
 
     String getPassword();
 
-    //todo shouldn't we return the raw bytes of the nonce instead of the Base64Encoded string?
-    //otherwise every user of the nonce has to decode it first.
-    String getNonce();
+    byte[] getNonce();
 
     String getCreatedTime();
 

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/principal/WSUsernameTokenPrincipalImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/principal/WSUsernameTokenPrincipalImpl.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/principal/WSUsernameTokenPrincipalImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/principal/WSUsernameTokenPrincipalImpl.java Mon Apr  1 18:28:38 2013
@@ -20,6 +20,8 @@
 package org.apache.wss4j.common.principal;
 
 
+import java.util.Arrays;
+
 /**
  * This class implements the <code>Principal</code> interface and
  * represents a UsernameToken user. 
@@ -43,12 +45,9 @@ package org.apache.wss4j.common.principa
  */
 public class WSUsernameTokenPrincipalImpl implements java.io.Serializable, UsernameTokenPrincipal {
 
-    /**
-     * 
-     */
     private static final long serialVersionUID = 5608648208455259722L;
     private String name;
-    private String nonce;
+    private byte[] nonce;
     private String password;
     private String createdTime;
     private String passwordType;
@@ -107,7 +106,7 @@ public class WSUsernameTokenPrincipalImp
      *
      * @param nonce
      */
-    public void setNonce(String nonce) {
+    public void setNonce(byte[] nonce) {
         this.nonce = nonce;
     }
 
@@ -117,7 +116,7 @@ public class WSUsernameTokenPrincipalImp
      * @return the WSUsernameToken nonce for this <code>WSUsernameTokenPrincipalImpl</code>
      */
     @Override
-    public String getNonce() {
+    public byte[] getNonce() {
         return nonce;
     }
 
@@ -193,7 +192,7 @@ public class WSUsernameTokenPrincipalImp
         if (this.name == null ? that.getName() != null : !this.name.equals(that.getName())) {
             return false;
         }
-        if (this.nonce == null ? that.getNonce() != null : !this.nonce.equals(that.getNonce())) {
+        if (this.nonce == null ? that.getNonce() != null : !Arrays.equals(this.nonce, that.getNonce())) {
             return false;
         }
         if (this.password == null ? that.getPassword() != null : !this.password.equals(that.getPassword())) {
@@ -220,7 +219,7 @@ public class WSUsernameTokenPrincipalImp
         int hashcode = 17;
         hashcode = 31 * hashcode + (digest ? 1 : 0);
         hashcode = 31 * hashcode + (name == null ? 0 : name.hashCode());
-        hashcode = 31 * hashcode + (nonce == null ? 0 : nonce.hashCode());
+        hashcode = 31 * hashcode + (nonce == null ? 0 : Arrays.hashCode(nonce));
         hashcode = 31 * hashcode + (password == null ? 0 : password.hashCode());
         hashcode = 31 * hashcode + (createdTime == null ? 0 : createdTime.hashCode());
         hashcode = 31 * hashcode + (passwordType == null ? 0 : passwordType.hashCode());

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/spnego/SpnegoTokenContext.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/spnego/SpnegoTokenContext.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/spnego/SpnegoTokenContext.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/spnego/SpnegoTokenContext.java Mon Apr  1 18:28:38 2013
@@ -76,8 +76,7 @@ public class SpnegoTokenContext {
                 WSSecurityException.ErrorCode.FAILURE,
                 "kerberosLoginError", 
                 ex,
-                new Object[] {ex.getMessage()}
-            );
+                ex.getMessage());
         }
         if (LOG.isDebugEnabled()) {
             LOG.debug("Successfully authenticated to the TGT");
@@ -88,15 +87,14 @@ public class SpnegoTokenContext {
         if (clientPrincipals.isEmpty()) {
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.FAILURE, 
-                "kerberosLoginError", 
-                new Object[] {"No Client principals found after login"}
-            );
+                "kerberosLoginError",
+                "No Client principals found after login");
         }
         
         // Get the service ticket
         clientAction.setServiceName(serviceName);
         clientAction.setMutualAuth(mutualAuth);
-        token = (byte[])Subject.doAs(clientSubject, clientAction);
+        token = Subject.doAs(clientSubject, clientAction);
         if (token == null) {
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.FAILURE, "kerberosServiceTicketError"
@@ -141,8 +139,7 @@ public class SpnegoTokenContext {
                 WSSecurityException.ErrorCode.FAILURE,
                 "kerberosLoginError", 
                 ex,
-                new Object[] {ex.getMessage()}
-            );
+                ex.getMessage());
         }
         if (LOG.isDebugEnabled()) {
             LOG.debug("Successfully authenticated to the TGT");
@@ -156,9 +153,8 @@ public class SpnegoTokenContext {
             if (principals.isEmpty()) {
                 throw new WSSecurityException(
                     WSSecurityException.ErrorCode.FAILURE, 
-                    "kerberosLoginError", 
-                    new Object[] {"No Client principals found after login"}
-                );
+                    "kerberosLoginError",
+                    "No Client principals found after login");
             }
             service = principals.iterator().next().getName();
         }
@@ -166,7 +162,7 @@ public class SpnegoTokenContext {
         // Validate the ticket
         serviceAction.setTicket(ticket);
         serviceAction.setServiceName(service);
-        token = (byte[])Subject.doAs(subject, serviceAction);
+        token = Subject.doAs(subject, serviceAction);
         
         secContext = serviceAction.getContext();
         if (LOG.isDebugEnabled()) {

Modified: webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/Loader.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/Loader.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/Loader.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/main/java/org/apache/wss4j/common/util/Loader.java Mon Apr  1 18:28:38 2013
@@ -46,7 +46,7 @@ public class Loader {
      * <p/>
      *
      * @param resource
-     * @return TODO
+     * @return the url to the resource or null if not found
      */
     public static URL getResource(String resource) {
         URL url = null;
@@ -63,8 +63,8 @@ public class Loader {
                     return url;
                 } 
             }
-        } catch (Throwable t) {
-            log.warn("Caught Exception while in Loader.getResource. This may be innocuous.", t);
+        } catch (Exception e) {
+            log.warn("Caught Exception while in Loader.getResource. This may be innocuous.", e);
         }
     
         ClassLoader cluClassloader = Loader.class.getClassLoader();
@@ -104,7 +104,7 @@ public class Loader {
      * <p/>
      *
      * @param resource
-     * @return TODO
+     * @return the url to the resource or null if not found
      */
     public static URL getResource(ClassLoader loader, String resource) {
         URL url = null;
@@ -120,8 +120,8 @@ public class Loader {
                     return url;
                 }
             }
-        } catch (Throwable t) {
-            log.warn("Caught Exception while in Loader.getResource. This may be innocuous.", t);
+        } catch (Exception e) {
+            log.warn("Caught Exception while in Loader.getResource. This may be innocuous.", e);
         }
         return getResource(resource);
     }
@@ -173,7 +173,7 @@ public class Loader {
                     return c;
                 }
             }
-        } catch (Throwable e) {
+        } catch (Exception e) {
             log.warn(e.getMessage(), e);
         }
         return loadClass(clazz, true);
@@ -199,7 +199,7 @@ public class Loader {
                     return c.asSubclass(type);
                 }
             }
-        } catch (Throwable e) {
+        } catch (Exception e) {
             log.warn(e.getMessage(), e);
         }
         return loadClass(clazz, true, type);
@@ -212,7 +212,7 @@ public class Loader {
      * <p/>
      *
      * @param clazz
-     * @return TODO
+     * @return the class
      * @throws ClassNotFoundException
      */
     public static Class<?> loadClass(String clazz) throws ClassNotFoundException {
@@ -227,7 +227,7 @@ public class Loader {
      *
      * @param clazz
      * @param type  Type to cast it to
-     * @return TODO
+     * @return the class
      * @throws ClassNotFoundException
      */
     public static <T> Class<? extends T> loadClass(String clazz, Class<T> type)
@@ -251,7 +251,7 @@ public class Loader {
                     return c;
                 }
             }
-        } catch (Throwable e) {
+        } catch (Exception e) {
             if (warn) {
                 log.warn(e.getMessage(), e);
             } else {

Modified: webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/X509NameTokenizerTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/X509NameTokenizerTest.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/X509NameTokenizerTest.java (original)
+++ webservices/wss4j/trunk/ws-security-common/src/test/java/org/apache/wss4j/common/crypto/X509NameTokenizerTest.java Mon Apr  1 18:28:38 2013
@@ -97,7 +97,7 @@ public class X509NameTokenizerTest exten
             assertTrue(tokenizer.hasMoreTokens());
             assertEquals(tokenizer.nextToken(), expected[i]);
         }
-        assertTrue(!tokenizer.hasMoreTokens());
+        assertFalse(tokenizer.hasMoreTokens());
         assertEquals(tokenizer.nextToken(), "");
     }
 }

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSSConfig.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSSConfig.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSSConfig.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSSConfig.java Mon Apr  1 18:28:38 2013
@@ -68,35 +68,35 @@ public class WSSConfig {
         final Map<Integer, Class<?>> tmp = new HashMap<Integer, Class<?>>();
         try {
             tmp.put(
-                Integer.valueOf(WSConstants.UT),
+                WSConstants.UT,
                 org.apache.wss4j.dom.action.UsernameTokenAction.class
             );
             tmp.put(
-                Integer.valueOf(WSConstants.ENCR),
+                WSConstants.ENCR,
                 org.apache.wss4j.dom.action.EncryptionAction.class
             );
             tmp.put(
-                Integer.valueOf(WSConstants.SIGN),
+                WSConstants.SIGN,
                 org.apache.wss4j.dom.action.SignatureAction.class
             );
             tmp.put(
-                Integer.valueOf(WSConstants.ST_SIGNED),
+                WSConstants.ST_SIGNED,
                 org.apache.wss4j.dom.action.SAMLTokenSignedAction.class
             );
             tmp.put(
-                Integer.valueOf(WSConstants.ST_UNSIGNED),
+                WSConstants.ST_UNSIGNED,
                 org.apache.wss4j.dom.action.SAMLTokenUnsignedAction.class
             );
             tmp.put(
-                Integer.valueOf(WSConstants.TS),
+                WSConstants.TS,
                 org.apache.wss4j.dom.action.TimestampAction.class
             );
             tmp.put(
-                Integer.valueOf(WSConstants.UT_SIGN),
+                WSConstants.UT_SIGN,
                 org.apache.wss4j.dom.action.UsernameTokenSignedAction.class
             );
             tmp.put(
-                Integer.valueOf(WSConstants.SC),
+                WSConstants.SC,
                 org.apache.wss4j.dom.action.SignatureConfirmationAction.class
             );
         } catch (final Exception ex) {
@@ -558,7 +558,7 @@ public class WSSConfig {
      * it is up to the implementing class to ensure that it is thread-safe.
      */
     public Class<?> setAction(int code, Action action) {
-        Object result = actionMap.put(Integer.valueOf(code), action);
+        Object result = actionMap.put(code, action);
         if (result instanceof Class<?>) {
             return (Class<?>)result;
         } else if (result instanceof Action) {
@@ -574,7 +574,7 @@ public class WSSConfig {
      * actions for well-known operations.
      */
     public Class<?> setAction(int code, Class<?> clazz) {
-        Object result = actionMap.put(Integer.valueOf(code), clazz);
+        Object result = actionMap.put(code, clazz);
         if (result instanceof Class<?>) {
             return (Class<?>)result;
         } else if (result instanceof Action) {
@@ -591,7 +591,7 @@ public class WSSConfig {
      * @throws WSSecurityException
      */
     public Action getAction(int action) throws WSSecurityException {
-        final Object actionObject = actionMap.get(Integer.valueOf(action));
+        final Object actionObject = actionMap.get(action);
         
         if (actionObject instanceof Class<?>) {
             try {

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSSecurityEngineResult.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSSecurityEngineResult.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSSecurityEngineResult.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/WSSecurityEngineResult.java Mon Apr  1 18:28:38 2013
@@ -228,14 +228,14 @@ public class WSSecurityEngineResult exte
     public static final String TAG_ID = "id";
     
     public WSSecurityEngineResult(int act) {
-        put(TAG_ACTION, Integer.valueOf(act));
+        put(TAG_ACTION, act);
     }
     
     public WSSecurityEngineResult(
         int act, 
         SamlAssertionWrapper ass
     ) {
-        put(TAG_ACTION, Integer.valueOf(act));
+        put(TAG_ACTION, act);
         put(TAG_SAML_ASSERTION, ass);
         put(TAG_VALIDATED_TOKEN, Boolean.FALSE);
         put(TAG_TOKEN_ELEMENT, ass.getElement());
@@ -247,7 +247,7 @@ public class WSSecurityEngineResult exte
         X509Certificate[] certs, 
         byte[] sv
     ) {
-        put(TAG_ACTION, Integer.valueOf(act));
+        put(TAG_ACTION, act);
         put(TAG_PRINCIPAL, princ);
         put(TAG_X509_CERTIFICATES, certs);
         put(TAG_SIGNATURE_VALUE, sv);
@@ -275,7 +275,7 @@ public class WSSecurityEngineResult exte
         byte[] encryptedKeyBytes,
         List<WSDataRef> dataRefUris
     ) {
-        put(TAG_ACTION, Integer.valueOf(act));
+        put(TAG_ACTION, act);
         put(TAG_SECRET, decryptedKey);
         put(TAG_ENCRYPTED_EPHEMERAL_KEY, encryptedKeyBytes);
         put(TAG_DATA_REF_URIS, dataRefUris);
@@ -289,7 +289,7 @@ public class WSSecurityEngineResult exte
         List<WSDataRef> dataRefUris,
         X509Certificate[] certs
     ) {
-        put(TAG_ACTION, Integer.valueOf(act));
+        put(TAG_ACTION, act);
         put(TAG_SECRET, decryptedKey);
         put(TAG_ENCRYPTED_EPHEMERAL_KEY, encryptedKeyBytes);
         put(TAG_DATA_REF_URIS, dataRefUris);
@@ -301,27 +301,27 @@ public class WSSecurityEngineResult exte
     }
     
     public WSSecurityEngineResult(int act, List<WSDataRef> dataRefUris) {
-        put(TAG_ACTION, Integer.valueOf(act));
+        put(TAG_ACTION, act);
         put(TAG_DATA_REF_URIS, dataRefUris);
         put(TAG_VALIDATED_TOKEN, Boolean.FALSE);
     }
     
     public WSSecurityEngineResult(int act, Timestamp tstamp) {
-        put(TAG_ACTION, Integer.valueOf(act));
+        put(TAG_ACTION, act);
         put(TAG_TIMESTAMP, tstamp);
         put(TAG_VALIDATED_TOKEN, Boolean.FALSE);
         put(TAG_TOKEN_ELEMENT, tstamp.getElement());
     }
     
     public WSSecurityEngineResult(int act, SecurityContextToken sct) {
-        put(TAG_ACTION, Integer.valueOf(act));
+        put(TAG_ACTION, act);
         put(TAG_SECURITY_CONTEXT_TOKEN, sct);
         put(TAG_VALIDATED_TOKEN, Boolean.FALSE);
         put(TAG_TOKEN_ELEMENT, sct.getElement());
     }
     
     public WSSecurityEngineResult(int act, SignatureConfirmation sc) {
-        put(TAG_ACTION, Integer.valueOf(act));
+        put(TAG_ACTION, act);
         put(TAG_SIGNATURE_CONFIRMATION, sc);
         put(TAG_VALIDATED_TOKEN, Boolean.FALSE);
         put(TAG_TOKEN_ELEMENT, sc.getElement());
@@ -332,7 +332,7 @@ public class WSSecurityEngineResult exte
     }
     
     public WSSecurityEngineResult(int act, UsernameToken usernameToken, Principal principal) {
-        put(TAG_ACTION, Integer.valueOf(act));
+        put(TAG_ACTION, act);
         put(TAG_USERNAME_TOKEN, usernameToken);
         put(TAG_PRINCIPAL, principal);
         put(TAG_VALIDATED_TOKEN, Boolean.FALSE);
@@ -340,7 +340,7 @@ public class WSSecurityEngineResult exte
     }
 
     public WSSecurityEngineResult(int act, BinarySecurity token, X509Certificate[] certs) {
-        put(TAG_ACTION, Integer.valueOf(act));
+        put(TAG_ACTION, act);
         put(TAG_BINARY_SECURITY_TOKEN, token);
         put(TAG_X509_CERTIFICATES, certs);
         if (certs != null) {

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SignatureConfirmationAction.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SignatureConfirmationAction.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SignatureConfirmationAction.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/action/SignatureConfirmationAction.java Mon Apr  1 18:28:38 2013
@@ -79,7 +79,7 @@ public class SignatureConfirmationAction
                         + signatureActions.size());
             }
             for (int i = 0; i < signatureActions.size(); i++) {
-                WSSecurityEngineResult wsr = (WSSecurityEngineResult) signatureActions.get(i);
+                WSSecurityEngineResult wsr = signatureActions.get(i);
                 byte[] sigVal = (byte[]) wsr.get(WSSecurityEngineResult.TAG_SIGNATURE_VALUE);
                 wsc.build(doc, sigVal, reqData.getSecHeader());
                 signatureParts.add(new WSEncryptionPart(wsc.getId()));

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/cache/MemoryReplayCache.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/cache/MemoryReplayCache.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/cache/MemoryReplayCache.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/cache/MemoryReplayCache.java Mon Apr  1 18:28:38 2013
@@ -38,8 +38,8 @@ public class MemoryReplayCache implement
     
     public static final long DEFAULT_TTL = 60L * 5L;
     public static final long MAX_TTL = DEFAULT_TTL * 12L;
-    private SortedMap<Date, List<String>> cache = new TreeMap<Date, List<String>>();
-    private Set<String> ids = Collections.synchronizedSet(new HashSet<String>());
+    private final SortedMap<Date, List<String>> cache = new TreeMap<Date, List<String>>();
+    private final Set<String> ids = Collections.synchronizedSet(new HashSet<String>());
     
     /**
      * Add the given identifier to the cache. It will be cached for a default amount of time.

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandler.java Mon Apr  1 18:28:38 2013
@@ -322,12 +322,12 @@ public abstract class WSHandler {
         int ai = 0;
         for (WSSecurityEngineResult result : wsResult) {
             final Integer actInt = (Integer) result.get(WSSecurityEngineResult.TAG_ACTION);
-            int act = actInt.intValue();
+            int act = actInt;
             if (act == WSConstants.SC || act == WSConstants.BST) {
                 continue;
             }
             
-            if (ai >= size || actions.get(ai++).intValue() != act) {
+            if (ai >= size || actions.get(ai++) != act) {
                 return false;
             }
         }
@@ -349,7 +349,7 @@ public abstract class WSHandler {
         
         for (WSSecurityEngineResult result : wsResult) {
             final Integer actInt = (Integer) result.get(WSSecurityEngineResult.TAG_ACTION);
-            int act = actInt.intValue();
+            int act = actInt;
             if (act == WSConstants.SC || act == WSConstants.BST) {
                 continue;
             }
@@ -415,7 +415,7 @@ public abstract class WSHandler {
                 } else {
                     boolean found = false;
                     for (int j = 0; j < savedSignatures.size(); j++) {
-                        byte[] storedValue = (byte[]) savedSignatures.get(j);
+                        byte[] storedValue = savedSignatures.get(j);
                         if (Arrays.equals(sigVal, storedValue)) {
                             found = true;
                             savedSignatures.remove(j);
@@ -503,14 +503,14 @@ public abstract class WSHandler {
         
         String keyId = getString(WSHandlerConstants.SIG_KEY_ID, mc);
         if (keyId != null) {
-            Integer id = (Integer) WSHandlerConstants.getKeyIdentifier(keyId);
+            Integer id = WSHandlerConstants.getKeyIdentifier(keyId);
             if (id == null) {
                 throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
                         "empty",
                         "WSHandler: Signature: unknown key identification"
                 );
             }
-            int tmp = id.intValue();
+            int tmp = id;
             if (!(tmp == WSConstants.ISSUER_SERIAL
                     || tmp == WSConstants.BST_DIRECT_REFERENCE
                     || tmp == WSConstants.X509_KEY_IDENTIFIER
@@ -585,14 +585,14 @@ public abstract class WSHandler {
          */
         String encKeyId = getString(WSHandlerConstants.ENC_KEY_ID, mc);
         if (encKeyId != null) {
-            Integer id = (Integer) WSHandlerConstants.getKeyIdentifier(encKeyId);
+            Integer id = WSHandlerConstants.getKeyIdentifier(encKeyId);
             if (id == null) {
                 throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
                         "empty",
                         "WSHandler: Encryption: unknown key identification"
                 );
             }
-            int tmp = id.intValue();
+            int tmp = id;
             reqData.setEncKeyId(tmp);
             if (!(tmp == WSConstants.ISSUER_SERIAL
                     || tmp == WSConstants.X509_KEY_IDENTIFIER
@@ -1032,7 +1032,7 @@ public abstract class WSHandler {
             );
         }
         try {
-            cbHandler = (CallbackHandler) cbClass.newInstance();
+            cbHandler = cbClass.newInstance();
         } catch (Exception e) {
             throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
                     "empty", e,
@@ -1210,8 +1210,8 @@ public abstract class WSHandler {
              * encryption action :-).
              */
             for (WSSecurityEngineResult wser : wsSecEngineResults) {
-                int wserAction = 
-                    ((java.lang.Integer)wser.get(WSSecurityEngineResult.TAG_ACTION)).intValue();
+                int wserAction =
+                        (Integer) wser.get(WSSecurityEngineResult.TAG_ACTION);
                 if (wserAction == WSConstants.SIGN) {
                     X509Certificate cert = 
                         (X509Certificate)wser.get(WSSecurityEngineResult.TAG_X509_CERTIFICATE);

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandlerConstants.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandlerConstants.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandlerConstants.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/handler/WSHandlerConstants.java Mon Apr  1 18:28:38 2013
@@ -189,7 +189,7 @@ public final class WSHandlerConstants {
      * The callback function
      * {@link javax.security.auth.callback.CallbackHandler#handle(
      * javax.security.auth.callback.Callback[])} gets an array of 
-     * {@link org.apache.wss4j.dom.WSPasswordCallback} objects. Only the first entry of the 
+     * {@link org.apache.wss4j.common.ext.WSPasswordCallback} objects. Only the first entry of the
      * array is used. This object contains the username/keyname as identifier. The callback
      * handler must set the password or key associated with this identifier before it returns.
      * <p/>
@@ -243,7 +243,7 @@ public final class WSHandlerConstants {
      * loads this file. Therefore it must be accessible via the classpath.
      * <p/>
      * To locate the implementation of the
-     * {@link org.apache.wss4j.dom.components.crypto.Crypto Crypto}
+     * {@link org.apache.wss4j.common.crypto.Crypto Crypto}
      * interface implementation the property file must contain the property
      * <code>org.apache.wss4j.crypto.provider</code>. The value of
      * this property is the classname of the implementation class.
@@ -253,7 +253,7 @@ public final class WSHandlerConstants {
      * org.apache.wss4j.crypto.provider=org.apache.wss4j.common.crypto.Merlin
      * </pre>
      * The other contents of the property file depend on the implementation
-     * of the {@link org.apache.wss4j.dom.components.crypto.Crypto Crypto}
+     * of the {@link org.apache.wss4j.common.crypto.Crypto Crypto}
      * interface. Please see the WSS4J website for more information on the Merlin property 
      * tags and values.
      * </p>
@@ -817,22 +817,14 @@ public final class WSHandlerConstants {
     private static Map<String, Integer> keyIdentifier = new HashMap<String, Integer>();
 
     static {
-        keyIdentifier.put("DirectReference",
-                Integer.valueOf(WSConstants.BST_DIRECT_REFERENCE));
-        keyIdentifier.put("IssuerSerial",
-                Integer.valueOf(WSConstants.ISSUER_SERIAL));
-        keyIdentifier.put("X509KeyIdentifier",
-                Integer.valueOf(WSConstants.X509_KEY_IDENTIFIER));
-        keyIdentifier.put("SKIKeyIdentifier",
-                Integer.valueOf(WSConstants.SKI_KEY_IDENTIFIER));
-        keyIdentifier.put("EmbeddedKeyName",
-                Integer.valueOf(WSConstants.EMBEDDED_KEYNAME));
-        keyIdentifier.put("Thumbprint",
-                Integer.valueOf(WSConstants.THUMBPRINT_IDENTIFIER));
-        keyIdentifier.put("EncryptedKeySHA1",
-                Integer.valueOf(WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER));
-        keyIdentifier.put("KeyValue",
-                Integer.valueOf(WSConstants.KEY_VALUE));
+        keyIdentifier.put("DirectReference", WSConstants.BST_DIRECT_REFERENCE);
+        keyIdentifier.put("IssuerSerial", WSConstants.ISSUER_SERIAL);
+        keyIdentifier.put("X509KeyIdentifier", WSConstants.X509_KEY_IDENTIFIER);
+        keyIdentifier.put("SKIKeyIdentifier", WSConstants.SKI_KEY_IDENTIFIER);
+        keyIdentifier.put("EmbeddedKeyName", WSConstants.EMBEDDED_KEYNAME);
+        keyIdentifier.put("Thumbprint", WSConstants.THUMBPRINT_IDENTIFIER);
+        keyIdentifier.put("EncryptedKeySHA1", WSConstants.ENCRYPTED_KEY_SHA1_IDENTIFIER);
+        keyIdentifier.put("KeyValue", WSConstants.KEY_VALUE);
     }
     
     /**

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncrypt.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncrypt.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncrypt.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncrypt.java Mon Apr  1 18:28:38 2013
@@ -171,9 +171,8 @@ public class WSSecEncrypt extends WSSecE
                 if (certs == null || certs.length <= 0) {
                     throw new WSSecurityException(
                         WSSecurityException.ErrorCode.FAILURE,
-                        "noUserCertsFound", 
-                        new Object[] { user, "encryption" }
-                    );
+                        "noUserCertsFound",
+                        user, "encryption");
                 }
                 remoteCert = certs[0];
             }
@@ -382,9 +381,8 @@ public class WSSecEncrypt extends WSSecE
             if (elementsToEncrypt == null || elementsToEncrypt.size() == 0) {
                 throw new WSSecurityException(
                     WSSecurityException.ErrorCode.FAILURE,
-                    "noEncElement", 
-                    new Object[] {"{" + encPart.getNamespace() + "}" + encPart.getName()}
-                );
+                    "noEncElement",
+                    "{" + encPart.getNamespace() + "}" + encPart.getName());
             }
 
             String modifier = encPart.getEncModifier();
@@ -422,7 +420,7 @@ public class WSSecEncrypt extends WSSecE
         KeyInfo keyInfo
     ) throws WSSecurityException {
 
-        boolean content = "Content".equals(modifier) ? true : false;
+        boolean content = "Content".equals(modifier);
         //
         // Encrypt data, and set necessary attributes in xenc:EncryptedData
         //

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncryptedKey.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncryptedKey.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncryptedKey.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecEncryptedKey.java Mon Apr  1 18:28:38 2013
@@ -211,9 +211,8 @@ public class WSSecEncryptedKey extends W
             if (certs == null || certs.length <= 0) {
                 throw new WSSecurityException(
                     WSSecurityException.ErrorCode.FAILURE,
-                    "noUserCertsFound", 
-                    new Object[] {user, "encryption"}
-                );
+                    "noUserCertsFound",
+                    user, "encryption");
             }
             remoteCert = certs[0];
         }

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSAMLToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSAMLToken.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSAMLToken.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSAMLToken.java Mon Apr  1 18:28:38 2013
@@ -78,7 +78,7 @@ public class WSSecSAMLToken extends WSSe
      */
     public void prependToHeader(WSSecHeader secHeader) {
         try {
-            Element element = (Element) saml.toDOM(document);
+            Element element = saml.toDOM(document);
             WSSecurityUtil.prependChildElement(secHeader.getSecurityHeader(), element);
         } catch (WSSecurityException ex) {
             throw new RuntimeException(ex.toString(), ex);

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignature.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignature.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignature.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignature.java Mon Apr  1 18:28:38 2013
@@ -788,9 +788,8 @@ public class WSSecSignature extends WSSe
             if (certs == null || certs.length <= 0) {
                 throw new WSSecurityException(
                         WSSecurityException.ErrorCode.FAILURE,
-                        "noUserCertsFound", 
-                        new Object[] { user, "signature" }
-                );
+                        "noUserCertsFound",
+                        user, "signature");
             }
             certUri = getWsConfig().getIdAllocator().createSecureId("X509-", certs[0]);  
             //
@@ -808,8 +807,7 @@ public class WSSecSignature extends WSSe
                     throw new WSSecurityException(
                         WSSecurityException.ErrorCode.FAILURE,
                         "unknownSignatureAlgorithm",
-                        new Object[] {pubKeyAlgo}
-                    );
+                        pubKeyAlgo);
                 }
             }
         }

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignatureBase.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignatureBase.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignatureBase.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/WSSecSignatureBase.java Mon Apr  1 18:28:38 2013
@@ -161,8 +161,7 @@ public class WSSecSignatureBase extends 
                         throw new WSSecurityException(
                             WSSecurityException.ErrorCode.FAILURE, 
                             "noEncElement",
-                            new Object[] {nmSpace + ", " + elemName}
-                        );
+                            nmSpace + ", " + elemName);
                     }
                     for (Element elementToSign : elementsToSign) {
                         TransformParameterSpec transformSpec = null;

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/BinarySecurity.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/BinarySecurity.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/BinarySecurity.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/BinarySecurity.java Mon Apr  1 18:28:38 2013
@@ -62,9 +62,7 @@ public class BinarySecurity {
         if (!(el.equals(TOKEN_BST) || el.equals(TOKEN_KI))) {
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.INVALID_SECURITY_TOKEN, 
-                "unhandledToken",
-                new Object[] {el}
-            );
+                "unhandledToken", el);
         }
         String encoding = getEncodingType();
         if (encoding == null || "".equals(encoding)) {
@@ -255,7 +253,7 @@ public class BinarySecurity {
      * @return the string representation of the token.
      */
     public String toString() {
-        return DOM2Writer.nodeToString((Node)element);
+        return DOM2Writer.nodeToString(element);
     }
     
     @Override

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/DOMX509Data.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/DOMX509Data.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/DOMX509Data.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/DOMX509Data.java Mon Apr  1 18:28:38 2013
@@ -25,7 +25,6 @@ import org.apache.wss4j.common.util.DOM2
 import org.apache.wss4j.dom.util.WSSecurityUtil;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
-import org.w3c.dom.Node;
 
 /**
  * An X509Data token.
@@ -93,7 +92,7 @@ public final class DOMX509Data {
      * @return the string representation of the token.
      */
     public String toString() {
-        return DOM2Writer.nodeToString((Node)element);
+        return DOM2Writer.nodeToString(element);
     }
     
 }

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/DOMX509IssuerSerial.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/DOMX509IssuerSerial.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/DOMX509IssuerSerial.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/DOMX509IssuerSerial.java Mon Apr  1 18:28:38 2013
@@ -126,7 +126,7 @@ public final class DOMX509IssuerSerial {
      * @return the string representation of the token.
      */
     public String toString() {
-        return DOM2Writer.nodeToString((Node)element);
+        return DOM2Writer.nodeToString(element);
     }
     
     

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/DerivedKeyToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/DerivedKeyToken.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/DerivedKeyToken.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/DerivedKeyToken.java Mon Apr  1 18:28:38 2013
@@ -261,7 +261,6 @@ public class DerivedKeyToken {
 
     public Map<String, String> getProperties() {
         if (elementProperties != null) {
-            //todo Bug:? Contents of collection table are updated, but never queried
             Map<String, String> table = new HashMap<String, String>();
             Node node = elementProperties.getFirstChild();
             while (node != null) {
@@ -271,6 +270,7 @@ public class DerivedKeyToken {
                 }
                 node = node.getNextSibling();
             }
+            return table;
         }
         return null;
     }
@@ -438,7 +438,7 @@ public class DerivedKeyToken {
      * @return a XML string representation
      */
     public String toString() {
-        return DOM2Writer.nodeToString((Node)element);
+        return DOM2Writer.nodeToString(element);
     }
 
     /**

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/KerberosSecurity.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/KerberosSecurity.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/KerberosSecurity.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/KerberosSecurity.java Mon Apr  1 18:28:38 2013
@@ -126,9 +126,7 @@ public class KerberosSecurity extends Bi
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.FAILURE,
                 "kerberosLoginError", 
-                ex,
-                new Object[] {ex.getMessage()}
-            );
+                ex, ex.getMessage());
         }
         if (log.isDebugEnabled()) {
             log.debug("Successfully authenticated to the TGT");
@@ -139,9 +137,8 @@ public class KerberosSecurity extends Bi
         if (clientPrincipals.isEmpty()) {
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.FAILURE, 
-                "kerberosLoginError", 
-                new Object[] {"No Client principals found after login"}
-            );
+                "kerberosLoginError",
+                "No Client principals found after login");
         }
         // Store the TGT
         KerberosTicket tgt = getKerberosTicket(clientSubject, null);
@@ -149,7 +146,7 @@ public class KerberosSecurity extends Bi
         // Get the service ticket
         KerberosClientAction action =
             new KerberosClientAction(clientPrincipals.iterator().next(), serviceName);
-        byte[] ticket = (byte[])Subject.doAs(clientSubject, action);
+        byte[] ticket = Subject.doAs(clientSubject, action);
         if (ticket == null) {
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.FAILURE, "kerberosServiceTicketError"

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/Reference.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/Reference.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/Reference.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/Reference.java Mon Apr  1 18:28:38 2013
@@ -27,7 +27,6 @@ import org.apache.wss4j.common.util.DOM2
 import org.apache.wss4j.dom.util.WSSecurityUtil;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
-import org.w3c.dom.Node;
 
 /**
  * Reference.
@@ -131,7 +130,7 @@ public class Reference {
      * @return the string representation.
      */
     public String toString() {
-        return DOM2Writer.nodeToString((Node)element);
+        return DOM2Writer.nodeToString(element);
     }
     
     @Override

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SecurityContextToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SecurityContextToken.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SecurityContextToken.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SecurityContextToken.java Mon Apr  1 18:28:38 2013
@@ -215,7 +215,7 @@ public class SecurityContextToken {
      * @return a XML string representation
      */
     public String toString() {
-        return DOM2Writer.nodeToString((Node)element);
+        return DOM2Writer.nodeToString(element);
     }
 
     /**

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SecurityTokenReference.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SecurityTokenReference.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SecurityTokenReference.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SecurityTokenReference.java Mon Apr  1 18:28:38 2013
@@ -225,9 +225,7 @@ public class SecurityTokenReference {
         if (tokElement == null) {
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.SECURITY_TOKEN_UNAVAILABLE,
-                "noToken",
-                new Object[]{uri}
-            );
+                "noToken", uri);
         }
         return tokElement;
     }
@@ -366,9 +364,7 @@ public class SecurityTokenReference {
         if (cert.getVersion() != 3) {
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.UNSUPPORTED_SECURITY_TOKEN,
-                "invalidCertForSKI",
-                new Object[]{Integer.valueOf(cert.getVersion())}
-            );
+                "invalidCertForSKI", cert.getVersion());
         }
         
         Document doc = element.getOwnerDocument();
@@ -475,10 +471,8 @@ public class SecurityTokenReference {
 
         if (X509Security.X509_V3_TYPE.equals(value)) {
             X509Security token = new X509Security(elem, new BSPEnforcer(true));
-            if (token != null) {
-                X509Certificate cert = token.getX509Certificate(crypto);
-                return new X509Certificate[]{cert};
-            }
+            X509Certificate cert = token.getX509Certificate(crypto);
+            return new X509Certificate[]{cert};
         } else if (SKI_URI.equals(value)) {
             X509Certificate cert = getX509SKIAlias(crypto);
             if (cert != null) {
@@ -780,7 +774,7 @@ public class SecurityTokenReference {
      * @return a representation of this SecurityTokenReference element as a String
      */
     public String toString() {
-        return DOM2Writer.nodeToString((Node) element);
+        return DOM2Writer.nodeToString(element);
     }
     
     /**

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SignatureConfirmation.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SignatureConfirmation.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SignatureConfirmation.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/SignatureConfirmation.java Mon Apr  1 18:28:38 2013
@@ -31,7 +31,6 @@ import org.apache.xml.security.exception
 import org.apache.xml.security.utils.Base64;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
-import org.w3c.dom.Node;
 
 
 /**
@@ -115,7 +114,7 @@ public class SignatureConfirmation {
      * @return a XML string representation
      */
     public String toString() {
-        return DOM2Writer.nodeToString((Node)element);
+        return DOM2Writer.nodeToString(element);
     }
     
     /**

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/Timestamp.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/Timestamp.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/Timestamp.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/Timestamp.java Mon Apr  1 18:28:38 2013
@@ -228,7 +228,7 @@ public class Timestamp {
      * @return a XML string representation
      */
     public String toString() {
-        return DOM2Writer.nodeToString((Node) element);
+        return DOM2Writer.nodeToString(element);
     }
 
     /**

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/UsernameToken.java Mon Apr  1 18:28:38 2013
@@ -682,7 +682,7 @@ public class UsernameToken {
      * @return a XML string representation
      */
     public String toString() {
-        return DOM2Writer.nodeToString((Node)element);
+        return DOM2Writer.nodeToString(element);
     }
 
     /**
@@ -917,13 +917,19 @@ public class UsernameToken {
     /**
      * Create a WSUsernameTokenPrincipal from this UsernameToken object
      */
-    public Principal createPrincipal() {
-        WSUsernameTokenPrincipalImpl principal =
-            new WSUsernameTokenPrincipalImpl(getName(), isHashed());
-        principal.setNonce(getNonce());
-        principal.setPassword(getPassword());
-        principal.setCreatedTime(getCreated());
-        return principal;
+    public Principal createPrincipal() throws WSSecurityException {
+        try {
+            WSUsernameTokenPrincipalImpl principal =
+                new WSUsernameTokenPrincipalImpl(getName(), isHashed());
+            principal.setNonce(Base64.decode(getNonce()));
+            principal.setPassword(getPassword());
+            principal.setCreatedTime(getCreated());
+            return principal;
+        } catch (Base64DecodingException e) {
+            throw new WSSecurityException(
+                    WSSecurityException.ErrorCode.FAILURE, "decoding.general", e
+            );
+        }
     }
     
     /**

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/X509Security.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/X509Security.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/X509Security.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/message/token/X509Security.java Mon Apr  1 18:28:38 2013
@@ -87,8 +87,7 @@ public class X509Security extends Binary
         byte[] data = getToken();
         if (data == null) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILURE, "invalidCertData", new Object[]{Integer.valueOf(0)}
-            );
+                WSSecurityException.ErrorCode.FAILURE, "invalidCertData", 0);
         }
         InputStream in = new ByteArrayInputStream(data);
         cachedCert = crypto.loadCertificate(in);

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/EncryptedKeyProcessor.java Mon Apr  1 18:28:38 2013
@@ -350,9 +350,7 @@ public class EncryptedKeyProcessor imple
             if (certs == null || certs.length < 1 || certs[0] == null) {
                 throw new WSSecurityException(
                     WSSecurityException.ErrorCode.FAILURE,
-                    "noCertsFound", 
-                    new Object[] {"decryption (KeyId)"}
-                );
+                    "noCertsFound", "decryption (KeyId)");
             }
             return certs;
         } else {
@@ -439,8 +437,7 @@ public class EncryptedKeyProcessor imple
         } catch (IllegalArgumentException ex) {
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, "badEncAlgo", 
-                ex, new Object[]{symEncAlgo}
-            );
+                ex, symEncAlgo);
         }
         
         // Check for compliance against the defined AlgorithmSuite

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/ReferenceListProcessor.java Mon Apr  1 18:28:38 2013
@@ -141,10 +141,10 @@ public class ReferenceListProcessor impl
         // Prepare the SecretKey object to decrypt EncryptedData
         //
         String symEncAlgo = X509Util.getEncAlgo(encryptedDataElement);
-        Element keyInfoElement = 
-            (Element)WSSecurityUtil.getDirectChildElement(
-                encryptedDataElement, "KeyInfo", WSConstants.SIG_NS
-            );
+        Element keyInfoElement =
+                WSSecurityUtil.getDirectChildElement(
+                    encryptedDataElement, "KeyInfo", WSConstants.SIG_NS
+                );
         // KeyInfo cannot be null
         if (keyInfoElement == null) {
             throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, "noKeyinfo");
@@ -272,8 +272,7 @@ public class ReferenceListProcessor impl
             callbackLookup.getElement(dataRefURI, null, true);
         if (encryptedDataElement == null) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.INVALID_SECURITY, "dataRef", new Object[] {dataRefURI}
-            );
+                WSSecurityException.ErrorCode.INVALID_SECURITY, "dataRef", dataRefURI);
         }
         if (encryptedDataElement.getLocalName().equals(WSConstants.ENCRYPTED_HEADER)
             && encryptedDataElement.getNamespaceURI().equals(WSConstants.WSSE11_NS)) {

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SAMLTokenProcessor.java Mon Apr  1 18:28:38 2013
@@ -154,8 +154,7 @@ public class SAMLTokenProcessor implemen
                 } else {
                     throw new WSSecurityException(
                         WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity",
-                        new Object[]{"cannot get certificate or key"}
-                    );
+                        "cannot get certificate or key");
                 }
             
                 // Not checking signature here, just marshalling into an XMLSignature

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SecurityContextTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SecurityContextTokenProcessor.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SecurityContextTokenProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SecurityContextTokenProcessor.java Mon Apr  1 18:28:38 2013
@@ -111,15 +111,13 @@ public class SecurityContextTokenProcess
                 WSSecurityException.ErrorCode.FAILURE, 
                 "noKey",
                 e,
-                new Object[] {identifier} 
-            );
+                identifier);
         } catch (UnsupportedCallbackException e) {
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.FAILURE, 
                 "noKey",
                 e,
-                new Object[] {identifier} 
-            );
+                identifier);
         }
 
         return callback.getKey();

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/SignatureProcessor.java Mon Apr  1 18:28:38 2013
@@ -166,7 +166,7 @@ public class SignatureProcessor implemen
                 Map<String, Object> parameters = new HashMap<String, Object>();
                 parameters.put(SignatureSTRParser.SIGNATURE_METHOD, signatureMethod);
                 parameters.put(
-                    SignatureSTRParser.SECRET_KEY_LENGTH, Integer.valueOf(data.getWssConfig().getSecretKeyLength())
+                    SignatureSTRParser.SECRET_KEY_LENGTH, data.getWssConfig().getSecretKeyLength()
                 );
                 strParser.parseSecurityTokenReference(
                     child, data, wsDocInfo, parameters
@@ -478,7 +478,7 @@ public class SignatureProcessor implemen
                 element = wsDocInfo.getTokenElement(uri);
             }
             if (element != null) {
-                WSSecurityUtil.storeElementInContext(((DOMValidateContext)context), uri, element);
+                WSSecurityUtil.storeElementInContext(context, uri, element);
             }
         }
     }
@@ -652,8 +652,8 @@ public class SignatureProcessor implemen
             Node sibling = signatureElement.getNextSibling();
             while (sibling != null) {
                 if (sibling instanceof Element 
-                    && WSConstants.TIMESTAMP_TOKEN_LN.equals(((Element)sibling).getLocalName())
-                    && WSConstants.WSU_NS.equals(((Element)sibling).getNamespaceURI())) {
+                    && WSConstants.TIMESTAMP_TOKEN_LN.equals(sibling.getLocalName())
+                    && WSConstants.WSU_NS.equals(sibling.getNamespaceURI())) {
                     timeStamp = new Timestamp((Element)sibling, requestData.getBSPEnforcer());
                     break;
                 }
@@ -675,8 +675,7 @@ public class SignatureProcessor implemen
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.INVALID_SECURITY,
                 "invalidTimestamp",
-                new Object[] {"A replay attack has been detected"}
-            );
+                "A replay attack has been detected");
         }
 
         // Store the Timestamp/SignatureValue combination in the cache

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/UsernameTokenProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/UsernameTokenProcessor.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/UsernameTokenProcessor.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/UsernameTokenProcessor.java Mon Apr  1 18:28:38 2013
@@ -22,6 +22,7 @@ package org.apache.wss4j.dom.processor;
 import java.util.Date;
 import java.util.List;
 
+import org.apache.commons.codec.binary.Base64;
 import org.apache.wss4j.common.principal.SAMLTokenPrincipalImpl;
 import org.apache.wss4j.common.principal.WSUsernameTokenPrincipalImpl;
 import org.w3c.dom.Element;
@@ -93,7 +94,7 @@ public class UsernameTokenProcessor impl
             } else {
                 WSUsernameTokenPrincipalImpl principal =
                     new WSUsernameTokenPrincipalImpl(token.getName(), token.isHashed());
-                principal.setNonce(token.getNonce());
+                principal.setNonce(Base64.decodeBase64(token.getNonce()));
                 principal.setPassword(token.getPassword());
                 principal.setCreatedTime(token.getCreated());
                 principal.setPasswordType(token.getPasswordType());

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/X509Util.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/X509Util.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/X509Util.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/processor/X509Util.java Mon Apr  1 18:28:38 2013
@@ -105,23 +105,20 @@ public final class X509Util {
                 WSSecurityException.ErrorCode.FAILURE,
                 "noPassword",
                 e,
-                new Object[]{keyName} 
-            );
+                keyName);
         } catch (UnsupportedCallbackException e) {
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.FAILURE,
                 "noPassword",
                 e,
-                new Object[]{keyName} 
-            );
+                keyName);
         }
         byte[] decryptedData = pwCb.getKey();
         if (decryptedData == null) {
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.FAILURE,
                 "noPassword",
-                new Object[]{keyName}
-            );
+                keyName);
         }
         return WSSecurityUtil.prepareSecretKey(algorithm, decryptedData);
     }

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSecSignatureSAML.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSecSignatureSAML.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSecSignatureSAML.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/saml/WSSecSignatureSAML.java Mon Apr  1 18:28:38 2013
@@ -208,7 +208,7 @@ public class WSSecSignatureSAML extends 
         issuerKeyName = iKeyName;
         issuerKeyPW = iKeyPW;
         
-        samlToken = (Element) samlAssertion.toDOM(doc);
+        samlToken = samlAssertion.toDOM(doc);
 
         //
         // Get some information about the SAML token content. This controls how
@@ -250,8 +250,7 @@ public class WSSecSignatureSAML extends 
                 throw new WSSecurityException(
                     WSSecurityException.ErrorCode.FAILURE,
                     "invalidSAMLsecurity",
-                    new Object[] { "for SAML Signature (Key Holder)" }
-                );
+                    "for SAML Signature (Key Holder)");
             }
             if (secretKey == null) {
                 RequestData data = new RequestData();
@@ -272,8 +271,7 @@ public class WSSecSignatureSAML extends 
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.FAILURE,
                 "noCertsFound",
-                new Object[] { "SAML signature" }
-            );
+                "SAML signature");
         }
         
         if (sigAlgo == null) {
@@ -298,10 +296,7 @@ public class WSSecSignatureSAML extends 
                 throw new WSSecurityException(
                     WSSecurityException.ErrorCode.FAILURE,
                     "unknownSignatureAlgorithm",
-                    new Object[] {
-                        pubKeyAlgo
-                    }
-                );
+                    pubKeyAlgo);
             }
         }
         sig = null;
@@ -417,7 +412,7 @@ public class WSSecSignatureSAML extends 
 
             default:
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILURE, "unsupportedKeyId", new Object[]{}
+                    WSSecurityException.ErrorCode.FAILURE, "unsupportedKeyId"
                 );
             }
         } else if (useDirectReferenceToAssertion) {

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/DerivedKeyTokenSTRParser.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/DerivedKeyTokenSTRParser.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/DerivedKeyTokenSTRParser.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/DerivedKeyTokenSTRParser.java Mon Apr  1 18:28:38 2013
@@ -90,8 +90,7 @@ public class DerivedKeyTokenSTRParser im
                 getSecretKeyFromToken(uri, null, WSPasswordCallback.Usage.SECURITY_CONTEXT_TOKEN, data);
             if (secretKey == null) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId", new Object[] {uri}
-                );
+                    WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId", uri);
             }
         } else if (secRef.containsKeyIdentifier()) {
             String keyIdentifierValueType = secRef.getKeyIdentifierValueType();
@@ -117,8 +116,7 @@ public class DerivedKeyTokenSTRParser im
                 }
                 if (secretKey == null) {
                     throw new WSSecurityException(
-                        WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId", new Object[] {uri}
-                    );
+                        WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId", uri);
                 }
             } else {
                 if (keyIdentifierValueType.equals(SecurityTokenReference.ENC_KEY_SHA1_URI)) {
@@ -133,8 +131,7 @@ public class DerivedKeyTokenSTRParser im
                        ); 
                     if (secretKey == null) {
                         throw new WSSecurityException(
-                            WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId", new Object[] {uri}
-                        );
+                            WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId", uri);
                     }
                 } else {
                     secretKey = crypto.getPrivateKey(certs[0], data.getCallbackHandler()).getEncoded();
@@ -227,9 +224,7 @@ public class DerivedKeyTokenSTRParser im
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.FAILURE,
                 "noPassword", 
-                e,
-                new Object[] {id}
-            );
+                e, id);
         }
 
         return null;
@@ -244,7 +239,7 @@ public class DerivedKeyTokenSTRParser im
         RequestData data,
         WSDocInfo wsDocInfo
     ) throws WSSecurityException {
-        int action = ((Integer)result.get(WSSecurityEngineResult.TAG_ACTION)).intValue();
+        int action = ((Integer)result.get(WSSecurityEngineResult.TAG_ACTION));
         if (WSConstants.UT_NOPASSWORD == action || WSConstants.UT == action) {
             STRParserUtil.checkUsernameTokenBSPCompliance(secRef, data.getBSPEnforcer());
             secretKey = (byte[])result.get(WSSecurityEngineResult.TAG_SECRET);

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/EncryptedKeySTRParser.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/EncryptedKeySTRParser.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/EncryptedKeySTRParser.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/EncryptedKeySTRParser.java Mon Apr  1 18:28:38 2013
@@ -197,7 +197,7 @@ public class EncryptedKeySTRParser imple
         RequestData data,
         WSDocInfo wsDocInfo
     ) throws WSSecurityException {
-        int action = ((Integer)result.get(WSSecurityEngineResult.TAG_ACTION)).intValue();
+        int action = (Integer) result.get(WSSecurityEngineResult.TAG_ACTION);
         if (WSConstants.BST == action) {
             BinarySecurity token = 
                 (BinarySecurity)result.get(

Modified: webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SecurityTokenRefSTRParser.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SecurityTokenRefSTRParser.java?rev=1463243&r1=1463242&r2=1463243&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SecurityTokenRefSTRParser.java (original)
+++ webservices/wss4j/trunk/ws-security-dom/src/main/java/org/apache/wss4j/dom/str/SecurityTokenRefSTRParser.java Mon Apr  1 18:28:38 2013
@@ -97,8 +97,7 @@ public class SecurityTokenRefSTRParser i
             
             if (secretKey == null) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId", new Object[] {uri}
-                );
+                    WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId", uri);
             }
         } else if (secRef.containsReference()) {
             Reference reference = secRef.getReference();
@@ -120,8 +119,7 @@ public class SecurityTokenRefSTRParser i
             }
             if (secretKey == null) {
                 throw new WSSecurityException(
-                    WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId", new Object[] {uri}
-                );
+                    WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId", uri);
             }
         } else if (secRef.containsKeyIdentifier()) {
             String valueType = secRef.getKeyIdentifierValueType();
@@ -156,8 +154,7 @@ public class SecurityTokenRefSTRParser i
                 }
                 if (secretKey == null) {
                     throw new WSSecurityException(
-                        WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId", new Object[] {uri}
-                    );
+                        WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId", uri);
                 }
             } else {
                 if (SecurityTokenReference.ENC_KEY_SHA1_URI.equals(valueType)) {
@@ -169,8 +166,7 @@ public class SecurityTokenRefSTRParser i
                     );
                 if (secretKey == null) {
                     throw new WSSecurityException(
-                        WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId", new Object[] {uri}
-                    );
+                        WSSecurityException.ErrorCode.FAILED_CHECK, "unsupportedKeyId", uri);
                 }
             }
         } else {
@@ -257,9 +253,7 @@ public class SecurityTokenRefSTRParser i
             throw new WSSecurityException(
                 WSSecurityException.ErrorCode.FAILURE,
                 "noPassword", 
-                e,
-                new Object[] {id}
-            );
+                e, id);
         }
 
         return null;
@@ -281,8 +275,7 @@ public class SecurityTokenRefSTRParser i
                     data.getSigVerCrypto(), data.getCallbackHandler());
         if (samlKi == null) {
             throw new WSSecurityException(
-                WSSecurityException.ErrorCode.FAILED_CHECK, "invalidSAMLToken", new Object[] {"No Secret Key"}
-            );
+                WSSecurityException.ErrorCode.FAILED_CHECK, "invalidSAMLToken", "No Secret Key");
         }
         return samlKi.getSecret();
     }
@@ -297,7 +290,7 @@ public class SecurityTokenRefSTRParser i
         Map<String, Object> parameters,
         WSDocInfo wsDocInfo
     ) throws WSSecurityException {
-        int action = ((Integer)result.get(WSSecurityEngineResult.TAG_ACTION)).intValue();
+        int action = (Integer) result.get(WSSecurityEngineResult.TAG_ACTION);
         if (WSConstants.ENCR == action) {
             STRParserUtil.checkEncryptedKeyBSPCompliance(secRef, data.getBSPEnforcer());
             secretKey = (byte[])result.get(WSSecurityEngineResult.TAG_SECRET);



Mime
View raw message