ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gi...@apache.org
Subject svn commit: r1325366 [1/2] - in /webservices/wss4j/branches/swssf: cxf-integration/src/test/resources/integration/ streaming-ws-policy/src/test/java/org/swssf/policy/test/ streaming-ws-security/src/main/java/org/swssf/wss/ext/ streaming-ws-security/src...
Date Thu, 12 Apr 2012 16:36:30 GMT
Author: giger
Date: Thu Apr 12 16:36:28 2012
New Revision: 1325366

URL: http://svn.apache.org/viewvc?rev=1325366&view=rev
Log:
- introduce schema validation of the security header elements.
- Fixes for bugs (mostly invalid wsu:id) which are found by the schema validation

Added:
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/util/IDGenerator.java   (with props)
Modified:
    webservices/wss4j/branches/swssf/cxf-integration/src/test/resources/integration/test-application-context.xml
    webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/VulnerabliltyVectorsTest.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/ext/WSSConstants.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/BinarySecurityTokenInputHandler.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/DerivedKeyTokenInputHandler.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/EncryptedKeyInputHandler.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/ReferenceListInputHandler.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SAMLTokenInputHandler.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SecurityContextTokenInputHandler.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SecurityTokenReferenceInputHandler.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SignatureConfirmationInputHandler.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/TimestampInputHandler.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/UsernameTokenInputHandler.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/BinarySecurityTokenOutputProcessor.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/DerivedKeyTokenOutputProcessor.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/EncryptOutputProcessor.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/EncryptedKeyOutputProcessor.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SAMLTokenOutputProcessor.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SecurityContextTokenOutputProcessor.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SignatureConfirmationOutputProcessor.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SignatureEndingOutputProcessor.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SignatureOutputProcessor.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/UsernameTokenOutputProcessor.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLAssertionWrapper.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML1ComponentBuilder.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML2ComponentBuilder.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/HttpsSecurityToken.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/AbstractTestBase.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/InteroperabilityTest.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/SignatureConfirmationTest.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/SignatureTest.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/UsernameTokenTest.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/VulnerabliltyVectorsTest.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/saml/SAMLTokenHOKTest.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/saml/SAMLTokenReferenceTest.java
    webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/saml/SAMLTokenSVTest.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/AbstractInputSecurityHeaderHandler.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityConstants.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityProperties.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/input/AbstractDecryptInputProcessor.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/input/AbstractSignatureInputHandler.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/output/AbstractEncryptOutputProcessor.java
    webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/impl/processor/output/AbstractSignatureEndingOutputProcessor.java

Modified: webservices/wss4j/branches/swssf/cxf-integration/src/test/resources/integration/test-application-context.xml
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/cxf-integration/src/test/resources/integration/test-application-context.xml?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/cxf-integration/src/test/resources/integration/test-application-context.xml (original)
+++ webservices/wss4j/branches/swssf/cxf-integration/src/test/resources/integration/test-application-context.xml Thu Apr 12 16:36:28 2012
@@ -40,6 +40,8 @@
         <!--<property name="encryptionUser" value="transmitter"/>-->
         <property name="useReqSigCertForEncryption" value="true"/>
         <property name="skipDocumentEvents" value="true"/>
+        <!-- disable schema validation until wss4j is fixed -->
+        <property name="disableSchemaValidation" value="true"/>
     </bean>
 
     <bean name="outSecurityProperties" class="org.swssf.wss.ext.WSSSecurityProperties">

Modified: webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/VulnerabliltyVectorsTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/VulnerabliltyVectorsTest.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/VulnerabliltyVectorsTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-policy/src/test/java/org/swssf/policy/test/VulnerabliltyVectorsTest.java Thu Apr 12 16:36:28 2012
@@ -126,6 +126,8 @@ public class VulnerabliltyVectorsTest ex
         inSecurityProperties.setCallbackHandler(new CallbackHandlerImpl());
         inSecurityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
         inSecurityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
+        //we have to disable the schema validation until WSS4J-DOM is fixed. WSS4J generates an empty PrefixList which is not schema valid!
+        inSecurityProperties.setDisableSchemaValidation(true);
 
         PolicyEnforcerFactory policyEnforcerFactory = PolicyEnforcerFactory.newInstance(this.getClass().getClassLoader().getResource("testdata/wsdl/actionSpoofing.wsdl"));
         PolicyEnforcer policyEnforcer = policyEnforcerFactory.newPolicyEnforcer("goodPolicy");

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/ext/WSSConstants.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/ext/WSSConstants.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/ext/WSSConstants.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/ext/WSSConstants.java Thu Apr 12 16:36:28 2012
@@ -19,10 +19,19 @@
 package org.swssf.wss.ext;
 
 import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.impl.util.ConcreteLSInput;
+import org.w3c.dom.ls.LSInput;
+import org.w3c.dom.ls.LSResourceResolver;
+import org.xml.sax.SAXException;
 
