Author: alessio.soldano(a)jboss.com
Date: 2007-10-29 05:40:43 -0400 (Mon, 29 Oct 2007)
New Revision: 4907
Added:
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestCase.java
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestService.java
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/META-INF/
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/META-INF/jboss-wsse-client.xml
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/META-INF/scenarios.xml
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/WEB-INF/
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/WEB-INF/jboss-web.xml
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/WEB-INF/jboss-wsse-server.xml
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/WEB-INF/web.xml
Modified:
stack/native/branches/asoldano/trunk/ant-import-tests/build-jars-jaxws.xml
Log:
WCF interoperability tests, wsse scenario 3.3
(rsa-oaep algorithm not used yet)
Modified: stack/native/branches/asoldano/trunk/ant-import-tests/build-jars-jaxws.xml
===================================================================
--- stack/native/branches/asoldano/trunk/ant-import-tests/build-jars-jaxws.xml 2007-10-29
09:39:25 UTC (rev 4906)
+++ stack/native/branches/asoldano/trunk/ant-import-tests/build-jars-jaxws.xml 2007-10-29
09:40:43 UTC (rev 4907)
@@ -791,7 +791,38 @@
<metainf
dir="${tests.output.dir}/resources/interop/wsse/sign/META-INF"/>
</jar>
+ <!-- WCF Interoperability Plug-fest November 2007 -->
+ <!-- jbossws-interop-nov2007-wsseEncrypt.war -->
+ <war
warfile="${tests.output.dir}/libs/jbossws-interop-nov2007-wsseEncrypt.war"
+
webxml="${tests.output.dir}/resources/interop/nov2007/wsse/encrypt/WEB-INF/web.xml">
+ <classes dir="${tests.output.dir}/classes">
+ <include name="org/jboss/test/ws/interop/nov2007/wsse/**/*.class"/>
+ <include name="org/jboss/test/ws/interop/*.class"/>
+ </classes>
+
+ <webinf
dir="${tests.output.dir}/resources/interop/nov2007/wsse/encrypt/WEB-INF">
+ <include name="jboss-wsse-server.xml"/>
+ <include name="jboss-web.xml"/>
+ </webinf>
+ <webinf
dir="${tests.output.dir}/resources/interop/nov2007/wsse/shared/WEB-INF">
+ <include name="wsdl/**.*"/>
+ </webinf>
+ <webinf
dir="${tests.output.dir}/resources/interop/nov2007/wsse/shared/META-INF">
+ <include name="bob-sign_enc.jks"/>
+ <include name="wsse10.truststore"/>
+ </webinf>
+
+ <fileset dir="${tests.output.dir}/resources/interop/nov2007/wsse/">
+ <include name="*.*"/>
+ </fileset>
+ </war>
+ <!-- jbossws-interop-nov2007-wsseEncrypt.jar -->
+ <jar
destfile="${tests.output.dir}/libs/jbossws-interop-nov2007-wsseEncrypt-client.jar">
+ <metainf
dir="${tests.output.dir}/resources/interop/nov2007/wsse/encrypt/META-INF"/>
+ </jar>
+
+
<!-- jbossws-interop-nov2007-wsseSign.war -->
<war
warfile="${tests.output.dir}/libs/jbossws-interop-nov2007-wsseSign.war"
webxml="${tests.output.dir}/resources/interop/nov2007/wsse/sign/WEB-INF/web.xml">
Added:
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestCase.java
===================================================================
---
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestCase.java
(rev 0)
+++
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestCase.java 2007-10-29
09:40:43 UTC (rev 4907)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.interop.nov2007.wsse;
+
+import javax.xml.namespace.QName;
+
+import junit.framework.Test;
+
+import org.jboss.ws.core.StubExt;
+import org.jboss.wsf.test.JBossWSTestSetup;
+
+/**
+ * WCF Interoperability Plug-fest - November 2007
+ *
+ * Scenario 3.3: X509 Mutual Authentication, Sign Then Encrypt
+ *
+ * Client and Server are authenticated and messages integrity and confidentiality are
provided by using
+ * Asymmetric Binding from Security Policy with server X509 certificate used as Recipient
Token and
+ * client X509 certificate used as Initiator Token. SignedParts and EncryptedParts
assertions are
+ * present in the corresponding policy, indicating that the Body of the message must be
signed and
+ * encrypted. Protection Order property of the binding is set to SignBeforeEncrypt.
+ *
+ * SOAP Version: 1.1
+ * Addressing: No
+ * Client Certificate: Alice
+ * Server Certificate: Bob
+ * Timestamp: Yes
+ * Protection Order: Sign then Encrypt
+ * Signed parts: Timestamp, Body
+ * Encrypted parts: Body
+ * Key Wrap: RSA-OAEP
+ * Encryption: AES256
+ * Canonicalization: XML-EXC-C14N
+ * Signature: SHA1
+ *
+ *
+ * @author Alessio Soldano <alessio.soldano(a)jboss.com>
+ *
+ * @version $Id$
+ * @since 29-Oct-2007
+ */
+public class EncryptTestCase extends AbstractWSSEBase
+{
+
+ public static Test suite()
+ {
+
addClientConfToClasspath("jbossws-interop-nov2007-wsseEncrypt-client.jar");
+ return new JBossWSTestSetup(EncryptTestCase.class,
"jbossws-interop-nov2007-wsseEncrypt.war");
+ }
+
+ public void testScenario() throws Exception
+ {
+ String text = "Hello!";
+ String result = port.ping(text);
+ assertNotNull(result);
+ assertEquals(text, result);
+ }
+
+ @Override
+ protected void scenarioSetup(IPingService port)
+ {
+ ((StubExt)port).setConfigName("Standard WSSecurity Client");
+
+ System.setProperty("org.jboss.ws.wsse.keyStore",
"resources/interop/nov2007/wsse/shared/META-INF/alice-sign_enc.jks");
+ System.setProperty("org.jboss.ws.wsse.trustStore",
"resources/interop/nov2007/wsse/shared/META-INF/wsse10.truststore");
+ System.setProperty("org.jboss.ws.wsse.keyStorePassword",
"password");
+ System.setProperty("org.jboss.ws.wsse.trustStorePassword",
"password");
+ System.setProperty("org.jboss.ws.wsse.keyStoreType", "jks");
+ System.setProperty("org.jboss.ws.wsse.trustStoreType", "jks");
+ }
+
+ @Override
+ protected QName getScenarioPortQName()
+ {
+ return new
QName("http://tempuri.org/",
"MutualCertificate10SignEncrypt_IPingService_port");
+ }
+
+}
Property changes on:
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestCase.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestService.java
===================================================================
---
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestService.java
(rev 0)
+++
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestService.java 2007-10-29
09:40:43 UTC (rev 4907)
@@ -0,0 +1,56 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt 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.interop.nov2007.wsse;
+
+import javax.jws.WebService;
+
+import org.jboss.ws.annotation.EndpointConfig;
+
+
+/**
+ * WCF Interoperability Plug-fest - November 2007
+ *
+ * IPingService test implementation
+ *
+ * @author Alessio Soldano <alessio.soldano(a)jboss.com>
+ *
+ * @version $Id$
+ * @since 29-Oct-2007
+ */
+@WebService(
+ wsdlLocation = "WEB-INF/wsdl/WSSecurty10.wsdl",
+ serviceName = "PingService10",
+ name = "IPingService",
+ targetNamespace = "http://tempuri.org/",
+ endpointInterface =
"org.jboss.test.ws.interop.nov2007.wsse.IPingService",
+ portName = "MutualCertificate10SignEncrypt_IPingService_port")
+@EndpointConfig(configName = "Standard WSSecurity Endpoint")
+public class EncryptTestService implements IPingService
+{
+
+ public String ping(String ping)
+ {
+ System.out.println("ping: "+ping);
+ return ping;
+ }
+
+}
Property changes on:
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/interop/nov2007/wsse/EncryptTestService.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/META-INF/jboss-wsse-client.xml
===================================================================
---
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/META-INF/jboss-wsse-client.xml
(rev 0)
+++
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/META-INF/jboss-wsse-client.xml 2007-10-29
09:40:43 UTC (rev 4907)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jboss-ws-security
xmlns="http://www.jboss.com/ws-security/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+ <config>
+ <timestamp ttl="300"/>
+ <sign type="x509v3" alias="1"
includeTimestamp="true"/>
+ <encrypt type="x509v3" alias="bob"
algorithm="aes-256"/>
+ <requires>
+ <signature/>
+ <encryption/>
+ </requires>
+ </config>
+</jboss-ws-security>
\ No newline at end of file
Property changes on:
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/META-INF/jboss-wsse-client.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/META-INF/scenarios.xml
===================================================================
---
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/META-INF/scenarios.xml
(rev 0)
+++
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/META-INF/scenarios.xml 2007-10-29
09:40:43 UTC (rev 4907)
@@ -0,0 +1,8 @@
+<client-scenarios>
+ <scenario name="default" description="Testing local
endpoint">
+
<target-endpoint>http://localhost:8080/nov2007/wsseEncrypt/endpoint</target-endpoint>
+ </scenario>
+ <scenario name="default-munich" description="Testing Munich
endpoint">
+
<target-endpoint>http://jbossws.demo.jboss.com:8080/nov2007/wsseEncrypt/endpoint</target-endpoint>
+ </scenario>
+</client-scenarios>
Property changes on:
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/META-INF/scenarios.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/WEB-INF/jboss-web.xml
===================================================================
---
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/WEB-INF/jboss-web.xml
(rev 0)
+++
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/WEB-INF/jboss-web.xml 2007-10-29
09:40:43 UTC (rev 4907)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
+
+<jboss-web>
+ <context-root>/nov2007/wsseEncrypt</context-root>
+</jboss-web>
\ No newline at end of file
Property changes on:
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/WEB-INF/jboss-web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/WEB-INF/jboss-wsse-server.xml
===================================================================
---
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/WEB-INF/jboss-wsse-server.xml
(rev 0)
+++
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/WEB-INF/jboss-wsse-server.xml 2007-10-29
09:40:43 UTC (rev 4907)
@@ -0,0 +1,21 @@
+<jboss-ws-security
xmlns="http://www.jboss.com/ws-security/config"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://www.jboss.com/ws-security/config
+
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
+ <key-store-file>WEB-INF/bob-sign_enc.jks</key-store-file>
+ <key-store-password>password</key-store-password>
+ <key-store-type>jks</key-store-type>
+ <trust-store-file>WEB-INF/wsse10.truststore</trust-store-file>
+ <trust-store-password>password</trust-store-password>
+
+ <config>
+ <timestamp ttl="300"/>
+ <sign type="x509v3" alias="1"
includeTimestamp="true"/>
+ <encrypt type="x509v3" alias="alice"
algorithm="aes-256"/>
+ <requires>
+ <signature/>
+ <encryption/>
+ </requires>
+ </config>
+
+</jboss-ws-security>
Property changes on:
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/WEB-INF/jboss-wsse-server.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added:
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/WEB-INF/web.xml
===================================================================
---
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/WEB-INF/web.xml
(rev 0)
+++
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/WEB-INF/web.xml 2007-10-29
09:40:43 UTC (rev 4907)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app version="2.4"
xmlns="http://java.sun.com/xml/ns/j2ee"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+
+ <display-name>wsseEncryptService App</display-name>
+
+ <servlet>
+ <servlet-name>EncryptEndpoint</servlet-name>
+
<servlet-class>org.jboss.test.ws.interop.nov2007.wsse.EncryptTestService</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>EncryptEndpoint</servlet-name>
+ <url-pattern>/endpoint</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file
Property changes on:
stack/native/branches/asoldano/trunk/src/test/resources/interop/nov2007/wsse/encrypt/WEB-INF/web.xml
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF