You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by gi...@apache.org on 2011/10/11 20:03:15 UTC

svn commit: r1181995 [20/26] - in /webservices/wss4j/branches/swssf: ./ cxf-integration/ cxf-integration/src/main/java/org/swssf/cxfIntegration/ cxf-integration/src/main/java/org/swssf/cxfIntegration/interceptor/ cxf-integration/src/main/java/org/swssf...

Copied: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/ComparableAttribute.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/ComparableAttribute.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/ComparableAttribute.java?p2=webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/ComparableAttribute.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/ComparableAttribute.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/ComparableAttribute.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/ComparableAttribute.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.swssf.ext;
+package org.swssf.xmlsec.ext;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.Location;

Copied: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/ComparableNamespace.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/ComparableNamespace.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/ComparableNamespace.java?p2=webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/ComparableNamespace.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/ComparableNamespace.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/ComparableNamespace.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/ComparableNamespace.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.swssf.ext;
+package org.swssf.xmlsec.ext;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.Location;

Copied: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/DocumentContext.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/DocumentContext.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/DocumentContext.java?p2=webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/DocumentContext.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/DocumentContext.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/DocumentContext.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/DocumentContext.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.swssf.ext;
+package org.swssf.xmlsec.ext;
 
 import javax.xml.namespace.QName;
 import java.util.List;
@@ -35,11 +35,6 @@ public interface DocumentContext {
     public String getEncoding();
 
     /**
-     * @return The SOAP Version used
-     */
-    public String getSOAPMessageVersionNamespace();
-
-    /**
      * Adds a Element to the path
      *
      * @param qName The QName of the path element
@@ -67,39 +62,11 @@ public interface DocumentContext {
     public QName getParentElement(int eventType);
 
     /**
-     * Indicates if we are currently processing the soap header
-     *
-     * @return true if we stay in the soap header, false otherwise
-     */
-    public boolean isInSOAPHeader();
-
-    /**
-     * Indicates if we are currently processing the soap body
-     *
-     * @return true if we stay in the soap body, false otherwise
-     */
-    public boolean isInSOAPBody();
-
-    /**
      * @return The current level in the document
      */
     public int getDocumentLevel();
 
     /**
-     * Indicates if we are currently processing the security header
-     *
-     * @return true if we stay in the security header, false otherwise
-     */
-    public boolean isInSecurityHeader();
-
-    /**
-     * Specifies that we are now in the security header
-     *
-     * @param inSecurityHeader set to true when we entering the security header, false otherwise
-     */
-    public void setInSecurityHeader(boolean inSecurityHeader);
-
-    /**
      * Indicates if we currently stay in an encrypted content
      */
     public void setIsInEncryptedContent();

Copied: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/InputProcessor.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/InputProcessor.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/InputProcessor.java?p2=webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/InputProcessor.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/InputProcessor.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/InputProcessor.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/InputProcessor.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.swssf.ext;
+package org.swssf.xmlsec.ext;
 
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.events.XMLEvent;
@@ -49,34 +49,34 @@ public interface InputProcessor {
      *
      * @return The Phase
      */
-    Constants.Phase getPhase();
+    XMLSecurityConstants.Phase getPhase();
 
     /**
      * Will be called from the framework when the next security-header XMLEvent is requested
      *
      * @param inputProcessorChain
      * @return The next XMLEvent
-     * @throws XMLStreamException  thrown when a streaming error occurs
-     * @throws WSSecurityException thrown when a Security failure occurs
+     * @throws XMLStreamException   thrown when a streaming error occurs
+     * @throws XMLSecurityException thrown when a Security failure occurs
      */
-    XMLEvent processNextHeaderEvent(InputProcessorChain inputProcessorChain) throws XMLStreamException, WSSecurityException;
+    XMLEvent processNextHeaderEvent(InputProcessorChain inputProcessorChain) throws XMLStreamException, XMLSecurityException;
 
     /**
      * Will be called from the framework when the next XMLEvent is requested
      *
      * @param inputProcessorChain
      * @return The next XMLEvent
-     * @throws XMLStreamException  thrown when a streaming error occurs
-     * @throws WSSecurityException thrown when a Security failure occurs
+     * @throws XMLStreamException   thrown when a streaming error occurs
+     * @throws XMLSecurityException thrown when a Security failure occurs
      */
-    XMLEvent processNextEvent(InputProcessorChain inputProcessorChain) throws XMLStreamException, WSSecurityException;
+    XMLEvent processNextEvent(InputProcessorChain inputProcessorChain) throws XMLStreamException, XMLSecurityException;
 
     /**
      * Will be called when the whole document is processed.
      *
      * @param inputProcessorChain
-     * @throws XMLStreamException  thrown when a streaming error occurs
-     * @throws WSSecurityException thrown when a Security failure occurs
+     * @throws XMLStreamException   thrown when a streaming error occurs
+     * @throws XMLSecurityException thrown when a Security failure occurs
      */
-    void doFinal(InputProcessorChain inputProcessorChain) throws XMLStreamException, WSSecurityException;
+    void doFinal(InputProcessorChain inputProcessorChain) throws XMLStreamException, XMLSecurityException;
 }

Copied: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/InputProcessorChain.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/InputProcessorChain.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/InputProcessorChain.java?p2=webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/InputProcessorChain.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/InputProcessorChain.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/InputProcessorChain.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/InputProcessorChain.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.swssf.ext;
+package org.swssf.xmlsec.ext;
 
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.events.XMLEvent;
@@ -73,26 +73,26 @@ public interface InputProcessorChain ext
      *
      * @param inputProcessor The InputProcessor position the XMLEvents should be processed over this SubChain.
      * @return A new InputProcessorChain
-     * @throws XMLStreamException  thrown when a streaming error occurs
-     * @throws WSSecurityException thrown when a Security failure occurs
+     * @throws XMLStreamException   thrown when a streaming error occurs
+     * @throws XMLSecurityException thrown when a Security failure occurs
      */
-    public InputProcessorChain createSubChain(InputProcessor inputProcessor) throws XMLStreamException, WSSecurityException;
+    public InputProcessorChain createSubChain(InputProcessor inputProcessor) throws XMLStreamException, XMLSecurityException;
 
     /**
      * Requests the next security header XMLEvent from the next processor in the chain.
      *
      * @return The next XMLEvent from the previous processor
-     * @throws XMLStreamException  thrown when a streaming error occurs
-     * @throws WSSecurityException thrown when a Security failure occurs
+     * @throws XMLStreamException   thrown when a streaming error occurs
+     * @throws XMLSecurityException thrown when a Security failure occurs
      */
-    public XMLEvent processHeaderEvent() throws XMLStreamException, WSSecurityException;
+    public XMLEvent processHeaderEvent() throws XMLStreamException, XMLSecurityException;
 
     /**
      * Requests the next XMLEvent from the next processor in the chain.
      *
      * @return The next XMLEvent from the previous processor
-     * @throws XMLStreamException  thrown when a streaming error occurs
-     * @throws WSSecurityException thrown when a Security failure occurs
+     * @throws XMLStreamException   thrown when a streaming error occurs
+     * @throws XMLSecurityException thrown when a Security failure occurs
      */
-    public XMLEvent processEvent() throws XMLStreamException, WSSecurityException;
+    public XMLEvent processEvent() throws XMLStreamException, XMLSecurityException;
 }

Copied: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/OutputProcessor.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/OutputProcessor.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/OutputProcessor.java?p2=webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/OutputProcessor.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/OutputProcessor.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/OutputProcessor.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/OutputProcessor.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.swssf.ext;
+package org.swssf.xmlsec.ext;
 
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.events.XMLEvent;
@@ -49,24 +49,24 @@ public interface OutputProcessor {
      *
      * @return The Phase
      */
-    Constants.Phase getPhase();
+    XMLSecurityConstants.Phase getPhase();
 
     /**
      * Will be called from the framework for every XMLEvent
      *
      * @param xmlEvent             The next XMLEvent to process
      * @param outputProcessorChain
-     * @throws XMLStreamException  thrown when a streaming error occurs
-     * @throws WSSecurityException thrown when a Security failure occurs
+     * @throws XMLStreamException   thrown when a streaming error occurs
+     * @throws XMLSecurityException thrown when a Security failure occurs
      */
-    void processNextEvent(XMLEvent xmlEvent, OutputProcessorChain outputProcessorChain) throws XMLStreamException, WSSecurityException;
+    void processNextEvent(XMLEvent xmlEvent, OutputProcessorChain outputProcessorChain) throws XMLStreamException, XMLSecurityException;
 
     /**
      * Will be called when the whole document is processed.
      *
      * @param outputProcessorChain
-     * @throws XMLStreamException  thrown when a streaming error occurs
-     * @throws WSSecurityException thrown when a Security failure occurs
+     * @throws XMLStreamException   thrown when a streaming error occurs
+     * @throws XMLSecurityException thrown when a Security failure occurs
      */
-    void doFinal(OutputProcessorChain outputProcessorChain) throws XMLStreamException, WSSecurityException;
+    void doFinal(OutputProcessorChain outputProcessorChain) throws XMLStreamException, XMLSecurityException;
 }

