ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1720192 [31/33] - in /webservices/wss4j/trunk: bindings/src/main/java/org/apache/wss4j/binding/wss10/ bindings/src/main/java/org/apache/wss4j/binding/wss11/ bindings/src/main/java/org/apache/wss4j/binding/wssc13/ bindings/src/main/java/org...
Date Tue, 15 Dec 2015 16:40:42 GMT
Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/ConfigurationConverter.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/ConfigurationConverter.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/ConfigurationConverter.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/ConfigurationConverter.java Tue Dec 15 16:40:37 2015
@@ -49,37 +49,37 @@ import org.apache.xml.security.stax.ext.
  * This utility class converts between a Map<String, Object> and a WSSSecurityProperties class
  */
 public final class ConfigurationConverter {
-    
-    private static final org.slf4j.Logger LOG = 
+
+    private static final org.slf4j.Logger LOG =
         org.slf4j.LoggerFactory.getLogger(ConfigurationConverter.class);
-                                          
+
     private ConfigurationConverter() {
         // complete
     }
-    
+
     public static WSSSecurityProperties convert(Map<String, Object> config) {
         WSSSecurityProperties properties = new WSSSecurityProperties();
-        
+
         if (config == null) {
             return properties;
         }
-        
+
         parseActions(config, properties);
         parseUserProperties(config, properties);
         parseCallback(config, properties);
         parseCrypto(config, properties);
         parseBooleanProperties(config, properties);
         parseNonBooleanProperties(config, properties);
-        
+
         return properties;
     }
-    
+
     public static void parseActions(
-        Map<String, Object> config, 
+        Map<String, Object> config,
         WSSSecurityProperties properties
     ) {
         String action = getString(ConfigurationConstants.ACTION, config);
-        
+
         String actionToParse = action;
         if (actionToParse == null) {
             return;
@@ -127,20 +127,20 @@ public final class ConfigurationConverte
         if (sigConf) {
             actions.add(WSSConstants.SIGNATURE_CONFIRMATION);
         }
-        
+
         properties.setActions(actions);
     }
-    
+
     public static void parseUserProperties(
-        Map<String, Object> config, 
+        Map<String, Object> config,
         WSSSecurityProperties properties
     ) {
         String user = getString(ConfigurationConstants.USER, config);
         properties.setTokenUser(user);
-        
+
         String actor = getString(ConfigurationConstants.ACTOR, config);
         properties.setActor(actor);
-        
+
         String encUser = getString(ConfigurationConstants.ENCRYPTION_USER, config);
         if (encUser == null) {
             encUser = user;
@@ -149,19 +149,19 @@ public final class ConfigurationConverte
         if (ConfigurationConstants.USE_REQ_SIG_CERT.equals(encUser)) {
             properties.setUseReqSigCertForEncryption(true);
         }
-        
+
         String sigUser = getString(ConfigurationConstants.SIGNATURE_USER, config);
         if (sigUser == null) {
             sigUser = user;
         }
         properties.setSignatureUser(sigUser);
     }
-    
+
     public static void parseCrypto(
-        Map<String, Object> config, 
+        Map<String, Object> config,
         WSSSecurityProperties properties
     ) {
-        Object passwordEncryptorObj = 
+        Object passwordEncryptorObj =
             config.get(ConfigurationConstants.PASSWORD_ENCRYPTOR_INSTANCE);
         PasswordEncryptor passwordEncryptor = null;
         if (passwordEncryptorObj instanceof PasswordEncryptor) {
@@ -173,7 +173,7 @@ public final class ConfigurationConverte
                 passwordEncryptor = new JasyptPasswordEncryptor(callbackHandler);
             }
         }
-        
+
         String sigPropRef = getString(ConfigurationConstants.SIG_PROP_REF_ID, config);
         boolean foundSigRef = false;
         if (sigPropRef != null) {
@@ -189,12 +189,12 @@ public final class ConfigurationConverte
                 properties.setSignatureUser(getDefaultX509Identifier(properties, true));
             }
         }
-        
+
         if (!foundSigRef) {
             String sigPropFile = getString(ConfigurationConstants.SIG_PROP_FILE, config);
             if (sigPropFile != null) {
                 try {
-                    Properties sigProperties = 
+                    Properties sigProperties =
                         CryptoFactory.getProperties(sigPropFile, getClassLoader());
                     properties.setSignatureCryptoProperties(sigProperties, passwordEncryptor);
                     if (properties.getSignatureUser() == null) {
@@ -205,7 +205,7 @@ public final class ConfigurationConverte
                 }
             }
         }
-        
+
         String sigVerPropRef = getString(ConfigurationConstants.SIG_VER_PROP_REF_ID, config);
         boolean foundSigVerRef = false;
         if (sigVerPropRef != null) {
@@ -216,14 +216,14 @@ public final class ConfigurationConverte
             } else if (sigVerRef instanceof Properties) {
                 foundSigVerRef = true;
                 properties.setSignatureVerificationCryptoProperties((Properties)sigVerRef, passwordEncryptor);
-            } 
+            }
         }
-        
+
         if (!foundSigVerRef) {
             String sigPropFile = getString(ConfigurationConstants.SIG_VER_PROP_FILE, config);
             if (sigPropFile != null) {
                 try {
-                    Properties sigProperties = 
+                    Properties sigProperties =
                         CryptoFactory.getProperties(sigPropFile, getClassLoader());
                     properties.setSignatureVerificationCryptoProperties(sigProperties, passwordEncryptor);
                 } catch (WSSecurityException e) {
@@ -231,7 +231,7 @@ public final class ConfigurationConverte
                 }
             }
         }
-        
+
         String encPropRef = getString(ConfigurationConstants.ENC_PROP_REF_ID, config);
         boolean foundEncRef = false;
         if (encPropRef != null) {
@@ -242,14 +242,14 @@ public final class ConfigurationConverte
             } else if (encRef instanceof Properties) {
                 foundEncRef = true;
                 properties.setEncryptionCryptoProperties((Properties)encRef, passwordEncryptor);
-            } 
+            }
         }
-        
+
         if (!foundEncRef) {
             String encPropFile = getString(ConfigurationConstants.ENC_PROP_FILE, config);
             if (encPropFile != null) {
                 try {
-                    Properties encProperties = 
+                    Properties encProperties =
                         CryptoFactory.getProperties(encPropFile, getClassLoader());
                     properties.setEncryptionCryptoProperties(encProperties, passwordEncryptor);
                 } catch (WSSecurityException e) {
@@ -257,7 +257,7 @@ public final class ConfigurationConverte
                 }
             }
         }
-        
+
         String decPropRef = getString(ConfigurationConstants.DEC_PROP_REF_ID, config);
         boolean foundDecRef = false;
         if (decPropRef != null) {
@@ -268,14 +268,14 @@ public final class ConfigurationConverte
             } else if (decRef instanceof Properties) {
                 foundDecRef = true;
                 properties.setDecryptionCryptoProperties((Properties)decRef, passwordEncryptor);
-            } 
+            }
         }
-        
+
         if (!foundDecRef) {
             String encPropFile = getString(ConfigurationConstants.DEC_PROP_FILE, config);
             if (encPropFile != null) {
                 try {
-                    Properties encProperties = 
+                    Properties encProperties =
                         CryptoFactory.getProperties(encPropFile, getClassLoader());
                     properties.setDecryptionCryptoProperties(encProperties, passwordEncryptor);
                 } catch (WSSecurityException e) {
@@ -284,7 +284,7 @@ public final class ConfigurationConverte
             }
         }
     }
-    
+
     public static String getDefaultX509Identifier(
         WSSSecurityProperties properties, boolean signature
     ) {
@@ -303,9 +303,9 @@ public final class ConfigurationConverte
         }
         return null;
     }
-    
+
     public static void parseCallback(
-        Map<String, Object> config, 
+        Map<String, Object> config,
         WSSSecurityProperties properties
     ) {
         Object pwPropRef = config.get(ConfigurationConstants.PW_CALLBACK_REF);
@@ -322,7 +322,7 @@ public final class ConfigurationConverte
                 }
             }
         }
-        
+
         Object samlPropRef = config.get(ConfigurationConstants.SAML_CALLBACK_REF);
         if (samlPropRef instanceof CallbackHandler) {
             properties.setSamlCallbackHandler((CallbackHandler)samlPropRef);
@@ -338,7 +338,7 @@ public final class ConfigurationConverte
             }
         }
     }
