You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by co...@apache.org on 2017/02/13 11:20:05 UTC

svn commit: r1782748 [9/9] - in /webservices/wss4j/trunk: bindings/src/main/java/org/apache/wss4j/binding/wssc200502/ policy/src/main/java/org/apache/wss4j/policy/builders/ policy/src/main/java/org/apache/wss4j/policy/model/ ws-security-common/src/main...

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=1782748&r1=1782747&r2=1782748&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 Mon Feb 13 11:20:02 2017
@@ -157,7 +157,7 @@ public class OutboundWSSec {
      * @throws WSSecurityException thrown when a Security failure occurs
      */
     public XMLStreamWriter processOutMessage(
-            XMLStreamWriter xmlStreamWriter, String encoding, OutboundSecurityContext outbounSecurityContext) 
+            XMLStreamWriter xmlStreamWriter, String encoding, OutboundSecurityContext outbounSecurityContext)
                 throws WSSecurityException {
         return processOutMessage((Object) xmlStreamWriter, encoding, outbounSecurityContext);
     }
@@ -174,9 +174,9 @@ public class OutboundWSSec {
         try {
             final SecurityHeaderOutputProcessor securityHeaderOutputProcessor = new SecurityHeaderOutputProcessor();
             initializeOutputProcessor(outputProcessorChain, securityHeaderOutputProcessor, null);
-            
+
             ConfiguredAction configuredAction = configureActions(outputProcessorChain);
-            
+
             // Set up appropriate keys
             if (configuredAction.signatureAction) {
                 setupSignatureKey(outputProcessorChain, securityProperties, configuredAction.signedSAML);
@@ -523,7 +523,7 @@ public class OutboundWSSec {
         }
         return null;
     }
-    
+
     private PublicKey getReqSigPublicKey(SecurityContext securityContext) throws XMLSecurityException {
         List<SecurityEvent> securityEventList = securityContext.getAsList(SecurityEvent.class);
         if (securityEventList != null) {
@@ -564,10 +564,10 @@ public class OutboundWSSec {
                 break;
             }
     }
-    
+
     private ConfiguredAction configureActions(OutputProcessorChainImpl outputProcessorChain) throws XMLSecurityException {
         ConfiguredAction configuredAction = new ConfiguredAction();
-        
+
         //todo some combinations are not possible atm: eg Action.SIGNATURE and Action.USERNAMETOKEN_SIGNED
         //todo they use the same signature parts
 
@@ -645,7 +645,7 @@ public class OutboundWSSec {
                     }
                     configuredAction.encryptionAction = true;
                     configuredAction.derivedEncryption = true;
-                } else if (securityProperties.getDerivedKeyTokenReference() 
+                } else if (securityProperties.getDerivedKeyTokenReference()
                     == WSSConstants.DerivedKeyTokenReference.SecurityContextToken) {
                     final SecurityContextTokenOutputProcessor securityContextTokenOutputProcessor =
                             new SecurityContextTokenOutputProcessor();
@@ -673,7 +673,7 @@ public class OutboundWSSec {
                     encryptedKeyOutputProcessor = new EncryptedKeyOutputProcessor();
                     initializeOutputProcessor(outputProcessorChain, encryptedKeyOutputProcessor, action);
 
-                } else if (securityProperties.getDerivedKeyTokenReference() 
+                } else if (securityProperties.getDerivedKeyTokenReference()
                     == WSSConstants.DerivedKeyTokenReference.SecurityContextToken) {
                     final SecurityContextTokenOutputProcessor securityContextTokenOutputProcessor =
                             new SecurityContextTokenOutputProcessor();
@@ -735,10 +735,10 @@ public class OutboundWSSec {
                 initializeOutputProcessor(outputProcessorChain, unknownTokenOutputProcessor, action);
             }
         }
-        
+
         return configuredAction;
     }
-    
+
     private static class ConfiguredAction {
         boolean signatureAction = false;
         boolean encryptionAction = false;

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=1782748&r1=1782747&r2=1782748&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 Mon Feb 13 11:20:02 2017
@@ -168,7 +168,7 @@ public class WSSec {
      * @throws org.apache.wss4j.stax.ext.WSSConfigurationException
      *          if the configuration is invalid
      */
-    public static WSSSecurityProperties validateAndApplyDefaultsToOutboundSecurityProperties(WSSSecurityProperties securityProperties) 
+    public static WSSSecurityProperties validateAndApplyDefaultsToOutboundSecurityProperties(WSSSecurityProperties securityProperties)
         throws WSSConfigurationException {
         if (securityProperties.getActions() == null || securityProperties.getActions().isEmpty()) {
             throw new WSSConfigurationException(WSSConfigurationException.ErrorCode.FAILURE, "noOutputAction");
@@ -245,7 +245,7 @@ public class WSSec {
                     securityProperties.setSignatureKeyIdentifier(WSSecurityTokenConstants.KEYIDENTIFIER_SECURITY_TOKEN_DIRECT_REFERENCE);
                 }
                 checkDefaultSecureParts(true, securityProperties);
-            } else if (WSSConstants.SAML_TOKEN_UNSIGNED.equals(action) 
+            } else if (WSSConstants.SAML_TOKEN_UNSIGNED.equals(action)
                 && securityProperties.getSamlCallbackHandler() == null) {
                 throw new WSSConfigurationException(WSSConfigurationException.ErrorCode.FAILURE, "noSAMLCallbackHandler");
             } else if (WSSConstants.SIGNATURE_WITH_KERBEROS_TOKEN.equals(action)) {
@@ -280,7 +280,7 @@ public class WSSec {
         }
         return new WSSSecurityProperties(securityProperties);
     }
-    
+
     private static void checkOutboundSignatureProperties(WSSSecurityProperties securityProperties) throws WSSConfigurationException {
         if (!WSSConstants.NS_XMLDSIG_HMACSHA1.equals(securityProperties.getSignatureAlgorithm())) {
             if (securityProperties.getSignatureKeyStore() == null
@@ -309,7 +309,7 @@ public class WSSec {
         }
         checkDefaultSecureParts(true, securityProperties);
     }
-    
+
     private static void checkOutboundSignatureDerivedProperties(WSSSecurityProperties securityProperties) throws WSSConfigurationException {
         if (securityProperties.getCallbackHandler() == null) {
             throw new WSSConfigurationException(WSSConfigurationException.ErrorCode.FAILURE, "noCallback");
@@ -349,7 +349,7 @@ public class WSSec {
         }
         checkDefaultSecureParts(true, securityProperties);
     }
-    
+
     private static void checkOutboundEncryptionProperties(WSSSecurityProperties securityProperties) throws WSSConfigurationException {
         if (securityProperties.getEncryptionUseThisCertificate() == null
             && securityProperties.getEncryptionKeyStore() == null
@@ -379,8 +379,8 @@ public class WSSec {
         }
         checkDefaultSecureParts(false, securityProperties);
     }
-    
-    private static void checkOutboundEncryptionDerivedProperties(WSSSecurityProperties securityProperties) 
+
+    private static void checkOutboundEncryptionDerivedProperties(WSSSecurityProperties securityProperties)
         throws WSSConfigurationException {
         if (securityProperties.getCallbackHandler() == null) {
             throw new WSSConfigurationException(WSSConfigurationException.ErrorCode.FAILURE, "noCallback");
@@ -451,7 +451,7 @@ public class WSSec {
      * @throws org.apache.wss4j.stax.ext.WSSConfigurationException
      *          if the configuration is invalid
      */
-    public static WSSSecurityProperties validateAndApplyDefaultsToInboundSecurityProperties(WSSSecurityProperties securityProperties) 
+    public static WSSSecurityProperties validateAndApplyDefaultsToInboundSecurityProperties(WSSSecurityProperties securityProperties)
         throws WSSConfigurationException {
         return new WSSSecurityProperties(securityProperties);
     }
@@ -496,15 +496,15 @@ public class WSSec {
                         new StreamSource(ClassLoaderUtils.getResourceAsStream("schemas/xenc-schema.xsd", WSSec.class)),
                         new StreamSource(ClassLoaderUtils.getResourceAsStream("schemas/xenc-schema-11.xsd", WSSec.class)),
                         new StreamSource(ClassLoaderUtils.getResourceAsStream("schemas/xmldsig11-schema.xsd", WSSec.class)),
-                        new StreamSource(ClassLoaderUtils.getResourceAsStream("schemas/oasis-200401-wss-wssecurity-utility-1.0.xsd", 
+                        new StreamSource(ClassLoaderUtils.getResourceAsStream("schemas/oasis-200401-wss-wssecurity-utility-1.0.xsd",
                                                                               WSSec.class)),
-                        new StreamSource(ClassLoaderUtils.getResourceAsStream("schemas/oasis-200401-wss-wssecurity-secext-1.0.xsd", 
+                        new StreamSource(ClassLoaderUtils.getResourceAsStream("schemas/oasis-200401-wss-wssecurity-secext-1.0.xsd",
                                                                               WSSec.class)),
-                        new StreamSource(ClassLoaderUtils.getResourceAsStream("schemas/oasis-wss-wssecurity-secext-1.1.xsd", 
+                        new StreamSource(ClassLoaderUtils.getResourceAsStream("schemas/oasis-wss-wssecurity-secext-1.1.xsd",
                                                                               WSSec.class)),
-                        new StreamSource(ClassLoaderUtils.getResourceAsStream("schemas/ws-secureconversation-200502.xsd", 
+                        new StreamSource(ClassLoaderUtils.getResourceAsStream("schemas/ws-secureconversation-200502.xsd",
                                                                               WSSec.class)),
-                        new StreamSource(ClassLoaderUtils.getResourceAsStream("schemas/ws-secureconversation-1.3.xsd", 
+                        new StreamSource(ClassLoaderUtils.getResourceAsStream("schemas/ws-secureconversation-1.3.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=1782748&r1=1782747&r2=1782748&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 Mon Feb 13 11:20:02 2017
@@ -243,23 +243,23 @@ public class WSSUtils extends XMLSecurit
             valueType = WSSConstants.NS_X509_PKIPATH_V1;
         }
         List<XMLSecAttribute> attributes = new ArrayList<>(3);
-        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_ENCODING_TYPE, 
+        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_ENCODING_TYPE,
                                                                WSSConstants.SOAPMESSAGE_NS10_BASE64_ENCODING));
         attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_VALUE_TYPE, valueType));
         attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_WSU_ID, referenceId));
-        abstractOutputProcessor.createStartElementAndOutputAsEvent(outputProcessorChain, 
-                                                                   WSSConstants.TAG_WSSE_BINARY_SECURITY_TOKEN, 
+        abstractOutputProcessor.createStartElementAndOutputAsEvent(outputProcessorChain,
+                                                                   WSSConstants.TAG_WSSE_BINARY_SECURITY_TOKEN,
                                                                    false, attributes);
         try {
             if (useSingleCertificate) {
-                String encodedCert = 
+                String encodedCert =
                     new Base64(76, new byte[]{'\n'}).encodeToString(x509Certificates[0].getEncoded());
                 abstractOutputProcessor.createCharactersAndOutputAsEvent(outputProcessorChain, encodedCert);
             } else {
                 try {
                     CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509");
                     List<X509Certificate> certificates = Arrays.asList(x509Certificates);
-                    String encodedCert = 
+                    String encodedCert =
                         new Base64(76, new byte[]{'\n'}).encodeToString(certificateFactory.generateCertPath(certificates).getEncoded());
                     abstractOutputProcessor.createCharactersAndOutputAsEvent(outputProcessorChain, encodedCert);
                 } catch (CertificateException e) {
@@ -269,7 +269,7 @@ public class WSSUtils extends XMLSecurit
         } catch (CertificateEncodingException e) {
             throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e);
         }
-        abstractOutputProcessor.createEndElementAndOutputAsEvent(outputProcessorChain, 
+        abstractOutputProcessor.createEndElementAndOutputAsEvent(outputProcessorChain,
                                                                  WSSConstants.TAG_WSSE_BINARY_SECURITY_TOKEN);
     }
 
@@ -283,17 +283,17 @@ public class WSSUtils extends XMLSecurit
         }
 
         List<XMLSecAttribute> attributes = new ArrayList<>(2);
-        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_ENCODING_TYPE, 
+        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_ENCODING_TYPE,
                                                                WSSConstants.SOAPMESSAGE_NS10_BASE64_ENCODING));
-        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_VALUE_TYPE, 
+        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_VALUE_TYPE,
                                                                WSSConstants.NS_X509_SKI));
-        abstractOutputProcessor.createStartElementAndOutputAsEvent(outputProcessorChain, 
-                                                                   WSSConstants.TAG_WSSE_KEY_IDENTIFIER, 
+        abstractOutputProcessor.createStartElementAndOutputAsEvent(outputProcessorChain,
+                                                                   WSSConstants.TAG_WSSE_KEY_IDENTIFIER,
                                                                    false, attributes);
         byte[] data = new Merlin().getSKIBytesFromCert(x509Certificates[0]);
-        abstractOutputProcessor.createCharactersAndOutputAsEvent(outputProcessorChain, 
+        abstractOutputProcessor.createCharactersAndOutputAsEvent(outputProcessorChain,
                                                                  new Base64(76, new byte[]{'\n'}).encodeToString(data));
-        abstractOutputProcessor.createEndElementAndOutputAsEvent(outputProcessorChain, 
+        abstractOutputProcessor.createEndElementAndOutputAsEvent(outputProcessorChain,
                                                                  WSSConstants.TAG_WSSE_KEY_IDENTIFIER);
     }
 
@@ -302,12 +302,12 @@ public class WSSUtils extends XMLSecurit
                                                         X509Certificate[] x509Certificates)
             throws XMLStreamException, XMLSecurityException {
         List<XMLSecAttribute> attributes = new ArrayList<>(2);
-        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_ENCODING_TYPE, 
+        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_ENCODING_TYPE,
                                                                WSSConstants.SOAPMESSAGE_NS10_BASE64_ENCODING));
-        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_VALUE_TYPE, 
+        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_VALUE_TYPE,
                                                                WSSConstants.NS_X509_V3_TYPE));
-        abstractOutputProcessor.createStartElementAndOutputAsEvent(outputProcessorChain, 
-                                                                   WSSConstants.TAG_WSSE_KEY_IDENTIFIER, 
+        abstractOutputProcessor.createStartElementAndOutputAsEvent(outputProcessorChain,
+                                                                   WSSConstants.TAG_WSSE_KEY_IDENTIFIER,
                                                                    false, attributes);
         try {
             String encodedCert = new Base64(76, new byte[]{'\n'}).encodeToString(x509Certificates[0].getEncoded());
@@ -315,7 +315,7 @@ public class WSSUtils extends XMLSecurit
         } catch (CertificateEncodingException e) {
             throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e);
         }
-        abstractOutputProcessor.createEndElementAndOutputAsEvent(outputProcessorChain, 
+        abstractOutputProcessor.createEndElementAndOutputAsEvent(outputProcessorChain,
                                                                  WSSConstants.TAG_WSSE_KEY_IDENTIFIER);
     }
 
@@ -324,17 +324,17 @@ public class WSSUtils extends XMLSecurit
                                                               X509Certificate[] x509Certificates)
             throws XMLStreamException, XMLSecurityException {
         List<XMLSecAttribute> attributes = new ArrayList<>(2);
-        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_ENCODING_TYPE, 
+        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_ENCODING_TYPE,
                                                                WSSConstants.SOAPMESSAGE_NS10_BASE64_ENCODING));
-        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_VALUE_TYPE, 
+        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_VALUE_TYPE,
                                                                WSSConstants.NS_THUMBPRINT));
-        abstractOutputProcessor.createStartElementAndOutputAsEvent(outputProcessorChain, 
-                                                                   WSSConstants.TAG_WSSE_KEY_IDENTIFIER, 
+        abstractOutputProcessor.createStartElementAndOutputAsEvent(outputProcessorChain,
+                                                                   WSSConstants.TAG_WSSE_KEY_IDENTIFIER,
                                                                    false, attributes);
         try {
             MessageDigest sha = MessageDigest.getInstance("SHA-1");
             byte[] data = sha.digest(x509Certificates[0].getEncoded());
-            abstractOutputProcessor.createCharactersAndOutputAsEvent(outputProcessorChain, 
+            abstractOutputProcessor.createCharactersAndOutputAsEvent(outputProcessorChain,
                                                                      new Base64(76, new byte[]{'\n'}).encodeToString(data));
         } catch (CertificateEncodingException | NoSuchAlgorithmException e) {
             throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e);
@@ -349,7 +349,7 @@ public class WSSUtils extends XMLSecurit
         try {
             MessageDigest sha = MessageDigest.getInstance("SHA-1");
             byte[] data = sha.digest(key.getEncoded());
-            createEncryptedKeySha1IdentifierStructure(abstractOutputProcessor, outputProcessorChain, 
+            createEncryptedKeySha1IdentifierStructure(abstractOutputProcessor, outputProcessorChain,
                                                       new Base64(76, new byte[]{'\n'}).encodeToString(data));
         } catch (NoSuchAlgorithmException e) {
             throw new WSSecurityException(WSSecurityException.ErrorCode.FAILURE, e);
@@ -361,11 +361,11 @@ public class WSSUtils extends XMLSecurit
             throws XMLStreamException, XMLSecurityException {
 
         List<XMLSecAttribute> attributes = new ArrayList<>(2);
-        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_ENCODING_TYPE, 
+        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_ENCODING_TYPE,
                                                                WSSConstants.SOAPMESSAGE_NS10_BASE64_ENCODING));
-        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_VALUE_TYPE, 
+        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_VALUE_TYPE,
                                                                WSSConstants.NS_ENCRYPTED_KEY_SHA1));
-        abstractOutputProcessor.createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_KEY_IDENTIFIER, 
+        abstractOutputProcessor.createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_KEY_IDENTIFIER,
                                                                    false, attributes);
         abstractOutputProcessor.createCharactersAndOutputAsEvent(outputProcessorChain, identifier);
         abstractOutputProcessor.createEndElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_KEY_IDENTIFIER);
@@ -376,11 +376,11 @@ public class WSSUtils extends XMLSecurit
             throws XMLStreamException, XMLSecurityException {
 
         List<XMLSecAttribute> attributes = new ArrayList<>(2);
-        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_ENCODING_TYPE, 
+        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_ENCODING_TYPE,
                                                                WSSConstants.SOAPMESSAGE_NS10_BASE64_ENCODING));
-        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_VALUE_TYPE, 
+        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_VALUE_TYPE,
                                                                WSSConstants.NS_KERBEROS5_AP_REQ_SHA1));
-        abstractOutputProcessor.createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_KEY_IDENTIFIER, 
+        abstractOutputProcessor.createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_KEY_IDENTIFIER,
                                                                    false, attributes);
         abstractOutputProcessor.createCharactersAndOutputAsEvent(outputProcessorChain, identifier);
         abstractOutputProcessor.createEndElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_KEY_IDENTIFIER);
@@ -396,7 +396,7 @@ public class WSSUtils extends XMLSecurit
         if (valueType != null) {
             attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_VALUE_TYPE, valueType));
         }
-        abstractOutputProcessor.createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_REFERENCE, 
+        abstractOutputProcessor.createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_REFERENCE,
                                                                    false, attributes);
         abstractOutputProcessor.createEndElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_REFERENCE);
     }
