You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2009/06/05 20:22:00 UTC
svn commit: r782089 [1/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...
Author: dkulp
Date: Fri Jun 5 18:21:57 2009
New Revision: 782089
URL: http://svn.apache.org/viewvc?rev=782089&view=rev
Log:
[CXF-2194, CXF-2251] Add system tests for much of the WS-SecurityPolicy
stuff as well as not swallowing an exception. Fix from Eamonn Dwyer
applied.
Added:
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCTest.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/certs/
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/certs/alice.jks
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/certs/alice.p12
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/certs/bob.jks
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/certs/cxfca.jks
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/KeystorePasswordCallback.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/UTPasswordCallback.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/alice.properties (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/bob.properties (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/client.xml (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/PingServiceImpl.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/Server.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/alice.properties (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/bob.properties (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/server.xml (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/alice.jks
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/bob.jks
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/cxfca.jks
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/restricted/
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/restricted/alice.jks
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/restricted/bob.jks
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/restricted/cxfca.jks
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/KeystorePasswordCallback.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/UTPasswordCallback.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/alice.properties (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/bob.properties (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/client.xml (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/client_restricted.xml (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/KeystorePasswordCallback.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncrypt.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncryptRestricted.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncryptRsa15TripleDes.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/MutualCertificate10SignEncryptRsa15TripleDesRestricted.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/PingServiceBase.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/Server.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/UTPasswordCallback.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/UserNameOverTransport.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/UserNameOverTransportRestricted.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/alice.properties (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/bob.properties (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/server.xml (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/server/server_restricted.xml (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity111Test.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity112Test.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/WSSecurity11Common.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/alice.jks
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/bob.jks
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/cxfca.jks
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/restricted/
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/restricted/alice.jks
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/restricted/bob.jks
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/certs/restricted/cxfca.jks
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/client/
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/client/KeystorePasswordCallback.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/client/UTPasswordCallback.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/client/alice.properties (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/client/bob.properties (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/client/client.xml (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/client/client_restricted.xml (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/client/restricted/
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/client/restricted/alice.properties (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/client/restricted/bob.properties (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/server/
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/server/KeystorePasswordCallback.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/server/PingService.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/server/Server.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/server/ServerRestricted.java (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/server/alice.properties (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/server/bob.properties (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/server/restricted/
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/server/restricted/alice.properties (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/server/restricted/bob.properties (with props)
cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec11/server/server.xml (with props)
cxf/trunk/systests/src/test/resources/wsdl_systest/wssc/
cxf/trunk/systests/src/test/resources/wsdl_systest/wssc/WSSecureConversation.wsdl (with props)
cxf/trunk/systests/src/test/resources/wsdl_systest/wssc/WSSecureConversation_policy.wsdl (with props)
cxf/trunk/systests/src/test/resources/wsdl_systest/wssc/XMLSoapPing.xsd (with props)
cxf/trunk/systests/src/test/resources/wsdl_systest/wssec10/
cxf/trunk/systests/src/test/resources/wsdl_systest/wssec10/WsSecurity10.wsdl (with props)
cxf/trunk/systests/src/test/resources/wsdl_systest/wssec10/WsSecurity10_policy.wsdl (with props)
cxf/trunk/systests/src/test/resources/wsdl_systest/wssec10/WsSecurity10_policy_restricted.wsdl (with props)
cxf/trunk/systests/src/test/resources/wsdl_systest/wssec10/WsSecurity10_restricted.wsdl (with props)
cxf/trunk/systests/src/test/resources/wsdl_systest/wssec11/
cxf/trunk/systests/src/test/resources/wsdl_systest/wssec11/WsSecurity11.wsdl (with props)
cxf/trunk/systests/src/test/resources/wsdl_systest/wssec11/WsSecurity11_policy.wsdl (with props)
cxf/trunk/systests/src/test/resources/wsdl_systest/wssec11/WsSecurity11_policy_restricted.wsdl (with props)
cxf/trunk/systests/src/test/resources/wsdl_systest/wssec11/WsSecurity11_restricted.wsdl (with props)
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCTest.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCTest.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCTest.java Fri Jun 5 18:21:57 2009
@@ -0,0 +1,172 @@
+/**
+ * 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.wssc;
+
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.systest.ws.wssc.server.Server;
+import org.apache.cxf.systest.ws.wssec11.WSSecurity11Common;
+import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.apache.cxf.ws.security.SecurityConstants;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.xmlsoap.ping.Ping;
+
+import wssec.wssc.IPingService;
+import wssec.wssc.PingRequest;
+import wssec.wssc.PingResponse;
+import wssec.wssc.PingService;
+
+
+/**
+ *
+ */
+public class WSSCTest extends AbstractBusClientServerTestBase {
+
+
+ private static final String OUT = "CXF : ping";
+
+ @BeforeClass
+ public static void startServers() throws Exception {
+ if (!WSSecurity11Common.checkUnrestrictedPoliciesInstalled()) {
+ //do nothing
+ return;
+ }
+ assertTrue(
+ "Server failed to launch",
+ // run the server in the same process
+ // set this to false to fork
+ launchServer(Server.class, true)
+ );
+ }
+
+ @Test
+ public void testClientServer() {
+ if (!WSSecurity11Common.checkUnrestrictedPoliciesInstalled()) {
+ //do nothing
+ return;
+ }
+ String[] argv = new String[] {
+ "SecureConversation_MutualCertificate10SignEncrypt_IPingService",
+ "AC_IPingService",
+ "ADC_IPingService",
+ "ADC-ES_IPingService",
+ "_A_IPingService",
+ "_AD_IPingService",
+ "_AD-ES_IPingService",
+
+ "UXC_IPingService",
+ "UXDC_IPingService",
+ "UXDC-SEES_IPingService",
+ "_UX_IPingService",
+ "_UXD_IPingService",
+ "_UXD-SEES_IPingService",
+
+
+ "XC_IPingService",
+ "XDC_IPingService",
+ "XDC_IPingService1",
+ "XDC-ES_IPingService",
+ "XDC-SEES_IPingService",
+ "_X_IPingService",
+ "_X10_IPingService",
+ "_XD_IPingService",
+ "_XD-SEES_IPingService",
+ "_XD-ES_IPingService",
+ };
+ //argv = new String[] {argv[1]};
+ final Bus bus =
+ new SpringBusFactory().createBus("org/apache/cxf/systest/ws/wssc/client/client.xml");
+ BusFactory.setDefaultBus(bus);
+ BusFactory.setThreadDefaultBus(bus);
+ List<String> results = new ArrayList<String>(argv.length);
+ URL wsdlLocation = null;
+
+ for (String portPrefix : argv) {
+ try {
+ PingService svc;
+ wsdlLocation = new URL("http://localhost:9001/" + portPrefix + "?wsdl");
+
+ svc = new PingService(wsdlLocation);
+ final IPingService port =
+ svc.getPort(
+ new QName(
+ "http://WSSec/wssc",
+ portPrefix
+ ),
+ IPingService.class
+ );
+
+
+ if (portPrefix.charAt(0) == '_') {
+ //MS would like the _ versions to send a cancel
+ ((BindingProvider)port).getRequestContext()
+ .put(SecurityConstants.STS_TOKEN_DO_CANCEL, Boolean.TRUE);
+ }
+ PingRequest params = new PingRequest();
+ Ping ping = new Ping();
+ ping.setOrigin("CXF");
+ ping.setScenario("Scenario5");
+ ping.setText("ping");
+ params.setPing(ping);
+ PingResponse output = port.ping(params);
+ assertTrue("Expected OUT, " + OUT + ", not equal to received :"
+ + output.getPingResponse().getText(),
+ OUT.equals(output.getPingResponse().getText()));
+ if (!OUT.equals(output.getPingResponse().getText())) {
+ System.err.println(
+ "Expected " + OUT + " but got " + output.getPingResponse().getText()
+ );
+ results.add("Unexpected output " + output.getPingResponse().getText());
+
+ } else {
+ System.out.println(portPrefix + ": OK!");
+ results.add("OK!");
+ }
+ } catch (Throwable t) {
+ t.printStackTrace();
+ results.add("Exception: " + t);
+ assertTrue("Unexpected exception thrown, t : " + t,
+ t == null);
+ }
+ //blasting the MS endpoints tends to cause a hang
+ //pause a sec to allow it to recover
+ try {
+ Thread.sleep(1000);
+ System.gc();
+ } catch (Exception e) {
+ //not really a problem
+ }
+ }
+ for (int x = 0; x < argv.length; x++) {
+ System.out.println(argv[x] + ": " + results.get(x));
+ }
+ }
+
+
+}
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/WSSCTest.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/certs/alice.jks
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/certs/alice.jks?rev=782089&view=auto
==============================================================================
Files cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/certs/alice.jks (added) and cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/certs/alice.jks Fri Jun 5 18:21:57 2009 differ
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/certs/alice.p12
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/certs/alice.p12?rev=782089&view=auto
==============================================================================
Files cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/certs/alice.p12 (added) and cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/certs/alice.p12 Fri Jun 5 18:21:57 2009 differ
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/certs/bob.jks
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/certs/bob.jks?rev=782089&view=auto
==============================================================================
Files cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/certs/bob.jks (added) and cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/certs/bob.jks Fri Jun 5 18:21:57 2009 differ
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/certs/cxfca.jks
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/certs/cxfca.jks?rev=782089&view=auto
==============================================================================
Files cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/certs/cxfca.jks (added) and cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/certs/cxfca.jks Fri Jun 5 18:21:57 2009 differ
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/KeystorePasswordCallback.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/KeystorePasswordCallback.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/KeystorePasswordCallback.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/KeystorePasswordCallback.java Fri Jun 5 18:21:57 2009
@@ -0,0 +1,78 @@
+/**
+ * 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.wssc.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");
+ 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/wssc/client/KeystorePasswordCallback.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/KeystorePasswordCallback.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/UTPasswordCallback.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/UTPasswordCallback.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/UTPasswordCallback.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/UTPasswordCallback.java Fri Jun 5 18:21:57 2009
@@ -0,0 +1,71 @@
+/**
+ * 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.wssc.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");
+ }
+
+ /**
+ * 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/wssc/client/UTPasswordCallback.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/UTPasswordCallback.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/alice.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/alice.properties?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/alice.properties (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/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/wssc/certs/alice.jks
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/alice.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/alice.properties
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/alice.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/bob.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/bob.properties?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/bob.properties (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/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/wssc/certs/bob.jks
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/bob.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/bob.properties
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/bob.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/client.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/client.xml?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/client.xml (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/client.xml Fri Jun 5 18:21:57 2009
@@ -0,0 +1,260 @@
+<?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>
+
+
+ <jaxws:client name="{http://WSSec/wssc}SecureConversation_UserNameOverTransport_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username.sct" value="Alice"/>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.UTPasswordCallback"/>
+ </jaxws:properties>
+ </jaxws:client>
+ <jaxws:client name="{http://WSSec/wssc}SecureConversation_MutualCertificate10SignEncrypt_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.signature.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/alice.properties"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+
+
+ <jaxws:client name="{http://WSSec/wssc}AC_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+ <jaxws:client name="{http://WSSec/wssc}ADC_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+ <jaxws:client name="{http://WSSec/wssc}ADC-ES_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+ <jaxws:client name="{http://WSSec/wssc}_A_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+ <jaxws:client name="{http://WSSec/wssc}_AD_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+ <jaxws:client name="{http://WSSec/wssc}_AD-ES_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+
+ <jaxws:client name="{http://WSSec/wssc}XC_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username.sct" value="abcd"/>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+
+ <jaxws:client name="{http://WSSec/wssc}XDC_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username.sct" value="abcd"/>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+
+ <jaxws:client name="{http://WSSec/wssc}XDC_IPingService1" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username.sct" value="abcd"/>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+
+ <jaxws:client name="{http://WSSec/wssc}XDC-ES_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username.sct" value="abcd"/>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+
+ <jaxws:client name="{http://WSSec/wssc}XDC-SEES_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username.sct" value="abcd"/>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+
+ <jaxws:client name="{http://WSSec/wssc}_X_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username.sct" value="abcd"/>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+
+ <jaxws:client name="{http://WSSec/wssc}_X10_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username.sct" value="abcd"/>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.signature.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/alice.properties"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+
+ <jaxws:client name="{http://WSSec/wssc}_XD_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username.sct" value="abcd"/>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+
+ <jaxws:client name="{http://WSSec/wssc}_XD-SEES_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username.sct" value="abcd"/>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+
+ <jaxws:client name="{http://WSSec/wssc}_XD-ES_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username.sct" value="abcd"/>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+
+ <jaxws:client name="{http://WSSec/wssc}UXC_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username.sct" value="abcd"/>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+ <jaxws:client name="{http://WSSec/wssc}UXDC_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username.sct" value="abcd"/>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+ <jaxws:client name="{http://WSSec/wssc}UXDC-SEES_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username.sct" value="abcd"/>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+ <jaxws:client name="{http://WSSec/wssc}_UX_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username.sct" value="abcd"/>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+ <jaxws:client name="{http://WSSec/wssc}_UXD_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username.sct" value="abcd"/>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+ <jaxws:client name="{http://WSSec/wssc}_UXD-SEES_IPingService" createdFromAPI="true">
+ <jaxws:properties>
+ <entry key="ws-security.username.sct" value="abcd"/>
+ <entry key="ws-security.callback-handler.sct" value="org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback"/>
+ <entry key="ws-security.encryption.properties.sct" value="org/apache/cxf/systest/ws/wssc/client/bob.properties"/>
+ </jaxws:properties>
+ </jaxws:client>
+
+ <http:conduit name="http://localhost/.*">
+ <http:client AllowChunking="false"/>
+ </http:conduit>
+ <http:conduit name="http://localhost/.*">
+ <http:client AllowChunking="false"/>
+ </http:conduit>
+ <http:conduit name="https://localhost/.*">
+ <http:tlsClientParameters disableCNCheck="true">
+ <sec:keyManagers keyPassword="password">
+ <sec:keyStore type="pkcs12" password="password" resource="org/apache/cxf/systest/ws/wssc/certs/alice.jks"/>
+ </sec:keyManagers>
+ <sec:trustManagers>
+ <sec:keyStore type="pkcs12" password="password" resource="org/apache/cxf/systest/ws/wssc/certs/bob.jks"/>
+ </sec:trustManagers>
+ </http:tlsClientParameters>
+ <http:client AllowChunking="false"/>
+ </http:conduit>
+ <http:conduit name="https://localhost/.*">
+ <http:tlsClientParameters disableCNCheck="true">
+ <sec:keyManagers keyPassword="password">
+ <sec:keyStore type="pkcs12" password="password" resource="org/apache/cxf/systest/ws/wssc/certs/bob.jks"/>
+ </sec:keyManagers>
+ <sec:trustManagers>
+ <sec:keyStore type="pkcs12" password="password" resource="org/apache/cxf/systest/ws/wssc/certs/WssIP.jks"/>
+ </sec:trustManagers>
+ </http:tlsClientParameters>
+ <http:client AllowChunking="false"/>
+ </http:conduit>
+ <http:conduit name="https://localhost:8443/.*">
+ <http:tlsClientParameters disableCNCheck="true">
+ <sec:keyManagers keyPassword="password">
+ <sec:keyStore type="pkcs12" password="password" resource="org/apache/cxf/systest/ws/wssc/certs/alice.jks"/>
+ </sec:keyManagers>
+ <sec:trustManagers>
+ <sec:keyStore type="pkcs12" password="password" resource="org/apache/cxf/systest/ws/wssc/certs/WssIP.jks"/>
+ </sec:trustManagers>
+ </http:tlsClientParameters>
+ <http:client AllowChunking="false"/>
+ </http:conduit>
+
+
+</beans>
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/client.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/client.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/client/client.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/PingServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/PingServiceImpl.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/PingServiceImpl.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/PingServiceImpl.java Fri Jun 5 18:21:57 2009
@@ -0,0 +1,52 @@
+/**
+ * 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.wssc.server;
+
+
+import org.xmlsoap.ping.PingResponseBody;
+
+import wssec.wssc.IPingService;
+import wssec.wssc.PingRequest;
+import wssec.wssc.PingResponse;
+
+/**
+ *
+ */
+public class PingServiceImpl implements IPingService {
+
+ public String echo(String request) {
+ return request;
+ }
+
+
+
+ public PingResponse ping(PingRequest parameters) {
+ PingResponse resp = new PingResponse();
+ PingResponseBody body = new PingResponseBody();
+ body.setOrigin("CXF");
+ body.setScenario(parameters.getPing().getScenario());
+ body.setText(parameters.getPing().getOrigin() + " : "
+ + parameters.getPing().getText());
+ resp.setPingResponse(body);
+ return resp;
+ }
+
+
+
+}
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/PingServiceImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/PingServiceImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/Server.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/Server.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/Server.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/Server.java Fri Jun 5 18:21:57 2009
@@ -0,0 +1,291 @@
+/**
+ * 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.wssc.server;
+
+import javax.xml.ws.Endpoint;
+
+import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
+import org.apache.cxf.bus.spring.SpringBusFactory;
+import org.apache.cxf.systest.ws.wssc.client.KeystorePasswordCallback;
+import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+import org.apache.cxf.ws.security.SecurityConstants;
+import org.apache.ws.security.WSSConfig;
+
+
+public class Server extends AbstractBusTestServerBase {
+
+ public Server() throws Exception {
+
+ }
+
+ protected Server(String baseUrl) throws Exception {
+
+
+ //"SecureConversation_UserNameOverTransport_IPingService",
+ doPublish(baseUrl + "SecureConversation_MutualCertificate10SignEncrypt_IPingService",
+ new SCMCSEIPingService());
+
+ doPublish(baseUrl + "AC_IPingService", new ACIPingService());
+ doPublish(baseUrl + "ADC_IPingService", new ADCIPingService());
+ doPublish(baseUrl + "ADC-ES_IPingService", new ADCESIPingService());
+ doPublish(baseUrl + "_A_IPingService", new AIPingService());
+ doPublish(baseUrl + "_AD_IPingService", new ADIPingService());
+ doPublish(baseUrl + "_AD-ES_IPingService", new ADESIPingService());
+
+ doPublish(baseUrl + "UXC_IPingService", new UXCIPingService());
+ doPublish(baseUrl + "UXDC_IPingService", new UXDCIPingService());
+ doPublish(baseUrl + "UXDC-SEES_IPingService", new UXDCSEESIPingService());
+ doPublish(baseUrl + "_UX_IPingService", new UXIPingService());
+ doPublish(baseUrl + "_UXD_IPingService", new UXDIPingService());
+ doPublish(baseUrl + "_UXD-SEES_IPingService", new UXDSEESIPingService());
+
+ doPublish(baseUrl + "XC_IPingService", new XCIPingService());
+ doPublish(baseUrl + "XDC_IPingService", new XDCIPingService());
+ doPublish(baseUrl + "XDC_IPingService1", new XDC1IPingService());
+ doPublish(baseUrl + "XDC-ES_IPingService", new XDCESIPingService());
+ doPublish(baseUrl + "XDC-SEES_IPingService", new XDCSEESIPingService());
+ doPublish(baseUrl + "_X_IPingService", new XIPingService());
+ doPublish(baseUrl + "_X10_IPingService", new X10IPingService());
+ doPublish(baseUrl + "_XD_IPingService", new XDIPingService());
+ doPublish(baseUrl + "_XD-SEES_IPingService", new XDSEESIPingService());
+ doPublish(baseUrl + "_XD-ES_IPingService", new XDESIPingService());
+
+
+ //Kerberos token - not sure where the token comes from or how these work
+ //"KC_IPingService",
+ //"KDC_IPingService",
+ //"KC10_IPingService",
+ //"KDC10_IPingService",
+ //"_K10_IPingService",
+ //"_KD10_IPingService",
+ //"_K_IPingService",
+ //"_KD_IPingService",
+ //"_KD-SEES_IPingService",
+
+ }
+
+ protected void run() {
+ try {
+ WSSConfig.getDefaultWSConfig();
+ new Server("http://localhost:9001/");
+ Bus busLocal = new SpringBusFactory().createBus(
+ "org/apache/cxf/systest/ws/wssc/server/server.xml");
+ BusFactory.setDefaultBus(busLocal);
+ setBus(busLocal);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+
+ private void doPublish(String url, Object obj) {
+ Endpoint ep = Endpoint.create(obj);
+ ep.getProperties().put(SecurityConstants.CALLBACK_HANDLER + ".sct", new KeystorePasswordCallback());
+ ep.getProperties().put(SecurityConstants.ENCRYPT_PROPERTIES + ".sct",
+ "org/apache/cxf/systest/ws/wssec11/server/bob.properties");
+
+ if (url.contains("X10_I")) {
+ ep.getProperties().put(SecurityConstants.SIGNATURE_PROPERTIES + ".sct",
+ "org/apache/cxf/systest/ws/wssec11/server/bob.properties");
+ ep.getProperties().put(SecurityConstants.ENCRYPT_PROPERTIES + ".sct",
+ "org/apache/cxf/systest/ws/wssec11/server/alice.properties");
+ }
+ ep.publish(url);
+ }
+
+ public static void main(String args[]) throws Exception {
+ WSSConfig.getDefaultWSConfig();
+ new SpringBusFactory().createBus("org/apache/cxf/systest/ws/wssc/server/server.xml");
+ new Server("http://localhost:9001/");
+ System.out.println("Server ready...");
+
+ Thread.sleep(60 * 60 * 10000);
+ System.out.println("Server exiting");
+ System.exit(0);
+ }
+
+
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "SecureConversation_MutualCertificate10SignEncrypt_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class SCMCSEIPingService extends PingServiceImpl {
+ }
+
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "AC_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class ACIPingService extends PingServiceImpl {
+ }
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "ADC_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class ADCIPingService extends PingServiceImpl {
+ }
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "ADC-ES_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class ADCESIPingService extends PingServiceImpl {
+ }
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "_A_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class AIPingService extends PingServiceImpl {
+ }
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "_AD_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class ADIPingService extends PingServiceImpl {
+ }
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "_AD-ES_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class ADESIPingService extends PingServiceImpl {
+ }
+
+
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "UXC_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class UXCIPingService extends PingServiceImpl {
+ }
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "UXDC_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class UXDCIPingService extends PingServiceImpl {
+ }
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "UXDC-SEES_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class UXDCSEESIPingService extends PingServiceImpl {
+ }
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "_UX_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class UXIPingService extends PingServiceImpl {
+ }
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "_UXD_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class UXDIPingService extends PingServiceImpl {
+ }
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "_UXD-SEES_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class UXDSEESIPingService extends PingServiceImpl {
+ }
+
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "XC_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class XCIPingService extends PingServiceImpl {
+ }
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "XDC_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class XDCIPingService extends PingServiceImpl {
+ }
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "XDC_IPingService1",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class XDC1IPingService extends PingServiceImpl {
+ }
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "XDC-ES_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class XDCESIPingService extends PingServiceImpl {
+ }
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "XDC-SEES_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class XDCSEESIPingService extends PingServiceImpl {
+ }
+
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "_X_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class XIPingService extends PingServiceImpl {
+ }
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "_X10_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class X10IPingService extends PingServiceImpl {
+ }
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "_XD_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class XDIPingService extends PingServiceImpl {
+ }
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "_XD-SEES_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class XDSEESIPingService extends PingServiceImpl {
+ }
+ @javax.jws.WebService(targetNamespace = "http://WSSec/wssc",
+ serviceName = "PingService",
+ portName = "_XD-ES_IPingService",
+ endpointInterface = "wssec.wssc.IPingService",
+ wsdlLocation = "target/test-classes/wsdl_systest/wssc/WSSecureConversation.wsdl")
+ public static class XDESIPingService extends PingServiceImpl {
+ }
+}
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/Server.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/Server.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/alice.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/alice.properties?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/alice.properties (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/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/wssc/certs/alice.jks
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/alice.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/alice.properties
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/alice.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/bob.properties
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/bob.properties?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/bob.properties (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/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/wssc/certs/bob.jks
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/bob.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/bob.properties
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/bob.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/server.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/server.xml?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/server.xml (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/server.xml Fri Jun 5 18:21:57 2009
@@ -0,0 +1,62 @@
+<?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"
+ xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration"
+
+ 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/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-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"
+>
+ <cxf:bus>
+ <cxf:features>
+ <p:policies/>
+ <cxf:logging/>
+ </cxf:features>
+ </cxf:bus>
+
+ <!-- -->
+ <!-- Any services listening on port 9002 must use the following -->
+ <!-- Transport Layer Security (TLS) settings -->
+ <!-- -->
+ <httpj:engine-factory bus="cxf">
+ <httpj:engine port="9002">
+ <httpj:tlsServerParameters>
+ <sec:keyManagers keyPassword="password">
+ <sec:keyStore type="pkcs12" password="password" resource="org/apache/cxf/systest/ws/wssc/certs/alice.p12"/>
+ </sec:keyManagers>
+
+ </httpj:tlsServerParameters>
+ </httpj:engine>
+ </httpj:engine-factory>
+
+
+
+</beans>
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/server.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/server.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssc/server/server.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java Fri Jun 5 18:21:57 2009
@@ -0,0 +1,140 @@
+/**
+ * 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;
+
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+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.systest.ws.wssec10.server.Server;
+import org.apache.cxf.systest.ws.wssec11.WSSecurity11Common;
+import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import wssec.wssec10.IPingService;
+import wssec.wssec10.PingService;
+
+
+/**
+ *
+ */
+public class WSSecurity10Test extends AbstractBusClientServerTestBase {
+
+ private static final String INPUT = "foo";
+ private static boolean unrestrictedPoliciesInstalled;
+
+ static {
+ unrestrictedPoliciesInstalled = WSSecurity11Common.checkUnrestrictedPoliciesInstalled();
+ };
+
+ @BeforeClass
+ public static void startServers() throws Exception {
+
+ assertTrue(
+ "Server failed to launch",
+ // run the server in the same process
+ // set this to false to fork
+ launchServer(Server.class, true)
+ );
+ }
+
+ @Test
+ public void testClientServer() {
+
+ String[] argv = new String[] {
+ "UserNameOverTransport",
+ "MutualCertificate10SignEncrypt",
+ "MutualCertificate10SignEncryptRsa15TripleDes"
+ };
+ //argv = new String[] {argv[1]};
+ Bus bus = null;
+ if (unrestrictedPoliciesInstalled) {
+ bus = new SpringBusFactory().createBus("org/apache/cxf/systest/ws/wssec10/client/client.xml");
+ } else {
+ bus = new SpringBusFactory().createBus(
+ "org/apache/cxf/systest/ws/wssec10/client/client_restricted.xml");
+ }
+ BusFactory.setDefaultBus(bus);
+ BusFactory.setThreadDefaultBus(bus);
+ List<String> results = new ArrayList<String>();
+ URL wsdlLocation = null;
+ for (String portPrefix : argv) {
+ try {
+ PingService svc = null;
+ wsdlLocation = getWsdlLocation(portPrefix);
+ svc = new PingService(wsdlLocation);
+ final IPingService port =
+ svc.getPort(
+ new QName(
+ "http://WSSec/wssec10",
+ portPrefix + "_IPingService"
+ ),
+ IPingService.class
+ );
+
+ final String output = port.echo(INPUT);
+ assertTrue("Input, " + INPUT + " not equal to Output " + output,
+ INPUT.equals(output));
+ 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("Caught excetion: " + t,
+ false);
+ }
+ }
+ for (int x = 0; x < argv.length; x++) {
+ System.out.println(argv[x] + ": " + results.get(x));
+ }
+ }
+
+ private static URL getWsdlLocation(String portPrefix) {
+ try {
+ if ("UserNameOverTransport".equals(portPrefix)) {
+ return new URL("https://localhost:9001/" + portPrefix + "?wsdl");
+ } else if ("MutualCertificate10SignEncrypt".equals(portPrefix)) {
+ return new URL("http://localhost:9002/" + portPrefix + "?wsdl");
+ } else if ("MutualCertificate10SignEncryptRsa15TripleDes".equals(portPrefix)) {
+ return new URL("http://localhost:9000/" + portPrefix + "?wsdl");
+ }
+ } catch (MalformedURLException mue) {
+ return null;
+ }
+ return null;
+ }
+
+
+}
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/WSSecurity10Test.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/alice.jks
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/alice.jks?rev=782089&view=auto
==============================================================================
Files cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/alice.jks (added) and cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/alice.jks Fri Jun 5 18:21:57 2009 differ
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/bob.jks
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/bob.jks?rev=782089&view=auto
==============================================================================
Files cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/bob.jks (added) and cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/bob.jks Fri Jun 5 18:21:57 2009 differ
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/cxfca.jks
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/cxfca.jks?rev=782089&view=auto
==============================================================================
Files cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/cxfca.jks (added) and cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/cxfca.jks Fri Jun 5 18:21:57 2009 differ
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/restricted/alice.jks
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/restricted/alice.jks?rev=782089&view=auto
==============================================================================
Files cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/restricted/alice.jks (added) and cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/restricted/alice.jks Fri Jun 5 18:21:57 2009 differ
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/restricted/bob.jks
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/restricted/bob.jks?rev=782089&view=auto
==============================================================================
Files cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/restricted/bob.jks (added) and cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/restricted/bob.jks Fri Jun 5 18:21:57 2009 differ
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/restricted/cxfca.jks
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/restricted/cxfca.jks?rev=782089&view=auto
==============================================================================
Files cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/restricted/cxfca.jks (added) and cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/certs/restricted/cxfca.jks Fri Jun 5 18:21:57 2009 differ
Added: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/KeystorePasswordCallback.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/KeystorePasswordCallback.java?rev=782089&view=auto
==============================================================================
--- cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/KeystorePasswordCallback.java (added)
+++ cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/KeystorePasswordCallback.java Fri Jun 5 18:21:57 2009
@@ -0,0 +1,56 @@
+/**
+ * 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 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 {
+
+ public KeystorePasswordCallback() {
+ }
+
+ /**
+ * 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];
+ if ("alice".equals(pc.getIdentifier())) {
+ pc.setPassword("password");
+ } else if ("bob".equals(pc.getIdentifier())) {
+ pc.setPassword("password");
+ } else {
+ pc.setPassword("abcd!1234");
+ }
+ }
+ }
+
+
+}
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/KeystorePasswordCallback.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/wssec10/client/KeystorePasswordCallback.java
------------------------------------------------------------------------------
svn:keywords = Rev Date