cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r782089 [2/10] - in /cxf/trunk/systests/src/test: java/org/apache/cxf/systest/ws/wssc/ java/org/apache/cxf/systest/ws/wssc/certs/ java/org/apache/cxf/systest/ws/wssc/client/ java/org/apache/cxf/systest/ws/wssc/server/ java/org/apache/cxf/sy...
Date Fri, 05 Jun 2009 18:22:00 GMT
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/UTPasswordCallback.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/UTPasswordCallback.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/UTPasswordCallback.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/UTPasswordCallback.java Fri Jun  5 18:21:57 2009
@@ -0,0 +1,73 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.ws.wssec10.client;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ */
+
+public class UTPasswordCallback implements CallbackHandler {
+    
+    private Map<String, String> passwords = 
+        new HashMap<String, String>();
+    
+    public UTPasswordCallback() {
+        passwords.put("Alice", "ecilA");
+        passwords.put("Frank", "invalid-password");
+        //for MS clients
+        passwords.put("abcd", "dcba");
+    }
+
+    /**
+     * Here, we attempt to get the password from the private 
+     * alias/passwords map.
+     */
+    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+        for (int i = 0; i < callbacks.length; i++) {
+            WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];
+
+            String pass = passwords.get(pc.getIdentifier());
+            if (pass != null) {
+                pc.setPassword(pass);
+                return;
+            }
+        }
+        
+        //
+        // Password not found
+        //
+        throw new IOException();
+    }
+    
+    /**
+     * Add an alias/password pair to the callback mechanism.
+     */
+    public void setAliasPassword(String alias, String password) {
+        passwords.put(alias, password);
+    }
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/UTPasswordCallback.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/UTPasswordCallback.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/alice.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/alice.properties?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/alice.properties (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/alice.properties Fri Jun  5 18:21:57 2009
@@ -0,0 +1,21 @@
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=password
+org.apache.ws.security.crypto.merlin.keystore.alias=alice
+org.apache.ws.security.crypto.merlin.file=src/test/java/org/apache/cxf/systest/ws/wssec10/certs/alice.jks

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/alice.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/alice.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/alice.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/bob.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/bob.properties?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/bob.properties (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/bob.properties Fri Jun  5 18:21:57 2009
@@ -0,0 +1,23 @@
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=password
+org.apache.ws.security.crypto.merlin.keystore.alias=bob
+org.apache.ws.security.crypto.merlin.file=src/test/java/org/apache/cxf/systest/ws/wssec10/certs/bob.jks
+
+

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/bob.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/bob.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/bob.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/client.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/client.xml?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/client.xml (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/client.xml Fri Jun  5 18:21:57 2009
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:http="http://cxf.apache.org/transports/http/configuration"
+       xmlns:jaxws="http://cxf.apache.org/jaxws"
+       xmlns:cxf="http://cxf.apache.org/core"
+       xmlns:p="http://cxf.apache.org/policy"
+       xmlns:sec="http://cxf.apache.org/configuration/security"
+       xsi:schemaLocation="
+          http://www.springframework.org/schema/beans           http://www.springframework.org/schema/beans/spring-beans.xsd
+          http://cxf.apache.org/jaxws                           http://cxf.apache.org/schemas/jaxws.xsd
+          http://cxf.apache.org/transports/http/configuration   http://cxf.apache.org/schemas/configuration/http-conf.xsd
+          http://cxf.apache.org/configuration/security          http://cxf.apache.org/schemas/configuration/security.xsd
+          http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+          http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd"
+>
+    <cxf:bus>
+        <cxf:features>
+            <p:policies/>
+            <cxf:logging/>
+        </cxf:features>
+    </cxf:bus>
+    
+    
+    <!-- -->
+    <!-- Scenario 3.1 -->
+    <!-- -->
+    <jaxws:client name="{http://WSSec/wssec10}UserNameOverTransport_IPingService" createdFromAPI="true">
+        <jaxws:properties>
+            <entry key="ws-security.username" value="Alice"/>
+            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.wssec10.client.UTPasswordCallback"/>
+        </jaxws:properties>
+    </jaxws:client>
+    <http:conduit name="https://.*/UserNameOverTransport.*">
+        <http:tlsClientParameters disableCNCheck="true">
+            <sec:keyManagers keyPassword="password">
+                <sec:keyStore type="jks" password="password" resource="org/apache/cxf/systest/ws/wssec10/certs/alice.jks"/>
+            </sec:keyManagers>
+            <sec:trustManagers>
+                <sec:keyStore type="jks" password="password" resource="org/apache/cxf/systest/ws/wssec10/certs/bob.jks"/>
+            </sec:trustManagers>
+        </http:tlsClientParameters>
+    </http:conduit>    
+    
+    <!-- -->
+    <!-- Scenario 3.3 -->
+    <!-- -->
+    <jaxws:client name="{http://WSSec/wssec10}MutualCertificate10SignEncrypt_IPingService" createdFromAPI="true">
+        <jaxws:properties>
+            <entry key="ws-security.username" value="Alice"/>
+            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.wssec10.client.KeystorePasswordCallback"/>
+            <entry key="ws-security.signature.properties" value="org/apache/cxf/systest/ws/wssec10/client/alice.properties"/>
+            <entry key="ws-security.encryption.properties" value="org/apache/cxf/systest/ws/wssec10/client/bob.properties"/>
+        </jaxws:properties>
+    </jaxws:client>
+
+    
+    <!-- -->
+    <!-- Scenario 3.4 -->
+    <!-- -->
+    <jaxws:client name="{http://WSSec/wssec10}MutualCertificate10SignEncryptRsa15TripleDes_IPingService" createdFromAPI="true">
+        <jaxws:properties>
+            <entry key="ws-security.username" value="Alice"/>
+            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.wssec10.client.KeystorePasswordCallback"/>
+            <entry key="ws-security.signature.properties" value="org/apache/cxf/systest/ws/wssec10/client/alice.properties"/>
+            <entry key="ws-security.encryption.properties" value="org/apache/cxf/systest/ws/wssec10/client/bob.properties"/>
+        </jaxws:properties>
+    </jaxws:client>
+
+</beans>

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/client.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/client.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/client.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/client_restricted.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/client_restricted.xml?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/client_restricted.xml (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/client_restricted.xml Fri Jun  5 18:21:57 2009
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:http="http://cxf.apache.org/transports/http/configuration"
+       xmlns:jaxws="http://cxf.apache.org/jaxws"
+       xmlns:cxf="http://cxf.apache.org/core"
+       xmlns:p="http://cxf.apache.org/policy"
+       xmlns:sec="http://cxf.apache.org/configuration/security"
+       xsi:schemaLocation="
+          http://www.springframework.org/schema/beans           http://www.springframework.org/schema/beans/spring-beans.xsd
+          http://cxf.apache.org/jaxws                           http://cxf.apache.org/schemas/jaxws.xsd
+          http://cxf.apache.org/transports/http/configuration   http://cxf.apache.org/schemas/configuration/http-conf.xsd
+          http://cxf.apache.org/configuration/security          http://cxf.apache.org/schemas/configuration/security.xsd
+          http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+          http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd"
+>
+    <cxf:bus>
+        <cxf:features>
+            <p:policies/>
+            <cxf:logging/>
+        </cxf:features>
+    </cxf:bus>
+    
+    
+    <!-- -->
+    <!-- Scenario 3.1 -->
+    <!-- -->
+    <jaxws:client name="{http://WSSec/wssec10}UserNameOverTransport_IPingService" createdFromAPI="true">
+        <jaxws:properties>
+            <entry key="ws-security.username" value="Alice"/>
+            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.wssec10.client.UTPasswordCallback"/>
+        </jaxws:properties>
+    </jaxws:client>
+    <http:conduit name="https://.*/UserNameOverTransport.*">
+        <http:tlsClientParameters disableCNCheck="true">
+            <sec:keyManagers keyPassword="password">
+                <sec:keyStore type="jks" password="password" resource="org/apache/cxf/systest/ws/wssec10/certs/restricted/alice.jks"/>
+            </sec:keyManagers>
+            <sec:trustManagers>
+                <sec:keyStore type="jks" password="password" resource="org/apache/cxf/systest/ws/wssec10/certs/restricted/bob.jks"/>
+            </sec:trustManagers>
+        </http:tlsClientParameters>
+    </http:conduit>    
+    
+    <!-- -->
+    <!-- Scenario 3.3 -->
+    <!-- -->
+    <jaxws:client name="{http://WSSec/wssec10}MutualCertificate10SignEncrypt_IPingService" createdFromAPI="true">
+        <jaxws:properties>
+            <entry key="ws-security.username" value="Alice"/>
+            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.wssec10.client.KeystorePasswordCallback"/>
+            <entry key="ws-security.signature.properties" value="org/apache/cxf/systest/ws/wssec10/client/alice.properties"/>
+            <entry key="ws-security.encryption.properties" value="org/apache/cxf/systest/ws/wssec10/client/bob.properties"/>
+        </jaxws:properties>
+    </jaxws:client>
+
+    
+    <!-- -->
+    <!-- Scenario 3.4 -->
+    <!-- -->
+    <jaxws:client name="{http://WSSec/wssec10}MutualCertificate10SignEncryptRsa15TripleDes_IPingService" createdFromAPI="true">
+        <jaxws:properties>
+            <entry key="ws-security.username" value="Alice"/>
+            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.wssec10.client.KeystorePasswordCallback"/>
+            <entry key="ws-security.signature.properties" value="org/apache/cxf/systest/ws/wssec10/client/alice.properties"/>
+            <entry key="ws-security.encryption.properties" value="org/apache/cxf/systest/ws/wssec10/client/bob.properties"/>
+        </jaxws:properties>
+    </jaxws:client>
+
+</beans>

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/client_restricted.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/client_restricted.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/client_restricted.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/KeystorePasswordCallback.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/KeystorePasswordCallback.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/KeystorePasswordCallback.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/KeystorePasswordCallback.java Fri Jun  5 18:21:57 2009
@@ -0,0 +1,75 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.ws.wssec10.server;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ */
+
+public class KeystorePasswordCallback implements CallbackHandler {
+    private Map<String, String> passwords = 
+        new HashMap<String, String>();
+    
+    public KeystorePasswordCallback() {
+        passwords.put("alice", "password");
+        passwords.put("bob", "password");
+        passwords.put("abcd", "dcba");
+        passwords.put("6e0e88f36ebb8744d470f62f604d03ea4ebe5094", "password");
+    }
+
+    /**
+     * It attempts to get the password from the private 
+     * alias/passwords map.
+     */
+    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+        for (int i = 0; i < callbacks.length; i++) {
+            WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];
+            try {
+                Integer.parseInt(pc.getIdentifier());
+                //Its an alias generated for a pfx file,
+                //this seems to be the way sun seem to load
+                //.pfc files into keystores, assigning an int value
+                //as the key aliases,
+                //The above is an issue when doing encrypt or signing only.
+                //Perhaps using a more suitable keystore format like .jks would be better
+                pc.setPassword("password");
+                return;
+            } catch (NumberFormatException nfe) {
+                //not a pfx alias, carry on to next
+            }
+
+            String pass = passwords.get(pc.getIdentifier());
+            if (pass != null) {
+                pc.setPassword(pass);
+                return;
+            } else {
+                pc.setPassword("password");
+            }
+        }
+    } 
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/KeystorePasswordCallback.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/KeystorePasswordCallback.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncrypt.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncrypt.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncrypt.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncrypt.java Fri Jun  5 18:21:57 2009
@@ -0,0 +1,30 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.ws.wssec10.server;
+
+@javax.jws.WebService(
+    targetNamespace = "http://WSSec/wssec10", 
+    serviceName = "PingService", 
+    portName = "MutualCertificate10SignEncrypt_IPingService", 
+    endpointInterface = "wssec.wssec10.IPingService",
+    wsdlLocation = "target/test-classes/wsdl_systest/wssec10/WsSecurity10.wsdl"
+)                  
+public class MutualCertificate10SignEncrypt extends PingServiceBase {
+    // complete
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncrypt.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncrypt.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncryptRestricted.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncryptRestricted.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncryptRestricted.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncryptRestricted.java Fri Jun  5 18:21:57 2009
@@ -0,0 +1,30 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.ws.wssec10.server;
+
+@javax.jws.WebService(
+    targetNamespace = "http://WSSec/wssec10", 
+    serviceName = "PingService", 
+    portName = "MutualCertificate10SignEncrypt_IPingService", 
+    endpointInterface = "wssec.wssec10.IPingService",
+    wsdlLocation = "target/test-classes/wsdl_systest/wssec10/WsSecurity10_restricted.wsdl"
+)                  
+public class MutualCertificate10SignEncryptRestricted extends PingServiceBase {
+    // complete
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncryptRestricted.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncryptRestricted.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncryptRsa15TripleDes.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncryptRsa15TripleDes.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncryptRsa15TripleDes.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncryptRsa15TripleDes.java Fri Jun  5 18:21:57 2009
@@ -0,0 +1,30 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.ws.wssec10.server;
+
+@javax.jws.WebService(
+    targetNamespace = "http://WSSec/wssec10", 
+    serviceName = "PingService", 
+    portName = "MutualCertificate10SignEncryptRsa15TripleDes_IPingService", 
+    endpointInterface = "wssec.wssec10.IPingService",
+    wsdlLocation = "target/test-classes/wsdl_systest/wssec10/WsSecurity10.wsdl"
+)                  
+public class MutualCertificate10SignEncryptRsa15TripleDes extends PingServiceBase {
+    // complete
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncryptRsa15TripleDes.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncryptRsa15TripleDes.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncryptRsa15TripleDesRestricted.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncryptRsa15TripleDesRestricted.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncryptRsa15TripleDesRestricted.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncryptRsa15TripleDesRestricted.java Fri Jun  5 18:21:57 2009
@@ -0,0 +1,30 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.ws.wssec10.server;
+
+@javax.jws.WebService(
+    targetNamespace = "http://WSSec/wssec10", 
+    serviceName = "PingService", 
+    portName = "MutualCertificate10SignEncryptRsa15TripleDes_IPingService", 
+    endpointInterface = "wssec.wssec10.IPingService",
+    wsdlLocation = "target/test-classes/wsdl_systest/wssec10/WsSecurity10_restricted.wsdl"
+)                  
+public class MutualCertificate10SignEncryptRsa15TripleDesRestricted extends PingServiceBase {
+    // complete
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncryptRsa15TripleDesRestricted.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncryptRsa15TripleDesRestricted.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/PingServiceBase.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/PingServiceBase.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/PingServiceBase.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/PingServiceBase.java Fri Jun  5 18:21:57 2009
@@ -0,0 +1,44 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.ws.wssec10.server;
+
+import javax.annotation.Resource;
+import javax.xml.ws.WebServiceContext;
+
+import wssec.wssec10.IPingService;
+
+public abstract class PingServiceBase implements IPingService {
+    
+    @Resource
+    protected WebServiceContext ctx;
+
+    protected PingServiceBase() {
+    }
+ 
+
+    public java.lang.String 
+    echo(
+        java.lang.String request
+    ) {
+        System.out.println("echo(" + request + ")");
+        return request;
+    }
+
+    
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/PingServiceBase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/PingServiceBase.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/Server.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/Server.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/Server.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/Server.java Fri Jun  5 18:21:57 2009
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.ws.wssec10.server;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.systest.ws.wssec11.WSSecurity11Common;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+
+public class Server extends AbstractBusTestServerBase {
+
+    private static boolean unrestrictedPoliciesInstalled;
+    private static String configFileName;
+    
+    static {
+        unrestrictedPoliciesInstalled = WSSecurity11Common.checkUnrestrictedPoliciesInstalled();
+        if (unrestrictedPoliciesInstalled) {
+            configFileName = "org/apache/cxf/systest/ws/wssec10/server/server.xml";
+        } else {
+            configFileName = "org/apache/cxf/systest/ws/wssec10/server/server_restricted.xml";
+        }
+    };    
+
+    public Server() throws Exception {
+        
+    }
+    
+    protected void run()  {
+        Bus busLocal = new SpringBusFactory().createBus(configFileName);
+        BusFactory.setDefaultBus(busLocal);
+        setBus(busLocal);
+    }
+
+    public static void main(String args[]) throws Exception {
+        new Server();
+        new SpringBusFactory().createBus(configFileName);
+        System.out.println("Server ready...");
+
+        Thread.sleep(60 * 60 * 1000);
+        System.out.println("Server exiting");
+        System.exit(0);
+    }
+}
+

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/Server.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/Server.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/UTPasswordCallback.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/UTPasswordCallback.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/UTPasswordCallback.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/UTPasswordCallback.java Fri Jun  5 18:21:57 2009
@@ -0,0 +1,79 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.ws.wssec10.server;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ */
+
+public class UTPasswordCallback implements CallbackHandler {
+    
+    private Map<String, String> passwords = 
+        new HashMap<String, String>();
+    
+    public UTPasswordCallback() {
+        passwords.put("Alice", "ecilA");
+        passwords.put("Frank", "invalid-password");
+        //for MS clients
+        passwords.put("abcd", "dcba");
+    }
+
+    /**
+     * Here, we attempt to get the password from the private 
+     * alias/passwords map.
+     */
+    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+        for (int i = 0; i < callbacks.length; i++) {
+            WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];
+            String sentPassword = pc.getPassword();
+            String pass = passwords.get(pc.getIdentifier());
+            if (sentPassword == null) {
+                throw new IOException("Reveived password from clienthas null value");
+            }
+            if (pass == null) {
+                throw new IOException("Unknown username sent from client");
+            }
+            if (pass.equals(sentPassword)) {
+                pc.setPassword(pass);
+                return;
+            }
+        }
+        
+        //
+        // Password not found
+        //
+        throw new IOException();
+    }
+    
+    /**
+     * Add an alias/password pair to the callback mechanism.
+     */
+    public void setAliasPassword(String alias, String password) {
+        passwords.put(alias, password);
+    }
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/UTPasswordCallback.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/UTPasswordCallback.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/UserNameOverTransport.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/UserNameOverTransport.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/UserNameOverTransport.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/UserNameOverTransport.java Fri Jun  5 18:21:57 2009
@@ -0,0 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.ws.wssec10.server;
+
+@javax.jws.WebService(
+    targetNamespace = "http://WSSec/wssec10", 
+    serviceName = "PingService", 
+    portName = "UserNameOverTransportLocal_IPingService", 
+    endpointInterface = "wssec.wssec10.IPingService",
+    wsdlLocation = "target/test-classes/wsdl_systest/wssec10/WsSecurity10.wsdl"
+)                  
+public class UserNameOverTransport extends PingServiceBase {
+    // complete
+}
+ 
\ No newline at end of file

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/UserNameOverTransport.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/UserNameOverTransport.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/UserNameOverTransportRestricted.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/UserNameOverTransportRestricted.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/UserNameOverTransportRestricted.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/UserNameOverTransportRestricted.java Fri Jun  5 18:21:57 2009
@@ -0,0 +1,31 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.ws.wssec10.server;
+
+@javax.jws.WebService(
+    targetNamespace = "http://WSSec/wssec10", 
+    serviceName = "PingService", 
+    portName = "UserNameOverTransportLocal_IPingService", 
+    endpointInterface = "wssec.wssec10.IPingService",
+    wsdlLocation = "target/test-classes/wsdl_systest/wssec10/WsSecurity10_restricted.wsdl"
+)                  
+public class UserNameOverTransportRestricted extends PingServiceBase {
+    // complete
+}
+ 
\ No newline at end of file

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/UserNameOverTransportRestricted.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/UserNameOverTransportRestricted.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/alice.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/alice.properties?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/alice.properties (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/alice.properties Fri Jun  5 18:21:57 2009
@@ -0,0 +1,21 @@
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=password
+org.apache.ws.security.crypto.merlin.keystore.alias=alice
+org.apache.ws.security.crypto.merlin.file=src/test/java/org/apache/cxf/systest/ws/wssec10/certs/alice.jks

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/alice.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/alice.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/alice.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/bob.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/bob.properties?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/bob.properties (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/bob.properties Fri Jun  5 18:21:57 2009
@@ -0,0 +1,21 @@
+#    Licensed to the Apache Software Foundation (ASF) under one
+#    or more contributor license agreements. See the NOTICE file
+#    distributed with this work for additional information
+#    regarding copyright ownership. The ASF licenses this file
+#    to you under the Apache License, Version 2.0 (the
+#    "License"); you may not use this file except in compliance
+#    with the License. You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing,
+#    software distributed under the License is distributed on an
+#    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#    KIND, either express or implied. See the License for the
+#    specific language governing permissions and limitations
+#    under the License.
+org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin
+org.apache.ws.security.crypto.merlin.keystore.type=jks
+org.apache.ws.security.crypto.merlin.keystore.password=password
+org.apache.ws.security.crypto.merlin.keystore.alias=bob
+org.apache.ws.security.crypto.merlin.file=src/test/java/org/apache/cxf/systest/ws/wssec10/certs/bob.jks

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/bob.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/bob.properties
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/bob.properties
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/server.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/server.xml?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/server.xml (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/server.xml Fri Jun  5 18:21:57 2009
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:jaxws="http://cxf.apache.org/jaxws"
+    xmlns:http="http://cxf.apache.org/transports/http/configuration"
+    xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
+    xmlns:sec="http://cxf.apache.org/configuration/security"
+    xmlns:security="http://schemas.iona.com/soa/security-config"
+    xmlns:interop="http://WSSec/wssec10"
+    xmlns:cxf="http://cxf.apache.org/core"
+    xmlns:p="http://cxf.apache.org/policy"
+    xsi:schemaLocation="
+        http://www.springframework.org/schema/beans                     http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+        http://cxf.apache.org/jaxws                                     http://cxf.apache.org/schemas/jaxws.xsd
+        http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+        http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd
+        http://cxf.apache.org/transports/http/configuration             http://cxf.apache.org/schemas/configuration/http-conf.xsd
+        http://cxf.apache.org/transports/http-jetty/configuration       http://cxf.apache.org/schemas/configuration/http-jetty.xsd
+        http://cxf.apache.org/configuration/security                    http://cxf.apache.org/schemas/configuration/security.xsd
+        http://schemas.iona.com/soa/security-config                     http://schemas.iona.com/soa/security-config.xsd
+    ">
+    
+    <cxf:bus>
+        <cxf:features>
+            <p:policies/>
+            <cxf:logging/>
+        </cxf:features>
+    </cxf:bus>
+
+    <!-- -->
+    <!-- Any services listening on port 9001 must use the following -->
+    <!-- Transport Layer Security (TLS) settings -->
+    <!-- -->
+    <httpj:engine-factory id="tls-settings">
+        <httpj:engine port="9001">
+            <httpj:tlsServerParameters>
+                <sec:keyManagers keyPassword="password">
+                    <sec:keyStore type="jks" password="password" resource="org/apache/cxf/systest/ws/wssec10/certs/bob.jks"/>
+                </sec:keyManagers>
+                <sec:trustManagers>
+                    <sec:keyStore type="jks" password="password" resource="org/apache/cxf/systest/ws/wssec10/certs/alice.jks"/>
+                </sec:trustManagers> 
+
+                <!--
+                <sec:cipherSuitesFilter>
+                    <sec:include>.*_EXPORT_.*</sec:include>
+                    <sec:include>.*_EXPORT1024_.*</sec:include>
+                    <sec:include>.*_WITH_DES_.*</sec:include>
+                    <sec:include>.*_WITH_NULL_.*</sec:include>
+                    <sec:exclude>.*_DH_anon_.*</sec:exclude>
+                </sec:cipherSuitesFilter>
+                <sec:clientAuthentication want="true" required="true"/>
+                -->
+            </httpj:tlsServerParameters>
+        </httpj:engine>
+    </httpj:engine-factory>
+    
+    <!-- -->
+    <!-- Scenario 3.1 -->
+    <!-- -->
+    <jaxws:endpoint 
+       id="UserNameOverTransport"
+       address="https://localhost:9001/UserNameOverTransport" 
+       serviceName="interop:PingService"
+       endpointName="interop:UserNameOverTransport_IPingService"
+       implementor="org.apache.cxf.systest.ws.wssec10.server.UserNameOverTransport"
+       depends-on="tls-settings">
+        
+       <jaxws:properties>
+            <entry key="ws-security.username" value="Alice"/>
+            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.wssec10.server.UTPasswordCallback"/>
+        </jaxws:properties> 
+     
+    </jaxws:endpoint> 
+    
+
+    <!-- -->
+    <!-- Scenario 3.3 -->
+    <!-- -->
+    <jaxws:endpoint 
+       name="{http://WSSec/wssec10}MutualCertificate10SignEncrypt_IPingService"
+       id="MutualCertificate10SignEncrypt"
+       address="http://localhost:9002/MutualCertificate10SignEncrypt" 
+       serviceName="interop:PingService"
+       endpointName="interop:MutualCertificate10SignEncrypt_IPingService"
+       implementor="org.apache.cxf.systest.ws.wssec10.server.MutualCertificate10SignEncrypt">
+        
+        <jaxws:properties>
+            <entry key="ws-security.username" value="Alice"/>
+            <entry key="ws-security.signature.properties" value="org/apache/cxf/systest/ws/wssec10/server/bob.properties"/>
+            <entry key="ws-security.encryption.properties" value="org/apache/cxf/systest/ws/wssec10/server/alice.properties"/>
+            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.wssec10.server.KeystorePasswordCallback"/>
+        </jaxws:properties> 
+
+    </jaxws:endpoint> 
+    
+
+    <!-- -->
+    <!-- Scenario 3.4 -->
+    <!-- -->
+    <jaxws:endpoint 
+       name="{http://WSSec/wssec10}MutualCertificate10SignEncryptRsa15TripleDes_IPingService"
+       id="MutualCertificate10SignEncryptRsa15TripleDes"
+       address="http://localhost:9000/MutualCertificate10SignEncryptRsa15TripleDes" 
+       serviceName="interop:PingService"
+       endpointName="interop:MutualCertificate10SignEncryptRsa15TripleDes_IPingService"
+       implementor="org.apache.cxf.systest.ws.wssec10.server.MutualCertificate10SignEncryptRsa15TripleDes">
+        
+        <jaxws:properties>
+            <entry key="ws-security.username" value="Alice"/>
+            <entry key="ws-security.signature.properties" value="org/apache/cxf/systest/ws/wssec10/server/bob.properties"/>
+            <entry key="ws-security.encryption.properties" value="org/apache/cxf/systest/ws/wssec10/server/alice.properties"/>
+            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.wssec10.server.KeystorePasswordCallback"/>
+        </jaxws:properties> 
+
+    </jaxws:endpoint> 
+
+    
+</beans>

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/server.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/server.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/server.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/server_restricted.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/server_restricted.xml?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/server_restricted.xml (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/server_restricted.xml Fri Jun  5 18:21:57 2009
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+ 
+ http://www.apache.org/licenses/LICENSE-2.0
+ 
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:jaxws="http://cxf.apache.org/jaxws"
+    xmlns:http="http://cxf.apache.org/transports/http/configuration"
+    xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
+    xmlns:sec="http://cxf.apache.org/configuration/security"
+    xmlns:security="http://schemas.iona.com/soa/security-config"
+    xmlns:interop="http://WSSec/wssec10"
+    xmlns:cxf="http://cxf.apache.org/core"
+    xmlns:p="http://cxf.apache.org/policy"
+    xsi:schemaLocation="
+        http://www.springframework.org/schema/beans                     http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+        http://cxf.apache.org/jaxws                                     http://cxf.apache.org/schemas/jaxws.xsd
+        http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
+        http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd
+        http://cxf.apache.org/transports/http/configuration             http://cxf.apache.org/schemas/configuration/http-conf.xsd
+        http://cxf.apache.org/transports/http-jetty/configuration       http://cxf.apache.org/schemas/configuration/http-jetty.xsd
+        http://cxf.apache.org/configuration/security                    http://cxf.apache.org/schemas/configuration/security.xsd
+        http://schemas.iona.com/soa/security-config                     http://schemas.iona.com/soa/security-config.xsd
+    ">
+    
+    <cxf:bus>
+        <cxf:features>
+            <p:policies/>
+            <cxf:logging/>
+        </cxf:features>
+    </cxf:bus>
+
+    <!-- -->
+    <!-- Any services listening on port 9001 must use the following -->
+    <!-- Transport Layer Security (TLS) settings -->
+    <!-- -->
+    <httpj:engine-factory id="tls-settings">
+        <httpj:engine port="9001">
+            <httpj:tlsServerParameters>
+                <sec:keyManagers keyPassword="password">
+                    <sec:keyStore type="jks" password="password" resource="org/apache/cxf/systest/ws/wssec10/certs/restricted/bob.jks"/>
+                </sec:keyManagers>
+                <sec:trustManagers>
+                    <sec:keyStore type="jks" password="password" resource="org/apache/cxf/systest/ws/wssec10/certs/restricted/alice.jks"/>
+                </sec:trustManagers> 
+
+                <!--
+                <sec:cipherSuitesFilter>
+                    <sec:include>.*_EXPORT_.*</sec:include>
+                    <sec:include>.*_EXPORT1024_.*</sec:include>
+                    <sec:include>.*_WITH_DES_.*</sec:include>
+                    <sec:include>.*_WITH_NULL_.*</sec:include>
+                    <sec:exclude>.*_DH_anon_.*</sec:exclude>
+                </sec:cipherSuitesFilter>
+                <sec:clientAuthentication want="true" required="true"/>
+                -->
+            </httpj:tlsServerParameters>
+        </httpj:engine>
+    </httpj:engine-factory>
+    
+    <!-- -->
+    <!-- Scenario 3.1 -->
+    <!-- -->
+    <jaxws:endpoint 
+       id="UserNameOverTransport"
+       address="https://localhost:9001/UserNameOverTransport" 
+       serviceName="interop:PingService"
+       endpointName="interop:UserNameOverTransport_IPingService"
+       implementor="org.apache.cxf.systest.ws.wssec10.server.UserNameOverTransportRestricted"
+       depends-on="tls-settings">
+        
+       <jaxws:properties>
+            <entry key="ws-security.username" value="Alice"/>
+            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.wssec10.server.UTPasswordCallback"/>
+        </jaxws:properties> 
+     
+    </jaxws:endpoint> 
+    
+
+    <!-- -->
+    <!-- Scenario 3.3 -->
+    <!-- -->
+    <jaxws:endpoint 
+       name="{http://WSSec/wssec10}MutualCertificate10SignEncrypt_IPingService"
+       id="MutualCertificate10SignEncrypt"
+       address="http://localhost:9002/MutualCertificate10SignEncrypt" 
+       serviceName="interop:PingService"
+       endpointName="interop:MutualCertificate10SignEncrypt_IPingService"
+       implementor="org.apache.cxf.systest.ws.wssec10.server.MutualCertificate10SignEncryptRestricted">
+        
+        <jaxws:properties>
+            <entry key="ws-security.username" value="Alice"/>
+            <entry key="ws-security.signature.properties" value="org/apache/cxf/systest/ws/wssec10/server/bob.properties"/>
+            <entry key="ws-security.encryption.properties" value="org/apache/cxf/systest/ws/wssec10/server/alice.properties"/>
+            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.wssec10.server.KeystorePasswordCallback"/>
+        </jaxws:properties> 
+
+    </jaxws:endpoint> 
+    
+
+    <!-- -->
+    <!-- Scenario 3.4 -->
+    <!-- -->
+    <jaxws:endpoint 
+       name="{http://WSSec/wssec10}MutualCertificate10SignEncryptRsa15TripleDes_IPingService"
+       id="MutualCertificate10SignEncryptRsa15TripleDes"
+       address="http://localhost:9000/MutualCertificate10SignEncryptRsa15TripleDes" 
+       serviceName="interop:PingService"
+       endpointName="interop:MutualCertificate10SignEncryptRsa15TripleDes_IPingService"
+       implementor="org.apache.cxf.systest.ws.wssec10.server.MutualCertificate10SignEncryptRsa15TripleDesRestricted">
+        
+        <jaxws:properties>
+            <entry key="ws-security.username" value="Alice"/>
+            <entry key="ws-security.signature.properties" value="org/apache/cxf/systest/ws/wssec10/server/bob.properties"/>
+            <entry key="ws-security.encryption.properties" value="org/apache/cxf/systest/ws/wssec10/server/alice.properties"/>
+            <entry key="ws-security.callback-handler" value="org.apache.cxf.systest.ws.wssec10.server.KeystorePasswordCallback"/>
+        </jaxws:properties> 
+
+    </jaxws:endpoint> 
+
+    
+</beans>

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/server_restricted.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/server_restricted.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/server_restricted.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity111Test.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity111Test.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity111Test.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity111Test.java Fri Jun  5 18:21:57 2009
@@ -0,0 +1,77 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.ws.wssec11;
+
+import org.apache.cxf.systest.ws.wssec11.server.Server;
+import org.apache.cxf.systest.ws.wssec11.server.ServerRestricted;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+/**
+ * This class runs the first half of the tests, as having all in 
+ * the one class causes an out of memory problem in eclipse
+ */
+public class WSSecurity111Test extends WSSecurity11Common {
+    private static boolean unrestrictedPoliciesInstalled;
+    
+    static {
+        unrestrictedPoliciesInstalled = checkUnrestrictedPoliciesInstalled();
+    };
+
+    @BeforeClass
+    public static void startServers() throws Exception {
+        if (unrestrictedPoliciesInstalled) {
+            assertTrue(
+                    "Server failed to launch",
+                    // run the server in the same process
+                    // set this to false to fork
+                    launchServer(Server.class, true)
+            );
+        } else {
+            assertTrue(
+                    "Server failed to launch",
+                    // run the server in the same process
+                    // set this to false to fork
+                    launchServer(ServerRestricted.class, true)
+            );
+        }
+    }
+
+    @Test
+    public void testClientServer() {
+        String[] argv = new String[] {
+            "A",
+            "A-NoTimestamp",
+            "AD",
+            "A-ES",
+            "AD-ES",
+            "UX",
+            "UX-NoTimestamp",
+            "UXD",
+            "UX-SEES",
+            "UXD-SEES", 
+        };
+        runClientServer(argv, unrestrictedPoliciesInstalled);
+    }
+    
+ 
+        
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity111Test.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity111Test.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity112Test.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity112Test.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity112Test.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity112Test.java Fri Jun  5 18:21:57 2009
@@ -0,0 +1,88 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.ws.wssec11;
+
+
+import org.apache.cxf.systest.ws.wssec11.server.Server;
+import org.apache.cxf.systest.ws.wssec11.server.ServerRestricted;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+/**
+ * This class runs the second half of the tests, as having all in 
+ * the one class causes an out of meemory problem in eclipse
+ */
+public class WSSecurity112Test extends WSSecurity11Common {
+    private static boolean unrestrictedPoliciesInstalled;
+    
+    static {
+        unrestrictedPoliciesInstalled = checkUnrestrictedPoliciesInstalled();
+    };
+      
+    @BeforeClass
+    public static void startServers() throws Exception {
+        if (unrestrictedPoliciesInstalled) {
+            assertTrue(
+                    "Server failed to launch",
+                    // run the server in the same process
+                    // set this to false to fork
+                    launchServer(Server.class, true)
+            );
+        } else {
+            assertTrue(
+                    "Server failed to launch",
+                    // run the server in the same process
+                    // set this to false to fork
+                    launchServer(ServerRestricted.class, true)
+            );
+        }
+    }
+
+    @Test
+    public void testClientServer() {
+        String[] argv = null;
+        if (unrestrictedPoliciesInstalled) {
+            argv = new String[] {
+                "X",
+                "X-NoTimestamp",
+                "X-AES128",
+                "X-AES192",
+                "X-TripleDES",
+                "XD",
+                "XD-ES",
+                "XD-SEES",
+            };
+        } else {
+            argv = new String[] {
+                "X",
+                "X-NoTimestamp",
+                "XD",
+                "XD-ES",
+                "XD-SEES",
+            };
+        }
+        runClientServer(argv, unrestrictedPoliciesInstalled);
+
+    }
+    
+ 
+    
+}
\ No newline at end of file

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity112Test.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity112Test.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java Fri Jun  5 18:21:57 2009
@@ -0,0 +1,133 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.ws.wssec11;
+
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.crypto.Cipher;
+import javax.crypto.SecretKey;
+import javax.crypto.spec.SecretKeySpec;
+import javax.xml.namespace.QName;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+
+import wssec.wssec11.IPingService;
+import wssec.wssec11.PingService11;
+
+
+/**
+ *
+ */
+public class WSSecurity11Common extends AbstractBusClientServerTestBase {
+
+       
+    private static final String INPUT = "foo";
+
+    public void runClientServer(String[] argv, boolean unrestrictedPoliciesInstalled) {
+        
+        Bus bus = null;
+        if (unrestrictedPoliciesInstalled) {
+            bus = new SpringBusFactory().createBus("org/apache/cxf/systest/ws/wssec11/client/client.xml");
+        } else {
+            bus = new SpringBusFactory().createBus(
+                    "org/apache/cxf/systest/ws/wssec11/client/client_restricted.xml");
+        }
+        BusFactory.setDefaultBus(bus);
+        BusFactory.setThreadDefaultBus(bus);
+        List<String> results = new ArrayList<String>();
+        URL wsdlLocation = null;
+        for (String portPrefix : argv) {
+            try {
+                PingService11 svc = null; 
+                wsdlLocation = getWsdlLocation(portPrefix); 
+                svc = new PingService11(wsdlLocation);
+                final IPingService port = 
+                    svc.getPort(
+                        new QName(
+                            "http://WSSec/wssec11",
+                            portPrefix + "_IPingService"
+                        ),
+                        IPingService.class
+                    );
+                
+                final String output = port.echo(INPUT);
+                assertTrue("INPUT, " + INPUT + " not equal to output, " + output, 
+                        output.equals(INPUT));
+                if (!INPUT.equals(output)) {
+                    System.err.println(
+                        "Expected " + INPUT + " but got " + output
+                    );
+                    results.add("Expected " + INPUT + " but got " + output);
+                } else {
+                    System.out.println("OK!");
+                    results.add("OK");
+                }
+            } catch (Throwable t) {
+                results.add("Exception: " + t);
+                t.printStackTrace();
+                assertTrue("Unexpected exception thrown, t = " + t,
+                        t == null);
+                
+            }
+        }
+        for (int x = 0; x < argv.length; x++) {
+            System.out.println(argv[x] + ": " + results.get(x));
+        }
+    }
+    
+ 
+    
+    private static URL getWsdlLocation(String portPrefix) {
+        try {
+            return new URL("http://localhost:9001/" + portPrefix + "PingService?wsdl");
+        } catch (MalformedURLException mue) {
+            return null;
+        }
+    }
+
+    
+    public static boolean checkUnrestrictedPoliciesInstalled() {
+        boolean unrestrictedPoliciesInstalled = false;
+        try {
+            byte[] data = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
+
+            SecretKey key192 = new SecretKeySpec(
+                new byte[] {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+                            0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+                            0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17},
+                            "AES");
+            Cipher c = Cipher.getInstance("AES");
+            c.init(Cipher.ENCRYPT_MODE, key192);
+            c.doFinal(data);
+            unrestrictedPoliciesInstalled = true;
+        } catch (Exception e) {
+            return unrestrictedPoliciesInstalled;
+        }
+        return unrestrictedPoliciesInstalled;
+    }
+    
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/alice.jks
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/alice.jks?rev=782089&view=auto
==============================================================================
Files cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/alice.jks (added) and cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/alice.jks Fri Jun  5 18:21:57 2009 differ

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/bob.jks
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/bob.jks?rev=782089&view=auto
==============================================================================
Files cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/bob.jks (added) and cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/bob.jks Fri Jun  5 18:21:57 2009 differ

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/cxfca.jks
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/cxfca.jks?rev=782089&view=auto
==============================================================================
Files cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/cxfca.jks (added) and cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/cxfca.jks Fri Jun  5 18:21:57 2009 differ

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/restricted/alice.jks
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/restricted/alice.jks?rev=782089&view=auto
==============================================================================
Files cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/restricted/alice.jks (added) and cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/restricted/alice.jks Fri Jun  5 18:21:57 2009 differ

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/restricted/bob.jks
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/restricted/bob.jks?rev=782089&view=auto
==============================================================================
Files cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/restricted/bob.jks (added) and cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/restricted/bob.jks Fri Jun  5 18:21:57 2009 differ

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/restricted/cxfca.jks
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/restricted/cxfca.jks?rev=782089&view=auto
==============================================================================
Files cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/restricted/cxfca.jks (added) and cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/restricted/cxfca.jks Fri Jun  5 18:21:57 2009 differ

Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/client/KeystorePasswordCallback.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/client/KeystorePasswordCallback.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/client/KeystorePasswordCallback.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/client/KeystorePasswordCallback.java Fri Jun  5 18:21:57 2009
@@ -0,0 +1,69 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.systest.ws.wssec11.client;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.security.auth.callback.Callback;
+import javax.security.auth.callback.CallbackHandler;
+import javax.security.auth.callback.UnsupportedCallbackException;
+
+import org.apache.ws.security.WSPasswordCallback;
+
+/**
+ */
+
+public class KeystorePasswordCallback implements CallbackHandler {
+    
+    private Map<String, String> passwords = 
+        new HashMap<String, String>();
+    
+    public KeystorePasswordCallback() {
+        passwords.put("Alice", "abcd!1234");
+        passwords.put("alice", "password");
+        passwords.put("Bob", "abcd!1234");
+        passwords.put("bob", "password");
+        passwords.put("abcd", "dcba");
+    }
+
+    /**
+     * It attempts to get the password from the private 
+     * alias/passwords map.
+     */
+    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {
+        for (int i = 0; i < callbacks.length; i++) {
+            WSPasswordCallback pc = (WSPasswordCallback)callbacks[i];
+
+            String pass = passwords.get(pc.getIdentifier());
+            if (pass != null) {
+                pc.setPassword(pass);
+                return;
+            }
+        }
+    }
+    
+    /**
+     * Add an alias/password pair to the callback mechanism.
+     */
+    public void setAliasPassword(String alias, String password) {
+        passwords.put(alias, password);
+    }
+}

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/client/KeystorePasswordCallback.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/client/KeystorePasswordCallback.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date



Mime
View raw message