@@ -411,7 +411,7 @@ public class WSSUtils extends XMLSecurit
         } else if (WSSecurityTokenConstants.SAML_20_TOKEN.equals(tokenType)) {
             attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_VALUE_TYPE, WSSConstants.NS_SAML20_TYPE));
         }
-        abstractOutputProcessor.createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_KEY_IDENTIFIER, 
+        abstractOutputProcessor.createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_KEY_IDENTIFIER,
                                                                    false, attributes);
         abstractOutputProcessor.createCharactersAndOutputAsEvent(outputProcessorChain, referenceId);
         abstractOutputProcessor.createEndElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_KEY_IDENTIFIER);
@@ -427,7 +427,7 @@ public class WSSUtils extends XMLSecurit
         } else if (WSSecurityTokenConstants.SAML_20_TOKEN.equals(tokenType)) {
             attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_VALUE_TYPE, WSSConstants.NS_SAML20_TYPE));
         }
-        abstractOutputProcessor.createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_KEY_IDENTIFIER, 
+        abstractOutputProcessor.createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_KEY_IDENTIFIER,
                                                                    false, attributes);
         abstractOutputProcessor.createCharactersAndOutputAsEvent(outputProcessorChain, referenceId);
         abstractOutputProcessor.createEndElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_KEY_IDENTIFIER);
