Author: alessio.soldano(a)jboss.com
Date: 2012-09-10 08:58:10 -0400 (Mon, 10 Sep 2012)
New Revision: 16704
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/ServerUsernamePasswordCallback.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2111Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2112Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2113Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2121Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service213Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service214Impl.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/UsernamePasswordCallback.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples21xTestCase.java
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService21x.wsdl
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples22xTestCase.java
Log:
[JBWS-3405] Adding WS-SecurityPolicy Examples 1.0 (most of 2.1.x) testcases
Modified: stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml 2012-09-10
09:07:07 UTC (rev 16703)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/scripts/cxf-samples-jars-jaxws.xml 2012-09-10
12:58:10 UTC (rev 16704)
@@ -122,17 +122,40 @@
</manifest>
</war>
+ <!-- jaxws-samples-wsse-policy-oasis-21x -->
+ <war
+
warfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-policy-oasis-21x.war"
needxmlfile='false'>
+ <classes dir="${tests.output.dir}/test-classes">
+ <include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/ServiceIface.class"/>
+ <include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service21*Impl.class"/>
+ <include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/jaxws/Say*.class"/>
+ <include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/ServerUsernamePasswordCallback.class"/>
+ </classes>
+ <webinf
dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/policy/oasis/WEB-INF">
+ <include name="wsdl/*.xsd"/>
+ <include name="wsdl/SecurityService21x.wsdl"/>
+ </webinf>
+ <zipfileset
dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/policy/oasis/WEB-INF"
prefix="WEB-INF/classes">
+ <include name="bob.jks" />
+ <include name="bob.properties" />
+ </zipfileset>
+ <manifest>
+ <attribute name="Dependencies"
value="org.apache.ws.security,org.apache.cxf"/>
+ </manifest>
+ </war>
+
<!-- jaxws-samples-wsse-policy-oasis-22x -->
<war
warfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-policy-oasis-22x.war"
needxmlfile='false'>
<classes dir="${tests.output.dir}/test-classes">
<include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/ServiceIface.class"/>
- <include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service*Impl.class"/>
+ <include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service22*Impl.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/jaxws/Say*.class"/>
<include
name="org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/KeystorePasswordCallback.class"/>
</classes>
<webinf
dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/policy/oasis/WEB-INF">
- <include name="wsdl/*"/>
+ <include name="wsdl/*.xsd"/>
+ <include name="wsdl/SecurityService.wsdl"/>
</webinf>
<zipfileset
dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/policy/oasis/WEB-INF"
prefix="WEB-INF/classes">
<include name="bob.jks" />
@@ -143,8 +166,8 @@
</manifest>
</war>
- <!-- jaxws-samples-wsse-policy-oasis-22x-client -->
- <jar
destfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-policy-oasis-22x-client.jar">
+ <!-- jaxws-samples-wsse-policy-oasis-client -->
+ <jar
destfile="${tests.output.dir}/test-libs/jaxws-samples-wsse-policy-oasis-client.jar">
<metainf
dir="${tests.output.dir}/test-resources/jaxws/samples/wsse/policy/oasis/META-INF">
<include name="alice.properties" />
<include name="alice.jks" />
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/ServerUsernamePasswordCallback.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/ServerUsernamePasswordCallback.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/ServerUsernamePasswordCallback.java 2012-09-10
12:58:10 UTC (rev 16704)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.oasis;
+
+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 ServerUsernamePasswordCallback implements CallbackHandler
+{
+ public void handle(Callback[] callbacks) throws IOException,
UnsupportedCallbackException
+ {
+ WSPasswordCallback pc = (WSPasswordCallback)callbacks[0];
+ final String id = pc.getIdentifier();
+ if ("kermit".equals(id))
+ pc.setPassword("thefrog");
+ else if ("alice".equals(id) || "bob".equals(id))
+ pc.setPassword("password");
+ }
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2111Impl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2111Impl.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2111Impl.java 2012-09-10
12:58:10 UTC (rev 16704)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.oasis;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+import org.jboss.ws.api.annotation.WebContext;
+
+@WebService
+(
+ portName = "SecurityService2111Port",
+ serviceName = "SecurityService",
+ wsdlLocation = "WEB-INF/wsdl/SecurityService21x.wsdl",
+ targetNamespace =
"http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy/oasis-samples",
+ endpointInterface =
"org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServiceIface"
+)
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.callback-handler", value =
"org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServerUsernamePasswordCallback")
+ }
+)
+@Stateless
+@WebContext(urlPattern = "SecurityService2111")
+public class Service2111Impl implements ServiceIface
+{
+ public String sayHello()
+ {
+ return "Hello - UsernameToken with plain text password";
+ }
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2112Impl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2112Impl.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2112Impl.java 2012-09-10
12:58:10 UTC (rev 16704)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.oasis;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+import org.jboss.ws.api.annotation.WebContext;
+
+@WebService
+(
+ portName = "SecurityService2112Port",
+ serviceName = "SecurityService",
+ wsdlLocation = "WEB-INF/wsdl/SecurityService21x.wsdl",
+ targetNamespace =
"http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy/oasis-samples",
+ endpointInterface =
"org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServiceIface"
+)
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.callback-handler", value =
"org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServerUsernamePasswordCallback")
+ }
+)
+@Stateless
+@WebContext(urlPattern = "SecurityService2112")
+public class Service2112Impl implements ServiceIface
+{
+ public String sayHello()
+ {
+ return "Hello - UsernameToken without password";
+ }
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2113Impl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2113Impl.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2113Impl.java 2012-09-10
12:58:10 UTC (rev 16704)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.oasis;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+import org.jboss.ws.api.annotation.WebContext;
+
+@WebService
+(
+ portName = "SecurityService2113Port",
+ serviceName = "SecurityService",
+ wsdlLocation = "WEB-INF/wsdl/SecurityService21x.wsdl",
+ targetNamespace =
"http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy/oasis-samples",
+ endpointInterface =
"org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServiceIface"
+)
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.callback-handler", value =
"org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServerUsernamePasswordCallback")
+ }
+)
+@Stateless
+@WebContext(urlPattern = "SecurityService2113")
+public class Service2113Impl implements ServiceIface
+{
+ public String sayHello()
+ {
+ return "Hello - UsernameToken with timestamp, nonce and password hash";
+ }
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2121Impl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2121Impl.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service2121Impl.java 2012-09-10
12:58:10 UTC (rev 16704)
@@ -0,0 +1,51 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.oasis;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+import org.jboss.ws.api.annotation.WebContext;
+
+@WebService
+(
+ portName = "SecurityService2121Port",
+ serviceName = "SecurityService",
+ wsdlLocation = "WEB-INF/wsdl/SecurityService21x.wsdl",
+ targetNamespace =
"http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy/oasis-samples",
+ endpointInterface =
"org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServiceIface"
+)
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.callback-handler", value =
"org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServerUsernamePasswordCallback")
+ }
+)
+@Stateless
+@WebContext(urlPattern = "SecurityService2121",
transportGuarantee="CONFIDENTIAL")
+public class Service2121Impl implements ServiceIface
+{
+ public String sayHello()
+ {
+ return "Hello - UsernameToken as supporting token";
+ }
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service213Impl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service213Impl.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service213Impl.java 2012-09-10
12:58:10 UTC (rev 16704)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.oasis;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+import org.jboss.ws.api.annotation.WebContext;
+
+@WebService
+(
+ portName = "SecurityService213Port",
+ serviceName = "SecurityService",
+ wsdlLocation = "WEB-INF/wsdl/SecurityService21x.wsdl",
+ targetNamespace =
"http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy/oasis-samples",
+ endpointInterface =
"org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServiceIface"
+)
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.signature.properties", value =
"bob.properties"),
+ @EndpointProperty(key = "ws-security.encryption.properties", value =
"bob.properties"),
+ @EndpointProperty(key = "ws-security.signature.username", value =
"bob"),
+ @EndpointProperty(key = "ws-security.encryption.username", value =
"useReqSigCert"),
+ @EndpointProperty(key = "ws-security.callback-handler", value =
"org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServerUsernamePasswordCallback")
+ }
+)
+@Stateless
+@WebContext(urlPattern = "SecurityService213")
+public class Service213Impl implements ServiceIface
+{
+ public String sayHello()
+ {
+ return "Hello - (WSS 1.0) UsernameToken with Mutual X.509v3 Authentication,
Sign, Encrypt";
+ }
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service214Impl.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service214Impl.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/Service214Impl.java 2012-09-10
12:58:10 UTC (rev 16704)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2011, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.oasis;
+
+import javax.ejb.Stateless;
+import javax.jws.WebService;
+
+import org.apache.cxf.annotations.EndpointProperties;
+import org.apache.cxf.annotations.EndpointProperty;
+import org.jboss.ws.api.annotation.WebContext;
+
+@WebService
+(
+ portName = "SecurityService214Port",
+ serviceName = "SecurityService",
+ wsdlLocation = "WEB-INF/wsdl/SecurityService21x.wsdl",
+ targetNamespace =
"http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy/oasis-samples",
+ endpointInterface =
"org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServiceIface"
+)
+@EndpointProperties(value = {
+ @EndpointProperty(key = "ws-security.signature.properties", value =
"bob.properties"),
+ @EndpointProperty(key = "ws-security.encryption.properties", value =
"bob.properties"),
+ @EndpointProperty(key = "ws-security.signature.username", value =
"bob"),
+ @EndpointProperty(key = "ws-security.encryption.username", value =
"useReqSigCert"),
+ @EndpointProperty(key = "ws-security.callback-handler", value =
"org.jboss.test.ws.jaxws.samples.wsse.policy.oasis.ServerUsernamePasswordCallback")
+ }
+)
+@Stateless
+@WebContext(urlPattern = "SecurityService214")
+public class Service214Impl implements ServiceIface
+{
+ public String sayHello()
+ {
+ return "Hello - (WSS 1.1) User Name with Certificates, Sign, Encrypt";
+ }
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/UsernamePasswordCallback.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/UsernamePasswordCallback.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/UsernamePasswordCallback.java 2012-09-10
12:58:10 UTC (rev 16704)
@@ -0,0 +1,44 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.oasis;
+
+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 UsernamePasswordCallback implements CallbackHandler
+{
+ public void handle(Callback[] callbacks) throws IOException,
UnsupportedCallbackException
+ {
+ WSPasswordCallback pc = (WSPasswordCallback)callbacks[0];
+ final String id = pc.getIdentifier();
+ if ("kermit".equals(id))
+ pc.setPassword("thefrog");
+ else if ("alice".equals(id) || "bob".equals(id))
+ pc.setPassword("password");
+ else
+ pc.setPassword("wrong password");
+ }
+}
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples21xTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples21xTestCase.java
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples21xTestCase.java 2012-09-10
12:58:10 UTC (rev 16704)
@@ -0,0 +1,159 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2012, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.jboss.test.ws.jaxws.samples.wsse.policy.oasis;
+
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
+import javax.xml.ws.Service;
+
+import junit.framework.Test;
+
+import org.apache.cxf.ws.security.SecurityConstants;
+import org.jboss.wsf.test.JBossWSCXFTestSetup;
+import org.jboss.wsf.test.JBossWSTest;
+
+/**
+ * WS-Security Policy examples
+ *
+ * From OASIS WS-SecurityPolicy Examples Version 1.0
+ *
http://docs.oasis-open.org/ws-sx/security-policy/examples/ws-sp-usecases-...
+ *
+ * @author alessio.soldano(a)jboss.com
+ * @since 10-Sep-2012
+ */
+public final class WSSecurityPolicyExamples21xTestCase extends JBossWSTest
+{
+ private final String NS =
"http://www.jboss.org/jbossws/ws-extensions/wssecuritypolicy/oasis-samples";
+ private final String serviceURL = "http://" + getServerHost() +
":8080/jaxws-samples-wsse-policy-oasis-21x/";
+ private final QName serviceName = new QName(NS, "SecurityService");
+
+ public static Test suite()
+ {
+ /** System properties - currently set at testsuite start time
+ System.setProperty("javax.net.ssl.trustStore",
"my.truststore");
+ System.setProperty("javax.net.ssl.trustStorePassword",
"changeit");
+ System.setProperty("javax.net.ssl.trustStoreType", "jks");
+ System.setProperty("org.jboss.security.ignoreHttpsHost",
"true");
+ */
+ JBossWSCXFTestSetup setup = new
JBossWSCXFTestSetup(WSSecurityPolicyExamples21xTestCase.class,
+
"jaxws-samples-wsse-policy-oasis-21x.war,jaxws-samples-wsse-policy-oasis-client.jar");
+ Map<String, String> sslOptions = new HashMap<String, String>();
+ sslOptions.put("certificate-key-file",
System.getProperty("org.jboss.ws.testsuite.server.keystore"));
+ sslOptions.put("password", "changeit");
+ sslOptions.put("verify-client", "false");
+ sslOptions.put("key-alias", "tomcat");
+ setup.setHttpsConnectorRequirement(sslOptions);
+ return setup;
+ }
+
+ /**
+ * 2.1.1.1 UsernameToken with plain text password
+ *
+ * @throws Exception
+ */
+ public void test2111() throws Exception
+ {
+ Service service = Service.create(new URL(serviceURL +
"SecurityService2111?wsdl"), serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS,
"SecurityService2111Port"), ServiceIface.class);
+ setupWsse(proxy);
+ assertTrue(proxy.sayHello().equals("Hello - UsernameToken with plain text
password"));
+ }
+
+ /**
+ * 2.1.1.2 UsernameToken without password
+ *
+ * @throws Exception
+ */
+ public void test2112() throws Exception
+ {
+ Service service = Service.create(new URL(serviceURL +
"SecurityService2112?wsdl"), serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS,
"SecurityService2112Port"), ServiceIface.class);
+ setupWsse(proxy);
+ assertTrue(proxy.sayHello().equals("Hello - UsernameToken without
password"));
+ }
+
+ /**
+ * 2.1.1.3 UsernameToken with timestamp, nonce and password hash
+ *
+ * @throws Exception
+ */
+ public void test2113() throws Exception
+ {
+ Service service = Service.create(new URL(serviceURL +
"SecurityService2113?wsdl"), serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS,
"SecurityService2113Port"), ServiceIface.class);
+ setupWsse(proxy);
+ assertTrue(proxy.sayHello().equals("Hello - UsernameToken with timestamp,
nonce and password hash"));
+ }
+
+ /**
+ * 2.1.2.1 UsernameToken as supporting token
+ *
+ * @throws Exception
+ */
+ public void test2121() throws Exception
+ {
+ Service service = Service.create(new URL(serviceURL +
"SecurityService2121?wsdl"), serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS,
"SecurityService2121Port"), ServiceIface.class);
+ setupWsse(proxy);
+ assertTrue(proxy.sayHello().equals("Hello - UsernameToken as supporting
token"));
+ }
+
+ /**
+ * 2.1.3 (WSS 1.0) UsernameToken with Mutual X.509v3 Authentication, Sign, Encrypt
+ *
+ * @throws Exception
+ */
+ public void test213() throws Exception
+ {
+ Service service = Service.create(new URL(serviceURL +
"SecurityService213?wsdl"), serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS,
"SecurityService213Port"), ServiceIface.class);
+ setupWsse(proxy);
+ assertTrue(proxy.sayHello().equals("Hello - (WSS 1.0) UsernameToken with
Mutual X.509v3 Authentication, Sign, Encrypt"));
+ }
+
+ /**
+ * 2.1.4 (WSS 1.1) User Name with Certificates, Sign, Encrypt
+ *
+ * @throws Exception
+ */
+ public void test214() throws Exception
+ {
+ Service service = Service.create(new URL(serviceURL +
"SecurityService214?wsdl"), serviceName);
+ ServiceIface proxy = (ServiceIface)service.getPort(new QName(NS,
"SecurityService214Port"), ServiceIface.class);
+ setupWsse(proxy);
+ assertTrue(proxy.sayHello().equals("Hello - (WSS 1.1) User Name with
Certificates, Sign, Encrypt"));
+ }
+
+ private void setupWsse(ServiceIface proxy)
+ {
+ ((BindingProvider)proxy).getRequestContext().put(SecurityConstants.USERNAME,
"kermit");
+
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER, new
UsernamePasswordCallback());
+
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES,
Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
+
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES,
Thread.currentThread().getContextClassLoader().getResource("META-INF/alice.properties"));
+
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.SIGNATURE_USERNAME,
"alice");
+
((BindingProvider)proxy).getRequestContext().put(SecurityConstants.ENCRYPT_USERNAME,
"bob");
+ }
+}
Modified:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples22xTestCase.java
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples22xTestCase.java 2012-09-10
09:07:07 UTC (rev 16703)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/java/org/jboss/test/ws/jaxws/samples/wsse/policy/oasis/WSSecurityPolicyExamples22xTestCase.java 2012-09-10
12:58:10 UTC (rev 16704)
@@ -51,7 +51,7 @@
public static Test suite()
{
return new JBossWSCXFTestSetup(WSSecurityPolicyExamples22xTestCase.class,
-
"jaxws-samples-wsse-policy-oasis-22x.war,jaxws-samples-wsse-policy-oasis-22x-client.jar");
+
"jaxws-samples-wsse-policy-oasis-22x.war,jaxws-samples-wsse-policy-oasis-client.jar");
}
/**
@@ -73,7 +73,6 @@
/**
* 2.2.2 (WSS1.0) Mutual Authentication with X.509 Certificates, Sign, Encrypt
*
- * This scenario is based on WSS Interop, Scenario 3, Web Services Security: Interop
1, Draft 06, Editor, Hal Lockhart, BEA Systems
* This use case corresponds to the situation where both parties have X.509v3
certificates (and public-private key pairs).
* The requestor wishes to identify itself to the service using its X.509 credential
(strong authentication).
* The message exchange needs to be integrity protected and encrypted as well. The
difference from previous use case is
Added:
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService21x.wsdl
===================================================================
---
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService21x.wsdl
(rev 0)
+++
stack/cxf/trunk/modules/testsuite/cxf-tests/src/test/resources/jaxws/samples/wsse/policy/oasis/WEB-INF/wsdl/SecurityService21x.wsdl 2012-09-10
12:58:10 UTC (rev 16704)
@@ -0,0 +1,345 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<wsdl:definitions name="SecurityService"
+
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
+
xmlns:tns="http://www.jboss.org/jbossws/ws-extensions/wssecuritypoli...
+
xmlns:wsp="http://www.w3.org/ns/ws-policy"
+
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-w...
+
xmlns:wsaws="http://www.w3.org/2005/08/addressing"
+
xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy&...
+
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702&...
+
targetNamespace="http://www.jboss.org/jbossws/ws-extensions/wssecuri...
+ <wsdl:types>
+ <xsd:schema>
+ <xsd:import
namespace="http://www.jboss.org/jbossws/ws-extensions/wssecuritypoli...
schemaLocation="SecurityService_schema1.xsd"/>
+ </xsd:schema>
+ </wsdl:types>
+ <wsdl:message name="sayHello">
+ <wsdl:part name="parameters" element="tns:sayHello"/>
+ </wsdl:message>
+ <wsdl:message name="sayHelloResponse">
+ <wsdl:part name="parameters"
element="tns:sayHelloResponse"/>
+ </wsdl:message>
+ <wsdl:portType name="ServiceIface">
+ <wsdl:operation name="sayHello">
+ <wsdl:input message="tns:sayHello"/>
+ <wsdl:output message="tns:sayHelloResponse"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="SecurityService2111PortBinding"
type="tns:ServiceIface">
+ <wsp:PolicyReference URI="#SecurityService2111Policy"/>
+ <soap:binding
transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
+ <wsdl:operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="SecurityService2112PortBinding"
type="tns:ServiceIface">
+ <wsp:PolicyReference URI="#SecurityService2112Policy"/>
+ <soap:binding
transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
+ <wsdl:operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="SecurityService2113PortBinding"
type="tns:ServiceIface">
+ <wsp:PolicyReference URI="#SecurityService2113Policy"/>
+ <soap:binding
transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
+ <wsdl:operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="SecurityService2121PortBinding"
type="tns:ServiceIface">
+ <wsp:PolicyReference URI="#SecurityService2121Policy"/>
+ <soap:binding
transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
+ <wsdl:operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="SecurityService213PortBinding"
type="tns:ServiceIface">
+ <wsp:PolicyReference URI="#SecurityService213Policy"/>
+ <soap:binding
transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
+ <wsdl:operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ <wsp:PolicyReference URI="#SecurityService_Input_Policy"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ <wsp:PolicyReference URI="#SecurityService_Output_Policy"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="SecurityService214PortBinding"
type="tns:ServiceIface">
+ <wsp:PolicyReference URI="#SecurityService214Policy"/>
+ <soap:binding
transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
+ <wsdl:operation name="sayHello">
+ <soap:operation soapAction=""/>
+ <wsdl:input>
+ <soap:body use="literal"/>
+ <wsp:PolicyReference URI="#SecurityService_Input_Policy"/>
+ </wsdl:input>
+ <wsdl:output>
+ <soap:body use="literal"/>
+ <wsp:PolicyReference URI="#SecurityService_Output_Policy"/>
+ </wsdl:output>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="SecurityService">
+ <wsdl:port name="SecurityService2111Port"
binding="tns:SecurityService2111PortBinding">
+ <soap:address
location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-oasis/SecurityService2111"/>
+ </wsdl:port>
+ <wsdl:port name="SecurityService2112Port"
binding="tns:SecurityService2112PortBinding">
+ <soap:address
location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-oasis/SecurityService2112"/>
+ </wsdl:port>
+ <wsdl:port name="SecurityService2113Port"
binding="tns:SecurityService2113PortBinding">
+ <soap:address
location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-oasis/SecurityService2113"/>
+ </wsdl:port>
+ <wsdl:port name="SecurityService2121Port"
binding="tns:SecurityService2121PortBinding">
+ <soap:address
location="https://@jboss.bind.address@:8443/jaxws-samples-wsse-policy-oasis/SecurityService2121"/>
+ </wsdl:port>
+ <wsdl:port name="SecurityService213Port"
binding="tns:SecurityService213PortBinding">
+ <soap:address
location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-oasis/SecurityService213"/>
+ </wsdl:port>
+ <wsdl:port name="SecurityService214Port"
binding="tns:SecurityService214PortBinding">
+ <soap:address
location="http://@jboss.bind.address@:8080/jaxws-samples-wsse-policy-oasis/SecurityService214"/>
+ </wsdl:port>
+ </wsdl:service>
+
+
+ <!-- 2.1.1.1 UsernameToken with plain text password -->
+ <wsp:Policy wsu:Id="SecurityService2111Policy">
+ <sp:SupportingTokens>
+ <wsp:Policy>
+ <sp:UsernameToken
+
sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/...
+ <wsp:Policy/>
+ </sp:UsernameToken>
+ </wsp:Policy>
+ </sp:SupportingTokens>
+ </wsp:Policy>
+
+ <!-- 2.1.1.2 UsernameToken without password -->
+ <wsp:Policy wsu:Id="SecurityService2112Policy">
+ <sp:SupportingTokens>
+ <wsp:Policy>
+ <sp:UsernameToken
+
sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/...
+ <wsp:Policy>
+ <sp:NoPassword/>
+ </wsp:Policy>
+ </sp:UsernameToken>
+ </wsp:Policy>
+ </sp:SupportingTokens>
+ </wsp:Policy>
+
+ <!-- 2.1.1.3 UsernameToken with timestamp, nonce and password hash -->
+ <wsp:Policy wsu:Id="SecurityService2113Policy">
+ <sp:SupportingTokens>
+ <wsp:Policy>
+ <sp:UsernameToken
+
sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/...
+ <wsp:Policy>
+ <sp:HashPassword/>
+ </wsp:Policy>
+ </sp:UsernameToken>
+ </wsp:Policy>
+ </sp:SupportingTokens>
+ </wsp:Policy>
+
+ <!-- 2.1.2.1 UsernameToken as supporting token -->
+ <wsp:Policy wsu:Id="SecurityService2121Policy">
+ <sp:TransportBinding>
+ <wsp:Policy>
+ <sp:TransportToken>
+ <wsp:Policy>
+ <sp:HttpsToken>
+ <wsp:Policy/>
+ </sp:HttpsToken>
+ </wsp:Policy>
+ </sp:TransportToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic128 />
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict />
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp />
+ </wsp:Policy>
+ </sp:TransportBinding>
+ <sp:SupportingTokens>
+ <wsp:Policy>
+ <sp:UsernameToken
sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/...
+ <wsp:Policy/>
+ </sp:UsernameToken>
+ </wsp:Policy>
+ </sp:SupportingTokens>
+ </wsp:Policy>
+
+ <!-- 2.1.3 (WSS 1.0) UsernameToken with Mutual X.509v3 Authentication, Sign,
Encrypt -->
+ <wsp:Policy wsu:Id="SecurityService213Policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:AsymmetricBinding>
+ <wsp:Policy>
+ <sp:InitiatorToken>
+ <wsp:Policy>
+ <sp:X509Token
+
sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/...
+ <wsp:Policy>
+ <sp:WssX509V3Token10 />
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:InitiatorToken>
+ <sp:RecipientToken>
+ <wsp:Policy>
+ <sp:X509Token
+
sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/...
+ <wsp:Policy>
+ <sp:WssX509V3Token10 />
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:RecipientToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic128/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:AsymmetricBinding>
+ <sp:Wss10>
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ </wsp:Policy>
+ </sp:Wss10>
+ <sp:SignedEncryptedSupportingTokens>
+ <wsp:Policy>
+ <sp:UsernameToken
+
sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/...
+ <wsp:Policy>
+ <sp:WssUsernameToken10/>
+ </wsp:Policy>
+ </sp:UsernameToken>
+ </wsp:Policy>
+ </sp:SignedEncryptedSupportingTokens>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
+ <!-- 2.1.4 (WSS 1.1), User Name with Certificates, Sign, Encrypt -->
+ <wsp:Policy wsu:Id="SecurityService214Policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:SymmetricBinding>
+ <wsp:Policy>
+ <sp:ProtectionToken>
+ <wsp:Policy>
+ <sp:X509Token
+
sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/...
+ <wsp:Policy>
+ <sp:RequireThumbprintReference />
+ <sp:WssX509V3Token11/>
+ </wsp:Policy>
+ </sp:X509Token>
+ </wsp:Policy>
+ </sp:ProtectionToken>
+ <sp:AlgorithmSuite>
+ <wsp:Policy>
+ <sp:Basic128/>
+ </wsp:Policy>
+ </sp:AlgorithmSuite>
+ <sp:Layout>
+ <wsp:Policy>
+ <sp:Strict/>
+ </wsp:Policy>
+ </sp:Layout>
+ <sp:IncludeTimestamp/>
+ <sp:OnlySignEntireHeadersAndBody/>
+ </wsp:Policy>
+ </sp:SymmetricBinding>
+ <sp:SignedEncryptedSupportingTokens>
+ <wsp:Policy>
+ <sp:UsernameToken
+
sp:IncludeToken="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/...
+ <wsp:Policy>
+ <sp:WssUsernameToken11/>
+ </wsp:Policy>
+ </sp:UsernameToken>
+ </wsp:Policy>
+ </sp:SignedEncryptedSupportingTokens>
+ <sp:Wss11>
+ <wsp:Policy>
+ <sp:MustSupportRefKeyIdentifier/>
+ <sp:MustSupportRefIssuerSerial/>
+ <sp:MustSupportRefThumbprint/>
+ <sp:MustSupportRefEncryptedKey/>
+ </wsp:Policy>
+ </sp:Wss11>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
+
+ <wsp:Policy wsu:Id="SecurityService_Input_Policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:EncryptedParts>
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <sp:SignedParts>
+ <sp:Body/>
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+ <wsp:Policy wsu:Id="SecurityService_Output_Policy">
+ <wsp:ExactlyOne>
+ <wsp:All>
+ <sp:EncryptedParts>
+ <sp:Body/>
+ </sp:EncryptedParts>
+ <sp:SignedParts>
+ <sp:Body/>
+ </sp:SignedParts>
+ </wsp:All>
+ </wsp:ExactlyOne>
+ </wsp:Policy>
+
+</wsdl:definitions>
\ No newline at end of file