+import javax.xml.XMLConstants;
 import javax.xml.bind.JAXBContext;
 import javax.xml.bind.JAXBException;
 import javax.xml.namespace.QName;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
 import java.util.*;
 
 /**
@@ -35,10 +44,56 @@ public class WSSConstants extends XMLSec
 
     static {
         try {
-            //todo schema validation?
             setJaxbContext(JAXBContext.newInstance("org.swssf.binding.wss10:org.swssf.binding.wss11:org.swssf.binding.wsu10:org.swssf.binding.wssc13:org.swssf.binding.wssc200502:org.swssf.binding.xmlenc:org.swssf.binding.xmldsig:org.swssf.binding.xmldsig11:org.swssf.binding.excc14n"));
+            SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+            schemaFactory.setResourceResolver(new LSResourceResolver() {
+                @Override
+                public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) {
+                    if ("http://www.w3.org/2001/XMLSchema.dtd".equals(systemId)) {
+                        ConcreteLSInput concreteLSInput = new ConcreteLSInput();
+                        concreteLSInput.setByteStream(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("schemas/XMLSchema.dtd"));
+                        return concreteLSInput;
+                    } else if ("XMLSchema.dtd".equals(systemId)) {
+                        ConcreteLSInput concreteLSInput = new ConcreteLSInput();
+                        concreteLSInput.setByteStream(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("schemas/XMLSchema.dtd"));
+                        return concreteLSInput;
+                    } else if ("datatypes.dtd".equals(systemId)) {
+                        ConcreteLSInput concreteLSInput = new ConcreteLSInput();
+                        concreteLSInput.setByteStream(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("schemas/datatypes.dtd"));
+                        return concreteLSInput;
+                    } else if ("http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd".equals(systemId)) {
+                        ConcreteLSInput concreteLSInput = new ConcreteLSInput();
+                        concreteLSInput.setByteStream(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("schemas/xmldsig-core-schema.xsd"));
+                        return concreteLSInput;
+                    } else if ("http://www.w3.org/2001/xml.xsd".equals(systemId)) {
+                        ConcreteLSInput concreteLSInput = new ConcreteLSInput();
+                        concreteLSInput.setByteStream(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("schemas/xml.xsd"));
+                        return concreteLSInput;
+                    }
+                    return null;
+                }
+            });
+            Schema schema = schemaFactory.newSchema(
+                    new Source[]{
+                            new StreamSource(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("schemas/soap-1.1.xsd")),
+                            new StreamSource(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("schemas/soap-1.2.xsd")),
+                            new StreamSource(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("schemas/exc-c14n.xsd")),
+                            new StreamSource(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("schemas/xenc-schema.xsd")),
+                            new StreamSource(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("schemas/xmldsig11-schema.xsd")),
+                            new StreamSource(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("schemas/xmldsig-core-schema.xsd")),
+                            new StreamSource(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("schemas/xmldsig1-schema.xsd")),
+                            new StreamSource(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("schemas/oasis-200401-wss-wssecurity-utility-1.0.xsd")),
+                            new StreamSource(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("schemas/oasis-200401-wss-wssecurity-secext-1.0.xsd")),
+                            new StreamSource(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("schemas/oasis-wss-wssecurity-secext-1.1.xsd")),
+                            new StreamSource(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("schemas/ws-secureconversation-200502.xsd")),
+                            new StreamSource(XMLSecurityConstants.class.getClassLoader().getResourceAsStream("schemas/ws-secureconversation-1.3.xsd")),
+                    }
+            );
+            setJaxbSchemas(schema);
         } catch (JAXBException e) {
             throw new RuntimeException(e);
+        } catch (SAXException e) {
+            throw new RuntimeException(e);
         }
     }
 

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/BinarySecurityTokenInputHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/BinarySecurityTokenInputHandler.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/BinarySecurityTokenInputHandler.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/BinarySecurityTokenInputHandler.java Thu Apr 12 16:36:28 2012
@@ -27,13 +27,13 @@ import org.swssf.wss.impl.securityToken.
 import org.swssf.wss.securityEvent.X509TokenSecurityEvent;
 import org.swssf.xmlsec.crypto.Crypto;
 import org.swssf.xmlsec.ext.*;
+import org.swssf.xmlsec.impl.util.IDGenerator;
 
 import javax.xml.bind.JAXBElement;
 import javax.xml.namespace.QName;
 import javax.xml.stream.events.XMLEvent;
 import java.util.Deque;
 import java.util.List;
-import java.util.UUID;
 
 /**
  * Processor for the BinarySecurityToken XML Structure
@@ -48,12 +48,12 @@ public class BinarySecurityTokenInputHan
                        Deque<XMLEvent> eventQueue, Integer index) throws XMLSecurityException {
 
         final BinarySecurityTokenType binarySecurityTokenType =
-                ((JAXBElement<BinarySecurityTokenType>) parseStructure(eventQueue, index)).getValue();
+                ((JAXBElement<BinarySecurityTokenType>) parseStructure(eventQueue, index, securityProperties)).getValue();
 
         checkBSPCompliance(inputProcessorChain, binarySecurityTokenType);
 
         if (binarySecurityTokenType.getId() == null) {
-            binarySecurityTokenType.setId(UUID.randomUUID().toString());
+            binarySecurityTokenType.setId(IDGenerator.generateID(null));
         }
 
         final List<QName> elementPath = getElementPath(inputProcessorChain.getDocumentContext(), eventQueue);

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/DerivedKeyTokenInputHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/DerivedKeyTokenInputHandler.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/DerivedKeyTokenInputHandler.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/DerivedKeyTokenInputHandler.java Thu Apr 12 16:36:28 2012
@@ -31,6 +31,7 @@ import org.swssf.wss.securityEvent.Algor
 import org.swssf.wss.securityEvent.DerivedKeyTokenSecurityEvent;
 import org.swssf.xmlsec.config.JCEAlgorithmMapper;
 import org.swssf.xmlsec.ext.*;
+import org.swssf.xmlsec.impl.util.IDGenerator;
 
 import javax.crypto.spec.SecretKeySpec;
 import javax.xml.bind.JAXBElement;
@@ -40,7 +41,6 @@ import java.security.Key;
 import java.security.PublicKey;
 import java.util.Deque;
 import java.util.List;
-import java.util.UUID;
 
 /**
  * Processor for the SecurityContextToken XML Structure
@@ -56,9 +56,9 @@ public class DerivedKeyTokenInputHandler
 
         @SuppressWarnings("unchecked")
         final AbstractDerivedKeyTokenType derivedKeyTokenType =
-                ((JAXBElement<AbstractDerivedKeyTokenType>) parseStructure(eventQueue, index)).getValue();
+                ((JAXBElement<AbstractDerivedKeyTokenType>) parseStructure(eventQueue, index, securityProperties)).getValue();
         if (derivedKeyTokenType.getId() == null) {
-            derivedKeyTokenType.setId(UUID.randomUUID().toString());
+            derivedKeyTokenType.setId(IDGenerator.generateID(null));
         }
         if (derivedKeyTokenType.getSecurityTokenReference() == null) {
             throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_CHECK, "noReference");

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/EncryptedKeyInputHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/EncryptedKeyInputHandler.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/EncryptedKeyInputHandler.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/EncryptedKeyInputHandler.java Thu Apr 12 16:36:28 2012
@@ -31,6 +31,7 @@ import org.swssf.xmlsec.config.JCEAlgori
 import org.swssf.xmlsec.crypto.Crypto;
 import org.swssf.xmlsec.ext.*;
 import org.swssf.xmlsec.impl.securityToken.SecurityTokenFactory;
+import org.swssf.xmlsec.impl.util.IDGenerator;
 import org.xmlsecurity.ns.configuration.AlgorithmType;
 
 import javax.crypto.BadPaddingException;
@@ -42,7 +43,10 @@ import javax.xml.bind.JAXBElement;
 import javax.xml.namespace.QName;
 import javax.xml.stream.events.XMLEvent;
 import java.security.*;
-import java.util.*;
+import java.util.Deque;
+import java.util.Hashtable;
+import java.util.List;
+import java.util.Map;
 
 /**
  * Processor for the EncryptedKey XML Structure
@@ -57,7 +61,7 @@ public class EncryptedKeyInputHandler ex
                        Deque<XMLEvent> eventQueue, Integer index) throws XMLSecurityException {
 
         @SuppressWarnings("unchecked")
-        final EncryptedKeyType encryptedKeyType = ((JAXBElement<EncryptedKeyType>) parseStructure(eventQueue, index)).getValue();
+        final EncryptedKeyType encryptedKeyType = ((JAXBElement<EncryptedKeyType>) parseStructure(eventQueue, index, securityProperties)).getValue();
 
         if (encryptedKeyType.getEncryptionMethod() == null) {
             throw new WSSecurityException(WSSecurityException.ErrorCode.UNSUPPORTED_ALGORITHM, "noEncAlgo");
@@ -66,7 +70,7 @@ public class EncryptedKeyInputHandler ex
         checkBSPCompliance(inputProcessorChain, encryptedKeyType);
 
         if (encryptedKeyType.getId() == null) {
-            encryptedKeyType.setId(UUID.randomUUID().toString());
+            encryptedKeyType.setId(IDGenerator.generateID(null));
         }
 
         final List<QName> elementPath = getElementPath(inputProcessorChain.getDocumentContext(), eventQueue);

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/ReferenceListInputHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/ReferenceListInputHandler.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/ReferenceListInputHandler.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/ReferenceListInputHandler.java Thu Apr 12 16:36:28 2012
@@ -41,7 +41,7 @@ public class ReferenceListInputHandler e
     public void handle(final InputProcessorChain inputProcessorChain, final XMLSecurityProperties securityProperties,
                        Deque<XMLEvent> eventQueue, Integer index) throws XMLSecurityException {
 
-        final ReferenceList referenceList = (ReferenceList) parseStructure(eventQueue, index);
+        final ReferenceList referenceList = (ReferenceList) parseStructure(eventQueue, index, securityProperties);
 
         //instantiate a new DecryptInputProcessor and add it to the chain
         inputProcessorChain.addProcessor(

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SAMLTokenInputHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SAMLTokenInputHandler.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SAMLTokenInputHandler.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SAMLTokenInputHandler.java Thu Apr 12 16:36:28 2012
@@ -55,7 +55,7 @@ public class SAMLTokenInputHandler exten
     public void handle(final InputProcessorChain inputProcessorChain, final XMLSecurityProperties securityProperties,
                        Deque<XMLEvent> eventQueue, Integer index) throws XMLSecurityException {
 
-        final Document samlTokenDocument = (Document) parseStructure(eventQueue, index);
+        final Document samlTokenDocument = (Document) parseStructure(eventQueue, index, securityProperties);
 
         final SAMLAssertionWrapper samlAssertionWrapper = new SAMLAssertionWrapper(samlTokenDocument.getDocumentElement());
 
@@ -109,7 +109,7 @@ public class SAMLTokenInputHandler exten
 
     @SuppressWarnings("unchecked")
     @Override
-    protected <T> T parseStructure(Deque<XMLEvent> eventDeque, int index) throws XMLSecurityException {
+    protected <T> T parseStructure(Deque<XMLEvent> eventDeque, int index, XMLSecurityProperties securityProperties) throws XMLSecurityException {
         Document document = null;
         try {
             document = documentBuilderFactory.newDocumentBuilder().newDocument();

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SecurityContextTokenInputHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SecurityContextTokenInputHandler.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SecurityContextTokenInputHandler.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SecurityContextTokenInputHandler.java Thu Apr 12 16:36:28 2012
@@ -24,6 +24,7 @@ import org.swssf.wss.impl.securityToken.
 import org.swssf.wss.securityEvent.SecurityContextTokenSecurityEvent;
 import org.swssf.xmlsec.config.JCEAlgorithmMapper;
 import org.swssf.xmlsec.ext.*;
+import org.swssf.xmlsec.impl.util.IDGenerator;
 
 import javax.crypto.spec.SecretKeySpec;
 import javax.xml.bind.JAXBElement;
@@ -33,7 +34,6 @@ import java.security.Key;
 import java.security.PublicKey;
 import java.util.Deque;
 import java.util.List;
-import java.util.UUID;
 
 /**
  * Processor for the SecurityContextToken XML Structure
@@ -49,10 +49,10 @@ public class SecurityContextTokenInputHa
 
         @SuppressWarnings("unchecked")
         JAXBElement<AbstractSecurityContextTokenType> securityContextTokenTypeJAXBElement =
-                ((JAXBElement<AbstractSecurityContextTokenType>) parseStructure(eventQueue, index));
+                ((JAXBElement<AbstractSecurityContextTokenType>) parseStructure(eventQueue, index, securityProperties));
         final AbstractSecurityContextTokenType securityContextTokenType = securityContextTokenTypeJAXBElement.getValue();
         if (securityContextTokenType.getId() == null) {
-            securityContextTokenType.setId(UUID.randomUUID().toString());
+            securityContextTokenType.setId(IDGenerator.generateID(null));
         }
 
         final String identifier = (String) XMLSecurityUtils.getQNameType(securityContextTokenType.getAny(),

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SecurityTokenReferenceInputHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SecurityTokenReferenceInputHandler.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SecurityTokenReferenceInputHandler.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SecurityTokenReferenceInputHandler.java Thu Apr 12 16:36:28 2012
@@ -51,7 +51,7 @@ public class SecurityTokenReferenceInput
 
         @SuppressWarnings("unchecked")
         final SecurityTokenReferenceType securityTokenReferenceType =
-                ((JAXBElement<SecurityTokenReferenceType>) parseStructure(eventQueue, index)).getValue();
+                ((JAXBElement<SecurityTokenReferenceType>) parseStructure(eventQueue, index, securityProperties)).getValue();
 
         final KeyIdentifierType keyIdentifierType = XMLSecurityUtils.getQNameType(
                 securityTokenReferenceType.getAny(), WSSConstants.TAG_wsse_KeyIdentifier);

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SignatureConfirmationInputHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SignatureConfirmationInputHandler.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SignatureConfirmationInputHandler.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/SignatureConfirmationInputHandler.java Thu Apr 12 16:36:28 2012
@@ -45,7 +45,7 @@ public class SignatureConfirmationInputH
 
         @SuppressWarnings("unchecked")
         final SignatureConfirmationType signatureConfirmationType =
-                ((JAXBElement<SignatureConfirmationType>) parseStructure(eventQueue, index)).getValue();
+                ((JAXBElement<SignatureConfirmationType>) parseStructure(eventQueue, index, securityProperties)).getValue();
 
         checkBSPCompliance(inputProcessorChain, signatureConfirmationType);
 

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/TimestampInputHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/TimestampInputHandler.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/TimestampInputHandler.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/TimestampInputHandler.java Thu Apr 12 16:36:28 2012
@@ -65,7 +65,7 @@ public class TimestampInputHandler exten
         }
         inputProcessorChain.getSecurityContext().put(WSSConstants.TIMESTAMP_PROCESSED, Boolean.TRUE);
 
-        final TimestampType timestampType = ((JAXBElement<TimestampType>) parseStructure(eventQueue, index)).getValue();
+        final TimestampType timestampType = ((JAXBElement<TimestampType>) parseStructure(eventQueue, index, securityProperties)).getValue();
 
         checkBSPCompliance(inputProcessorChain, timestampType, eventQueue, index);
 

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/UsernameTokenInputHandler.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/UsernameTokenInputHandler.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/UsernameTokenInputHandler.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/input/UsernameTokenInputHandler.java Thu Apr 12 16:36:28 2012
@@ -31,6 +31,7 @@ import org.swssf.wss.ext.*;
 import org.swssf.wss.impl.securityToken.SecurityTokenFactoryImpl;
 import org.swssf.wss.securityEvent.UsernameTokenSecurityEvent;
 import org.swssf.xmlsec.ext.*;
+import org.swssf.xmlsec.impl.util.IDGenerator;
 
 import javax.xml.bind.JAXBElement;
 import javax.xml.datatype.DatatypeConfigurationException;
@@ -67,12 +68,12 @@ public class UsernameTokenInputHandler e
     public void handle(final InputProcessorChain inputProcessorChain, final XMLSecurityProperties securityProperties,
                        Deque<XMLEvent> eventQueue, Integer index) throws XMLSecurityException {
 
-        final UsernameTokenType usernameTokenType = ((JAXBElement<UsernameTokenType>) parseStructure(eventQueue, index)).getValue();
+        final UsernameTokenType usernameTokenType = ((JAXBElement<UsernameTokenType>) parseStructure(eventQueue, index, securityProperties)).getValue();
 
         checkBSPCompliance(inputProcessorChain, usernameTokenType, eventQueue, index);
 
         if (usernameTokenType.getId() == null) {
-            usernameTokenType.setId(UUID.randomUUID().toString());
+            usernameTokenType.setId(IDGenerator.generateID(null));
         }
 
         // If the UsernameToken is to be used for key derivation, the (1.1)

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/BinarySecurityTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/BinarySecurityTokenOutputProcessor.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/BinarySecurityTokenOutputProcessor.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/BinarySecurityTokenOutputProcessor.java Thu Apr 12 16:36:28 2012
@@ -24,6 +24,7 @@ import org.swssf.wss.securityEvent.Secur
 import org.swssf.wss.securityEvent.TokenSecurityEvent;
 import org.swssf.xmlsec.crypto.CryptoType;
 import org.swssf.xmlsec.ext.*;
+import org.swssf.xmlsec.impl.util.IDGenerator;
 
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.events.StartElement;
@@ -32,7 +33,6 @@ import java.security.Key;
 import java.security.PublicKey;
 import java.security.cert.X509Certificate;
 import java.util.List;
-import java.util.UUID;
 
 /**
  * @author $Author$
@@ -47,7 +47,7 @@ public class BinarySecurityTokenOutputPr
     @Override
     public void processEvent(XMLEvent xmlEvent, OutputProcessorChain outputProcessorChain) throws XMLStreamException, XMLSecurityException {
         try {
-            final String bstId = "BST-" + UUID.randomUUID().toString();
+            final String bstId = IDGenerator.generateID(null);
             final X509Certificate[] x509Certificates;
             final Key key;
 
@@ -97,7 +97,6 @@ public class BinarySecurityTokenOutputPr
                 key = null;
             }
 
-            //todo use the abstractSecurityToken class and make setProcessor method?
             final AbstractSecurityToken binarySecurityToken = new AbstractSecurityToken(bstId) {
 
                 @Override

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/DerivedKeyTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/DerivedKeyTokenOutputProcessor.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/DerivedKeyTokenOutputProcessor.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/DerivedKeyTokenOutputProcessor.java Thu Apr 12 16:36:28 2012
@@ -26,6 +26,7 @@ import org.swssf.wss.impl.derivedKey.Der
 import org.swssf.wss.impl.securityToken.AbstractSecurityToken;
 import org.swssf.xmlsec.config.JCEAlgorithmMapper;
 import org.swssf.xmlsec.ext.*;
+import org.swssf.xmlsec.impl.util.IDGenerator;
 
 import javax.crypto.spec.SecretKeySpec;
 import javax.xml.namespace.QName;
@@ -39,7 +40,6 @@ import java.security.cert.X509Certificat
 import java.util.HashMap;
 import java.util.Hashtable;
 import java.util.Map;
-import java.util.UUID;
 
 /**
  * @author $Author$
@@ -68,7 +68,7 @@ public class DerivedKeyTokenOutputProces
                 throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_ENCRYPTION);
             }
 
-            final String wsuIdDKT = "DK-" + UUID.randomUUID().toString();
+            final String wsuIdDKT = IDGenerator.generateID(null);
 
             int offset = 0;
             int length = 0;
@@ -253,7 +253,7 @@ public class DerivedKeyTokenOutputProces
                 throws XMLStreamException, XMLSecurityException {
 
             Map<QName, String> attributes = new HashMap<QName, String>();
-            attributes.put(WSSConstants.ATT_wsu_Id, "STRId-" + UUID.randomUUID().toString());
+            attributes.put(WSSConstants.ATT_wsu_Id, IDGenerator.generateID(null));
             if (keyIdentifierType == WSSConstants.KeyIdentifierType.SECURITY_TOKEN_DIRECT_REFERENCE && !useSingleCertificate) {
                 attributes.put(WSSConstants.ATT_wsse11_TokenType, WSSConstants.NS_X509PKIPathv1);
             } else if (derivedKeyTokenReference == WSSConstants.DerivedKeyTokenReference.EncryptedKey) {

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/EncryptOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/EncryptOutputProcessor.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/EncryptOutputProcessor.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/EncryptOutputProcessor.java Thu Apr 12 16:36:28 2012
@@ -26,6 +26,7 @@ import org.swssf.xmlsec.ext.SecurityToke
 import org.swssf.xmlsec.ext.XMLSecurityException;
 import org.swssf.xmlsec.impl.EncryptionPartDef;
 import org.swssf.xmlsec.impl.processor.output.AbstractEncryptOutputProcessor;
+import org.swssf.xmlsec.impl.util.IDGenerator;
 
 import javax.crypto.NoSuchPaddingException;
 import javax.xml.namespace.QName;
@@ -39,7 +40,6 @@ import java.security.NoSuchAlgorithmExce
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.UUID;
 
 /**
  * Processor to encrypt XML structures
@@ -79,7 +79,7 @@ public class EncryptOutputProcessor exte
                         SecurityTokenProvider securityTokenProvider = outputProcessorChain.getSecurityContext().getSecurityTokenProvider(tokenId);
                         EncryptionPartDef encryptionPartDef = new EncryptionPartDef();
                         encryptionPartDef.setModifier(securePart.getModifier());
-                        encryptionPartDef.setEncRefId("ED-" + UUID.randomUUID().toString());
+                        encryptionPartDef.setEncRefId(IDGenerator.generateID(null));
                         encryptionPartDef.setKeyId(securityTokenProvider.getId());
                         encryptionPartDef.setSymmetricKey(securityTokenProvider.getSecurityToken().getSecretKey(getSecurityProperties().getEncryptionSymAlgorithm(), null));
                         outputProcessorChain.getSecurityContext().putAsList(EncryptionPartDef.class, encryptionPartDef);

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/EncryptedKeyOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/EncryptedKeyOutputProcessor.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/EncryptedKeyOutputProcessor.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/EncryptedKeyOutputProcessor.java Thu Apr 12 16:36:28 2012
@@ -23,6 +23,7 @@ import org.swssf.wss.ext.*;
 import org.swssf.wss.impl.securityToken.AbstractSecurityToken;
 import org.swssf.xmlsec.config.JCEAlgorithmMapper;
 import org.swssf.xmlsec.ext.*;
+import org.swssf.xmlsec.impl.util.IDGenerator;
 
 import javax.crypto.Cipher;
 import javax.crypto.IllegalBlockSizeException;
@@ -39,7 +40,6 @@ import java.security.PublicKey;
 import java.security.cert.X509Certificate;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.UUID;
 
 /**
  * @author $Author$
@@ -81,7 +81,7 @@ public class EncryptedKeyOutputProcessor
 
             final Key symmetricKey = keyGen.generateKey();
 
-            final String ekId = "EK-" + UUID.randomUUID().toString();
+            final String ekId = IDGenerator.generateID(null);
 
             final AbstractSecurityToken encryptedKeySecurityToken = new AbstractSecurityToken(ekId) {
 
@@ -264,7 +264,7 @@ public class EncryptedKeyOutputProcessor
                 throws XMLStreamException, XMLSecurityException {
 
             Map<QName, String> attributes = new HashMap<QName, String>();
-            attributes.put(WSSConstants.ATT_wsu_Id, "STRId-" + UUID.randomUUID().toString());
+            attributes.put(WSSConstants.ATT_wsu_Id, IDGenerator.generateID(null));
             if (keyIdentifierType == WSSConstants.KeyIdentifierType.SECURITY_TOKEN_DIRECT_REFERENCE && !useSingleCertificate) {
                 attributes.put(WSSConstants.ATT_wsse11_TokenType, WSSConstants.NS_X509PKIPathv1);
             }

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SAMLTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SAMLTokenOutputProcessor.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SAMLTokenOutputProcessor.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SAMLTokenOutputProcessor.java Thu Apr 12 16:36:28 2012
@@ -30,6 +30,7 @@ import org.swssf.wss.impl.securityToken.
 import org.swssf.wss.impl.securityToken.SAMLSecurityToken;
 import org.swssf.xmlsec.crypto.CryptoType;
 import org.swssf.xmlsec.ext.*;
+import org.swssf.xmlsec.impl.util.IDGenerator;
 import org.w3c.dom.*;
 
 import javax.xml.namespace.QName;
@@ -43,7 +44,6 @@ import java.security.cert.X509Certificat
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.UUID;
 
 /**
  * @author $Author$
@@ -82,8 +82,8 @@ public class SAMLTokenOutputProcessor ex
                 }
             }
 
-            final String securityTokenReferenceId = "STRSAMLId-" + UUID.randomUUID().toString();
-            final String binarySecurityTokenId = "BST-" + UUID.randomUUID().toString();
+            final String securityTokenReferenceId = IDGenerator.generateID(null);
+            final String binarySecurityTokenId = IDGenerator.generateID(null);
             final String tokenId = samlAssertionWrapper.getId();
 
             PrivateKey privateKey = null;

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SecurityContextTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SecurityContextTokenOutputProcessor.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SecurityContextTokenOutputProcessor.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SecurityContextTokenOutputProcessor.java Thu Apr 12 16:36:28 2012
@@ -23,6 +23,7 @@ import org.swssf.wss.ext.WSSDocumentCont
 import org.swssf.wss.ext.WSSecurityException;
 import org.swssf.wss.impl.securityToken.AbstractSecurityToken;
 import org.swssf.xmlsec.ext.*;
+import org.swssf.xmlsec.impl.util.IDGenerator;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
@@ -33,7 +34,6 @@ import java.security.PublicKey;
 import java.security.cert.X509Certificate;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.UUID;
 
 /**
  * @author $Author$
@@ -61,8 +61,8 @@ public class SecurityContextTokenOutputP
                 throw new WSSecurityException(WSSecurityException.ErrorCode.FAILED_ENCRYPTION);
             }
 
-            final String wsuId = "SCT-" + UUID.randomUUID().toString();
-            final String identifier = UUID.randomUUID().toString();
+            final String wsuId = IDGenerator.generateID(null);
+            final String identifier = IDGenerator.generateID(null);
 
             final AbstractSecurityToken securityContextSecurityToken = new AbstractSecurityToken(wsuId) {
 

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SignatureConfirmationOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SignatureConfirmationOutputProcessor.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SignatureConfirmationOutputProcessor.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SignatureConfirmationOutputProcessor.java Thu Apr 12 16:36:28 2012
@@ -26,6 +26,7 @@ import org.swssf.wss.securityEvent.Signa
 import org.swssf.xmlsec.ext.AbstractOutputProcessor;
 import org.swssf.xmlsec.ext.OutputProcessorChain;
 import org.swssf.xmlsec.ext.XMLSecurityException;
+import org.swssf.xmlsec.impl.util.IDGenerator;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
@@ -34,7 +35,6 @@ import javax.xml.stream.events.XMLEvent;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.UUID;
 
 /**
  * @author $Author$
@@ -66,7 +66,7 @@ public class SignatureConfirmationOutput
                         SignatureValueSecurityEvent signatureValueSecurityEvent = (SignatureValueSecurityEvent) securityEvent;
 
                         Map<QName, String> attributes = new HashMap<QName, String>();
-                        attributes.put(WSSConstants.ATT_wsu_Id, "SigConf-" + UUID.randomUUID().toString());
+                        attributes.put(WSSConstants.ATT_wsu_Id, IDGenerator.generateID(null));
                         attributes.put(WSSConstants.ATT_NULL_Value, new Base64(76, new byte[]{'\n'}).encodeToString(signatureValueSecurityEvent.getSignatureValue()));
                         createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsse11_SignatureConfirmation, attributes);
                         createEndElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsse11_SignatureConfirmation);
@@ -75,7 +75,7 @@ public class SignatureConfirmationOutput
 
                 if (!aSignatureFound) {
                     Map<QName, String> attributes = new HashMap<QName, String>();
-                    attributes.put(WSSConstants.ATT_wsu_Id, "SigConf-" + UUID.randomUUID().toString());
+                    attributes.put(WSSConstants.ATT_wsu_Id, IDGenerator.generateID(null));
                     createStartElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsse11_SignatureConfirmation, attributes);
                     createEndElementAndOutputAsEvent(subOutputProcessorChain, WSSConstants.TAG_wsse11_SignatureConfirmation);
                 }

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SignatureEndingOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SignatureEndingOutputProcessor.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SignatureEndingOutputProcessor.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SignatureEndingOutputProcessor.java Thu Apr 12 16:36:28 2012
@@ -29,13 +29,13 @@ import org.swssf.xmlsec.ext.XMLSecurityE
 import org.swssf.xmlsec.impl.SignaturePartDef;
 import org.swssf.xmlsec.impl.algorithms.SignatureAlgorithm;
 import org.swssf.xmlsec.impl.processor.output.AbstractSignatureEndingOutputProcessor;
+import org.swssf.xmlsec.impl.util.IDGenerator;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import java.security.cert.X509Certificate;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.UUID;
 
 /**
  * @author $Author$
@@ -96,7 +96,7 @@ public class SignatureEndingOutputProces
             WSSUtils.createKeyValueTokenStructure(this, outputProcessorChain, x509Certificates);
         } else {
             Map<QName, String> attributes = new HashMap<QName, String>();
-            attributes.put(WSSConstants.ATT_wsu_Id, "STRId-" + UUID.randomUUID().toString());
+            attributes.put(WSSConstants.ATT_wsu_Id, IDGenerator.generateID(null));
             if (keyIdentifierType == WSSConstants.KeyIdentifierType.SECURITY_TOKEN_DIRECT_REFERENCE && !useSingleCertificate) {
                 attributes.put(WSSConstants.ATT_wsse11_TokenType, WSSConstants.NS_X509PKIPathv1);
             } else if (WSSConstants.Saml10Token.equals(securityToken.getTokenType())

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SignatureOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SignatureOutputProcessor.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SignatureOutputProcessor.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/SignatureOutputProcessor.java Thu Apr 12 16:36:28 2012
@@ -25,6 +25,7 @@ import org.swssf.xmlsec.ext.SecurePart;
 import org.swssf.xmlsec.ext.XMLSecurityException;
 import org.swssf.xmlsec.impl.SignaturePartDef;
 import org.swssf.xmlsec.impl.processor.output.AbstractSignatureOutputProcessor;
+import org.swssf.xmlsec.impl.util.IDGenerator;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
@@ -36,7 +37,6 @@ import java.security.NoSuchProviderExcep
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
-import java.util.UUID;
 
 /**
  * @author $Author$
@@ -72,7 +72,7 @@ public class SignatureOutputProcessor ex
                     try {
                         SignaturePartDef signaturePartDef = new SignaturePartDef();
                         if (securePart.getIdToSign() == null) {
-                            signaturePartDef.setSigRefId("id-" + UUID.randomUUID().toString());
+                            signaturePartDef.setSigRefId(IDGenerator.generateID(null));
                             signaturePartDef.setC14nAlgo(getSecurityProperties().getSignatureCanonicalizationAlgorithm());
 
                             boolean found = false;

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/UsernameTokenOutputProcessor.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/UsernameTokenOutputProcessor.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/UsernameTokenOutputProcessor.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/processor/output/UsernameTokenOutputProcessor.java Thu Apr 12 16:36:28 2012
@@ -22,6 +22,7 @@ import org.apache.commons.codec.binary.B
 import org.swssf.wss.ext.*;
 import org.swssf.wss.impl.securityToken.UsernameSecurityToken;
 import org.swssf.xmlsec.ext.*;
+import org.swssf.xmlsec.impl.util.IDGenerator;
 
 import javax.xml.datatype.DatatypeConfigurationException;
 import javax.xml.datatype.DatatypeFactory;
@@ -30,7 +31,10 @@ import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.events.StartElement;
 import javax.xml.stream.events.XMLEvent;
-import java.util.*;
+import java.util.Arrays;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.Map;
 
 /**
  * @author $Author$
@@ -61,7 +65,7 @@ public class UsernameTokenOutputProcesso
             DatatypeFactory datatypeFactory = DatatypeFactory.newInstance();
             XMLGregorianCalendar created = datatypeFactory.newXMLGregorianCalendar(new GregorianCalendar());
 
-            final String wsuId = "UsernameToken-" + UUID.randomUUID().toString();
+            final String wsuId = IDGenerator.generateID(null);
 
             final OutputProcessor outputProcessor = this;
 

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLAssertionWrapper.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLAssertionWrapper.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLAssertionWrapper.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/SAMLAssertionWrapper.java Thu Apr 12 16:36:28 2012
@@ -43,6 +43,7 @@ import org.swssf.wss.impl.saml.builder.S
 import org.swssf.xmlsec.crypto.Crypto;
 import org.swssf.xmlsec.crypto.CryptoType;
 import org.swssf.xmlsec.ext.XMLSecurityException;
+import org.swssf.xmlsec.impl.util.IDGenerator;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -63,7 +64,6 @@ import java.security.cert.CertificateNot
 import java.security.cert.X509Certificate;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.UUID;
 
 /**
  * @author $Author$
@@ -201,7 +201,7 @@ public class SAMLAssertionWrapper {
         }
         if (id == null || id.length() == 0) {
             logger.error("AssertionWrapper: ID was null, seeting a new ID value");
-            id = "_" + UUID.randomUUID().toString();
+            id = IDGenerator.generateID(null);
             if (saml2 != null) {
                 saml2.setID(id);
             } else if (saml1 != null) {

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML1ComponentBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML1ComponentBuilder.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML1ComponentBuilder.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML1ComponentBuilder.java Thu Apr 12 16:36:28 2012
@@ -34,10 +34,10 @@ import org.opensaml.xml.signature.KeyInf
 import org.swssf.wss.ext.WSSecurityException;
 import org.swssf.wss.impl.saml.OpenSAMLUtil;
 import org.swssf.wss.impl.saml.bean.*;
+import org.swssf.xmlsec.impl.util.IDGenerator;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.UUID;
 
 /**
  * Class SAML1ComponentBuilder provides builder methods that can be used
@@ -108,7 +108,7 @@ public class SAML1ComponentBuilder {
         assertion.setVersion(SAMLVersion.VERSION_11);
         assertion.setIssuer(issuer);
         assertion.setIssueInstant(new DateTime()); // now
-        assertion.setID("_" + UUID.randomUUID().toString());
+        assertion.setID(IDGenerator.generateID(null));
         return assertion;
     }
 

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML2ComponentBuilder.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML2ComponentBuilder.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML2ComponentBuilder.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/saml/builder/SAML2ComponentBuilder.java Thu Apr 12 16:36:28 2012
@@ -31,10 +31,10 @@ import org.opensaml.xml.schema.impl.XSSt
 import org.opensaml.xml.signature.KeyInfo;
 import org.swssf.wss.ext.WSSecurityException;
 import org.swssf.wss.impl.saml.bean.*;
+import org.swssf.xmlsec.impl.util.IDGenerator;
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.UUID;
 
 
 /**
@@ -103,7 +103,7 @@ public class SAML2ComponentBuilder {
         }
         Assertion assertion =
                 assertionBuilder.buildObject(Assertion.DEFAULT_ELEMENT_NAME, Assertion.TYPE_NAME);
-        assertion.setID("_" + UUID.randomUUID().toString());
+        assertion.setID(IDGenerator.generateID(null));
         assertion.setVersion(SAMLVersion.VERSION_20);
         assertion.setIssueInstant(new DateTime());
         return assertion;

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/HttpsSecurityToken.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/HttpsSecurityToken.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/HttpsSecurityToken.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/wss/impl/securityToken/HttpsSecurityToken.java Thu Apr 12 16:36:28 2012
@@ -23,11 +23,11 @@ import org.swssf.wss.ext.WSSecurityConte
 import org.swssf.wss.ext.WSSecurityException;
 import org.swssf.xmlsec.ext.SecurityToken;
 import org.swssf.xmlsec.ext.XMLSecurityConstants;
+import org.swssf.xmlsec.impl.util.IDGenerator;
 
 import java.security.Key;
 import java.security.PublicKey;
 import java.security.cert.X509Certificate;
-import java.util.UUID;
 
 /**
  * @author $Author$
@@ -46,13 +46,13 @@ public class HttpsSecurityToken extends 
     }
 
     public HttpsSecurityToken(X509Certificate x509Certificate, WSSecurityContext wsSecurityContext) throws WSSecurityException {
-        super(wsSecurityContext, null, null, UUID.randomUUID().toString(), null);
+        super(wsSecurityContext, null, null, IDGenerator.generateID(null), null);
         this.x509Certificate = x509Certificate;
         this.authenticationType = AuthenticationType.httpsClientAuthentication;
     }
 
     public HttpsSecurityToken(boolean basicAuthentication, String username, WSSecurityContext wsSecurityContext) throws WSSecurityException {
-        super(wsSecurityContext, null, null, UUID.randomUUID().toString(), null);
+        super(wsSecurityContext, null, null, IDGenerator.generateID(null), null);
         if (basicAuthentication) {
             this.authenticationType = AuthenticationType.httpBasicAuthentication;
         } else {

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/AbstractTestBase.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/AbstractTestBase.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/AbstractTestBase.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/AbstractTestBase.java Thu Apr 12 16:36:28 2012
@@ -21,11 +21,14 @@ package org.swssf.wss.test;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.ws.security.WSConstants;
+import org.apache.ws.security.WSSConfig;
 import org.apache.ws.security.WSSecurityEngineResult;
+import org.apache.ws.security.WsuIdAllocator;
 import org.apache.ws.security.handler.RequestData;
 import org.apache.ws.security.handler.WSHandler;
 import org.apache.ws.security.handler.WSHandlerConstants;
 import org.apache.ws.security.handler.WSHandlerResult;
+import org.apache.ws.security.util.UUIDGenerator;
 import org.apache.ws.security.util.WSSecurityUtil;
 import org.swssf.wss.WSSec;
 import org.swssf.wss.ext.*;
@@ -53,6 +56,7 @@ import javax.xml.xpath.XPathExpressionEx
 import javax.xml.xpath.XPathFactory;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
+import java.lang.reflect.Field;
 import java.security.Security;
 import java.util.*;
 import java.util.logging.Level;
@@ -81,6 +85,17 @@ public abstract class AbstractTestBase {
         Security.addProvider(new org.apache.jcp.xml.dsig.internal.dom.XMLDSigRI());
     }
 
+    //we have to set a custom baseUUID until WSS4J-DOM is fixed. WSS4J generates invalid id's. (wsu:id's must start with a letter)
+    static {
+        try {
+            Field field = UUIDGenerator.class.getDeclaredField("baseUUID");
+            field.setAccessible(true);
+            field.set(null, "G" + UUID.randomUUID().toString());
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+    }
+
     public AbstractTestBase() {
         documentBuilderFactory = DocumentBuilderFactory.newInstance();
         documentBuilderFactory.setNamespaceAware(true);
@@ -177,6 +192,24 @@ public abstract class AbstractTestBase {
         requestData.setMsgContext(messageContext);
         requestData.setNoSerialization(true);
         requestData.setCallbackHandler(new WSS4JCallbackHandlerImpl());
+        //we have to set a custom IDAllocator until WSS4J-DOM is fixed. WSS4J generates invalid id's. (wsu:id's must start with a letter)
+        requestData.setWssConfig(WSSConfig.getNewInstance());
+        requestData.getWssConfig().setIdAllocator(new WsuIdAllocator() {
+            @Override
+            public String createId(String prefix, Object o) {
+                return createSecureId(prefix, o);
+            }
+
+            @Override
+            public String createSecureId(String prefix, Object o) {
+                String id = UUID.randomUUID().toString();
+                if (prefix != null) {
+                    return prefix + id;
+                } else {
+                    return "G" + id;
+                }
+            }
+        });
 
         wss4JHandler.doSender(messageContext, requestData, true);
 

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/InteroperabilityTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/InteroperabilityTest.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/InteroperabilityTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/InteroperabilityTest.java Thu Apr 12 16:36:28 2012
@@ -64,6 +64,8 @@ public class InteroperabilityTest extend
         securityProperties.setCallbackHandler(new CallbackHandlerImpl());
         securityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
         securityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
+        //we have to disable the schema validation until WSS4J-DOM is fixed. WSS4J generates an empty PrefixList which is not schema valid!
+        securityProperties.setDisableSchemaValidation(true);
 
         SecurityEvent.Event[] expectedSecurityEvents = new SecurityEvent.Event[]{
                 SecurityEvent.Event.X509Token,
@@ -119,6 +121,8 @@ public class InteroperabilityTest extend
         securityProperties.setCallbackHandler(new CallbackHandlerImpl());
         securityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
         securityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
+        //we have to disable the schema validation until WSS4J-DOM is fixed. WSS4J generates an empty PrefixList which is not schema valid!
+        securityProperties.setDisableSchemaValidation(true);
 
         SecurityEvent.Event[] expectedSecurityEvents = new SecurityEvent.Event[]{
                 SecurityEvent.Event.X509Token,
@@ -175,6 +179,8 @@ public class InteroperabilityTest extend
         securityProperties.setCallbackHandler(new CallbackHandlerImpl());
         securityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
         securityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
+        //we have to disable the schema validation until WSS4J-DOM is fixed. WSS4J generates an empty PrefixList which is not schema valid!
+        securityProperties.setDisableSchemaValidation(true);
 
         SecurityEvent.Event[] expectedSecurityEvents = new SecurityEvent.Event[]{
                 SecurityEvent.Event.X509Token,
@@ -269,6 +275,8 @@ public class InteroperabilityTest extend
         securityProperties.setCallbackHandler(new CallbackHandlerImpl());
         securityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
         securityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
+        //we have to disable the schema validation until WSS4J-DOM is fixed. WSS4J generates an empty PrefixList which is not schema valid!
+        securityProperties.setDisableSchemaValidation(true);
 
         SecurityEvent.Event[] expectedSecurityEvents = new SecurityEvent.Event[]{
                 SecurityEvent.Event.X509Token,
@@ -389,6 +397,8 @@ public class InteroperabilityTest extend
         securityProperties.setCallbackHandler(new CallbackHandlerImpl());
         securityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
         securityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
+        //we have to disable the schema validation until WSS4J-DOM is fixed. WSS4J generates an empty PrefixList which is not schema valid!
+        securityProperties.setDisableSchemaValidation(true);
 
         SecurityEvent.Event[] expectedSecurityEvents = new SecurityEvent.Event[]{
                 SecurityEvent.Event.X509Token,
@@ -454,6 +464,8 @@ public class InteroperabilityTest extend
             securityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
             securityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
             securityProperties.setCallbackHandler(new org.swssf.wss.test.CallbackHandlerImpl());
+            //we have to disable the schema validation until WSS4J-DOM is fixed. WSS4J generates an empty PrefixList which is not schema valid!
+            securityProperties.setDisableSchemaValidation(true);
             InboundWSSec wsSecIn = WSSec.getInboundWSSec(securityProperties);
 
             SecurityEventListener securityEventListener = new SecurityEventListener() {
@@ -500,7 +512,7 @@ public class InteroperabilityTest extend
             Assert.assertEquals(nodeList.getLength(), 1);
             String idAttrValue = ((Element) nodeList.item(0)).getAttributeNS(WSSConstants.ATT_wsu_Id.getNamespaceURI(), WSSConstants.ATT_wsu_Id.getLocalPart());
             Assert.assertNotNull(idAttrValue);
-            Assert.assertTrue(idAttrValue.startsWith("id-"), "wsu:id Attribute doesn't start with id");
+            Assert.assertTrue(idAttrValue.length() > 0);
         }
 
         //verify SigConf response:
@@ -728,6 +740,8 @@ public class InteroperabilityTest extend
         securityProperties.setActor("test");
         securityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
         securityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
+        //we have to disable the schema validation until WSS4J-DOM is fixed. WSS4J generates an empty PrefixList which is not schema valid!
+        securityProperties.setDisableSchemaValidation(true);
 
         SecurityEvent.Event[] expectedSecurityEvents = new SecurityEvent.Event[]{
                 SecurityEvent.Event.X509Token,
@@ -824,6 +838,8 @@ public class InteroperabilityTest extend
         securityProperties.setActor("test");
         securityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
         securityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
+        //we have to disable the schema validation until WSS4J-DOM is fixed. WSS4J generates an empty PrefixList which is not schema valid!
+        securityProperties.setDisableSchemaValidation(true);
 
         SecurityEvent.Event[] expectedSecurityEvents = new SecurityEvent.Event[]{
                 SecurityEvent.Event.X509Token,
@@ -886,6 +902,8 @@ public class InteroperabilityTest extend
         securityProperties.setActor("test");
         securityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
         securityProperties.loadDecryptionKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
+        //we have to disable the schema validation until WSS4J-DOM is fixed. WSS4J generates an empty PrefixList which is not schema valid!
+        securityProperties.setDisableSchemaValidation(true);
 
         Document document = doInboundSecurity(securityProperties, xmlInputFactory.createXMLStreamReader(new ByteArrayInputStream(baos.toByteArray())));
 

Modified: webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/SignatureConfirmationTest.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/SignatureConfirmationTest.java?rev=1325366&r1=1325365&r2=1325366&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/SignatureConfirmationTest.java (original)
+++ webservices/wss4j/branches/swssf/streaming-ws-security/src/test/java/org/swssf/wss/test/SignatureConfirmationTest.java Thu Apr 12 16:36:28 2012
@@ -79,6 +79,8 @@ public class SignatureConfirmationTest e
         {
             WSSSecurityProperties securityProperties = new WSSSecurityProperties();
             securityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("receiver.jks"), "default".toCharArray());
+            //we have to disable the schema validation until WSS4J-DOM is fixed. WSS4J generates an empty PrefixList which is not schema valid!
+            securityProperties.setDisableSchemaValidation(true);
             InboundWSSec wsSecIn = WSSec.getInboundWSSec(securityProperties);
 
             SecurityEventListener securityEventListener = new SecurityEventListener() {
@@ -124,13 +126,13 @@ public class SignatureConfirmationTest e
             Assert.assertEquals(nodeList.getLength(), 1);
             Assert.assertNotSame(((Element) nodeList.item(0)).getAttribute(WSSConstants.ATT_NULL_Value.getLocalPart()), "");
             Assert.assertNotNull(((Element) nodeList.item(0)).getAttribute(WSSConstants.ATT_wsu_Id.getLocalPart()), "");
-            Assert.assertTrue(((Element) nodeList.item(0)).getAttributeNS(WSSConstants.ATT_wsu_Id.getNamespaceURI(), WSSConstants.ATT_wsu_Id.getLocalPart()).startsWith("SigConf-"));
+            Assert.assertTrue(((Element) nodeList.item(0)).getAttributeNS(WSSConstants.ATT_wsu_Id.getNamespaceURI(), WSSConstants.ATT_wsu_Id.getLocalPart()).length() > 0);
 
             nodeList = document.getElementsByTagNameNS(WSSConstants.NS_SOAP11, WSSConstants.TAG_soap_Body_LocalName);
             Assert.assertEquals(nodeList.getLength(), 1);
             String idAttrValue = ((Element) nodeList.item(0)).getAttributeNS(WSSConstants.ATT_wsu_Id.getNamespaceURI(), WSSConstants.ATT_wsu_Id.getLocalPart());
             Assert.assertNotNull(idAttrValue);
-            Assert.assertTrue(idAttrValue.startsWith("id-"), "wsu:id Attribute doesn't start with id");
+            Assert.assertTrue(idAttrValue.length() > 0);
         }
 
         //verify SigConf response:
@@ -209,7 +211,7 @@ public class SignatureConfirmationTest e
             Assert.assertEquals(nodeList.getLength(), 1);
             String idAttrValue = ((Element) nodeList.item(0)).getAttributeNS(WSSConstants.ATT_wsu_Id.getNamespaceURI(), WSSConstants.ATT_wsu_Id.getLocalPart());
             Assert.assertNotNull(idAttrValue);
-            Assert.assertTrue(idAttrValue.startsWith("id-"), "wsu:id Attribute doesn't start with id");
+            Assert.assertTrue(idAttrValue.length() > 0);
 
             javax.xml.transform.Transformer transformer = TRANSFORMER_FACTORY.newTransformer();
             transformer.transform(new DOMSource(securedDocument), new StreamResult(baos));
@@ -220,6 +222,8 @@ public class SignatureConfirmationTest e
             WSSSecurityProperties securityProperties = new WSSSecurityProperties();
             securityProperties.setEnableSignatureConfirmationVerification(true);
             securityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
+            //we have to disable the schema validation until WSS4J-DOM is fixed. WSS4J generates an empty PrefixList which is not schema valid!
+            securityProperties.setDisableSchemaValidation(true);
             InboundWSSec wsSecIn = WSSec.getInboundWSSec(securityProperties);
 
             XMLStreamReader xmlStreamReader = wsSecIn.processInMessage(
@@ -296,7 +300,7 @@ public class SignatureConfirmationTest e
             Assert.assertEquals(nodeList.getLength(), 1);
             String idAttrValue = ((Element) nodeList.item(0)).getAttributeNS(WSSConstants.ATT_wsu_Id.getNamespaceURI(), WSSConstants.ATT_wsu_Id.getLocalPart());
             Assert.assertNotNull(idAttrValue);
-            Assert.assertTrue(idAttrValue.startsWith("id-"), "wsu:id Attribute doesn't start with id");
+            Assert.assertTrue(idAttrValue.length() > 0);
 
             javax.xml.transform.Transformer transformer = TRANSFORMER_FACTORY.newTransformer();
             transformer.transform(new DOMSource(securedDocument), new StreamResult(baos));
@@ -307,6 +311,8 @@ public class SignatureConfirmationTest e
             WSSSecurityProperties securityProperties = new WSSSecurityProperties();
             securityProperties.setEnableSignatureConfirmationVerification(true);
             securityProperties.loadSignatureVerificationKeystore(this.getClass().getClassLoader().getResource("transmitter.jks"), "default".toCharArray());
+            //we have to disable the schema validation until WSS4J-DOM is fixed. WSS4J generates an empty PrefixList which is not schema valid!
+            securityProperties.setDisableSchemaValidation(true);
             InboundWSSec wsSecIn = WSSec.getInboundWSSec(securityProperties);
 
             XMLStreamReader xmlStreamReader = wsSecIn.processInMessage(xmlInputFactory.createXMLStreamReader(new ByteArrayInputStream(baos.toByteArray())), securityEventList, null);



Mime
View raw message