@@ -438,9 +438,9 @@ public class WSSUtils extends XMLSecurit
             throws XMLStreamException, XMLSecurityException {
         List<XMLSecAttribute> attributes = new ArrayList<>(2);
         attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_URI, "#" + tokenId));
-        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_VALUE_TYPE, 
+        attributes.add(abstractOutputProcessor.createAttribute(WSSConstants.ATT_NULL_VALUE_TYPE,
                                                                WSSConstants.NS_USERNAMETOKEN_PROFILE_USERNAME_TOKEN));
-        abstractOutputProcessor.createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_REFERENCE, 
+        abstractOutputProcessor.createStartElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_REFERENCE,
                                                                    false, attributes);
         abstractOutputProcessor.createEndElementAndOutputAsEvent(outputProcessorChain, WSSConstants.TAG_WSSE_REFERENCE);
     }
@@ -587,14 +587,14 @@ public class WSSUtils extends XMLSecurit
 
     @SuppressWarnings("unchecked")
     public static TokenSecurityEvent<? extends InboundSecurityToken>
-        createTokenSecurityEvent(final InboundSecurityToken inboundSecurityToken, String correlationID) 
+        createTokenSecurityEvent(final InboundSecurityToken inboundSecurityToken, String correlationID)
             throws WSSecurityException {
         WSSecurityTokenConstants.TokenType tokenType = inboundSecurityToken.getTokenType();
 
         TokenSecurityEvent<? extends SecurityToken> tokenSecurityEvent;
-        if (WSSecurityTokenConstants.X509V1Token.equals(tokenType) 
-            || WSSecurityTokenConstants.X509V3Token.equals(tokenType) 
-            || WSSecurityTokenConstants.X509Pkcs7Token.equals(tokenType) 
+        if (WSSecurityTokenConstants.X509V1Token.equals(tokenType)
+            || WSSecurityTokenConstants.X509V3Token.equals(tokenType)
+            || WSSecurityTokenConstants.X509Pkcs7Token.equals(tokenType)
             || WSSecurityTokenConstants.X509PkiPathV1Token.equals(tokenType)) {
             tokenSecurityEvent = new X509TokenSecurityEvent();
         } else if (WSSecurityTokenConstants.USERNAME_TOKEN.equals(tokenType)) {
@@ -603,8 +603,8 @@ public class WSSUtils extends XMLSecurit
             tokenSecurityEvent = new KerberosTokenSecurityEvent();
         } else if (WSSecurityTokenConstants.SECURITY_CONTEXT_TOKEN.equals(tokenType)) {
             tokenSecurityEvent = new SecurityContextTokenSecurityEvent();
-        } else if (WSSecurityTokenConstants.SAML_10_TOKEN.equals(tokenType) 
-            || WSSecurityTokenConstants.SAML_11_TOKEN.equals(tokenType) 
+        } else if (WSSecurityTokenConstants.SAML_10_TOKEN.equals(tokenType)
+            || WSSecurityTokenConstants.SAML_11_TOKEN.equals(tokenType)
             || WSSecurityTokenConstants.SAML_20_TOKEN.equals(tokenType)) {
             tokenSecurityEvent = new SamlTokenSecurityEvent();
         } else if (WSSecurityTokenConstants.REL_TOKEN.equals(tokenType)) {
@@ -625,7 +625,7 @@ public class WSSUtils extends XMLSecurit
         return (TokenSecurityEvent<? extends InboundSecurityToken>)tokenSecurityEvent;
     }
 
-    public static boolean pathMatches(List<QName> path1, List<QName> path2, 
+    public static boolean pathMatches(List<QName> path1, List<QName> path2,
                                       boolean matchAnySoapNS, boolean lastElementWildCard) {
         if (path1 == null) {
             throw new IllegalArgumentException("Internal error");

Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AttachmentTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AttachmentTest.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AttachmentTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/AttachmentTest.java Mon Feb 13 11:20:02 2017
@@ -479,7 +479,7 @@ public class AttachmentTest extends Abst
         Map<String, String> attHeaders = responseAttachment.getHeaders();
         Assert.assertEquals(6, attHeaders.size());
     }
-    
+
     @Test
     public void testXMLAttachmentContentEncryptionGCM() throws Exception {
 
@@ -513,7 +513,7 @@ public class AttachmentTest extends Abst
             xmlStreamWriter.close();
 
             Document securedDoc = documentBuilderFactory.newDocumentBuilder().parse(new ByteArrayInputStream(baos.toByteArray()));
-            
+
             NodeList references = securedDoc.getElementsByTagNameNS(WSConstants.ENC_NS, "DataReference");
             Assert.assertEquals(2, references.getLength());
             NodeList cipherReferences = securedDoc.getElementsByTagNameNS(WSConstants.ENC_NS, "CipherReference");
@@ -636,7 +636,7 @@ public class AttachmentTest extends Abst
         Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
         WSSecHeader secHeader = new WSSecHeader(doc);
         secHeader.insertSecurityHeader();
-        
+
         WSSecEncrypt encrypt = new WSSecEncrypt(secHeader);
         encrypt.setUserInfo("receiver", "default");
         encrypt.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);
@@ -1322,5 +1322,5 @@ public class AttachmentTest extends Abst
             }
         }
     }
-    
+
 }

Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/ReplayTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/ReplayTest.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/ReplayTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/ReplayTest.java Mon Feb 13 11:20:02 2017
@@ -50,7 +50,7 @@ import org.w3c.dom.Document;
 import org.w3c.dom.NodeList;
 
 public class ReplayTest extends AbstractTestBase {
-    
+
     private ReplayCache createCache(String key) throws WSSecurityException {
         ReplayCacheFactory replayCacheFactory = ReplayCacheFactory.newInstance();
         byte[] nonceValue;
@@ -115,7 +115,7 @@ public class ReplayTest extends Abstract
                 Assert.assertEquals("The message has expired", e.getCause().getMessage());
             }
         }