Copied: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/OutputProcessorChain.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/OutputProcessorChain.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/OutputProcessorChain.java?p2=webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/OutputProcessorChain.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/OutputProcessorChain.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/OutputProcessorChain.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/OutputProcessorChain.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.swssf.ext;
+package org.swssf.xmlsec.ext;
 
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.events.XMLEvent;
@@ -73,17 +73,17 @@ public interface OutputProcessorChain ex
      *
      * @param outputProcessor The OutputProcessor position the XMLEvents should be processed over this SubChain.
      * @return A new OutputProcessorChain
-     * @throws XMLStreamException  thrown when a streaming error occurs
-     * @throws WSSecurityException thrown when a Security failure occurs
+     * @throws XMLStreamException   thrown when a streaming error occurs
+     * @throws XMLSecurityException thrown when a Security failure occurs
      */
-    public OutputProcessorChain createSubChain(OutputProcessor outputProcessor) throws XMLStreamException, WSSecurityException;
+    public OutputProcessorChain createSubChain(OutputProcessor outputProcessor) throws XMLStreamException, XMLSecurityException;
 
     /**
      * Forwards the XMLEvent to the next processor in the chain.
      *
      * @param xmlEvent The XMLEvent which should be forwarded to the next processor
-     * @throws XMLStreamException  thrown when a streaming error occurs
-     * @throws WSSecurityException thrown when a Security failure occurs
+     * @throws XMLStreamException   thrown when a streaming error occurs
+     * @throws XMLSecurityException thrown when a Security failure occurs
      */
-    public void processEvent(XMLEvent xmlEvent) throws XMLStreamException, WSSecurityException;
+    public void processEvent(XMLEvent xmlEvent) throws XMLStreamException, XMLSecurityException;
 }
\ No newline at end of file

Copied: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/ParseException.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/ParseException.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/ParseException.java?p2=webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/ParseException.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/ParseException.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/ParseException.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/ParseException.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.swssf.ext;
+package org.swssf.xmlsec.ext;
 
 /**
  * Exception for the self made XML parsing.

Copied: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/Parseable.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/Parseable.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/Parseable.java?p2=webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/Parseable.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/Parseable.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/Parseable.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/Parseable.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.swssf.ext;
+package org.swssf.xmlsec.ext;
 
 import javax.xml.stream.events.XMLEvent;
 

Copied: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/ProcessorChain.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/ProcessorChain.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/ProcessorChain.java?p2=webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/ProcessorChain.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/ProcessorChain.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/ProcessorChain.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/ProcessorChain.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.swssf.ext;
+package org.swssf.xmlsec.ext;
 
 import javax.xml.stream.XMLStreamException;
 
@@ -36,8 +36,8 @@ public interface ProcessorChain {
     /**
      * Will finally be called when the whole document is processed
      *
-     * @throws XMLStreamException  thrown when a streaming error occurs
-     * @throws WSSecurityException thrown when a Security failure occurs
+     * @throws XMLStreamException   thrown when a streaming error occurs
+     * @throws XMLSecurityException thrown when a Security failure occurs
      */
-    public void doFinal() throws XMLStreamException, WSSecurityException;
+    public void doFinal() throws XMLStreamException, XMLSecurityException;
 }

Copied: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/SecurePart.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/SecurePart.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/SecurePart.java?p2=webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/SecurePart.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/SecurePart.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/SecurePart.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/SecurePart.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.swssf.ext;
+package org.swssf.xmlsec.ext;
 
 import java.util.EnumSet;
 import java.util.HashMap;

Copied: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/SecurityContext.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/SecurityContext.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/SecurityContext.java?p2=webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/SecurityContext.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/SecurityContext.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/SecurityContext.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/SecurityContext.java Tue Oct 11 18:03:00 2011
@@ -16,10 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.swssf.ext;
-
-import org.swssf.securityEvent.SecurityEvent;
-import org.swssf.securityEvent.SecurityEventListener;
+package org.swssf.xmlsec.ext;
 
 import java.util.List;
 
@@ -59,18 +56,4 @@ public interface SecurityContext {
      */
     public SecurityTokenProvider getSecurityTokenProvider(String id);
 
-    /**
-     * Registers a SecurityEventListener to receive Security-Events
-     *
-     * @param securityEventListener The SecurityEventListener
-     */
-    public void setSecurityEventListener(SecurityEventListener securityEventListener);
-
-    /**
-     * Registers a SecurityEvent which will be forwarded to the registered SecurityEventListener
-     *
-     * @param securityEvent The security event for the SecurityEventListener
-     * @throws WSSecurityException when the event will not be accepted (e.g. policy-violation)
-     */
-    public void registerSecurityEvent(SecurityEvent securityEvent) throws WSSecurityException;
 }

Copied: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/SecurityToken.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/SecurityToken.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/SecurityToken.java?p2=webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/SecurityToken.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/SecurityToken.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/SecurityToken.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/SecurityToken.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.swssf.ext;
+package org.swssf.xmlsec.ext;
 
 import java.security.Key;
 import java.security.PublicKey;
@@ -59,32 +59,32 @@ public interface SecurityToken {
      *
      * @param algorithmURI for the requested key
      * @return The requested key for the specified algorithmURI, or null if no matching key is found
-     * @throws WSSecurityException if the key can't be loaded
+     * @throws XMLSecurityException if the key can't be loaded
      */
-    public Key getSecretKey(String algorithmURI, Constants.KeyUsage keyUsage) throws WSSecurityException;
+    public Key getSecretKey(String algorithmURI, XMLSecurityConstants.KeyUsage keyUsage) throws XMLSecurityException;
 
     /**
      * Returns the public key if one exist for this token type
      *
      * @return The Public-Key for asymmetric algorithms
-     * @throws WSSecurityException if the key can't be loaded
+     * @throws XMLSecurityException if the key can't be loaded
      */
-    public PublicKey getPublicKey(Constants.KeyUsage keyUsage) throws WSSecurityException;
+    public PublicKey getPublicKey(XMLSecurityConstants.KeyUsage keyUsage) throws XMLSecurityException;
 
     /**
      * Returns the certificate chain if one exists for this token type
      *
      * @return The certificate chain
-     * @throws WSSecurityException if the certificates can't be retrieved
+     * @throws XMLSecurityException if the certificates can't be retrieved
      */
-    public X509Certificate[] getX509Certificates() throws WSSecurityException;
+    public X509Certificate[] getX509Certificates() throws XMLSecurityException;
 
     /**
      * Verifies the key if applicable
      *
-     * @throws WSSecurityException if the key couldn't be verified or the key isn't valid
+     * @throws XMLSecurityException if the key couldn't be verified or the key isn't valid
      */
-    public void verify() throws WSSecurityException;
+    public void verify() throws XMLSecurityException;
 
     /**
      * Returns the key wrapping token
@@ -105,5 +105,5 @@ public interface SecurityToken {
      *
      * @return the KeyIdentifierType
      */
-    public Constants.TokenType getTokenType();
+    public XMLSecurityConstants.TokenType getTokenType();
 }

Copied: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/SecurityTokenProvider.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/SecurityTokenProvider.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/SecurityTokenProvider.java?p2=webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/SecurityTokenProvider.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/SecurityTokenProvider.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/SecurityTokenProvider.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/SecurityTokenProvider.java Tue Oct 11 18:03:00 2011
@@ -16,9 +16,9 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.swssf.ext;
+package org.swssf.xmlsec.ext;
 
-import org.swssf.crypto.Crypto;
+import org.swssf.xmlsec.crypto.Crypto;
 
 /**
  * A SecurityTokenProvider is a object which provides a Token for cryptographic operations
@@ -33,9 +33,9 @@ public interface SecurityTokenProvider {
      *
      * @param crypto The Crypto to use to restore the Token
      * @return The SecurityToken
-     * @throws WSSecurityException if the token couldn't be loaded
+     * @throws XMLSecurityException if the token couldn't be loaded
      */