-    
+
     /**
      * Load a CallbackHandler instance.
      * @param callbackHandlerClass The class name of the CallbackHandler instance
@@ -352,14 +352,14 @@ public final class ConfigurationConverte
         Class<? extends CallbackHandler> cbClass = null;
         CallbackHandler cbHandler = null;
         try {
-            cbClass = 
-                Loader.loadClass(getClassLoader(), 
+            cbClass =
+                Loader.loadClass(getClassLoader(),
                                  callbackHandlerClass,
                                  CallbackHandler.class);
         } catch (ClassNotFoundException e) {
             throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e,
                     "empty",
-                    new Object[] {"WSHandler: cannot load callback handler class: " 
+                    new Object[] {"WSHandler: cannot load callback handler class: "
                     + callbackHandlerClass}
             );
         }
@@ -368,13 +368,13 @@ public final class ConfigurationConverte
         } catch (Exception e) {
             throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e,
                     "empty",
-                    new Object[] {"WSHandler: cannot create instance of callback handler: " 
+                    new Object[] {"WSHandler: cannot create instance of callback handler: "
                     + callbackHandlerClass}
             );
         }
         return cbHandler;
     }
-    
+
     private static ClassLoader getClassLoader() {
         try {
             return Loader.getTCL();
@@ -382,103 +382,103 @@ public final class ConfigurationConverte
             return null;
         }
     }
-    
+
     public static void parseBooleanProperties(
-        Map<String, Object> config, 
+        Map<String, Object> config,
         WSSSecurityProperties properties
     ) {
         //outbound sigConf is configured as an Action, see parseActions()
-        boolean sigConf = 
+        boolean sigConf =
             decodeBooleanConfigValue(ConfigurationConstants.ENABLE_SIGNATURE_CONFIRMATION, false, config);
         properties.setEnableSignatureConfirmationVerification(sigConf);
-        
-        boolean mustUnderstand = 
+
+        boolean mustUnderstand =
             decodeBooleanConfigValue(ConfigurationConstants.MUST_UNDERSTAND, true, config);
         properties.setMustUnderstand(mustUnderstand);
-        
-        boolean bspCompliant = 
+
+        boolean bspCompliant =
             decodeBooleanConfigValue(ConfigurationConstants.IS_BSP_COMPLIANT, true, config);
         properties.setDisableBSPEnforcement(!bspCompliant);
-        
-        boolean inclPrefixes = 
+
+        boolean inclPrefixes =
             decodeBooleanConfigValue(ConfigurationConstants.ADD_INCLUSIVE_PREFIXES, true, config);
         properties.setAddExcC14NInclusivePrefixes(inclPrefixes);
-        
-        boolean nonce = 
+
+        boolean nonce =
             decodeBooleanConfigValue(ConfigurationConstants.ADD_USERNAMETOKEN_NONCE, false, config);
         properties.setAddUsernameTokenNonce(nonce);
-        
-        boolean created = 
+
+        boolean created =
             decodeBooleanConfigValue(ConfigurationConstants.ADD_USERNAMETOKEN_CREATED, false, config);
         properties.setAddUsernameTokenCreated(created);
-        
-        boolean customPasswordTypes = 
+
+        boolean customPasswordTypes =
             decodeBooleanConfigValue(ConfigurationConstants.HANDLE_CUSTOM_PASSWORD_TYPES, false, config);
         properties.setHandleCustomPasswordTypes(customPasswordTypes);
-        
-        boolean allowNoPassword = 
+
+        boolean allowNoPassword =
             decodeBooleanConfigValue(ConfigurationConstants.ALLOW_USERNAMETOKEN_NOPASSWORD, false, config);
         properties.setAllowUsernameTokenNoPassword(allowNoPassword);
-        
-        boolean enableRevocation = 
+
+        boolean enableRevocation =
             decodeBooleanConfigValue(ConfigurationConstants.ENABLE_REVOCATION, false, config);
         properties.setEnableRevocation(enableRevocation);
-        
-        boolean singleCert = 
+
+        boolean singleCert =
             decodeBooleanConfigValue(ConfigurationConstants.USE_SINGLE_CERTIFICATE, true, config);
         properties.setUseSingleCert(singleCert);
-        
-        boolean derivedKeyMAC = 
+
+        boolean derivedKeyMAC =
             decodeBooleanConfigValue(ConfigurationConstants.USE_DERIVED_KEY_FOR_MAC, true, config);
         properties.setUseDerivedKeyForMAC(derivedKeyMAC);
-        
-        boolean timestampStrict = 
+
+        boolean timestampStrict =
             decodeBooleanConfigValue(ConfigurationConstants.TIMESTAMP_STRICT, true, config);
         properties.setStrictTimestampCheck(timestampStrict);
-        
-        boolean allowRSA15 = 
+
+        boolean allowRSA15 =
             decodeBooleanConfigValue(ConfigurationConstants.ALLOW_RSA15_KEY_TRANSPORT_ALGORITHM, false, config);
         properties.setAllowRSA15KeyTransportAlgorithm(allowRSA15);
-        
-        boolean validateSamlSubjectConf = 
+
+        boolean validateSamlSubjectConf =
             decodeBooleanConfigValue(ConfigurationConstants.VALIDATE_SAML_SUBJECT_CONFIRMATION, true, config);
         properties.setValidateSamlSubjectConfirmation(validateSamlSubjectConf);
-        
-        boolean includeSignatureToken = 
+
+        boolean includeSignatureToken =
             decodeBooleanConfigValue(ConfigurationConstants.INCLUDE_SIGNATURE_TOKEN, false, config);
         properties.setIncludeSignatureToken(includeSignatureToken);
-        
-        boolean includeEncryptionToken = 
+
+        boolean includeEncryptionToken =
             decodeBooleanConfigValue(ConfigurationConstants.INCLUDE_ENCRYPTION_TOKEN, false, config);
         properties.setIncludeEncryptionToken(includeEncryptionToken);
-        
-        boolean enableTimestampCache = 
+
+        boolean enableTimestampCache =
             decodeBooleanConfigValue(ConfigurationConstants.ENABLE_TIMESTAMP_CACHE, true, config);
         properties.setEnableTimestampReplayCache(enableTimestampCache);
-        
-        boolean enableNonceCache = 
+
+        boolean enableNonceCache =
             decodeBooleanConfigValue(ConfigurationConstants.ENABLE_NONCE_CACHE, true, config);
         properties.setEnableNonceReplayCache(enableNonceCache);
-        
-        boolean enableSamlOneTimeUseCache = 
+
+        boolean enableSamlOneTimeUseCache =
             decodeBooleanConfigValue(ConfigurationConstants.ENABLE_SAML_ONE_TIME_USE_CACHE, true, config);
         properties.setEnableSamlOneTimeUseReplayCache(enableSamlOneTimeUseCache);
-        
-        boolean encryptSymmetricEncryptionKey = 
+
+        boolean encryptSymmetricEncryptionKey =
             decodeBooleanConfigValue(ConfigurationConstants.ENC_SYM_ENC_KEY, true, config);
         properties.setEncryptSymmetricEncryptionKey(encryptSymmetricEncryptionKey);
-        
-        boolean use200512Namespace = 
+
+        boolean use200512Namespace =
             decodeBooleanConfigValue(ConfigurationConstants.USE_2005_12_NAMESPACE, true, config);
         properties.setUse200512Namespace(use200512Namespace);
-        
-        boolean requireTimestampExpires = 
+
+        boolean requireTimestampExpires =
             decodeBooleanConfigValue(ConfigurationConstants.REQUIRE_TIMESTAMP_EXPIRES, false, config);
         properties.setRequireTimestampExpires(requireTimestampExpires);
     }
-    
+
     public static void parseNonBooleanProperties(
-        Map<String, Object> config, 
+        Map<String, Object> config,
         WSSSecurityProperties properties
     ) {
         String pwType = getString(ConfigurationConstants.PASSWORD_TYPE, config);
@@ -489,23 +489,23 @@ public final class ConfigurationConverte
         } else if ("PasswordNone".equals(pwType)) {
             properties.setUsernameTokenPasswordType(UsernameTokenPasswordType.PASSWORD_NONE);
         }
-        
+
         String signatureKeyIdentifier = getString(ConfigurationConstants.SIG_KEY_ID, config);
-        WSSecurityTokenConstants.KeyIdentifier convSigKeyIdentifier = 
+        WSSecurityTokenConstants.KeyIdentifier convSigKeyIdentifier =
             convertKeyIdentifier(signatureKeyIdentifier);
         if (convSigKeyIdentifier != null) {
             properties.setSignatureKeyIdentifier(convSigKeyIdentifier);
         }
-        
+
         String sigAlgo = getString(ConfigurationConstants.SIG_ALGO, config);
         properties.setSignatureAlgorithm(sigAlgo);
-        
+
         String sigDigestAlgo = getString(ConfigurationConstants.SIG_DIGEST_ALGO, config);
         properties.setSignatureDigestAlgorithm(sigDigestAlgo);
-        
+
         String sigC14nAlgo = getString(ConfigurationConstants.SIG_C14N_ALGO, config);
         properties.setSignatureCanonicalizationAlgorithm(sigC14nAlgo);
-        
+
         Object sigParts = config.get(ConfigurationConstants.SIGNATURE_PARTS);
         if (sigParts != null) {
             if (sigParts instanceof String) {
@@ -526,7 +526,7 @@ public final class ConfigurationConverte
                 }
             }
         }
-        
+
         sigParts = config.get(ConfigurationConstants.OPTIONAL_SIGNATURE_PARTS);
         if (sigParts != null) {
             if (sigParts instanceof String) {
@@ -549,20 +549,20 @@ public final class ConfigurationConverte
                 }
             }
         }
-        
+
         String iterations = getString(ConfigurationConstants.DERIVED_KEY_ITERATIONS, config);
         if (iterations != null) {
             int iIterations = Integer.parseInt(iterations);
             properties.setDerivedKeyIterations(iIterations);
         }
-        
+
         String encKeyIdentifier = getString(ConfigurationConstants.ENC_KEY_ID, config);
-        WSSecurityTokenConstants.KeyIdentifier convEncKeyIdentifier = 
+        WSSecurityTokenConstants.KeyIdentifier convEncKeyIdentifier =
             convertKeyIdentifier(encKeyIdentifier);
         if (convEncKeyIdentifier != null) {
             properties.setEncryptionKeyIdentifier(convEncKeyIdentifier);
         }
-        
+
         Object encParts = config.get(ConfigurationConstants.ENCRYPTION_PARTS);
         if (encParts != null) {
             if (encParts instanceof String) {
@@ -581,7 +581,7 @@ public final class ConfigurationConverte
                 }
             }
         }
-        
+
         encParts = config.get(ConfigurationConstants.OPTIONAL_ENCRYPTION_PARTS);
         if (encParts != null) {
             if (encParts instanceof String) {
@@ -602,26 +602,26 @@ public final class ConfigurationConverte
                 }
             }
         }
-        
+
         String encSymcAlgo = getString(ConfigurationConstants.ENC_SYM_ALGO, config);
         properties.setEncryptionSymAlgorithm(encSymcAlgo);
-        
+
         String encKeyTransport = getString(ConfigurationConstants.ENC_KEY_TRANSPORT, config);
         properties.setEncryptionKeyTransportAlgorithm(encKeyTransport);
-        
+
         String encDigestAlgo = getString(ConfigurationConstants.ENC_DIGEST_ALGO, config);
         properties.setEncryptionKeyTransportDigestAlgorithm(encDigestAlgo);
-        
+
         String encMGFAlgo = getString(ConfigurationConstants.ENC_MGF_ALGO, config);
         properties.setEncryptionKeyTransportMGFAlgorithm(encMGFAlgo);
-        
+
         // Subject Cert Constraints
-        String certConstraints = 
+        String certConstraints =
             getString(ConfigurationConstants.SIG_SUBJECT_CERT_CONSTRAINTS, config);
         if (certConstraints != null) {
             String[] certConstraintsList = certConstraints.split(",");
             if (certConstraintsList != null) {
-                Collection<Pattern> subjectCertConstraints = 
+                Collection<Pattern> subjectCertConstraints =
                     new ArrayList<>(certConstraintsList.length);
                 for (String certConstraint : certConstraintsList) {
                     try {
@@ -633,66 +633,66 @@ public final class ConfigurationConverte
                 properties.setSubjectCertConstraints(subjectCertConstraints);
             }
         }
-        
+
         properties.setUtTTL(decodeTimeToLive(config, false));
         properties.setUtFutureTTL(decodeFutureTimeToLive(config, false));
         properties.setTimestampTTL(decodeTimeToLive(config, true));
         properties.setTimeStampFutureTTL(decodeFutureTimeToLive(config, true));
-        
+
         @SuppressWarnings("unchecked")
-        final Map<QName, Validator> validatorMap = 
+        final Map<QName, Validator> validatorMap =
             (Map<QName, Validator>)config.get(ConfigurationConstants.VALIDATOR_MAP);
         if (validatorMap != null) {
             for (Map.Entry<QName, Validator> entry : validatorMap.entrySet()) {
                 properties.addValidator(entry.getKey(), entry.getValue());
             }
         }
-        
-        ReplayCache nonceCache = 
+
+        ReplayCache nonceCache =
             (ReplayCache)config.get(ConfigurationConstants.NONCE_CACHE_INSTANCE);
         if (nonceCache != null) {
             properties.setNonceReplayCache(nonceCache);
         }
-        
-        ReplayCache timestampCache = 
+
+        ReplayCache timestampCache =
             (ReplayCache)config.get(ConfigurationConstants.TIMESTAMP_CACHE_INSTANCE);
         if (timestampCache != null) {
             properties.setTimestampReplayCache(timestampCache);
         }
-        
-        ReplayCache samlOneTimeUseCache = 
+
+        ReplayCache samlOneTimeUseCache =
             (ReplayCache)config.get(ConfigurationConstants.SAML_ONE_TIME_USE_CACHE_INSTANCE);
         if (samlOneTimeUseCache != null) {
             properties.setSamlOneTimeUseReplayCache(samlOneTimeUseCache);
         }
-        
+
         String derivedSignatureKeyLength = getString(ConfigurationConstants.DERIVED_SIGNATURE_KEY_LENGTH, config);
         if (derivedSignatureKeyLength != null) {
             int sigLength = Integer.parseInt(derivedSignatureKeyLength);
             properties.setDerivedSignatureKeyLength(sigLength);
         }
-        
+
         String derivedEncryptionKeyLength = getString(ConfigurationConstants.DERIVED_ENCRYPTION_KEY_LENGTH, config);
         if (derivedEncryptionKeyLength != null) {
             int encLength = Integer.parseInt(derivedEncryptionKeyLength);
             properties.setDerivedEncryptionKeyLength(encLength);
         }
-        
+
         String derivedTokenReference = getString(ConfigurationConstants.DERIVED_TOKEN_REFERENCE, config);
-        WSSConstants.DerivedKeyTokenReference convertedDerivedTokenReference = 
+        WSSConstants.DerivedKeyTokenReference convertedDerivedTokenReference =
             convertDerivedReference(derivedTokenReference);
         if (convertedDerivedTokenReference != null) {
             properties.setDerivedKeyTokenReference(convertedDerivedTokenReference);
         }
-        
+
         String derivedKeyIdentifier = getString(ConfigurationConstants.DERIVED_TOKEN_KEY_ID, config);
-        WSSecurityTokenConstants.KeyIdentifier convertedDerivedKeyIdentifier = 
+        WSSecurityTokenConstants.KeyIdentifier convertedDerivedKeyIdentifier =
             convertKeyIdentifier(derivedKeyIdentifier);
         if (convertedDerivedKeyIdentifier != null) {
             properties.setDerivedKeyKeyIdentifier(convertedDerivedKeyIdentifier);
         }
     }
-    
+
     public static WSSConstants.DerivedKeyTokenReference convertDerivedReference(String derivedTokenReference) {
         if ("EncryptedKey".equals(derivedTokenReference)) {
            return WSSConstants.DerivedKeyTokenReference.EncryptedKey;
@@ -703,7 +703,7 @@ public final class ConfigurationConverte
         }
         return null;
     }
-    
+
     public static WSSecurityTokenConstants.KeyIdentifier convertKeyIdentifier(String keyIdentifier) {
         if ("IssuerSerial".equals(keyIdentifier)) {
            return WSSecurityTokenConstants.KeyIdentifier_IssuerSerial;
@@ -726,7 +726,7 @@ public final class ConfigurationConverte
         }
         return null;
     }
-    
+
     private static int decodeTimeToLive(Map<String, Object> config, boolean timestamp) {
         String tag = ConfigurationConstants.TTL_TIMESTAMP;
         if (!timestamp) {
@@ -747,7 +747,7 @@ public final class ConfigurationConverte
         }
         return defaultTimeToLive;
     }
-    
+
     private static int decodeFutureTimeToLive(Map<String, Object> config, boolean timestamp) {
         String tag = ConfigurationConstants.TTL_FUTURE_TIMESTAMP;
         if (!timestamp) {
@@ -776,7 +776,7 @@ public final class ConfigurationConverte
         }
         return null;
     }
-    
+
     private static boolean decodeBooleanConfigValue(
         String tag, boolean defaultToTrue, Map<String, Object> config
     ) {
@@ -784,14 +784,14 @@ public final class ConfigurationConverte
 
         if ("0".equals(value) || "false".equals(value)) {
             return false;
-        } 
+        }
         if ("1".equals(value) || "true".equals(value)) {
             return true;
         }
-        
+
         return defaultToTrue;
     }
-    
+
     private static void splitEncParts(String tmpS, List<SecurePart> parts, String soapNS) {
         SecurePart encPart = null;
         String[] rawParts = tmpS.split(";");
@@ -805,7 +805,7 @@ public final class ConfigurationConverte
             } else if (partDef.length == 2) {
                 String mode = partDef[0].trim().substring(1);
                 String element = partDef[1].trim();
-                
+
                 if ("Content".equals(mode)) {
                     encPart = new SecurePart(element, SecurePart.Modifier.Content);
                 } else {
@@ -828,7 +828,7 @@ public final class ConfigurationConverte
                     }
                 }
                 String element = partDef[2].trim();
-                
+
                 QName qname = new QName(nmSpace, element);
                 if ("Content".equals(mode)) {
                     encPart = new SecurePart(qname, SecurePart.Modifier.Content);
@@ -836,7 +836,7 @@ public final class ConfigurationConverte
                     encPart = new SecurePart(qname, SecurePart.Modifier.Element);
                 }
             }
-        
+
             parts.add(encPart);
         }
     }

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/InboundWSSec.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/InboundWSSec.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/InboundWSSec.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/InboundWSSec.java Tue Dec 15 16:40:37 2015
@@ -55,7 +55,7 @@ import org.apache.xml.security.stax.secu
  */
 public class InboundWSSec {
 
-    protected static final transient org.slf4j.Logger log = 
+    protected static final transient org.slf4j.Logger log =
         org.slf4j.LoggerFactory.getLogger(InboundWSSec.class);
 
     private static final XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance();
@@ -80,7 +80,7 @@ public class InboundWSSec {
     public InboundWSSec(WSSSecurityProperties securityProperties) {
         this(securityProperties, false, false);
     }
-    
+
     public InboundWSSec(WSSSecurityProperties securityProperties, boolean initiator,
                         boolean returnSecurityError) {
         this.securityProperties = securityProperties;
@@ -103,7 +103,7 @@ public class InboundWSSec {
      * @param xmlStreamReader The original XMLStreamReader
      * @return A new XMLStreamReader which does transparently the security processing.
      * @throws XMLStreamException  thrown when a streaming error occurs
-     * @throws XMLSecurityException 
+     * @throws XMLSecurityException
      */
     public XMLStreamReader processInMessage(
             XMLStreamReader xmlStreamReader) throws XMLStreamException, WSSecurityException {
@@ -125,14 +125,14 @@ public class InboundWSSec {
      * @param xmlStreamReader       The original XMLStreamReader
      * @return A new XMLStreamReader which does transparently the security processing.
      * @throws XMLStreamException  thrown when a streaming error occurs
-     * @throws XMLSecurityException 
+     * @throws XMLSecurityException
      */
     public XMLStreamReader processInMessage(
             XMLStreamReader xmlStreamReader, List<SecurityEvent> requestSecurityEvents
     ) throws XMLStreamException, WSSecurityException {
         return this.processInMessage(xmlStreamReader, requestSecurityEvents, (SecurityEventListener)null);
     }
-    
+
     /**
      * Warning:
      * configure your xmlStreamReader correctly. Otherwise you can create a security hole.
@@ -149,12 +149,12 @@ public class InboundWSSec {
      * @param securityEventListener A SecurityEventListener to receive security-relevant events.
      * @return A new XMLStreamReader which does transparently the security processing.
      * @throws XMLStreamException  thrown when a streaming error occurs
-     * @throws XMLSecurityException 
+     * @throws XMLSecurityException
      */
     public XMLStreamReader processInMessage(
             XMLStreamReader xmlStreamReader, List<SecurityEvent> requestSecurityEvents,
             SecurityEventListener securityEventListener) throws XMLStreamException, WSSecurityException {
-        return this.processInMessage(xmlStreamReader, requestSecurityEvents, 
+        return this.processInMessage(xmlStreamReader, requestSecurityEvents,
                                      Collections.singletonList(securityEventListener));
     }
     /**
@@ -173,7 +173,7 @@ public class InboundWSSec {
      * @param securityEventListeners A list of SecurityEventListeners to receive security-relevant events.
      * @return A new XMLStreamReader which does transparently the security processing.
      * @throws XMLStreamException  thrown when a streaming error occurs
-     * @throws XMLSecurityException 
+     * @throws XMLSecurityException
      */
     public XMLStreamReader processInMessage(
             XMLStreamReader xmlStreamReader, List<SecurityEvent> requestSecurityEvents,

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/OutboundWSSec.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/OutboundWSSec.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/OutboundWSSec.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/OutboundWSSec.java Tue Dec 15 16:40:37 2015
@@ -145,7 +145,7 @@ public class OutboundWSSec {
         outboundSecurityContext.addSecurityEventListener(securityEventListener);
         return processOutMessage((Object) xmlStreamWriter, encoding, outboundSecurityContext);
     }
-    
+
     /**
      * This method is the entry point for the incoming security-engine.
      * Hand over the original XMLStreamWriter and use the returned one for further processing
@@ -181,7 +181,7 @@ public class OutboundWSSec {
             boolean encryptionKerberos = false;
             boolean derivedSignature = false;
             boolean derivedEncryption = false;
-            
+
             // Check to see whether we have a derived key signature, but not encryption, using
             // an encrypted key reference (as we only want one encrypted key here...)
             boolean derivedSignatureButNotDerivedEncryption = false;
@@ -195,7 +195,7 @@ public class OutboundWSSec {
                     }
                 }
             }
-            
+
             for (XMLSecurityConstants.Action action : securityProperties.getActions()) {
                 if (WSSConstants.TIMESTAMP.equals(action)) {
                     final TimestampOutputProcessor timestampOutputProcessor = new TimestampOutputProcessor();
@@ -266,7 +266,7 @@ public class OutboundWSSec {
                         signatureAction = true;
                         derivedSignature = true;
                     }
-                    
+
                     final DerivedKeyTokenOutputProcessor derivedKeyTokenOutputProcessor = new DerivedKeyTokenOutputProcessor();
                     initializeOutputProcessor(outputProcessorChain, derivedKeyTokenOutputProcessor, action);
 
@@ -305,7 +305,7 @@ public class OutboundWSSec {
                     final BinarySecurityTokenOutputProcessor binarySecurityTokenOutputProcessor =
                         new BinarySecurityTokenOutputProcessor();
                     initializeOutputProcessor(outputProcessorChain, binarySecurityTokenOutputProcessor, action);
-                        
+
                     final SAMLTokenOutputProcessor samlTokenOutputProcessor = new SAMLTokenOutputProcessor();
                     initializeOutputProcessor(outputProcessorChain, samlTokenOutputProcessor, action);
 
@@ -344,7 +344,7 @@ public class OutboundWSSec {
                     initializeOutputProcessor(outputProcessorChain, unknownTokenOutputProcessor, action);
                 }
             }
-            
+
             // Set up appropriate keys
             if (signatureAction) {
                 setupSignatureKey(outputProcessorChain, securityProperties, signedSAML);
@@ -353,16 +353,16 @@ public class OutboundWSSec {
                 setupEncryptionKey(outputProcessorChain, securityProperties);
             }
             if (kerberos) {
-                setupKerberosKey(outputProcessorChain, securityProperties, 
+                setupKerberosKey(outputProcessorChain, securityProperties,
                                  signatureKerberos, encryptionKerberos);
             }
             if (derivedSignature) {
-                String id = 
+                String id =
                     outputProcessorChain.getSecurityContext().get(WSSConstants.PROP_USE_THIS_TOKEN_ID_FOR_SIGNATURE);
                 setDerivedIdentifier(outputProcessorChain, id);
             }
             if (derivedEncryption) {
-                String id = 
+                String id =
                     outputProcessorChain.getSecurityContext().get(WSSConstants.PROP_USE_THIS_TOKEN_ID_FOR_ENCRYPTED_KEY);
                 if (id == null) {
                     // Maybe not encrypting the key here...
@@ -370,10 +370,10 @@ public class OutboundWSSec {
                 }
                 setDerivedIdentifier(outputProcessorChain, id);
             }
-            
+
             final SecurityHeaderReorderProcessor securityHeaderReorderProcessor = new SecurityHeaderReorderProcessor();
             initializeOutputProcessor(outputProcessorChain, securityHeaderReorderProcessor, null);
-            
+
             if (output instanceof OutputStream) {
                 final FinalOutputProcessor finalOutputProcessor = new FinalOutputProcessor((OutputStream) output, encoding);
                 initializeOutputProcessor(outputProcessorChain, finalOutputProcessor, null);
@@ -398,17 +398,17 @@ public class OutboundWSSec {
         outputProcessor.setAction(action);
         outputProcessor.init(outputProcessorChain);
     }
-    
+
     private void setupSignatureKey(
         OutputProcessorChainImpl outputProcessorChain,
         WSSSecurityProperties securityProperties,
         boolean signedSAML
     ) throws XMLSecurityException {
         final String signatureAlgorithm = securityProperties.getSignatureAlgorithm();
-        
-        GenericOutboundSecurityToken securityToken = 
+
+        GenericOutboundSecurityToken securityToken =
             getOutboundSecurityToken(outputProcessorChain, WSSConstants.PROP_USE_THIS_TOKEN_ID_FOR_SIGNATURE);
-        // First off, see if we have a supplied token with the correct keys for 
+        // First off, see if we have a supplied token with the correct keys for
         // (a)symmetric signature
         if (securityToken != null && signatureAlgorithm != null) {
             if (signatureAlgorithm.contains("hmac-sha")
@@ -419,7 +419,7 @@ public class OutboundWSSec {
                     return;
                 } else {
                     // We have certs but no private key set. Use the CallbackHandler
-                    Key key = 
+                    Key key =
                         securityProperties.getSignatureCrypto().getPrivateKey(
                             securityToken.getX509Certificates()[0], securityProperties.getCallbackHandler()
                         );
@@ -428,12 +428,12 @@ public class OutboundWSSec {
                 }
             }
         }
-        
+
         // We have no supplied key. So use the PasswordCallback to get a secret key or password
         String alias = securityProperties.getSignatureUser();
         WSPasswordCallback pwCb = new WSPasswordCallback(alias, WSPasswordCallback.SIGNATURE);
             WSSUtils.doPasswordCallback(securityProperties.getCallbackHandler(), pwCb);
-      
+
         String password = pwCb.getPassword();
         byte[] secretKey = pwCb.getKey();
         Key key = null;
@@ -445,7 +445,7 @@ public class OutboundWSSec {
                 cryptoType.setAlias(alias);
                 x509Certificates = securityProperties.getSignatureCrypto().getX509Certificates(cryptoType);
                 if (x509Certificates == null || x509Certificates.length == 0) {
-                    throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_SIGNATURE, "noUserCertsFound", 
+                    throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_SIGNATURE, "noUserCertsFound",
                                                   new Object[] {alias});
                 }
             } else if (secretKey != null) {
@@ -453,7 +453,7 @@ public class OutboundWSSec {
                 String algoFamily = JCEAlgorithmMapper.getJCEKeyAlgorithmFromURI(signatureAlgorithm);
                 key = new SecretKeySpec(secretKey, algoFamily);
             } else {
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_SIGNATURE, "noPassword", 
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_SIGNATURE, "noPassword",
                                               new Object[] {alias});
             }
         } catch (WSSecurityException ex) {
@@ -468,7 +468,7 @@ public class OutboundWSSec {
         final String id = IDGenerator.generateID(null);
         final GenericOutboundSecurityToken binarySecurityToken =
                 new GenericOutboundSecurityToken(id, WSSecurityTokenConstants.X509V3Token, key, x509Certificates);
-          
+
         // binarySecurityToken.setSha1Identifier(reference);
         final SecurityTokenProvider<OutboundSecurityToken> binarySecurityTokenProvider =
                 new SecurityTokenProvider<OutboundSecurityToken>() {
@@ -483,19 +483,19 @@ public class OutboundWSSec {
                 return id;
             }
         };
-        
+
         outputProcessorChain.getSecurityContext().registerSecurityTokenProvider(id, binarySecurityTokenProvider);
         outputProcessorChain.getSecurityContext().put(WSSConstants.PROP_USE_THIS_TOKEN_ID_FOR_SIGNATURE, id);
     }
-    
+
     private void setupEncryptionKey(
         OutputProcessorChainImpl outputProcessorChain,
         WSSSecurityProperties securityProperties
     ) throws XMLSecurityException {
         final String symmetricEncryptionAlgorithm = securityProperties.getEncryptionSymAlgorithm();
-        
+
         // First check to see if a Symmetric key is available
-        GenericOutboundSecurityToken securityToken = 
+        GenericOutboundSecurityToken securityToken =
             getOutboundSecurityToken(outputProcessorChain, WSSConstants.PROP_USE_THIS_TOKEN_ID_FOR_ENCRYPTION);
         if (securityToken == null || securityToken.getSecretKey(symmetricEncryptionAlgorithm) == null) {
             //prepare the symmetric session key for all encryption parts
@@ -516,7 +516,7 @@ public class OutboundWSSec {
             final Key symmetricKey = keyGen.generateKey();
             final String symmId = IDGenerator.generateID(null);
 
-            final GenericOutboundSecurityToken symmetricSecurityToken = 
+            final GenericOutboundSecurityToken symmetricSecurityToken =
                 new GenericOutboundSecurityToken(symmId, WSSecurityTokenConstants.EncryptedKeyToken, symmetricKey);
             securityToken = symmetricSecurityToken;
             final SecurityTokenProvider<OutboundSecurityToken> securityTokenProvider =
@@ -536,7 +536,7 @@ public class OutboundWSSec {
             outputProcessorChain.getSecurityContext().registerSecurityTokenProvider(symmId, securityTokenProvider);
             outputProcessorChain.getSecurityContext().put(WSSConstants.PROP_USE_THIS_TOKEN_ID_FOR_ENCRYPTION, symmId);
         }
-        
+
         if (!securityProperties.isEncryptSymmetricEncryptionKey()) {
             // No EncryptedKey Token required here, so return
             return;
@@ -565,7 +565,7 @@ public class OutboundWSSec {
                                               new Object[] {securityProperties.getEncryptionUser(), "encryption"});
             }
         }
-        
+
         // Check for Revocation
         if (securityProperties.isEnableRevocation()) {
             Crypto crypto = securityProperties.getEncryptionCrypto();
@@ -576,10 +576,10 @@ public class OutboundWSSec {
         final String id = IDGenerator.generateID(null);
         final GenericOutboundSecurityToken encryptedKeyToken =
             new GenericOutboundSecurityToken(id, WSSecurityTokenConstants.X509V3Token, null, x509Certificates);
-   
+
         encryptedKeyToken.addWrappedToken(securityToken);
         securityToken.setKeyWrappingToken(encryptedKeyToken);
-        
+
         // binarySecurityToken.setSha1Identifier(reference);
         final SecurityTokenProvider<OutboundSecurityToken> encryptedKeyTokenProvider =
             new SecurityTokenProvider<OutboundSecurityToken>() {
@@ -598,14 +598,14 @@ public class OutboundWSSec {
         outputProcessorChain.getSecurityContext().registerSecurityTokenProvider(id, encryptedKeyTokenProvider);
         outputProcessorChain.getSecurityContext().put(WSSConstants.PROP_USE_THIS_TOKEN_ID_FOR_ENCRYPTED_KEY, id);
     }
-    
+
     private void setupKerberosKey(
         OutputProcessorChainImpl outputProcessorChain,
         WSSSecurityProperties securityProperties,
         boolean signature,
         boolean encryption
     ) throws XMLSecurityException {
-        GenericOutboundSecurityToken securityToken = 
+        GenericOutboundSecurityToken securityToken =
             getOutboundSecurityToken(outputProcessorChain, WSSConstants.PROP_USE_THIS_TOKEN_ID_FOR_KERBEROS);
         String kerberosId = null;
         // First off, see if we have a supplied token
@@ -617,54 +617,54 @@ public class OutboundWSSec {
                     new KerberosClientSecurityToken(
                         securityProperties.getCallbackHandler(), id
                     );
-    
+
             final SecurityTokenProvider<OutboundSecurityToken> kerberosSecurityTokenProvider =
                     new SecurityTokenProvider<OutboundSecurityToken>() {
-    
+
                 @Override
                 public OutboundSecurityToken getSecurityToken() throws WSSecurityException {
                     return kerberosClientSecurityToken;
                 }
-    
+
                 @Override
                 public String getId() {
                     return id;
                 }
             };
-            
+
             outputProcessorChain.getSecurityContext().registerSecurityTokenProvider(id, kerberosSecurityTokenProvider);
             outputProcessorChain.getSecurityContext().put(WSSConstants.PROP_USE_THIS_TOKEN_ID_FOR_KERBEROS, id);
         } else {
             kerberosId = securityToken.getId();
         }
-        
+
         if (signature) {
             outputProcessorChain.getSecurityContext().put(WSSConstants.PROP_USE_THIS_TOKEN_ID_FOR_SIGNATURE, kerberosId);
         }
         if (encryption) {
             outputProcessorChain.getSecurityContext().put(WSSConstants.PROP_USE_THIS_TOKEN_ID_FOR_ENCRYPTION, kerberosId);
         }
-        
+
     }
-    
+
     // Return an outbound SecurityToken object for a given id (encryption/signature)
     private GenericOutboundSecurityToken getOutboundSecurityToken(
         OutputProcessorChainImpl outputProcessorChain, String id
     ) throws XMLSecurityException {
-        String tokenId = 
+        String tokenId =
             outputProcessorChain.getSecurityContext().get(id);
         SecurityTokenProvider<OutboundSecurityToken> signatureTokenProvider = null;
         if (tokenId != null) {
-            signatureTokenProvider = 
+            signatureTokenProvider =
                 outputProcessorChain.getSecurityContext().getSecurityTokenProvider(tokenId);
             if (signatureTokenProvider != null) {
                 return (GenericOutboundSecurityToken)signatureTokenProvider.getSecurityToken();
             }
         }
-        
+
         return null;
     }
-    
+
     private X509Certificate getReqSigCert(SecurityContext securityContext) throws XMLSecurityException {
         List<SecurityEvent> securityEventList = securityContext.getAsList(SecurityEvent.class);
         if (securityEventList != null) {
@@ -672,7 +672,7 @@ public class OutboundWSSec {
                 SecurityEvent securityEvent = securityEventList.get(i);
                 if (securityEvent instanceof TokenSecurityEvent) {
                     @SuppressWarnings("unchecked")
-                    TokenSecurityEvent<? extends SecurityToken> tokenSecurityEvent 
+                    TokenSecurityEvent<? extends SecurityToken> tokenSecurityEvent
                         = (TokenSecurityEvent<? extends SecurityToken>) securityEvent;
                     if (!tokenSecurityEvent.getSecurityToken().getTokenUsages().contains(WSSecurityTokenConstants.TokenUsage_MainSignature)) {
                         continue;
@@ -686,7 +686,7 @@ public class OutboundWSSec {
         }
         return null;
     }
-    
+
     private void setDerivedIdentifier(OutputProcessorChainImpl outputProcessorChain, String id) {
         WSSConstants.DerivedKeyTokenReference derivedKeyTokenReference = securityProperties.getDerivedKeyTokenReference();
             switch (derivedKeyTokenReference) {

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/WSSec.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/WSSec.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/WSSec.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/setup/WSSec.java Tue Dec 15 16:40:37 2015
@@ -53,14 +53,14 @@ import org.xml.sax.SAXException;
  * with this class.
  */
 public class WSSec {
-    
+
     //todo outgoing client setup per policy
 
     static {
         WSProviderConfig.init();
         try {
             Init.init(ClassLoaderUtils.getResource("wss/wss-config.xml", WSSec.class).toURI(), WSSec.class);
-            
+
             WSSConstants.setJaxbContext(
                     JAXBContext.newInstance(
                             org.apache.wss4j.binding.wss10.ObjectFactory.class,
@@ -75,7 +75,7 @@ public class WSSec {
                             org.apache.xml.security.binding.excc14n.ObjectFactory.class
                     )
             );
-            
+
             Schema schema = loadWSSecuritySchemas();
             WSSConstants.setJaxbSchemas(schema);
         } catch (XMLSecurityException | JAXBException
@@ -83,11 +83,11 @@ public class WSSec {
             throw new RuntimeException(e.getMessage(), e);
         }
     }
-    
+
     public static void init() {
         // Do nothing
     }
-    
+
     /**
      * Creates and configures an outbound streaming security engine
      *
@@ -106,7 +106,7 @@ public class WSSec {
         securityProperties = validateAndApplyDefaultsToOutboundSecurityProperties(securityProperties);
         return new OutboundWSSec(securityProperties);
     }
-    
+
     /**
      * Creates and configures an inbound streaming security engine
      *
@@ -120,7 +120,7 @@ public class WSSec {
     public static InboundWSSec getInboundWSSec(WSSSecurityProperties securityProperties) throws WSSecurityException {
         return getInboundWSSec(securityProperties, false);
     }
-    
+
     /**
      * Creates and configures an inbound streaming security engine
      *
@@ -136,7 +136,7 @@ public class WSSec {
             boolean initiator) throws WSSecurityException {
         return getInboundWSSec(securityProperties, false, false);
     }
-    
+
     /**
      * Creates and configures an inbound streaming security engine
      *
@@ -159,7 +159,7 @@ public class WSSec {
         securityProperties = validateAndApplyDefaultsToInboundSecurityProperties(securityProperties);
         return new InboundWSSec(securityProperties, initiator, returnSecurityError);
     }
-    
+
     /**
      * Validates the user supplied configuration and applies default values as apropriate for the outbound security engine
      *
@@ -172,9 +172,9 @@ public class WSSec {
         if (securityProperties.getActions() == null || securityProperties.getActions().isEmpty()) {
             throw new WSSConfigurationException(WSSConfigurationException.ErrorCode.FAILURE, "noOutputAction");
         }
-        
+
         // Check for duplicate actions
-        if (new HashSet<XMLSecurityConstants.Action>(securityProperties.getActions()).size() 
+        if (new HashSet<XMLSecurityConstants.Action>(securityProperties.getActions()).size()
             != securityProperties.getActions().size()) {
             throw new WSSConfigurationException(WSSConfigurationException.ErrorCode.FAILURE, "stax.duplicateActions");
         }
@@ -404,7 +404,7 @@ public class WSSec {
         }
         return new WSSSecurityProperties(securityProperties);
     }
-    
+
     private static void checkDefaultSecureParts(boolean signature, WSSSecurityProperties securityProperties) {
         if (signature) {
             List<SecurePart> signatureParts = securityProperties.getSignatureSecureParts();
@@ -436,7 +436,7 @@ public class WSSec {
     public static WSSSecurityProperties validateAndApplyDefaultsToInboundSecurityProperties(WSSSecurityProperties securityProperties) throws WSSConfigurationException {
         return new WSSSecurityProperties(securityProperties);
     }
-    
+
     public static Schema loadWSSecuritySchemas() throws SAXException {
         SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
         schemaFactory.setResourceResolver(new LSResourceResolver() {
@@ -466,7 +466,7 @@ public class WSSec {
                 return null;
             }
         });
-        
+
         Schema schema = schemaFactory.newSchema(
                 new Source[] {
                         new StreamSource(ClassLoaderUtils.getResourceAsStream("schemas/xml.xsd", WSSec.class)),

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/utils/WSSUtils.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/utils/WSSUtils.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/utils/WSSUtils.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/utils/WSSUtils.java Tue Dec 15 16:40:37 2015
@@ -329,7 +329,7 @@ public class WSSUtils extends XMLSecurit
             throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e);
         }
     }
-    
+
     public static void createEncryptedKeySha1IdentifierStructure(AbstractOutputProcessor abstractOutputProcessor,
                                                                  OutputProcessorChain outputProcessorChain, String identifier)
             throws XMLStreamException, XMLSecurityException {
@@ -341,7 +341,7 @@ public class WSSUtils extends XMLSecurit
         abstractOutputProcessor.createCharactersAndOutputAsEvent(outputProcessorChain, identifier);
         abstractOutputProcessor.createEndElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_wsse_KeyIdentifier);
     }
-    
+
     public static void createKerberosSha1IdentifierStructure(AbstractOutputProcessor abstractOutputProcessor,
                                                                  OutputProcessorChain outputProcessorChain, String identifier)
             throws XMLStreamException, XMLSecurityException {
@@ -382,7 +382,7 @@ public class WSSUtils extends XMLSecurit
         abstractOutputProcessor.createCharactersAndOutputAsEvent(outputProcessorChain, referenceId);
         abstractOutputProcessor.createEndElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_wsse_KeyIdentifier);
     }
-    
+
     public static void createSAMLKeyIdentifierStructure(AbstractOutputProcessor abstractOutputProcessor,
                                                             OutputProcessorChain outputProcessorChain,
                                                             WSSecurityTokenConstants.TokenType tokenType, String referenceId)
@@ -454,7 +454,7 @@ public class WSSUtils extends XMLSecurit
     public static void createEncryptedDataStructureForAttachments(
             AbstractOutputProcessor abstractOutputProcessor, OutputProcessorChain outputProcessorChain)
             throws XMLStreamException, XMLSecurityException {
-        
+
         List<EncryptionPartDef> encryptionPartDefs =
                 outputProcessorChain.getSecurityContext().getAsList(EncryptionPartDef.class);
         if (encryptionPartDefs == null) {
@@ -549,7 +549,7 @@ public class WSSUtils extends XMLSecurit
     }
 
     @SuppressWarnings("unchecked")
-    public static TokenSecurityEvent<? extends InboundSecurityToken> 
+    public static TokenSecurityEvent<? extends InboundSecurityToken>
         createTokenSecurityEvent(final InboundSecurityToken inboundSecurityToken, String correlationID) throws WSSecurityException {
         WSSecurityTokenConstants.TokenType tokenType = inboundSecurityToken.getTokenType();
 
@@ -636,5 +636,5 @@ public class WSSUtils extends XMLSecurit
         }
         return tmp;
     }
-    
+
 }

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/BinarySecurityTokenValidatorImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/BinarySecurityTokenValidatorImpl.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/BinarySecurityTokenValidatorImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/BinarySecurityTokenValidatorImpl.java Tue Dec 15 16:40:37 2015
@@ -34,7 +34,7 @@ import org.apache.xml.security.stax.secu
 
 public class BinarySecurityTokenValidatorImpl implements BinarySecurityTokenValidator {
 
-    private static final transient org.slf4j.Logger log = 
+    private static final transient org.slf4j.Logger log =
         org.slf4j.LoggerFactory.getLogger(BinarySecurityTokenValidatorImpl.class);
 
     @Override

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/JAASUsernameTokenValidatorImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/JAASUsernameTokenValidatorImpl.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/JAASUsernameTokenValidatorImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/JAASUsernameTokenValidatorImpl.java Tue Dec 15 16:40:37 2015
@@ -45,13 +45,13 @@ public class JAASUsernameTokenValidatorI
 
     private static final transient org.slf4j.Logger log =
             org.slf4j.LoggerFactory.getLogger(JAASUsernameTokenValidatorImpl.class);
-    
+
     private String contextName = null;
-    
+
     public void setContextName(String name) {
         contextName = name;
     }
-    
+
     public String getContextName() {
         return contextName;
     }
@@ -65,13 +65,13 @@ public class JAASUsernameTokenValidatorI
         if (passwordType != null && passwordType.getType() != null) {
             usernameTokenPasswordType = WSSConstants.UsernameTokenPasswordType.getUsernameTokenPasswordType(passwordType.getType());
         }
-        
+
         // Digest not supported
         if (usernameTokenPasswordType != WSSConstants.UsernameTokenPasswordType.PASSWORD_TEXT) {
             log.warn("Password type is not supported");
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_AUTHENTICATION);    
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_AUTHENTICATION);
         }
-        
+
         String username = null;
         if (usernameTokenType.getUsername() != null) {
             username = usernameTokenType.getUsername().getValue();
@@ -126,7 +126,7 @@ public class JAASUsernameTokenValidatorI
         T token = (T)usernameSecurityToken;
         return token;
     }
-    
+
     protected CallbackHandler getCallbackHandler(String name, String password) {
         return new NamePasswordCallbackHandler(name, password);
     }

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/SamlTokenValidatorImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/SamlTokenValidatorImpl.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/SamlTokenValidatorImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/SamlTokenValidatorImpl.java Tue Dec 15 16:40:37 2015
@@ -36,42 +36,42 @@ import org.joda.time.DateTime;
 import org.opensaml.saml.common.SAMLVersion;
 
 public class SamlTokenValidatorImpl extends SignatureTokenValidatorImpl implements SamlTokenValidator {
-    
+
     private static final transient org.slf4j.Logger LOG =
         org.slf4j.LoggerFactory.getLogger(SamlTokenValidatorImpl.class);
-                                          
+
     /**
      * The time in seconds in the future within which the NotBefore time of an incoming
      * Assertion is valid. The default is 60 seconds.
      */
     private int futureTTL = 60;
-    
+
     /**
      * The time in seconds within which a SAML Assertion is valid, if it does not contain
      * a NotOnOrAfter Condition. The default is 30 minutes.
      */
     private int ttl = 60 * 30;
-    
+
     /**
-     * Whether to validate the signature of the Assertion (if it exists) against the 
+     * Whether to validate the signature of the Assertion (if it exists) against the
      * relevant profile. Default is true.
      */
     private boolean validateSignatureAgainstProfile = true;
-    
+
     /**
      * If this is set, then the value must appear as one of the Subject Confirmation Methods
      */
     private String requiredSubjectConfirmationMethod;
-    
+
     /**
      * If this is set, at least one of the standard Subject Confirmation Methods *must*
      * be present in the assertion (Bearer / SenderVouches / HolderOfKey).
      */
     private boolean requireStandardSubjectConfirmationMethod = true;
-    
+
     /**
      * If this is set, an Assertion with a Bearer SubjectConfirmation Method must be
-     * signed 
+     * signed
      */
     private boolean requireBearerSignature = true;
 
@@ -82,9 +82,9 @@ public class SamlTokenValidatorImpl exte
     public void setFutureTTL(int newFutureTTL) {
         futureTTL = newFutureTTL;
     }
-    
+
     /**
-     * Whether to validate the signature of the Assertion (if it exists) against the 
+     * Whether to validate the signature of the Assertion (if it exists) against the
      * relevant profile. Default is true.
      */
     public boolean isValidateSignatureAgainstProfile() {
@@ -92,13 +92,13 @@ public class SamlTokenValidatorImpl exte
     }
 
     /**
-     * Whether to validate the signature of the Assertion (if it exists) against the 
+     * Whether to validate the signature of the Assertion (if it exists) against the
      * relevant profile. Default is true.
      */
     public void setValidateSignatureAgainstProfile(boolean validateSignatureAgainstProfile) {
         this.validateSignatureAgainstProfile = validateSignatureAgainstProfile;
     }
-    
+
     public String getRequiredSubjectConfirmationMethod() {
         return requiredSubjectConfirmationMethod;
     }
@@ -114,17 +114,17 @@ public class SamlTokenValidatorImpl exte
         // Check conditions
         checkConditions(samlAssertionWrapper,
                         tokenContext.getWssSecurityProperties().getAudienceRestrictions());
-        
+
         // Check the AuthnStatements of the assertion (if any)
         checkAuthnStatements(samlAssertionWrapper);
-        
+
         // Check the Subject Confirmation requirements
         verifySubjectConfirmationMethod(samlAssertionWrapper);
-        
+
         // Check OneTimeUse Condition
-        checkOneTimeUse(samlAssertionWrapper, 
+        checkOneTimeUse(samlAssertionWrapper,
                         tokenContext.getWssSecurityProperties().getSamlOneTimeUseReplayCache());
-        
+
         // Validate the assertion against schemas/profiles
         validateAssertion(samlAssertionWrapper);
 
@@ -152,20 +152,20 @@ public class SamlTokenValidatorImpl exte
     protected void verifySubjectConfirmationMethod(
         SamlAssertionWrapper samlAssertion
     ) throws WSSecurityException {
-        
+
         List<String> methods = samlAssertion.getConfirmationMethods();
         if (methods == null || methods.isEmpty()) {
             if (requiredSubjectConfirmationMethod != null) {
                 LOG.debug("A required subject confirmation method was not present");
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, 
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
                                           "invalidSAMLsecurity");
             } else if (requireStandardSubjectConfirmationMethod) {
                 LOG.debug("A standard subject confirmation method was not present");
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, 
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
                                           "invalidSAMLsecurity");
             }
         }
-        
+
         boolean signed = samlAssertion.isSigned();
         boolean requiredMethodFound = false;
         boolean standardMethodFound = false;
@@ -174,12 +174,12 @@ public class SamlTokenValidatorImpl exte
             if (OpenSAMLUtil.isMethodHolderOfKey(method)) {
                 if (!signed) {
                     LOG.debug("A holder-of-key assertion must be signed");
-                    throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, 
+                    throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
                                                   "invalidSAMLsecurity");
                 }
                 standardMethodFound = true;
             }
-            
+
             if (method != null) {
                 if (method.equals(requiredSubjectConfirmationMethod)) {
                     requiredMethodFound = true;
@@ -189,7 +189,7 @@ public class SamlTokenValidatorImpl exte
                     standardMethodFound = true;
                     if (requireBearerSignature && !signed) {
                         LOG.debug("A Bearer Assertion was not signed");
-                        throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, 
+                        throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
                                                       "invalidSAMLsecurity");
                     }
                 } else if (SAML2Constants.CONF_SENDER_VOUCHES.equals(method)
@@ -198,20 +198,20 @@ public class SamlTokenValidatorImpl exte
                 }
             }
         }
-        
+
         if (!requiredMethodFound && requiredSubjectConfirmationMethod != null) {
             LOG.debug("A required subject confirmation method was not present");
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, 
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
                                           "invalidSAMLsecurity");
         }
-        
+
         if (!standardMethodFound && requireStandardSubjectConfirmationMethod) {
             LOG.debug("A standard subject confirmation method was not present");
-            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, 
+            throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE,
                                       "invalidSAMLsecurity");
         }
     }
-    
+
     /**
      * Check the Conditions of the Assertion.
      */
@@ -221,7 +221,7 @@ public class SamlTokenValidatorImpl exte
         checkConditions(samlAssertion);
         samlAssertion.checkAudienceRestrictions(audienceRestrictions);
     }
-    
+
     /**
      * Check the Conditions of the Assertion.
      */
@@ -229,14 +229,14 @@ public class SamlTokenValidatorImpl exte
         samlAssertion.checkConditions(futureTTL);
         samlAssertion.checkIssueInstant(futureTTL, ttl);
     }
-    
+
     /**
      * Check the AuthnStatements of the Assertion (if any)
      */
     protected void checkAuthnStatements(SamlAssertionWrapper samlAssertion) throws WSSecurityException {
         samlAssertion.checkAuthnStatements(futureTTL);
     }
-    
+
     /**
      * Check the "OneTimeUse" Condition of the Assertion. If this is set then the Assertion
      * is cached (if a cache is defined), and must not have been previously cached
@@ -249,14 +249,14 @@ public class SamlTokenValidatorImpl exte
             && samlAssertion.getSaml2().getConditions() != null
             && samlAssertion.getSaml2().getConditions().getOneTimeUse() != null) {
             String identifier = samlAssertion.getId();
-            
+
             if (replayCache.contains(identifier)) {
                 throw new WSSecurityException(
                     WSSecurityException.ErrorCode.INVALID_SECURITY,
                     "badSamlToken",
                     new Object[] {"A replay attack has been detected"});
             }
-            
+
             DateTime expires = samlAssertion.getSaml2().getConditions().getNotOnOrAfter();
             if (expires != null) {
                 Date rightNow = new Date();
@@ -268,7 +268,7 @@ public class SamlTokenValidatorImpl exte
             }
         }
     }
-    
+
     /**
      * Validate the samlAssertion against schemas/profiles
      */
@@ -293,7 +293,7 @@ public class SamlTokenValidatorImpl exte
     public void setRequireBearerSignature(boolean requireBearerSignature) {
         this.requireBearerSignature = requireBearerSignature;
     }
-    
+
     public int getTtl() {
         return ttl;
     }
@@ -301,5 +301,5 @@ public class SamlTokenValidatorImpl exte
     public void setTtl(int ttl) {
         this.ttl = ttl;
     }
-    
+
 }

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/TimestampValidatorImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/TimestampValidatorImpl.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/TimestampValidatorImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/TimestampValidatorImpl.java Tue Dec 15 16:40:37 2015
@@ -73,7 +73,7 @@ public class TimestampValidatorImpl impl
             int ttl = tokenContext.getWssSecurityProperties().getTimestampTTL();
             int futureTTL = tokenContext.getWssSecurityProperties().getTimeStampFutureTTL();
 
-            if (expiresDate != null && tokenContext.getWssSecurityProperties().isStrictTimestampCheck() 
+            if (expiresDate != null && tokenContext.getWssSecurityProperties().isStrictTimestampCheck()
                 && expiresDate.before(rightNow)) {
                 log.debug("Time now: " + WSSConstants.datatypeFactory.newXMLGregorianCalendar(new GregorianCalendar()).toXMLFormat());
                 throw new WSSecurityException(WSSecurityException.ErrorCode.MESSAGE_EXPIRED, "invalidTimestamp",
@@ -90,5 +90,5 @@ public class TimestampValidatorImpl impl
             throw new WSSecurityException(WSSecurityException.ErrorCode.INVALID_SECURITY, e);
         }
     }
-    
+
 }

Modified: webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/UsernameTokenValidatorImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/UsernameTokenValidatorImpl.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/UsernameTokenValidatorImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/main/java/org/apache/wss4j/stax/validate/UsernameTokenValidatorImpl.java Tue Dec 15 16:40:37 2015
@@ -35,7 +35,7 @@ import org.apache.xml.security.stax.ext.
 import org.apache.xml.security.stax.securityToken.InboundSecurityToken;
 
 public class UsernameTokenValidatorImpl implements UsernameTokenValidator {
-    
+
     private static final transient org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(UsernameTokenValidatorImpl.class);
 
     @Override
@@ -53,17 +53,17 @@ public class UsernameTokenValidatorImpl
         }
 
         boolean handleCustomPasswordTypes = tokenContext.getWssSecurityProperties().getHandleCustomPasswordTypes();
-        boolean allowUsernameTokenNoPassword = 
-            tokenContext.getWssSecurityProperties().isAllowUsernameTokenNoPassword() 
+        boolean allowUsernameTokenNoPassword =
+            tokenContext.getWssSecurityProperties().isAllowUsernameTokenNoPassword()
                 || Boolean.parseBoolean((String)tokenContext.getWsSecurityContext().get(WSSConstants.PROP_ALLOW_USERNAMETOKEN_NOPASSWORD));
 
         // Check received password type against required type
-        WSSConstants.UsernameTokenPasswordType requiredPasswordType = 
+        WSSConstants.UsernameTokenPasswordType requiredPasswordType =
             tokenContext.getWssSecurityProperties().getUsernameTokenPasswordType();
         if (requiredPasswordType != null) {
             if (passwordType == null || passwordType.getType() == null) {
                 if (log.isDebugEnabled()) {
-                    log.debug("Authentication failed as the received password type does not " 
+                    log.debug("Authentication failed as the received password type does not "
                         + "match the required password type of: " + requiredPasswordType);
                 }
                 throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_AUTHENTICATION);
@@ -72,13 +72,13 @@ public class UsernameTokenValidatorImpl
                 WSSConstants.UsernameTokenPasswordType.getUsernameTokenPasswordType(passwordType.getType());
             if (requiredPasswordType != usernameTokenPasswordType) {
                 if (log.isDebugEnabled()) {
-                    log.debug("Authentication failed as the received password type does not " 
+                    log.debug("Authentication failed as the received password type does not "
                         + "match the required password type of: " + requiredPasswordType);
                 }
                 throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_AUTHENTICATION);
             }
         }
-        
+
         WSSConstants.UsernameTokenPasswordType usernameTokenPasswordType = WSSConstants.UsernameTokenPasswordType.PASSWORD_NONE;
         if (passwordType != null && passwordType.getType() != null) {
             usernameTokenPasswordType = WSSConstants.UsernameTokenPasswordType.getUsernameTokenPasswordType(passwordType.getType());
@@ -117,7 +117,7 @@ public class UsernameTokenValidatorImpl
         } else if (usernameTokenPasswordType == WSSConstants.UsernameTokenPasswordType.PASSWORD_TEXT
                 || passwordType != null && passwordType.getValue() != null
                 && usernameTokenPasswordType == WSSConstants.UsernameTokenPasswordType.PASSWORD_NONE) {
-            
+
             verifyPlaintextPassword(username.getValue(), passwordType, tokenContext);
         } else if (passwordType != null && passwordType.getValue() != null) {
             if (!handleCustomPasswordTypes) {
@@ -158,7 +158,7 @@ public class UsernameTokenValidatorImpl
         T token = (T)usernameSecurityToken;
         return token;
     }
-    
+
     /**
      * Verify a UsernameToken containing a password digest.
      */
@@ -189,7 +189,7 @@ public class UsernameTokenValidatorImpl
         }
         passwordType.setValue(pwCb.getPassword());
     }
-    
+
     /**
      * Verify a UsernameToken containing a plaintext password.
      */
@@ -217,7 +217,7 @@ public class UsernameTokenValidatorImpl
         }
         passwordType.setValue(pwCb.getPassword());
     }