-        
+
         replayCache.close();
     }
 
@@ -169,7 +169,7 @@ public class ReplayTest extends Abstract
                 Assert.assertTrue(e.getCause() instanceof XMLSecurityException);
             }
         }
-        
+
         replayCache.close();
     }
 
@@ -237,7 +237,7 @@ public class ReplayTest extends Abstract
             Document document = StAX2DOM.readDoc(documentBuilderFactory.newDocumentBuilder(), xmlStreamReader);
             Assert.assertNotNull(document);
         }
-        
+
         replayCache.close();
     }
 
@@ -308,7 +308,7 @@ public class ReplayTest extends Abstract
                 Assert.assertTrue(e.getCause() instanceof XMLSecurityException);
             }
         }
-        
+
         replayCache.close();
     }
 

Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/UsernameTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/UsernameTokenTest.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/UsernameTokenTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/UsernameTokenTest.java Mon Feb 13 11:20:02 2017
@@ -281,7 +281,7 @@ public class UsernameTokenTest extends A
         } catch (XMLStreamException e) {
             Assert.assertEquals(((WSSecurityException) e.getCause()).getFaultCode(), WSSecurityException.FAILED_AUTHENTICATION);
         }
-        
+
         replayCache.close();
     }
 
@@ -836,7 +836,7 @@ public class UsernameTokenTest extends A
             Assert.assertEquals(nodeList.item(0).getParentNode().getLocalName(), WSSConstants.TAG_WSSE_SECURITY.getLocalPart());
         }
     }