-    public SecurityToken getSecurityToken(Crypto crypto) throws WSSecurityException;
+    public SecurityToken getSecurityToken(Crypto crypto) throws XMLSecurityException;
 
     public String getId();
 }

Copied: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/Transformer.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/Transformer.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/Transformer.java?p2=webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/Transformer.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/Transformer.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/Transformer.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/Transformer.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.swssf.ext;
+package org.swssf.xmlsec.ext;
 
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.events.XMLEvent;

Copied: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/UncheckedXMLSecurityException.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/UncheckedWSSecurityException.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/UncheckedXMLSecurityException.java?p2=webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/UncheckedXMLSecurityException.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/UncheckedWSSecurityException.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/UncheckedWSSecurityException.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/UncheckedXMLSecurityException.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.swssf.ext;
+package org.swssf.xmlsec.ext;
 
 /**
  * Unchecked Exception to mark uncaught-exceptions in threads
@@ -24,17 +24,17 @@ package org.swssf.ext;
  * @author $Author$
  * @version $Revision$ $Date$
  */
-public class UncheckedWSSecurityException extends RuntimeException {
+public class UncheckedXMLSecurityException extends RuntimeException {
 
-    public UncheckedWSSecurityException(String message) {
+    public UncheckedXMLSecurityException(String message) {
         super(message);
     }
 
-    public UncheckedWSSecurityException(String message, Throwable cause) {
+    public UncheckedXMLSecurityException(String message, Throwable cause) {
         super(message, cause);
     }
 
-    public UncheckedWSSecurityException(Throwable cause) {
+    public UncheckedXMLSecurityException(Throwable cause) {
         super(cause);
     }
 }

Copied: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLEventNS.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/XMLEventNS.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLEventNS.java?p2=webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLEventNS.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/XMLEventNS.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/XMLEventNS.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLEventNS.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.swssf.ext;
+package org.swssf.xmlsec.ext;
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.Location;

Copied: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityConfigurationException.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/WSSConfigurationException.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityConfigurationException.java?p2=webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityConfigurationException.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/WSSConfigurationException.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/WSSConfigurationException.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityConfigurationException.java Tue Oct 11 18:03:00 2011
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.swssf.ext;
+package org.swssf.xmlsec.ext;
 
 /**
  * Exception when configuration errors are detected
@@ -24,33 +24,33 @@ package org.swssf.ext;
  * @author $Author$
  * @version $Revision$ $Date$
  */
-public class WSSConfigurationException extends WSSecurityException {
+public class XMLSecurityConfigurationException extends XMLSecurityException {
 
-    public WSSConfigurationException(ErrorCode errorCode, String msgId, Object[] args, Throwable exception) {
+    public XMLSecurityConfigurationException(ErrorCode errorCode, String msgId, Object[] args, Throwable exception) {
         super(errorCode, msgId, exception, args);
     }
 
-    public WSSConfigurationException(ErrorCode errorCode, String msgId, Throwable exception) {
+    public XMLSecurityConfigurationException(ErrorCode errorCode, String msgId, Throwable exception) {
         super(errorCode, msgId, exception);
     }
 
-    public WSSConfigurationException(ErrorCode errorCode, String msgId, Object[] args) {
+    public XMLSecurityConfigurationException(ErrorCode errorCode, String msgId, Object[] args) {
         super(errorCode, msgId, args);
     }
 
-    public WSSConfigurationException(ErrorCode errorCode, String msgId) {
+    public XMLSecurityConfigurationException(ErrorCode errorCode, String msgId) {
         super(errorCode, msgId);
     }
 
-    public WSSConfigurationException(ErrorCode errorCode) {
+    public XMLSecurityConfigurationException(ErrorCode errorCode) {
         super(errorCode);
     }
 
-    public WSSConfigurationException(String errorMessage) {
+    public XMLSecurityConfigurationException(String errorMessage) {
         super(errorMessage);
     }
 
-    public WSSConfigurationException(String errorMessage, Throwable t) {
+    public XMLSecurityConfigurationException(String errorMessage, Throwable t) {
         super(errorMessage, t);
     }
 }

Copied: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityConstants.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/Constants.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityConstants.java?p2=webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityConstants.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/Constants.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/Constants.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityConstants.java Tue Oct 11 18:03:00 2011
@@ -16,24 +16,21 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.swssf.ext;
+package org.swssf.xmlsec.ext;
 
 import javax.xml.namespace.QName;
 import java.security.NoSuchAlgorithmException;
 import java.security.SecureRandom;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.Map;
 
 /**
- * Constants for global use
+ * XMLSecurityConstants for global use
  *
  * @author $Author$
  * @version $Revision$ $Date$
  */
-public class Constants {
+public class XMLSecurityConstants {
 
-    private Constants() {
+    protected XMLSecurityConstants() {
     }
 
     public static final SecureRandom secureRandom;
@@ -54,41 +51,11 @@ public class Constants {
     }
 
     public static final String XMLINPUTFACTORY = "XMLInputFactory";
-    public static final String TIMESTAMP_PROCESSED = "TimestampProcessed";
 
     public static final String NS_XML = "http://www.w3.org/2000/xmlns/";
     public static final String NS_XMLENC = "http://www.w3.org/2001/04/xmlenc#";
     public static final String NS_DSIG = "http://www.w3.org/2000/09/xmldsig#";
-    public static final String NS_WSSE10 = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
     public static final String NS_WSSE11 = "http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd";
-    public static final String NS_WSU10 = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
-    public static final String NS_SOAP11 = "http://schemas.xmlsoap.org/soap/envelope/";
-    public static final String NS_SOAP12 = "http://www.w3.org/2003/05/soap-envelope";
-
-    public static final String NS_WST = "http://schemas.xmlsoap.org/ws/2005/02/trust";
-    public static final String NS_WSC_SCT = "http://schemas.xmlsoap.org/ws/2005/02/sc/sct";
-
-    public static final String NS_SAML = "urn:oasis:names:tc:SAML:1.0:assertion";
-    public static final String NS_SAML2 = "urn:oasis:names:tc:SAML:2.0:assertion";
-
-    public static final String PREFIX_SOAPENV = "env";
-    public static final String TAG_soap_Envelope_LocalName = "Envelope";
-    public static final String TAG_soap_Header_LocalName = "Header";
-    public static final String TAG_soap_Body_LocalName = "Body";
-
-    public static final QName TAG_soap11_Envelope = new QName(NS_SOAP11, TAG_soap_Envelope_LocalName, PREFIX_SOAPENV);
-    public static final QName TAG_soap11_Header = new QName(NS_SOAP11, TAG_soap_Header_LocalName, PREFIX_SOAPENV);
-    public static final QName TAG_soap11_Body = new QName(NS_SOAP11, TAG_soap_Body_LocalName, PREFIX_SOAPENV);
-    public static final QName ATT_soap11_Actor = new QName(NS_SOAP11, "actor", PREFIX_SOAPENV);
-
-    public static final QName TAG_soap12_Envelope = new QName(NS_SOAP12, TAG_soap_Envelope_LocalName, PREFIX_SOAPENV);
-    public static final QName TAG_soap12_Header = new QName(NS_SOAP12, TAG_soap_Header_LocalName, PREFIX_SOAPENV);
-    public static final QName TAG_soap12_Body = new QName(NS_SOAP12, TAG_soap_Body_LocalName, PREFIX_SOAPENV);
-    public static final QName ATT_soap12_Role = new QName(NS_SOAP12, "role", PREFIX_SOAPENV);
-
-    public static final String PREFIX_WSSE = "wsse";
-    public static final String PREFIX_WSSE11 = "wsse11";
-    public static final QName TAG_wsse_Security = new QName(NS_WSSE10, "Security", PREFIX_WSSE);
 
     public static final String PREFIX_XENC = "xenc";
     public static final QName TAG_xenc_EncryptedKey = new QName(NS_XMLENC, "EncryptedKey", PREFIX_XENC);
@@ -103,294 +70,157 @@ public class Constants {
     public static final String PREFIX_DSIG = "dsig";
     public static final QName TAG_dsig_KeyInfo = new QName(NS_DSIG, "KeyInfo", PREFIX_DSIG);
 
-    public static final QName TAG_wsse_SecurityTokenReference = new QName(NS_WSSE10, "SecurityTokenReference", PREFIX_WSSE);
-    public static final QName TAG_wsse_Reference = new QName(NS_WSSE10, "Reference", PREFIX_WSSE);
-    public static final QName ATT_wsse_Usage = new QName(NS_WSSE10, "Usage", PREFIX_WSSE);
-    public static final QName ATT_wsse11_TokenType = new QName(NS_WSSE11, "TokenType", PREFIX_WSSE11);
-
-    public static final QName TAG_wsse_KeyIdentifier = new QName(NS_WSSE10, "KeyIdentifier", PREFIX_WSSE);
-    public static final QName ATT_NULL_EncodingType = new QName(null, "EncodingType");
-    public static final QName ATT_NULL_ValueType = new QName(null, "ValueType");
-
     public static final QName TAG_xenc_EncryptionProperties = new QName(NS_XMLENC, "EncryptionProperties", PREFIX_XENC);
-
     public static final QName TAG_xenc_CipherData = new QName(NS_XMLENC, "CipherData", PREFIX_XENC);
-
     public static final QName TAG_xenc_CipherValue = new QName(NS_XMLENC, "CipherValue", PREFIX_XENC);
-
     public static final QName TAG_xenc_ReferenceList = new QName(NS_XMLENC, "ReferenceList", PREFIX_XENC);
-
     public static final QName TAG_xenc_DataReference = new QName(NS_XMLENC, "DataReference", PREFIX_XENC);
     public static final QName ATT_NULL_URI = new QName(null, "URI");
 
-    public static final QName TAG_wsse_BinarySecurityToken = new QName(NS_WSSE10, "BinarySecurityToken", PREFIX_WSSE);
-    public static final String PREFIX_WSU = "wsu";
-    public static final QName ATT_wsu_Id = new QName(NS_WSU10, "Id", PREFIX_WSU);
-
     public static final QName TAG_xenc_EncryptedData = new QName(NS_XMLENC, "EncryptedData", PREFIX_XENC);
 
+    public static final String PREFIX_WSSE11 = "wsse11";
     public static final QName TAG_wsse11_EncryptedHeader = new QName(NS_WSSE11, "EncryptedHeader", PREFIX_WSSE11);
 
     public static final QName TAG_dsig_Signature = new QName(NS_DSIG, "Signature", PREFIX_DSIG);
-
     public static final QName TAG_dsig_SignedInfo = new QName(NS_DSIG, "SignedInfo", PREFIX_DSIG);
-
     public static final QName TAG_dsig_CanonicalizationMethod = new QName(NS_DSIG, "CanonicalizationMethod", PREFIX_DSIG);
-
     public static final QName TAG_dsig_SignatureMethod = new QName(NS_DSIG, "SignatureMethod", PREFIX_DSIG);
-
     public static final QName TAG_dsig_Reference = new QName(NS_DSIG, "Reference", PREFIX_DSIG);
-
     public static final QName TAG_dsig_Transforms = new QName(NS_DSIG, "Transforms", PREFIX_DSIG);
-
     public static final QName TAG_dsig_Transform = new QName(NS_DSIG, "Transform", PREFIX_DSIG);
-
-    public static final QName TAG_wsse_TransformationParameters = new QName(NS_WSSE10, "TransformationParameters", PREFIX_WSSE);
-
     public static final QName TAG_dsig_DigestMethod = new QName(NS_DSIG, "DigestMethod", PREFIX_DSIG);
-
     public static final QName TAG_dsig_DigestValue = new QName(NS_DSIG, "DigestValue", PREFIX_DSIG);
-
     public static final QName TAG_dsig_SignatureValue = new QName(NS_DSIG, "SignatureValue", PREFIX_DSIG);
 
-    public static final QName TAG_wsu_Timestamp = new QName(NS_WSU10, "Timestamp", PREFIX_WSU);
-    public static final QName TAG_wsu_Created = new QName(NS_WSU10, "Created", PREFIX_WSU);
-    public static final QName TAG_wsu_Expires = new QName(NS_WSU10, "Expires", PREFIX_WSU);
-
     public static final QName TAG_dsig_X509Data = new QName(NS_DSIG, "X509Data", PREFIX_DSIG);
     public static final QName TAG_dsig_X509IssuerSerial = new QName(NS_DSIG, "X509IssuerSerial", PREFIX_DSIG);
     public static final QName TAG_dsig_X509IssuerName = new QName(NS_DSIG, "X509IssuerName", PREFIX_DSIG);
     public static final QName TAG_dsig_X509SerialNumber = new QName(NS_DSIG, "X509SerialNumber", PREFIX_DSIG);
 
-    public static final String NS10_SOAPMESSAGE_SECURITY = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0";
-    public static final String NS11_SOAPMESSAGE_SECURITY = "http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1";
-
-    public static final String NS_X509TOKEN_PROFILE = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0";
-
-    public static final String NS_X509_V3_TYPE = NS_X509TOKEN_PROFILE + "#X509v3";
-    public static final String NS_X509PKIPathv1 = NS_X509TOKEN_PROFILE + "#X509PKIPathv1";
-    public static final String NS_X509SubjectKeyIdentifier = NS_X509TOKEN_PROFILE + "#X509SubjectKeyIdentifier";
-    public static final String NS_THUMBPRINT = NS11_SOAPMESSAGE_SECURITY + "#ThumbprintSHA1";
-
-    public static final String SOAPMESSAGE_NS10_BASE64_ENCODING = NS10_SOAPMESSAGE_SECURITY + "#Base64Binary";
-
-    public static final QName TAG_wsse_UsernameToken = new QName(NS_WSSE10, "UsernameToken", PREFIX_WSSE);
-    public static final QName TAG_wsse_Username = new QName(NS_WSSE10, "Username", PREFIX_WSSE);
-    public static final QName TAG_wsse_Password = new QName(NS_WSSE10, "Password", PREFIX_WSSE);
-    public static final QName TAG_wsse_Nonce = new QName(NS_WSSE10, "Nonce", PREFIX_WSSE);
-    public static final QName TAG_wsse11_Salt = new QName(NS_WSSE11, "Salt", PREFIX_WSSE11);
-    public static final QName TAG_wsse11_Iteration = new QName(NS_WSSE11, "Iteration", PREFIX_WSSE11);
-
-    public static final String NS_USERNAMETOKEN_PROFILE11 = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0";
-    public static final String NS_PASSWORD_DIGEST = NS_USERNAMETOKEN_PROFILE11 + "#PasswordDigest";
-    public static final String NS_PASSWORD_TEXT = NS_USERNAMETOKEN_PROFILE11 + "#PasswordText";
-    public static final String NS_USERNAMETOKEN_PROFILE_UsernameToken = NS_USERNAMETOKEN_PROFILE11 + "#UsernameToken";
-
-    public static final QName TAG_wsse11_SignatureConfirmation = new QName(NS_WSSE11, "SignatureConfirmation", PREFIX_WSSE11);
-    public static final QName ATT_NULL_Value = new QName(null, "Value");
-
     public static final String NS_C14N_EXCL = "http://www.w3.org/2001/10/xml-exc-c14n#";
     public static final String PREFIX_C14N_EXCL = "c14nEx";
     public static final QName ATT_NULL_PrefixList = new QName(null, "PrefixList");
     public static final QName TAG_c14nExcl_InclusiveNamespaces = new QName(NS_C14N_EXCL, "InclusiveNamespaces", PREFIX_C14N_EXCL);
 
-    public static final QName TAG_wst_BinarySecret = new QName(NS_WST, "BinarySecret");
+    public static final String PROP_USE_THIS_TOKEN_ID_FOR_SIGNATURE = "PROP_USE_THIS_TOKEN_ID_FOR_SIGNATURE";
+    public static final String PROP_USE_THIS_TOKEN_ID_FOR_ENCRYPTION = "PROP_USE_THIS_TOKEN_ID_FOR_ENCRYPTION";
+    public static final String PROP_USE_THIS_TOKEN_ID_FOR_ENCRYPTED_KEY = "PROP_USE_THIS_TOKEN_ID_FOR_ENCRYPTED_KEY";
 
-    public static final String SOAPMESSAGE_NS10_STRTransform = NS10_SOAPMESSAGE_SECURITY + "#STR-Transform";
+    public static final String PROP_APPEND_SIGNATURE_ON_THIS_ID = "PROP_APPEND_SIGNATURE_ON_THIS_ID";
 
-    public static final QName TAG_saml_Assertion = new QName(NS_SAML, "Assertion");
-    public static final QName TAG_saml2_Assertion = new QName(NS_SAML2, "Assertion");
+    public static final Action SIGNATURE = new Action("SIGNATURE");
+    public static final Action ENCRYPT = new Action("ENCRYPT");
 
-    public static final String NS_SAML10_TOKEN_PROFILE = "http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.0";
-    public static final String NS_SAML11_TOKEN_PROFILE = "http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1";
-    public static final String NS_SAML10_TYPE = NS_SAML10_TOKEN_PROFILE + "#SAMLAssertionID";
-    public static final String NS_SAML20_TYPE = NS_SAML11_TOKEN_PROFILE + "#SAMLID";
-    public static final String NS_SAML11_TOKEN_PROFILE_TYPE = NS_SAML11_TOKEN_PROFILE + "#SAMLV1.1";
-    public static final String NS_SAML20_TOKEN_PROFILE_TYPE = NS_SAML11_TOKEN_PROFILE + "#SAMLV2.0";
-
-    public static final QName ATT_NULL_AssertionID = new QName(null, "AssertionID");
-    public static final QName ATT_NULL_ID = new QName(null, "ID");
-
-
-    public static final String NS_WSC_05_02 = "http://schemas.xmlsoap.org/ws/2005/02/sc";
-    public static final String NS_WSC_05_12 = "http://docs.oasis-open.org/ws-sx/ws-secureconversation/200512";
-    public static final String PREFIX_WSC = "wsc";
-
-    public static final QName TAG_wsc0502_SecurityContextToken = new QName(NS_WSC_05_02, "SecurityContextToken", PREFIX_WSC);
-    public static final QName TAG_wsc0512_SecurityContextToken = new QName(NS_WSC_05_12, "SecurityContextToken", PREFIX_WSC);
-    public static final QName TAG_wsc0502_Identifier = new QName(NS_WSC_05_02, "Identifier", PREFIX_WSC);
-    public static final QName TAG_wsc0512_Identifier = new QName(NS_WSC_05_12, "Identifier", PREFIX_WSC);
-
-    public static final QName TAG_wsc0502_DerivedKeyToken = new QName(NS_WSC_05_02, "DerivedKeyToken", PREFIX_WSC);
-    public static final QName TAG_wsc0512_DerivedKeyToken = new QName(NS_WSC_05_12, "DerivedKeyToken", PREFIX_WSC);
-    public static final QName TAG_wsc0502_Properties = new QName(NS_WSC_05_02, "Properties", PREFIX_WSC);
-    public static final QName TAG_wsc0512_Properties = new QName(NS_WSC_05_02, "Properties", PREFIX_WSC);
-    public static final QName TAG_wsc0502_Length = new QName(NS_WSC_05_02, "Length", PREFIX_WSC);
-    public static final QName TAG_wsc0512_Length = new QName(NS_WSC_05_02, "Length", PREFIX_WSC);
-    public static final QName TAG_wsc0502_Generation = new QName(NS_WSC_05_02, "Generation", PREFIX_WSC);
-    public static final QName TAG_wsc0512_Generation = new QName(NS_WSC_05_02, "Generation", PREFIX_WSC);
-    public static final QName TAG_wsc0502_Offset = new QName(NS_WSC_05_02, "Offset", PREFIX_WSC);
-    public static final QName TAG_wsc0512_Offset = new QName(NS_WSC_05_02, "Offset", PREFIX_WSC);
-    public static final QName TAG_wsc0502_Label = new QName(NS_WSC_05_02, "Label", PREFIX_WSC);
-    public static final QName TAG_wsc0512_Label = new QName(NS_WSC_05_02, "Label", PREFIX_WSC);
-    public static final QName TAG_wsc0502_Nonce = new QName(NS_WSC_05_02, "Nonce", PREFIX_WSC);
-    public static final QName TAG_wsc0512_Nonce = new QName(NS_WSC_05_02, "Nonce", PREFIX_WSC);
-
-    public static final String P_SHA_1 = "http://schemas.xmlsoap.org/ws/2005/02/sc/dk/p_sha1";
-    public static final String P_SHA_1_2005_12 = "http://docs.oasis-open.org/ws-sx/ws-secureconversation/200512/dk/p_sha1";
-    public static final String WS_SecureConversation_DEFAULT_LABEL = "WS-SecureConversation";
+    public static class Action implements Comparable<Action> {
+        private final String name;
 
-    public static final String NS_WSS_ENC_KEY_VALUE_TYPE = NS11_SOAPMESSAGE_SECURITY + "#EncryptedKey";
+        protected Action(String name) {
+            this.name = name;
+        }
 
-    public static final String PROP_USE_THIS_TOKEN_ID_FOR_SIGNATURE = "PROP_USE_THIS_TOKEN_ID_FOR_SIGNATURE";
-    public static final String PROP_USE_THIS_TOKEN_ID_FOR_ENCRYPTION = "PROP_USE_THIS_TOKEN_ID_FOR_ENCRYPTION";
-    public static final String PROP_USE_THIS_TOKEN_ID_FOR_ENCRYPTED_KEY = "PROP_USE_THIS_TOKEN_ID_FOR_ENCRYPTED_KEY";
-    public static final String PROP_USE_THIS_TOKEN_ID_FOR_DERIVED_KEY = "PROP_USE_THIS_TOKEN_ID_FOR_DERIVED_KEY";
-    public static final String PROP_USE_THIS_TOKEN_ID_FOR_SECURITYCONTEXTTOKEN = "PROP_USE_THIS_TOKEN_ID_FOR_SECURITYCONTEXTTOKEN";
+        public String toString() {
+            return name;
+        }
 
-    public static final String PROP_TIMESTAMP_SECURITYEVENT = "PROP_TIMESTAMP";
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj instanceof Action) {
+                Action otherAction = (Action) obj;
+                if (this.toString().equals(otherAction.toString())) {
+                    return true;
+                }
+            }
+            return false;
+        }
 
-    public static final String PROP_APPEND_SIGNATURE_ON_THIS_ID = "PROP_APPEND_SIGNATURE_ON_THIS_ID";
+        @Override
+        public int hashCode() {
+            return name != null ? name.hashCode() : 0;
+        }
 
-    /**
-     * Length of UsernameToken derived key used by .NET WSE to sign a message.
-     */
-    public static final int WSE_DERIVED_KEY_LEN = 16;
-    public static final String LABEL_FOR_DERIVED_KEY = "WS-Security";
-
-    public enum Action {
-        TIMESTAMP,
-        SIGNATURE,
-        ENCRYPT,
-        USERNAMETOKEN,
-        USERNAMETOKEN_SIGNED,
-        SIGNATURE_CONFIRMATION,
-        SIGNATURE_WITH_DERIVED_KEY,
-        ENCRYPT_WITH_DERIVED_KEY,
-        SAML_TOKEN_SIGNED,
-        SAML_TOKEN_UNSIGNED,
+        @Override
+        public int compareTo(Action o) {
+            return this.toString().compareTo(o.toString());
+        }
     }
 
-    public enum KeyIdentifierType {
-        DEFAULT_TOKEN,
-        ISSUER_SERIAL,
-        BST_DIRECT_REFERENCE,
-        BST_EMBEDDED,
-        X509_KEY_IDENTIFIER,
-        SKI_KEY_IDENTIFIER,
-        THUMBPRINT_IDENTIFIER,
-        EMBEDDED_SECURITY_TOKEN_REF,
-        EMEDDED_KEYIDENTIFIER_REF,
-        USERNAMETOKEN_REFERENCE,
-    }
+    public static final KeyUsage Sym_Sig = new KeyUsage("Sym_Sig");
+    public static final KeyUsage Asym_Sig = new KeyUsage("Asym_Sig");
+    public static final KeyUsage Enc = new KeyUsage("Enc");
 
-    public enum TokenType {
-        EncryptedKeyToken,
-        X509V3Token,
-        X509V1Token,
-        X509Pkcs7Token,
-        X509PkiPathV1Token,
-        UsernameToken,
-        SecurityContextToken,
-        Saml10Token,
-        Saml11Token,
-        Saml20Token,
-        IssuedToken,
-        SecureConversationToken,
-        HttpsToken,
+    public static class KeyUsage implements Comparable<KeyUsage> {
+        private final String name;
 
-    }
+        protected KeyUsage(String name) {
+            this.name = name;
+        }
 
-    public enum DerivedKeyTokenReference {
-        DirectReference,
-        EncryptedKey,
-        SecurityContextToken,
-    }
+        public String toString() {
+            return name;
+        }
 
-    public enum UsernameTokenPasswordType {
-        PASSWORD_NONE(null),
-        PASSWORD_TEXT(NS_PASSWORD_TEXT),
-        PASSWORD_DIGEST(NS_PASSWORD_DIGEST);
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj instanceof KeyUsage) {
+                KeyUsage otherKeyUsage = (KeyUsage) obj;
+                if (this.toString().equals(otherKeyUsage.toString())) {
+                    return true;
+                }
+            }
+            return false;
+        }
 
-        private String namespace;
-        private static final Map<String, UsernameTokenPasswordType> lookup = new HashMap<String, UsernameTokenPasswordType>();
+        @Override
+        public int hashCode() {
+            return name != null ? name.hashCode() : 0;
+        }
 
-        static {
-            for (UsernameTokenPasswordType u : EnumSet.allOf(UsernameTokenPasswordType.class))
-                lookup.put(u.getNamespace(), u);
+        @Override
+        public int compareTo(KeyUsage o) {
+            return this.toString().compareTo(o.toString());
         }
+    }
+
+    public static class TokenType implements Comparable<TokenType> {
+        private final String name;
 
-        UsernameTokenPasswordType(String namespace) {
-            this.namespace = namespace;
+        protected TokenType(String name) {
+            this.name = name;
         }
 
-        public String getNamespace() {
-            return namespace;
+        public String toString() {
+            return name;
         }
 
-        public static UsernameTokenPasswordType getUsernameTokenPasswordType(String namespace) {
-            return lookup.get(namespace);
+        @Override
+        public boolean equals(Object obj) {
+            if (this == obj) {
+                return true;
+            }
+            if (obj instanceof TokenType) {
+                TokenType otherTokenType = (TokenType) obj;
+                if (this.toString().equals(otherTokenType.toString())) {
+                    return true;
+                }
+            }
+            return false;
         }
-    }
 
+        @Override
+        public int hashCode() {
+            return name != null ? name.hashCode() : 0;
+        }
 
-    /****************************************************************************
-     * Fault codes defined in the WSS 1.1 spec under section 12, Error handling
-     */
-
-    /**
-     * An unsupported token was provided
-     */
-    public static final QName UNSUPPORTED_SECURITY_TOKEN = new QName(NS_WSSE10, "UnsupportedSecurityToken");
-
-    /**
-     * An unsupported signature or encryption algorithm was used
-     */
-    public static final QName UNSUPPORTED_ALGORITHM = new QName(NS_WSSE10, "UnsupportedAlgorithm");
-
-    /**
-     * An error was discovered processing the <Security> header
-     */
-    public static final QName INVALID_SECURITY = new QName(NS_WSSE10, "InvalidSecurity");
-
-    /**
-     * An invalid security token was provided
-     */
-    public static final QName INVALID_SECURITY_TOKEN = new QName(NS_WSSE10, "InvalidSecurityToken");
-
-    /**
-     * The security token could not be authenticated or authorized
-     */
-    public static final QName FAILED_AUTHENTICATION = new QName(NS_WSSE10, "FailedAuthentication");
-
-    /**
-     * The signature or decryption was invalid
-     */
-    public static final QName FAILED_CHECK = new QName(NS_WSSE10, "FailedCheck");
-
-    /**
-     * Referenced security token could not be retrieved
-     */
-    public static final QName SECURITY_TOKEN_UNAVAILABLE = new QName(NS_WSSE10, "SecurityTokenUnavailable");
-
-    /**
-     * The message has expired
-     */
-    public static final QName MESSAGE_EXPIRED = new QName(NS_WSSE10, "MessageExpired");
-
-    public enum KeyUsage {
-        Sym_Sig,
-        Asym_Sig,
-        Dig,
-        Enc,
-        Sym_Key_Wrap,
-        Asym_Key_Wrap,
-        Comp_Key,
-        Enc_KD,
-        Sig_KD,
-        C14n,
-        Soap_Norm,
-        STR_Trans,
-        XPath,
+        @Override
+        public int compareTo(TokenType o) {
+            return this.toString().compareTo(o.toString());
+        }
     }
 }

Copied: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityException.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/WSSecurityException.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityException.java?p2=webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityException.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/WSSecurityException.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/WSSecurityException.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityException.java Tue Oct 11 18:03:00 2011
@@ -17,13 +17,10 @@
  * under the License.
  */
 
-package org.swssf.ext;
+package org.swssf.xmlsec.ext;
 
-import javax.xml.namespace.QName;
 import java.rmi.RemoteException;
 import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.Map;
 import java.util.MissingResourceException;
 import java.util.ResourceBundle;
 
@@ -32,12 +29,12 @@ import java.util.ResourceBundle;
  */
 
 /**
- * Exception class for WS-Security.
+ * Exception class for XML-Security.
  * <p/>
  *
  * @author Davanum Srinivas (dims@yahoo.com).
  */
-public class WSSecurityException extends RemoteException {
+public class XMLSecurityException extends RemoteException {
 
     public enum ErrorCode {
         FAILURE,
@@ -54,14 +51,7 @@ public class WSSecurityException extends
     }
 
     private static ResourceBundle resources;
-    /*
-     * This is an Integer -> QName map. Its function is to map the integer error codes
-     * given above to the QName fault codes as defined in the SOAP Message Security 1.1
-     * specification. A client application can simply call getFaultCode rather than do
-     * any parsing of the error code. Note that there are no mappings for "FAILURE",
-     * "FAILED_ENCRYPTION" and "FAILED_SIGNATURE" as these are not standard error messages.
-     */
-    private static final Map<ErrorCode, QName> FAULT_CODE_MAP = new HashMap<ErrorCode, QName>();
+    private ErrorCode errorCode;
 
     static {
         try {
@@ -69,51 +59,8 @@ public class WSSecurityException extends
         } catch (MissingResourceException e) {
             throw new RuntimeException(e.getMessage(), e);
         }
-
-        FAULT_CODE_MAP.put(
-                ErrorCode.UNSUPPORTED_SECURITY_TOKEN,
-                Constants.UNSUPPORTED_SECURITY_TOKEN
-        );
-        FAULT_CODE_MAP.put(
-                ErrorCode.UNSUPPORTED_ALGORITHM,
-                Constants.UNSUPPORTED_ALGORITHM
-        );
-        FAULT_CODE_MAP.put(
-                ErrorCode.INVALID_SECURITY,
-                Constants.INVALID_SECURITY
-        );
-        FAULT_CODE_MAP.put(
-                ErrorCode.INVALID_SECURITY_TOKEN,
-                Constants.INVALID_SECURITY_TOKEN
-        );
-        FAULT_CODE_MAP.put(
-                ErrorCode.FAILED_AUTHENTICATION,
-                Constants.FAILED_AUTHENTICATION
-        );
-        FAULT_CODE_MAP.put(
-                ErrorCode.FAILED_CHECK,
-                Constants.FAILED_CHECK
-        );
-        FAULT_CODE_MAP.put(
-                ErrorCode.FAILED_SIGNATURE,
-                Constants.FAILED_CHECK
-        );
-        FAULT_CODE_MAP.put(
-                ErrorCode.FAILED_ENCRYPTION,
-                Constants.FAILED_CHECK
-        );
-        FAULT_CODE_MAP.put(
-                ErrorCode.SECURITY_TOKEN_UNAVAILABLE,
-                Constants.SECURITY_TOKEN_UNAVAILABLE
-        );
-        FAULT_CODE_MAP.put(
-                ErrorCode.MESSAGE_EXPIRED,
-                Constants.MESSAGE_EXPIRED
-        );
     }
 
-    private ErrorCode errorCode;
-
     /**
      * Constructor.
      * <p/>
@@ -123,7 +70,7 @@ public class WSSecurityException extends
      * @param exception
      * @param arguments
      */
-    public WSSecurityException(ErrorCode errorCode, String msgId, Throwable exception, Object... arguments) {
+    public XMLSecurityException(ErrorCode errorCode, String msgId, Throwable exception, Object... arguments) {
         super(getMessage(errorCode, msgId, arguments), exception);
         this.errorCode = errorCode;
     }
@@ -136,12 +83,12 @@ public class WSSecurityException extends
      * @param msgId
      * @param exception
      */
-    public WSSecurityException(ErrorCode errorCode, String msgId, Throwable exception) {
+    public XMLSecurityException(ErrorCode errorCode, String msgId, Throwable exception) {
         super(getMessage(errorCode, msgId), exception);
         this.errorCode = errorCode;
     }
 
-    public WSSecurityException(ErrorCode errorCode, Throwable exception) {
+    public XMLSecurityException(ErrorCode errorCode, Throwable exception) {
         super(getMessage(errorCode, null), exception);
         this.errorCode = errorCode;
     }
@@ -154,7 +101,7 @@ public class WSSecurityException extends
      * @param msgId
      * @param arguments
      */
-    public WSSecurityException(ErrorCode errorCode, String msgId, Object... arguments) {
+    public XMLSecurityException(ErrorCode errorCode, String msgId, Object... arguments) {
         super(getMessage(errorCode, msgId, arguments));
         this.errorCode = errorCode;
     }
@@ -166,7 +113,7 @@ public class WSSecurityException extends
      * @param errorCode
      * @param msgId
      */
-    public WSSecurityException(ErrorCode errorCode, String msgId) {
+    public XMLSecurityException(ErrorCode errorCode, String msgId) {
         this(errorCode, msgId, (Object[]) null);
     }
 
@@ -176,7 +123,7 @@ public class WSSecurityException extends
      *
      * @param errorCode
      */
-    public WSSecurityException(ErrorCode errorCode) {
+    public XMLSecurityException(ErrorCode errorCode) {
         this(errorCode, null, (Object[]) null);
     }
 
@@ -186,7 +133,7 @@ public class WSSecurityException extends
      *
      * @param errorMessage
      */
-    public WSSecurityException(String errorMessage) {
+    public XMLSecurityException(String errorMessage) {
         super(errorMessage);
     }
 
@@ -196,35 +143,11 @@ public class WSSecurityException extends
      *
      * @param errorMessage
      */
-    public WSSecurityException(String errorMessage, Throwable t) {
+    public XMLSecurityException(String errorMessage, Throwable t) {
         super(errorMessage, t);
     }
 
     /**
-     * Get the error code.
-     * <p/>
-     *
-     * @return error code of this exception See values above.
-     */
-    public ErrorCode getErrorCode() {
-        return this.errorCode;
-    }
-
-    /**
-     * Get the fault code QName for this associated error code.
-     * <p/>
-     *
-     * @return the fault code QName of this exception
-     */
-    public javax.xml.namespace.QName getFaultCode() {
-        QName ret = FAULT_CODE_MAP.get(this.errorCode);
-        if (ret != null) {
-            return ret;
-        }
-        return null;
-    }
-
-    /**
      * get the message from resource bundle.
      * <p/>
      *

Copied: webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityProperties.java (from r1179730, webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/SecurityProperties.java)
URL: http://svn.apache.org/viewvc/webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityProperties.java?p2=webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityProperties.java&p1=webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/SecurityProperties.java&r1=1179730&r2=1181995&rev=1181995&view=diff
==============================================================================
--- webservices/wss4j/branches/swssf/streaming-ws-security/src/main/java/org/swssf/ext/SecurityProperties.java (original)
+++ webservices/wss4j/branches/swssf/streaming-xml-security/src/main/java/org/swssf/xmlsec/ext/XMLSecurityProperties.java Tue Oct 11 18:03:00 2011
@@ -16,10 +16,10 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.swssf.ext;
+package org.swssf.xmlsec.ext;
 
-import org.swssf.crypto.Crypto;
-import org.swssf.crypto.CryptoBase;
+import org.swssf.xmlsec.crypto.Crypto;
+import org.swssf.xmlsec.crypto.CryptoBase;
 
 import javax.security.auth.callback.CallbackHandler;
 import java.net.URL;
@@ -31,12 +31,11 @@ import java.util.List;
 /**
  * Main configuration class to supply keys etc.
  * This class is subject to change in the future.
- * Probably we will allow to configure the framework per WSDL
  *
  * @author $Author$
  * @version $Revision$ $Date$
  */
-public class SecurityProperties {
+public class XMLSecurityProperties {
 
     private List<InputProcessor> inputProcessorList = new LinkedList<InputProcessor>();
 
@@ -93,7 +92,7 @@ public class SecurityProperties {
         if (decryptionCryptoClass != null) {
             return decryptionCryptoClass;
         }
-        decryptionCryptoClass = org.swssf.crypto.Merlin.class;
+        decryptionCryptoClass = org.swssf.xmlsec.crypto.Merlin.class;
         return decryptionCryptoClass;
     }
 
@@ -113,12 +112,12 @@ public class SecurityProperties {
      * returns the decryptionCrypto for the key-management
      *
      * @return A Crypto instance
-     * @throws WSSecurityException thrown if something goes wrong
+     * @throws XMLSecurityException thrown if something goes wrong
      */
-    public Crypto getDecryptionCrypto() throws WSSecurityException {
+    public Crypto getDecryptionCrypto() throws XMLSecurityException {
 
         if (this.getDecryptionKeyStore() == null) {
-            throw new WSSConfigurationException(WSSecurityException.ErrorCode.FAILURE, "decryptionKeyStoreNotSet");
+            throw new XMLSecurityConfigurationException(XMLSecurityException.ErrorCode.FAILURE, "decryptionKeyStoreNotSet");
         }
 
         if (this.getDecryptionKeyStore() == cachedDecryptionKeyStore) {
@@ -134,7 +133,7 @@ public class SecurityProperties {
             cachedDecryptionKeyStore = this.getDecryptionKeyStore();
             return decryptionCrypto;
         } catch (Exception e) {
-            throw new WSSConfigurationException(WSSecurityException.ErrorCode.FAILURE, "decryptionCryptoFailure", e);
+            throw new XMLSecurityConfigurationException(XMLSecurityException.ErrorCode.FAILURE, "decryptionCryptoFailure", e);
         }
     }
 
@@ -156,13 +155,12 @@ public class SecurityProperties {
         this.callbackHandler = callbackHandler;
     }
 
-    private Constants.Action[] outAction;
+    private XMLSecurityConstants.Action[] outAction;
 
     private Class<? extends CryptoBase> encryptionCryptoClass;
     private KeyStore encryptionKeyStore;
     private String encryptionUser;
     private X509Certificate encryptionUseThisCertificate;
-    private Constants.KeyIdentifierType encryptionKeyIdentifierType;
     private String encryptionSymAlgorithm;
     private String encryptionKeyTransportAlgorithm;
     private List<SecurePart> encryptionParts = new LinkedList<SecurePart>();
@@ -198,7 +196,7 @@ public class SecurityProperties {
         if (encryptionCryptoClass != null) {
             return encryptionCryptoClass;
         }
-        encryptionCryptoClass = org.swssf.crypto.Merlin.class;
+        encryptionCryptoClass = org.swssf.xmlsec.crypto.Merlin.class;
         return encryptionCryptoClass;
     }
 
@@ -218,12 +216,12 @@ public class SecurityProperties {
      * returns the encryptionCrypto for the key-management
      *
      * @return A Crypto instance
-     * @throws WSSecurityException thrown if something goes wrong
+     * @throws XMLSecurityException thrown if something goes wrong
      */
-    public Crypto getEncryptionCrypto() throws WSSecurityException {
+    public Crypto getEncryptionCrypto() throws XMLSecurityException {
 
         if (this.getEncryptionKeyStore() == null) {
-            throw new WSSConfigurationException(WSSecurityException.ErrorCode.FAILURE, "encryptionKeyStoreNotSet");
+            throw new XMLSecurityConfigurationException(XMLSecurityException.ErrorCode.FAILURE, "encryptionKeyStoreNotSet");
         }
 
         if (this.getEncryptionKeyStore() == cachedEncryptionKeyStore) {
@@ -239,7 +237,7 @@ public class SecurityProperties {
             cachedEncryptionKeyStore = this.getEncryptionKeyStore();
             return encryptionCrypto;
         } catch (Exception e) {
-            throw new WSSConfigurationException(WSSecurityException.ErrorCode.FAILURE, "encryptionCryptoFailure", e);
+            throw new XMLSecurityConfigurationException(XMLSecurityException.ErrorCode.FAILURE, "encryptionCryptoFailure", e);
         }
     }
 
@@ -324,24 +322,6 @@ public class SecurityProperties {
         this.encryptionUser = encryptionUser;
     }
 
-    /**
-     * returns the KeyIdentifierType which will be used in the secured document
-     *
-     * @return The KeyIdentifierType
-     */
-    public Constants.KeyIdentifierType getEncryptionKeyIdentifierType() {
-        return encryptionKeyIdentifierType;
-    }
-
-    /**
-     * Specifies the KeyIdentifierType to use in the secured document
-     *
-     * @param encryptionKeyIdentifierType
-     */
-    public void setEncryptionKeyIdentifierType(Constants.KeyIdentifierType encryptionKeyIdentifierType) {
-        this.encryptionKeyIdentifierType = encryptionKeyIdentifierType;
-    }
-
     private List<SecurePart> signatureParts = new LinkedList<SecurePart>();
     private String signatureAlgorithm;
     private String signatureDigestAlgorithm;
@@ -349,7 +329,6 @@ public class SecurityProperties {
     private Class<? extends CryptoBase> signatureCryptoClass;
     private KeyStore signatureKeyStore;
     private String signatureUser;
-    private Constants.KeyIdentifierType signatureKeyIdentifierType;
     private boolean useSingleCert = true;
 
     public void addSignaturePart(SecurePart securePart) {
@@ -398,7 +377,7 @@ public class SecurityProperties {
         if (signatureCryptoClass != null) {
             return signatureCryptoClass;
         }
-        signatureCryptoClass = org.swssf.crypto.Merlin.class;
+        signatureCryptoClass = org.swssf.xmlsec.crypto.Merlin.class;
         return signatureCryptoClass;
     }
 
@@ -407,13 +386,12 @@ public class SecurityProperties {
     }
 
     private Crypto cachedSignatureCrypto;
-    private Class<? extends CryptoBase> cachedSignatureCryptoClass;
     private KeyStore cachedSignatureKeyStore;
 
-    public Crypto getSignatureCrypto() throws WSSecurityException {
+    public Crypto getSignatureCrypto() throws XMLSecurityException {
 
         if (this.getSignatureKeyStore() == null) {
-            throw new WSSConfigurationException(WSSecurityException.ErrorCode.FAILURE, "signatureKeyStoreNotSet");
+            throw new XMLSecurityConfigurationException(XMLSecurityException.ErrorCode.FAILURE, "signatureKeyStoreNotSet");
         }
 
         if (this.getSignatureKeyStore() == cachedSignatureKeyStore) {
@@ -426,22 +404,13 @@ public class SecurityProperties {
             CryptoBase signatureCrypto = signatureCryptoClass.newInstance();
             signatureCrypto.setKeyStore(this.getSignatureKeyStore());
             cachedSignatureCrypto = signatureCrypto;
-            cachedSignatureCryptoClass = signatureCryptoClass;
             cachedSignatureKeyStore = this.getSignatureKeyStore();
             return signatureCrypto;
         } catch (Exception e) {
-            throw new WSSConfigurationException(WSSecurityException.ErrorCode.FAILURE, "signatureCryptoFailure", e);
+            throw new XMLSecurityConfigurationException(XMLSecurityException.ErrorCode.FAILURE, "signatureCryptoFailure", e);
         }
     }
 
-    public Constants.KeyIdentifierType getSignatureKeyIdentifierType() {
-        return signatureKeyIdentifierType;
-    }
-
-    public void setSignatureKeyIdentifierType(Constants.KeyIdentifierType signatureKeyIdentifierType) {
-        this.signatureKeyIdentifierType = signatureKeyIdentifierType;
-    }
-
     public boolean isUseSingleCert() {
         return useSingleCert;
     }
@@ -450,22 +419,12 @@ public class SecurityProperties {
         this.useSingleCert = useSingleCert;
     }
 
-    private Integer timestampTTL = 300;
-
-    public Integer getTimestampTTL() {
-        return timestampTTL;
-    }
-
-    public void setTimestampTTL(Integer timestampTTL) {
-        this.timestampTTL = timestampTTL;
-    }
-
     /**
      * Returns the actual set actions
      *
      * @return The Actions in applied order
      */
-    public Constants.Action[] getOutAction() {
+    public XMLSecurityConstants.Action[] getOutAction() {
         return outAction;
     }
 
@@ -474,7 +433,7 @@ public class SecurityProperties {
      *
      * @param outAction
      */
-    public void setOutAction(Constants.Action[] outAction) {
+    public void setOutAction(XMLSecurityConstants.Action[] outAction) {
         this.outAction = outAction;
     }
 
@@ -503,7 +462,7 @@ public class SecurityProperties {
         if (signatureVerificationCryptoClass != null) {
             return signatureVerificationCryptoClass;
         }
-        signatureVerificationCryptoClass = org.swssf.crypto.Merlin.class;
+        signatureVerificationCryptoClass = org.swssf.xmlsec.crypto.Merlin.class;
         return signatureVerificationCryptoClass;
     }
 
@@ -514,10 +473,10 @@ public class SecurityProperties {
     private Crypto cachedSignatureVerificationCrypto;
     private KeyStore cachedSignatureVerificationKeyStore;
 
-    public Crypto getSignatureVerificationCrypto() throws WSSecurityException {
+    public Crypto getSignatureVerificationCrypto() throws XMLSecurityException {
 
         if (this.getSignatureVerificationKeyStore() == null) {
-            throw new WSSConfigurationException(WSSecurityException.ErrorCode.FAILURE, "signatureVerificationKeyStoreNotSet");
+            throw new XMLSecurityConfigurationException(XMLSecurityException.ErrorCode.FAILURE, "signatureVerificationKeyStoreNotSet");
         }
 
         if (this.getSignatureVerificationKeyStore() == cachedSignatureVerificationKeyStore) {
@@ -533,20 +492,10 @@ public class SecurityProperties {
             cachedSignatureVerificationKeyStore = this.getSignatureVerificationKeyStore();
             return signatureVerificationCrypto;
         } catch (Exception e) {
-            throw new WSSConfigurationException(WSSecurityException.ErrorCode.FAILURE, "signatureVerificationCryptoFailure", e);
+            throw new XMLSecurityConfigurationException(XMLSecurityException.ErrorCode.FAILURE, "signatureVerificationCryptoFailure", e);
         }
     }
 
-    private boolean strictTimestampCheck = true;
-
-    public boolean isStrictTimestampCheck() {
-        return strictTimestampCheck;
-    }
-
-    public void setStrictTimestampCheck(boolean strictTimestampCheck) {
-        this.strictTimestampCheck = strictTimestampCheck;
-    }
-
     private boolean skipDocumentEvents = false;
 
     /**
@@ -566,73 +515,4 @@ public class SecurityProperties {
     public void setSkipDocumentEvents(boolean skipDocumentEvents) {
         this.skipDocumentEvents = skipDocumentEvents;
     }
-
-    private String tokenUser;
-    private Constants.UsernameTokenPasswordType usernameTokenPasswordType;
-
-    public String getTokenUser() {
-        return tokenUser;
-    }
-
-    public void setTokenUser(String tokenUser) {
-        this.tokenUser = tokenUser;
-    }
-
-    public Constants.UsernameTokenPasswordType getUsernameTokenPasswordType() {
-        return usernameTokenPasswordType;
-    }
-
-    public void setUsernameTokenPasswordType(Constants.UsernameTokenPasswordType usernameTokenPasswordType) {
-        this.usernameTokenPasswordType = usernameTokenPasswordType;
-    }
-
-    private boolean enableSignatureConfirmationVerification = false;
-
-    public boolean isEnableSignatureConfirmationVerification() {
-        return enableSignatureConfirmationVerification;
-    }
-
-    public void setEnableSignatureConfirmationVerification(boolean enableSignatureConfirmationVerification) {
-        this.enableSignatureConfirmationVerification = enableSignatureConfirmationVerification;
-    }
-
-    private boolean useReqSigCertForEncryption = false;
-
-    public boolean isUseReqSigCertForEncryption() {
-        return useReqSigCertForEncryption;
-    }
-
-    public void setUseReqSigCertForEncryption(boolean useReqSigCertForEncryption) {
-        this.useReqSigCertForEncryption = useReqSigCertForEncryption;
-    }
-
-    private String actor;
-
-    public String getActor() {
-        return actor;
-    }
-
-    public void setActor(String actor) {
-        this.actor = actor;
-    }
-
-
-    private Constants.KeyIdentifierType derivedKeyKeyIdentifierType;
-    private Constants.DerivedKeyTokenReference derivedKeyTokenReference;
-
-    public Constants.KeyIdentifierType getDerivedKeyKeyIdentifierType() {
-        return derivedKeyKeyIdentifierType;
-    }
-
-    public void setDerivedKeyKeyIdentifierType(Constants.KeyIdentifierType derivedKeyKeyIdentifierType) {
-        this.derivedKeyKeyIdentifierType = derivedKeyKeyIdentifierType;
-    }
-
-    public Constants.DerivedKeyTokenReference getDerivedKeyTokenReference() {
-        return derivedKeyTokenReference;
-    }
-
-    public void setDerivedKeyTokenReference(Constants.DerivedKeyTokenReference derivedKeyTokenReference) {
-        this.derivedKeyTokenReference = derivedKeyTokenReference;
-    }
 }