-    
+
     /**
      * Verify a UsernameToken containing a password of some unknown (but specified) password
      * type.

Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AbstractTestBase.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AbstractTestBase.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AbstractTestBase.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AbstractTestBase.java Tue Dec 15 16:40:37 2015
@@ -105,7 +105,7 @@ public abstract class AbstractTestBase e
         LogManager.getLogManager().getLogger("org.jcp.xml.dsig.internal.dom").setLevel(Level.FINE);
         WSSConfig.init();
     }
-    
+
     @AfterClass
     public static void cleanup() throws Exception {
         SecurityTestUtil.cleanup();
@@ -168,7 +168,7 @@ public abstract class AbstractTestBase e
         xmlStreamWriter.close();
         return baos;
     }
-    
+
     protected ByteArrayOutputStream doOutboundSecurity(Map<String, Object> config, InputStream sourceDocument)
         throws Exception {
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -226,7 +226,7 @@ public abstract class AbstractTestBase e
             requestData.setCallbackHandler(new WSS4JCallbackHandlerImpl());
         }
         requestData.setWssConfig(WSSConfig.getNewInstance());
-  
+
         wss4JHandler.doSender(messageContext, requestData, true);
 
         return messageContext;
@@ -277,14 +277,14 @@ public abstract class AbstractTestBase e
             requestData.setDecCrypto(crypto);
             requestData.setSigVerCrypto(crypto);
         }
-        
+
         if (properties.get(WSHandlerConstants.ALLOW_USERNAMETOKEN_NOPASSWORD) != null) {
-            messageContext.put(WSHandlerConstants.ALLOW_USERNAMETOKEN_NOPASSWORD, 
+            messageContext.put(WSHandlerConstants.ALLOW_USERNAMETOKEN_NOPASSWORD,
                                properties.get(WSHandlerConstants.ALLOW_USERNAMETOKEN_NOPASSWORD));
         } else if (WSHandlerConstants.USERNAME_TOKEN_SIGNATURE.equals(action)) {
             messageContext.put(WSHandlerConstants.ALLOW_USERNAMETOKEN_NOPASSWORD, "true");
         }
-        
+
         // Disable PrefixList checking as the stax code doesn't support this yet
         //todo
         List<BSPRule> ignoredRules = new ArrayList<BSPRule>();
@@ -373,7 +373,7 @@ public abstract class AbstractTestBase e
 
     class CustomWSS4JHandler extends WSHandler {
 
-        private final org.slf4j.Logger log = 
+        private final org.slf4j.Logger log =
             org.slf4j.LoggerFactory.getLogger(CustomWSS4JHandler.class.getName());
         private final boolean doDebug = log.isDebugEnabled();
 
@@ -381,7 +381,7 @@ public abstract class AbstractTestBase e
          * Handles incoming web service requests and outgoing responses
          *
          * @throws TransformerException
-         * @throws IOException 
+         * @throws IOException
          */
         public boolean doSender(Map<String, Object> mc, RequestData reqData, boolean isRequest)
                 throws WSSecurityException, TransformerException, IOException {
@@ -462,7 +462,7 @@ public abstract class AbstractTestBase e
                 throws WSSecurityException {
             String action = (String) mc.get(WSHandlerConstants.ACTION);
             if (action == null) {
-                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty", 
+                throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, "empty",
                                               new Object[] {"WSS4JHandler: No action defined"});
             }
             List<Integer> actions = WSSecurityUtil.decodeAction(action);
@@ -580,12 +580,12 @@ public abstract class AbstractTestBase e
             for (WSSecurityEngineResult result : wsSecurityEngineResults) {
                 final Integer act = (Integer) result.get(WSSecurityEngineResult.TAG_ACTION);
                 if (act != null) {
-                    if (act.intValue() == WSConstants.SC || act.intValue() == WSConstants.BST 
-                        || act.intValue() == WSConstants.DKT || act.intValue() == WSConstants.SCT 
+                    if (act.intValue() == WSConstants.SC || act.intValue() == WSConstants.BST
+                        || act.intValue() == WSConstants.DKT || act.intValue() == WSConstants.SCT
                         || act.intValue() == WSConstants.UT_NOPASSWORD) {
                         continue;
                     }
-    
+
                     if (ai >= size || actions.get(ai++).intValue() != act) {
                         return false;
                     }

Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AttachmentCallbackHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AttachmentCallbackHandler.java?rev=1720192&r1=1720191&r2=1720192&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AttachmentCallbackHandler.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AttachmentCallbackHandler.java Tue Dec 15 16:40:37 2015
@@ -34,15 +34,15 @@ import java.util.List;
 import java.util.Map;
 
 /**
- * A Callback Handler implementation for the case of signing/encrypting Attachments via the SwA 
+ * A Callback Handler implementation for the case of signing/encrypting Attachments via the SwA
  * (SOAP with Attachments) specification.
  */
 public class AttachmentCallbackHandler implements CallbackHandler {
-    
+
     private final List<Attachment> originalRequestAttachments;
     private Map<String, Attachment> attachmentMap = new HashMap<String, Attachment>();
     private List<Attachment> responseAttachments = new ArrayList<Attachment>();
-    
+
     public AttachmentCallbackHandler(List<Attachment> attachments) {
         originalRequestAttachments = attachments;
         if (attachments != null) {
@@ -51,26 +51,26 @@ public class AttachmentCallbackHandler i
             }
         }
     }
-    
+
     public void handle(Callback[] callbacks)
         throws IOException, UnsupportedCallbackException {
         for (int i = 0; i < callbacks.length; i++) {
             if (callbacks[i] instanceof AttachmentRequestCallback) {
-                AttachmentRequestCallback attachmentRequestCallback = 
+                AttachmentRequestCallback attachmentRequestCallback =
                     (AttachmentRequestCallback) callbacks[i];
 
-                List<Attachment> attachments = 
+                List<Attachment> attachments =
                     getAttachmentsToAdd(attachmentRequestCallback.getAttachmentId());
                 if (attachments.isEmpty()) {
                     throw new RuntimeException("wrong attachment requested");
                 }
-                
+
                 attachmentRequestCallback.setAttachments(attachments);
             } else if (callbacks[i] instanceof AttachmentResultCallback) {
-                AttachmentResultCallback attachmentResultCallback = 
+                AttachmentResultCallback attachmentResultCallback =
                     (AttachmentResultCallback) callbacks[i];
                 responseAttachments.add(attachmentResultCallback.getAttachment());
-                attachmentMap.put(attachmentResultCallback.getAttachment().getId(), 
+                attachmentMap.put(attachmentResultCallback.getAttachment().getId(),
                                   attachmentResultCallback.getAttachment());
             } else {
                 throw new UnsupportedCallbackException(callbacks[i], "Unrecognized Callback");
@@ -81,7 +81,7 @@ public class AttachmentCallbackHandler i
     public List<Attachment> getResponseAttachments() {
         return responseAttachments;
     }
-    
+
     // Try to match the Attachment Id. Otherwise, add all Attachments.
     private List<Attachment> getAttachmentsToAdd(String id) {
         List<Attachment> attachments = new ArrayList<Attachment>();
@@ -92,7 +92,7 @@ public class AttachmentCallbackHandler i
                 attachments.addAll(originalRequestAttachments);
             }
         }
-        
+
         return attachments;
     }
 



Mime
View raw message