-    
+
     private ReplayCache createCache(String key) throws WSSecurityException {
         ReplayCacheFactory replayCacheFactory = ReplayCacheFactory.newInstance();
         byte[] nonceValue;

Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/XOPAttachmentTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/XOPAttachmentTest.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/XOPAttachmentTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/XOPAttachmentTest.java Mon Feb 13 11:20:02 2017
@@ -115,7 +115,7 @@ public class XOPAttachmentTest extends A
     private List<Attachment> createEncryptedBodyInAttachment(Document doc) throws Exception {
         WSSecHeader secHeader = new WSSecHeader(doc);
         secHeader.insertSecurityHeader();
-        
+
         WSSecEncrypt encrypt = new WSSecEncrypt(secHeader);
         encrypt.setUserInfo("receiver", "default");
         encrypt.setKeyIdentifierType(WSConstants.ISSUER_SERIAL);

Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLCallbackHandlerImpl.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLCallbackHandlerImpl.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLCallbackHandlerImpl.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLCallbackHandlerImpl.java Mon Feb 13 11:20:02 2017
@@ -89,7 +89,7 @@ public class SAMLCallbackHandlerImpl imp
                 InputStream input = this.getClass().getClassLoader().getResourceAsStream("saml/issuer.jks");
                 keyStore.load(input, "default".toCharArray());
                 input.close();
-                
+
                 Merlin crypto = new Merlin();
                 crypto.setKeyStore(keyStore);
                 samlCallback.setIssuerCrypto(crypto);

Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenHOKTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenHOKTest.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenHOKTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenHOKTest.java Mon Feb 13 11:20:02 2017
@@ -486,7 +486,7 @@ public class SAMLTokenHOKTest extends Ab
             Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
             WSSecHeader secHeader = new WSSecHeader(doc);
             secHeader.insertSecurityHeader();
-            
+
             WSSecSAMLToken wsSign = new WSSecSAMLToken(secHeader);
 
             Document securedDocument = wsSign.build(samlAssertion);
@@ -986,7 +986,7 @@ public class SAMLTokenHOKTest extends Ab
             Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
             WSSecHeader secHeader = new WSSecHeader(doc);
             secHeader.insertSecurityHeader();
-            
+
             WSSecSAMLToken wsSign = new WSSecSAMLToken(secHeader);
 
             Document securedDocument = wsSign.build(samlAssertion);

Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenReferenceTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenReferenceTest.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenReferenceTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenReferenceTest.java Mon Feb 13 11:20:02 2017
@@ -803,7 +803,7 @@ public class SAMLTokenReferenceTest exte
 
             Crypto issuerCrypto = CryptoFactory.getInstance("saml/samlissuer.properties");
             samlAssertion.signAssertion("samlissuer", "default", issuerCrypto, false);
-            
+
             Document doc = SOAPUtil.toSOAPPart(SOAPUtil.SAMPLE_SOAP_MSG);
             WSSecHeader secHeader = new WSSecHeader(doc);
             secHeader.insertSecurityHeader();

Modified: webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenTest.java?rev=1782748&r1=1782747&r2=1782748&view=diff
==============================================================================
--- webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenTest.java (original)
+++ webservices/wss4j/trunk/ws-security-stax/src/test/java/org/apache/wss4j/stax/test/saml/SAMLTokenTest.java Mon Feb 13 11:20:02 2017
@@ -891,7 +891,7 @@ public class SAMLTokenTest extends Abstr
             Document doc = SOAPUtil.toSOAPPart(sourceDocument);
             WSSecHeader secHeader = new WSSecHeader(doc);
             secHeader.insertSecurityHeader();
-            
+
             WSSecSAMLToken wsSign = new WSSecSAMLToken(secHeader);
 
             wsSign.prepare(samlAssertion);