cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1512574 [4/6] - in /cxf/branches/2.7.x-fixes: parent/ services/ services/xkms/ services/xkms/xkms-client/ services/xkms/xkms-client/src/ services/xkms/xkms-client/src/main/ services/xkms/xkms-client/src/main/java/ services/xkms/xkms-client...
Date Sat, 10 Aug 2013 07:52:39 GMT
Added: cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/pom.xml?rev=1512574&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/pom.xml (added)
+++ cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/pom.xml Sat Aug 10 07:52:35 2013
@@ -0,0 +1,68 @@
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.cxf.services.xkms</groupId>
+    <artifactId>cxf-services-xkms-osgi</artifactId>
+    <packaging>bundle</packaging>
+    <name>Apache CXF XKMS OSGi deployment</name>
+    <url>http://cxf.apache.org</url>
+
+    <parent>
+        <groupId>org.apache.cxf</groupId>
+        <artifactId>cxf-parent</artifactId>
+        <version>2.7.7-SNAPSHOT</version>
+        <relativePath>../../../parent/pom.xml</relativePath>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.cxf.services.xkms</groupId>
+            <artifactId>cxf-services-xkms-common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf.services.xkms</groupId>
+            <artifactId>cxf-services-xkms-x509-handlers</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf.services.xkms</groupId>
+            <artifactId>cxf-services-xkms-service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Added: cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/src/main/resources/OSGI-INF/blueprint/blueprint.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/src/main/resources/OSGI-INF/blueprint/blueprint.xml?rev=1512574&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/src/main/resources/OSGI-INF/blueprint/blueprint.xml (added)
+++ cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/src/main/resources/OSGI-INF/blueprint/blueprint.xml Sat Aug 10 07:52:35 2013
@@ -0,0 +1,115 @@
+<!-- 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. -->
+<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:cxf="http://cxf.apache.org/blueprint/core"
+    xmlns:jaxws="http://cxf.apache.org/blueprint/jaxws"
+    xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
+    xmlns:ext="http://www.osgi.org/xmlns/blueprint-ext/v1.1.0"
+    xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
+                        http://www.osgi.org/xmlns/blueprint-ext/v1.1.0 https://svn.apache.org/repos/asf/aries/tags/blueprint-0.3.1/blueprint-core/src/main/resources/org/apache/aries/blueprint/ext/blueprint-ext.xsd  
+                        http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0 http://aries.apache.org/schemas/blueprint-cm/blueprint-cm-1.0.0.xsd
+                        http://cxf.apache.org/blueprint/jaxws http://cxf.apache.org/schemas/blueprint/jaxws.xsd
+                        http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd
+">
+
+	<cm:property-placeholder persistent-id="org.apache.cxf.xkms">
+		<cm:default-properties>
+			<cm:property name="xkms.enableXKRSS" value="true"/>
+			<cm:property name="xkms.ldap.url" value="tcp:localhost:389"/>
+			<cm:property name="xkms.ldap.user" value=""/>
+			<cm:property name="xkms.ldap.pwd" value=""/>
+			<cm:property name="xkms.ldap.retry" value="2"/>
+		</cm:default-properties>
+	</cm:property-placeholder>
+
+    <bean id="ldapSearch" class="org.apache.cxf.xkms.x509.repo.ldap.LdapSearch">
+        <argument value="${xkms.ldap.url}" />
+        <argument value="${xkms.ldap.user}" />
+        <argument value="${xkms.ldap.pwd}" />
+        <argument value="${xkms.ldap.retry}" />
+    </bean>
+
+    <bean id="ldapSchemaConfig" class="org.apache.cxf.xkms.x509.repo.ldap.LdapSchemaConfig">
+        <property name="certObjectClass" value="${xkms.ldap.schema.certObjectClass}" />
+        <property name="attrUID" value="${xkms.ldap.schema.attrUID}" />
+        <property name="attrIssuerID" value="${xkms.ldap.schema.attrIssuerID}" />
+        <property name="attrSerialNumber" value="${xkms.ldap.schema.attrSerialNumber}" />
+        <property name="attrCrtBinary" value="${xkms.ldap.schema.attrCrtBinary}" />
+        <property name="constAttrNamesCSV" value="${xkms.ldap.schema.constAttrNamesCSV}" />
+        <property name="constAttrValuesCSV" value="${xkms.ldap.schema.constAttrValuesCSV}" />
+        <property name="serviceCertRDNTemplate"
+            value="${xkms.ldap.schema.serviceCertRDNTemplate}" />
+        <property name="serviceCertUIDTemplate"
+            value="${xkms.ldap.schema.serviceCertUIDTemplate}" />
+        <property name="trustedAuthorityFilter" value="${xkms.ldap.schema.trustedAuthorities}" />
+        <property name="intermediateFilter" value="${xkms.ldap.schema.intermediates}" />
+    </bean>
+
+    <bean id="certificateRepo" class="org.apache.cxf.xkms.x509.repo.CertificateRepoFactory"
+        factory-method="createRepository">
+        <argument value="${xkms.certificate.repo}" />
+        <argument ref="ldapSearch" />
+        <argument ref="ldapSchemaConfig" />
+        <argument value="${xkms.ldap.rootDN}" />
+        <argument value="${xkms.file.storageDir}" />
+    </bean>
+
+    <bean id="dateValidator" class="org.apache.cxf.xkms.x509.validator.DateValidator" />
+    <bean id="trustedAuthorityValidator"
+        class="org.apache.cxf.xkms.x509.validator.TrustedAuthorityValidator">
+        <argument ref="certificateRepo" />
+    </bean>
+
+    <bean id="x509Locator" class="org.apache.cxf.xkms.x509.handlers.X509Locator">
+        <argument ref="certificateRepo" />
+    </bean>
+
+    <bean id="x509Register"
+        class="org.apache.cxf.xkms.x509.handlers.X509Register">
+        <argument ref="certificateRepo" />
+    </bean>
+
+    <bean id="xkmsService" class="org.apache.cxf.xkms.service.XKMSService">
+    	<property name="enableXKRSS" value="${xkms.enableXKRSS}" />
+        <property name="validators">
+            <list>
+                <ref component-id="dateValidator" />
+                <ref component-id="trustedAuthorityValidator" />
+            </list>
+        </property>
+        <property name="locators">
+            <list>
+                <ref component-id="x509Locator" />
+            </list>
+        </property>
+        <property name="keyRegisterHandlers">
+            <list>
+                <ref component-id="x509Register" />
+            </list>
+        </property>
+    </bean>
+
+    <bean id="additionalClasses"
+        class="org.apache.cxf.xkms.model.extensions.AdditionalClassesFactory" />
+
+    <jaxws:endpoint id="XKMSServiceEndpoint"
+        xmlns:serviceNamespace="http://www.w3.org/2002/03/xkms#wsdl"
+        serviceName="serviceNamespace:XKMSService" endpointName="serviceNamespace:XKMSPort"
+        implementor="#xkmsService" address="/XKMS">
+        <jaxws:properties>
+            <entry key="jaxb.additionalContextClasses">
+                <bean class="java.lang.Object" factory-ref="additionalClasses"
+                    factory-method="create" />
+            </entry>
+        </jaxws:properties>
+    </jaxws:endpoint>
+
+</blueprint>

Added: cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/src/test/resources/test-requests/request-locate.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/src/test/resources/test-requests/request-locate.xml?rev=1512574&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/src/test/resources/test-requests/request-locate.xml (added)
+++ cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/src/test/resources/test-requests/request-locate.xml Sat Aug 10 07:52:35 2013
@@ -0,0 +1,12 @@
+<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
+    <soap:Body>
+        <ns2:LocateRequest xmlns="http://www.w3.org/2000/09/xmldsig#"
+            xmlns:ns2="http://www.w3.org/2002/03/xkms#" xmlns:ns3="http://www.w3.org/2001/04/xmlenc#">
+            <ns2:QueryKeyBinding>
+                <ns2:UseKeyWith Application="urn:ietf:rfc:2459"
+                    Identifier="CN=www.issuer.com" />
+            </ns2:QueryKeyBinding>
+        </ns2:LocateRequest>
+    </soap:Body>
+</soap:Envelope>
+

Added: cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/src/test/resources/test-requests/request-validate.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/src/test/resources/test-requests/request-validate.xml?rev=1512574&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/src/test/resources/test-requests/request-validate.xml (added)
+++ cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/src/test/resources/test-requests/request-validate.xml Sat Aug 10 07:52:35 2013
@@ -0,0 +1,16 @@
+<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
+    <soap:Body>
+        <ns2:ValidateRequest xmlns="http://www.w3.org/2000/09/xmldsig#"
+            xmlns:ns2="http://www.w3.org/2002/03/xkms#" xmlns:ns3="http://www.w3.org/2001/04/xmlenc#"
+            Id="CN=www.anothersts.com, L=CGN, ST=NRW, C=DE, O=AnotherSTS">
+            <ns2:QueryKeyBinding>
+                <KeyInfo>
+                    <X509Data>
+                        <X509Certificate>MIIFIjCCAwoCAQEwDQYJKoZIhvcNAQEFBQAwUzEPMA0GA1UEChMGSXNzdWVyMQswCQYDVQQGEwJERTEMMAoGA1UECBMDTlJXMQwwCgYDVQQHEwNDR04xFzAVBgNVBAMTDnd3dy5pc3N1ZXIuY29tMB4XDTEyMDIyOTEyMjMxOVoXDTEzMDIyODEyMjMxOVowWzETMBEGA1UEChMKQW5vdGhlclNUUzELMAkGA1UEBhMCREUxDDAKBgNVBAgTA05SVzEMMAoGA1UEBxMDQ0dOMRswGQYDVQQDExJ3d3cuYW5vdGhlcnN0cy5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC89tdiW7NQcof51k/9T0X12bAuXlxS+KhRhwnruus1D5zLhw391fGUEU/3gGdQ5HXuwE2sIGVWfoaR71nd0uWl7ACfwuv4Isgblvvaa6XKzhGsG2bLDM/M0Swghr/YgO/627iuESOJ2Ub2ejYDVWk6HOTZOHdA9IUcXwJxntG1eiFCxcAsJOVs5fu4BFVq2gu2idi4QCuhxpAOEqY/hT5HsMT7sTPhsLZxC9MDY3Z04bikulOwRSpi+21w4xqlkVxAjxMFuB7kANQONNfapgOf2rY/sDETH8catfBvPiDXfRFouIPmqVssvRTbHlIXm3z0dM9fw6N/mkfNdt/BmONtfHr12qgErWg3kUpnDxshOPI7qqISQHR76zxLSTZaLeSplPVE5aPuvCTGQMNpujJIMKTQCUo9sgabu0JpwkaT0zMAJJXIDPV1kwEMf7jU/IhsppCBW1il02LC5I9hytYZyXHylpyEOqR0VOLw+7a0F5NGz95X6K6YMKUlmCnPjhdJDz4CFSqeyH0/7O69vooEYIHEOWEQRKtqb1qYWcx/P/gYU49IcQMB7Z87+i0StsA1D66FK5l3ejEWYOR0UIon
 zXTtCukmRgCXeUBbO5skE70HMoJmQfKTfhNLdx480SbfkwJ9cLc5lRFimjEbtcYn/bYQvbnR+hprGnd4+36jvwIDAQABMA0GCSqGSIb3DQEBBQUAA4ICAQBLKToriq3mex/ZHPTPh14RIONwzpXzmLvx9UjsxUI2k49OJHWrowLyEtyX4TLf9Gd9POAmjFBWxWK2nQLYisWQg07NSgOWDvtGj1Ql6XjGdY59JYh1N1h+Ppd/Sb/FsPDN+CQ7+8Xf2nfocbJafktOI6xZJe4PynENi/TIjjX6mdBN4pirNtLXCPzEVyP8MDphrmBrSGGTYU3loz9TzsLfiDLbh5x2Nyg33hSolGOpfHXFNFAo3T/fMA47vmr07qh7cKwJw6loxcU1AcC/Uhab6QgWySHyTyguH7EFGN9a0/7IRynd+UVqErA2DyjCE6mgzzT7mqVg5ox8W4Flzq2kmip8foLAZ4zW6b19y71+2LUVIPguEfufhLbpmmF65ezDZUmYRYFFHWulhPufSpfEUZguKXIM0voIXAgYrbdtLmHPTGb8Qm3qPDcVQJsOEeqTDbRB9nnXP1t+gaSKr/IO597Mr9o9+TUq2WlH1H3NauLL3XCsWmL0pBEBM8a5fMxs04xPdW9V6A8EyHk4CcSOofMJiAZQIlllqsdYQBsOD/iGVHeVYXSnP0PnQmCjdQMaoGIl/dC6oLuk2EerekIuR1NVMdGchpPY/Q2GQmpnnou0faCK/pE9nUEoh+uxva6iOi7Ns2O3gR2aXxeZM1Bgm4SwTnAl5Acnpy5Forg5pg==
+                        </X509Certificate>
+                    </X509Data>
+                </KeyInfo>
+            </ns2:QueryKeyBinding>
+        </ns2:ValidateRequest>
+    </soap:Body>
+</soap:Envelope>
\ No newline at end of file

Added: cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/src/test/resources/test-requests/response-locate.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/src/test/resources/test-requests/response-locate.xml?rev=1512574&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/src/test/resources/test-requests/response-locate.xml (added)
+++ cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/src/test/resources/test-requests/response-locate.xml Sat Aug 10 07:52:35 2013
@@ -0,0 +1,17 @@
+<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
+    <soap:Body>
+        <ns2:LocateResult xmlns="http://www.w3.org/2000/09/xmldsig#"
+            xmlns:ns2="http://www.w3.org/2002/03/xkms#" xmlns:ns3="http://www.w3.org/2001/04/xmlenc#"
+            ResultMajor="http://www.w3.org/2002/03/xkms#Success" Id="3bcbb1d6-3215-41aa-aafe-8192e324d283"
+            Service="http://services.sopera.org/xkms/v2.0">
+            <ns2:UnverifiedKeyBinding>
+                <KeyInfo>
+                    <X509Data>
+                        <X509Certificate>MIIF4DCCA8igAwIBAgIJAKI2DZw3MLqRMA0GCSqGSIb3DQEBBQUAMFMxDzANBgNVBAoTBklzc3VlcjELMAkGA1UEBhMCREUxDDAKBgNVBAgTA05SVzEMMAoGA1UEBxMDQ0dOMRcwFQYDVQQDEw53d3cuaXNzdWVyLmNvbTAeFw0xMjAyMjkxMDIzMDFaFw0xMzAyMjgxMDIzMDFaMFMxDzANBgNVBAoTBklzc3VlcjELMAkGA1UEBhMCREUxDDAKBgNVBAgTA05SVzEMMAoGA1UEBxMDQ0dOMRcwFQYDVQQDEw53d3cuaXNzdWVyLmNvbTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMSCbQd/92wAJnfaFZTRmEP0afGGS0lGJghLg3uoMpewcQj4A2RZVJl2sfFbk/OppUqtJYxLKv0LRkx9MsZ2rQOq1YfmHShxpb6PeyRx8dEgSCtgWivVzKk/w+UudilQVC3cTNWtCayjajHcc0UAG4Kaaypl5CNEWH0M4JapcjFCwU3t7INI/DcAZK2J0aZI0pevw977nEzHyHOeea3O0RFrTTQomt/fv4gtP08F4x13cK0ssD93YZwhzFQ/63E/P0UM6daKJG8Ysg9owjwuSGR6bDR/FNuDeH4hqq0QGuvFHANpVTakvE5d+WWw1BDIZ8RK2vf3yFs+/jazTUhUJvoiniqtTf6VnMUmI7n5mDFQbutiIOeFzK4bQ+KKYch/aO2Pc6dXoEYmCfgA/SdcoOhEfGJKqU8mvPU/bXJEDVj1VgFzRssnaZcmReXfrcFuxW9fkVMEQ4jXlUF6v63uwqpdMWqgBGlti5hHjOuE/MOYpmBv6mUNX0MxqtgRU7/8fUoR6HwgAlRBOoWGCHIzv/0V6fSm804OiUf+DY65dbpZRhZmd7yANYYoewSwrNokDXGlz6e5cPaXMUna
 kIgcj2crr+dqQpxkrpTgP5ihq8Jrw8GHYZwm0SE4dqhA/DcyL6UlJarZSk7U3XEGvs60p0YThEgbpHCkgyruxocyQ4z3AgMBAAGjgbYwgbMwHQYDVR0OBBYEFCN8oLmMeAxU7v5mcE6U2bDmP63cMIGDBgNVHSMEfDB6gBQjfKC5jHgMVO7+ZnBOlNmw5j+t3KFXpFUwUzEPMA0GA1UEChMGSXNzdWVyMQswCQYDVQQGEwJERTEMMAoGA1UECBMDTlJXMQwwCgYDVQQHEwNDR04xFzAVBgNVBAMTDnd3dy5pc3N1ZXIuY29tggkAojYNnDcwupEwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAgEAPDAcr3TdfLlczzkBR6iiN63ERK/FnIcB8vIJdxJeYsq/w49CgxMjOugGsZ7rKTmT89zPQzVe/GJITRHNS1q81cf8hd4SWZ/i3z7k8tqhMRq0b31aQqkLzjPWD6PAwzDWUAY8HMMq9Gbxx52u4yXxx1PabTxq/0EDtX7+JfZ462BGtWCcUrrXq6Wck4acvAw2NmMfUR+RYLVKLINen82KD1YAl+mOKFfc3r9i1mLi/ylE2LuKN6Z3LnYAcaUgq22mRKR6hGXyw4zU2HzFNlgBnoJottYdZWxa5Chcr6wMgZS/rg3gQ8z6ALOFG/UTBxcXRmI0CCBhTPjn4Dq8gd+BWixBzFVF8DoYEyVEX7fGNOAwb3OZCQMVsaM6PuqIfiz0s5oiqdohYSzwXc6ajmQB7JJkfHE8B43dnL+G1+d2mqvhXhTeJNlwC0Hcqtc7MY2rRDY0Kj0LrGqjhN6kKiXHXA0YqVpn1W7qsu+GS51jxpxZ2DUELNuIhXU/xbP3IS/BKMgiwNM2kZBtP0qkfKlsO9IemiQTNGZzxm+DJvE5U4wC0cVxsvqRTqdfKumaIMoUHsIrC5OWibTZ658KFuZZGHtxolH1sZnSPjs9D9RC9xDv5OyIH
 cHcMhN6c7wk2Tf3GpY91r6Sp6TxIkB2cZQDT8eTSS/PTHC+muh5/365lRE=
+                        </X509Certificate>
+                    </X509Data>
+                </KeyInfo>
+            </ns2:UnverifiedKeyBinding>
+        </ns2:LocateResult>
+    </soap:Body>
+</soap:Envelope>
\ No newline at end of file

Added: cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/src/test/resources/test-requests/response-validate.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/src/test/resources/test-requests/response-validate.xml?rev=1512574&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/src/test/resources/test-requests/response-validate.xml (added)
+++ cxf/branches/2.7.x-fixes/services/xkms/xkms-osgi/src/test/resources/test-requests/response-validate.xml Sat Aug 10 07:52:35 2013
@@ -0,0 +1,17 @@
+<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
+    <soap:Body>
+        <ns2:ValidateResult xmlns="http://www.w3.org/2000/09/xmldsig#"
+            xmlns:ns2="http://www.w3.org/2002/03/xkms#" xmlns:ns3="http://www.w3.org/2001/04/xmlenc#"
+            ResultMajor="http://www.w3.org/2002/03/xkms#Success"
+            RequestId="CN=www.anothersts.com, L=CGN, ST=NRW, C=DE, O=AnotherSTS"
+            Id="bbc29ec6-11b5-4dd1-97d4-01279fb0e8a5" Service="http://services.sopera.org/xkms/v2.0">
+            <ns2:KeyBinding>
+                <ns2:Status StatusValue="http://www.w3.org/2002/03/xkms#Valid">
+                    <ns2:ValidReason>http://www.w3.org/2002/03/xkms#IssuerTrust</ns2:ValidReason>
+                    <ns2:ValidReason>http://www.w3.org/2002/03/xkms#Signature</ns2:ValidReason>
+                    <ns2:ValidReason>http://www.w3.org/2002/03/xkms#ValidityInterval</ns2:ValidReason>
+                </ns2:Status>
+            </ns2:KeyBinding>
+        </ns2:ValidateResult>
+    </soap:Body>
+</soap:Envelope>
\ No newline at end of file

Propchange: cxf/branches/2.7.x-fixes/services/xkms/xkms-service/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 10 07:52:35 2013
@@ -0,0 +1,7 @@
+.settings
+
+.classpath
+
+.project
+
+target

Added: cxf/branches/2.7.x-fixes/services/xkms/xkms-service/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-service/pom.xml?rev=1512574&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/services/xkms/xkms-service/pom.xml (added)
+++ cxf/branches/2.7.x-fixes/services/xkms/xkms-service/pom.xml Sat Aug 10 07:52:35 2013
@@ -0,0 +1,68 @@
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.cxf.services.xkms</groupId>
+    <artifactId>cxf-services-xkms-service</artifactId>
+    <packaging>bundle</packaging>
+    <name>Apache CXF XKMS Service</name>
+    <url>http://cxf.apache.org</url>
+
+    <parent>
+        <groupId>org.apache.cxf</groupId>
+        <artifactId>cxf-parent</artifactId>
+        <version>2.7.7-SNAPSHOT</version>
+        <relativePath>../../../parent/pom.xml</relativePath>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.cxf.services.xkms</groupId>
+            <artifactId>cxf-services-xkms-common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+        	<groupId>junit</groupId>
+        	<artifactId>junit</artifactId>
+        	<scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+                    </instructions>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Added: cxf/branches/2.7.x-fixes/services/xkms/xkms-service/src/main/java/org/apache/cxf/xkms/service/XKMSResponseFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-service/src/main/java/org/apache/cxf/xkms/service/XKMSResponseFactory.java?rev=1512574&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/services/xkms/xkms-service/src/main/java/org/apache/cxf/xkms/service/XKMSResponseFactory.java (added)
+++ cxf/branches/2.7.x-fixes/services/xkms/xkms-service/src/main/java/org/apache/cxf/xkms/service/XKMSResponseFactory.java Sat Aug 10 07:52:35 2013
@@ -0,0 +1,109 @@
+/**
+ * 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.xkms.service;
+
+import java.util.UUID;
+
+import org.apache.cxf.xkms.model.xkms.RequestAbstractType;
+import org.apache.cxf.xkms.model.xkms.ResultMajorEnum;
+import org.apache.cxf.xkms.model.xkms.ResultType;
+
+public final class XKMSResponseFactory {
+
+    private XKMSResponseFactory() {
+    }
+
+    /**
+     * @param request Request to generate response for
+     * @return Returns response for provided request, with SUCCESS as default major result.
+     */
+    public static ResultType createResponse(RequestAbstractType request) {
+        return createResponse(request, new ResultType());
+    }
+
+    /**
+     * The following activities are performed:
+     *
+     * 1) generation and assigning of unique response ID
+     * 2) copying of request id
+     * 3) copying of service name
+     * 4) copying of opaqueClientData
+     * 5) setting major result to success
+     *
+     * @param request Request to be used for response
+     * @param response Response to be enriched
+     * @return Returns enriched response
+     */
+    public static <T extends ResultType> T createResponse(RequestAbstractType request, T response) {
+        response.setId(generateUniqueID());
+
+        copyRequestId(request, response);
+        copyServiceName(request, response);
+        copyOpaqueClientData(request, response);
+
+        response.setResultMajor(ResultMajorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_SUCCESS.value());
+
+        return response;
+    }
+
+    /**
+     * Copies OpaqueClientData from request to response as per XKMS specification
+     * http://www.w3.org/TR/xkms2/#XKMS_2_0_Section_1 [86]
+     *
+     * @param request Containing OpaqueClientData
+     * @param response to be used for inserting OpaqueClientData
+     * @return Response unmodified, except for including OpaqueClientData from request
+     */
+    public static ResultType copyOpaqueClientData(RequestAbstractType request, ResultType response) {
+        response.setOpaqueClientData(request.getOpaqueClientData());
+        return response;
+    }
+
+    /**
+     * Copies Request ID to response as per XKMS specification http://www.w3.org/TR/xkms2/#XKMS_2_0_Section_1
+     *
+     * @param request Containing request ID
+     * @param response to be used for inserting request ID
+     * @return Response unmodified, except for setting request ID
+     */
+    public static ResultType copyRequestId(RequestAbstractType request, ResultType response) {
+        response.setRequestId(request.getId());
+        return response;
+    }
+
+    /**
+     * Copies service name from request to response.
+     *
+     * @param request containing service name
+     * @param response to be used for inserting service name
+     * @return Response unmodified, except for setting service name
+     */
+    public static ResultType copyServiceName(RequestAbstractType request, ResultType response) {
+        response.setService(request.getService());
+        return response;
+    }
+
+    /**
+     * @return Returns generated random UUID
+     */
+    public static String generateUniqueID() {
+        return "I" + UUID.randomUUID().getMostSignificantBits();
+    }
+
+}

Added: cxf/branches/2.7.x-fixes/services/xkms/xkms-service/src/main/java/org/apache/cxf/xkms/service/XKMSService.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-service/src/main/java/org/apache/cxf/xkms/service/XKMSService.java?rev=1512574&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/services/xkms/xkms-service/src/main/java/org/apache/cxf/xkms/service/XKMSService.java (added)
+++ cxf/branches/2.7.x-fixes/services/xkms/xkms-service/src/main/java/org/apache/cxf/xkms/service/XKMSService.java Sat Aug 10 07:52:35 2013
@@ -0,0 +1,330 @@
+/**
+ * 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.xkms.service;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.cxf.common.logging.LogUtils;
+import org.apache.cxf.xkms.exception.ExceptionMapper;
+import org.apache.cxf.xkms.handlers.Locator;
+import org.apache.cxf.xkms.handlers.Register;
+import org.apache.cxf.xkms.handlers.Validator;
+import org.apache.cxf.xkms.handlers.XKMSConstants;
+import org.apache.cxf.xkms.model.xkms.CompoundRequestType;
+import org.apache.cxf.xkms.model.xkms.CompoundResultType;
+import org.apache.cxf.xkms.model.xkms.KeyBindingAbstractType;
+import org.apache.cxf.xkms.model.xkms.KeyBindingEnum;
+import org.apache.cxf.xkms.model.xkms.KeyBindingType;
+import org.apache.cxf.xkms.model.xkms.KeyUsageEnum;
+import org.apache.cxf.xkms.model.xkms.LocateRequestType;
+import org.apache.cxf.xkms.model.xkms.LocateResultType;
+import org.apache.cxf.xkms.model.xkms.MessageAbstractType;
+import org.apache.cxf.xkms.model.xkms.PendingRequestType;
+import org.apache.cxf.xkms.model.xkms.RecoverRequestType;
+import org.apache.cxf.xkms.model.xkms.RecoverResultType;
+import org.apache.cxf.xkms.model.xkms.RegisterRequestType;
+import org.apache.cxf.xkms.model.xkms.RegisterResultType;
+import org.apache.cxf.xkms.model.xkms.ReissueRequestType;
+import org.apache.cxf.xkms.model.xkms.ReissueResultType;
+import org.apache.cxf.xkms.model.xkms.ResultMinorEnum;
+import org.apache.cxf.xkms.model.xkms.ResultType;
+import org.apache.cxf.xkms.model.xkms.RevokeRequestType;
+import org.apache.cxf.xkms.model.xkms.RevokeResultType;
+import org.apache.cxf.xkms.model.xkms.StatusRequestType;
+import org.apache.cxf.xkms.model.xkms.StatusResultType;
+import org.apache.cxf.xkms.model.xkms.StatusType;
+import org.apache.cxf.xkms.model.xkms.UnverifiedKeyBindingType;
+import org.apache.cxf.xkms.model.xkms.ValidateRequestType;
+import org.apache.cxf.xkms.model.xkms.ValidateResultType;
+import org.w3._2002._03.xkms_wsdl.XKMSPortType;
+
+public class XKMSService implements XKMSPortType {
+
+    protected static final Logger LOG = LogUtils.getL7dLogger(XKMSService.class);
+
+    private String serviceName = XKMSConstants.XKMS_ENDPOINT_NAME;
+
+    private List<Locator> locators = new ArrayList<Locator>();
+
+    private List<Validator> validators = new ArrayList<Validator>();
+
+    private List<Register> keyRegisterHandlers = new ArrayList<Register>();
+    
+    private boolean enableXKRSS = true;
+
+    @Override
+    public ReissueResultType reissue(ReissueRequestType request) {
+        assertXKRSSAllowed();
+        try {
+            validateRequest(request);
+            ReissueResultType response = XKMSResponseFactory.createResponse(request, new ReissueResultType());
+            try {
+                for (Register handler : keyRegisterHandlers) {
+                    if (handler.canProcess(request)) {
+                        return handler.reissue(request, response);
+                    }
+                }
+                throw new UnsupportedOperationException("Service was unable to handle your request");
+            } catch (Exception e) {
+                LOG.log(Level.SEVERE, "Error due X509 Validation: " + e.getMessage(), e);
+                return ExceptionMapper.toResponse(e, response);
+            }
+        } catch (Exception e) {
+            return ExceptionMapper.toResponse(e, XKMSResponseFactory.createResponse(request, new ReissueResultType()));
+        }
+    }
+
+    @Override
+    public CompoundResultType compound(CompoundRequestType request) {
+        validateRequest(request);
+
+        RuntimeException ex = new UnsupportedOperationException("XKMS compound request is currently not supported");
+        CompoundResultType response = XKMSResponseFactory.createResponse(request, new CompoundResultType());
+        return ExceptionMapper.toResponse(ex, response);
+    }
+
+    @Override
+    public RegisterResultType register(RegisterRequestType request) {
+        try {
+            assertXKRSSAllowed();
+            validateRequest(request);
+            RegisterResultType response = XKMSResponseFactory.createResponse(request, new RegisterResultType());
+            try {
+                for (Register handler : keyRegisterHandlers) {
+                    if (handler.canProcess(request)) {
+                        return handler.register(request, response);
+                    }
+                }
+                throw new UnsupportedOperationException("Service was unable to handle your request");
+            } catch (Exception e) {
+                LOG.log(Level.SEVERE, "Error due X509 Validation: " + e.getMessage(), e);
+                return ExceptionMapper.toResponse(e, response);
+            }
+        } catch (Exception e) {
+            return ExceptionMapper.toResponse(e, XKMSResponseFactory.createResponse(request, new RegisterResultType()));
+        }
+    }
+
+    @Override
+    public ResultType pending(PendingRequestType request) {
+        validateRequest(request);
+
+        return ExceptionMapper.toResponse(new UnsupportedOperationException("XKMS request is currently not supported"),
+                XKMSResponseFactory.createResponse(request, new ResultType()));
+    }
+
+    @Override
+    public RevokeResultType revoke(RevokeRequestType request) {
+        try {
+            assertXKRSSAllowed();
+            validateRequest(request);
+            RevokeResultType response = XKMSResponseFactory.createResponse(request, new RevokeResultType());
+            try {
+                for (Register handler : keyRegisterHandlers) {
+                    if (handler.canProcess(request)) {
+                        return handler.revoke(request, response);
+                    }
+                }
+                throw new UnsupportedOperationException("Service was unable to handle your request");
+            } catch (Exception e) {
+                LOG.log(Level.SEVERE, "Error due X509 Validation: " + e.getMessage(), e);
+                return ExceptionMapper.toResponse(e, response);
+            }
+        } catch (Exception e) {
+            return ExceptionMapper.toResponse(e, XKMSResponseFactory.createResponse(request, new RevokeResultType()));
+        }
+    }
+
+    @Override
+    public LocateResultType locate(LocateRequestType request) {
+        try {
+            validateRequest(request);
+            // Create basic response
+            LocateResultType result = XKMSResponseFactory.createResponse(request, new LocateResultType());
+            // Search
+            for (Locator locator : locators) {
+                UnverifiedKeyBindingType keyBinding = locator.locate(request);
+                if (keyBinding != null) {
+                    result.getUnverifiedKeyBinding().add(keyBinding);
+                    return result;
+                }
+            }
+            // No matches found
+            result.setResultMinor(ResultMinorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_NO_MATCH.value());
+            return result;
+        } catch (Exception e) {
+            return ExceptionMapper.toResponse(e, XKMSResponseFactory.createResponse(request, new LocateResultType()));
+        }
+    }
+
+    @Override
+    public RecoverResultType recover(RecoverRequestType request) {
+        try {
+            assertXKRSSAllowed();
+            validateRequest(request);
+            RecoverResultType response = XKMSResponseFactory.createResponse(request, new RecoverResultType());
+            try {
+                for (Register handler : keyRegisterHandlers) {
+                    if (handler.canProcess(request)) {
+                        return handler.recover(request, response);
+                    }
+                }
+                throw new UnsupportedOperationException("Service was unable to handle your request");
+            } catch (Exception e) {
+                LOG.log(Level.SEVERE, "Error during recover: " + e.getMessage(), e);
+                return ExceptionMapper.toResponse(e, response);
+            }
+        } catch (Exception e) {
+            return ExceptionMapper.toResponse(e, XKMSResponseFactory.createResponse(request, new RecoverResultType()));
+        }
+    }
+
+    @Override
+    public StatusResultType status(StatusRequestType request) {
+        validateRequest(request);
+
+        return ExceptionMapper.toResponse(new UnsupportedOperationException("XKMS request is currently not supported"),
+                XKMSResponseFactory.createResponse(request, new StatusResultType()));
+    }
+
+    @Override
+    public ValidateResultType validate(ValidateRequestType request) {
+        try {
+            validateRequest(request);
+
+            // Create basic response
+            ValidateResultType result = XKMSResponseFactory.createResponse(request, new ValidateResultType());
+            KeyBindingType binding = createKeyBinding(result);
+
+            // Validate request
+            for (Validator validator : validators) {
+                StatusType status = validator.validate(request);
+                addValidationReasons(binding, status);
+            }
+
+            resolveValidationStatus(binding);
+            return result;
+        } catch (Exception e) {
+            return ExceptionMapper.toResponse(e, XKMSResponseFactory.createResponse(request, new ValidateResultType()));
+        }
+    }
+
+    /**
+     * Performs basic validations on request message to ensure XKMS standard is applied correctly.
+     *
+     * The following validations are performed: 1) Check if a request ID is set 2) Check if service name equals this
+     * XKMS service instance
+     *
+     * @param request XKMS request
+     */
+    private void validateRequest(MessageAbstractType request) {
+        // Check if ID is set
+        if (request.getId() == null || request.getId().isEmpty()) {
+            throw new IllegalArgumentException("Message Id is not set");
+        }
+        // Check if Service matches this instance
+        if (!serviceName.equals(request.getService())) {
+            throw new IllegalArgumentException("Service " + request.getService()
+                                               + " is not responsible to process request");
+        }
+    }
+
+    // TODO refactoring into factory class?
+    public static KeyBindingType createKeyBinding(ValidateResultType result) {
+        KeyBindingType binding = new KeyBindingType();
+        binding.setId(XKMSResponseFactory.generateUniqueID());
+        result.getKeyBinding().add(binding);
+
+        StatusType status = new StatusType();
+        binding.setStatus(status);
+
+        return binding;
+    }
+
+    private void addValidationReasons(KeyBindingType binding, StatusType status) {
+        StatusType resultStatus = binding.getStatus();
+        resultStatus.getValidReason().addAll(status.getValidReason());
+        resultStatus.getInvalidReason().addAll(status.getInvalidReason());
+        resultStatus.getIndeterminateReason().addAll(status.getIndeterminateReason());
+    }
+    
+    public void setServiceName(String serviceName) {
+        this.serviceName = serviceName;
+    }
+
+    public void setLocators(List<Locator> locators) {
+        this.locators = locators;
+    }
+
+    public void setValidators(List<Validator> validators) {
+        this.validators = validators;
+    }
+
+    public void setKeyRegisterHandlers(List<Register> keyRegisterHandlers) {
+        this.keyRegisterHandlers = keyRegisterHandlers;
+    }
+
+    /**
+     * http://www.w3.org/TR/xkms2/#XKMS_2_0_Section_4_1 [206]
+     *
+     * If no (or indeterminate) reasons are present total status is INDETERMINATE.
+     * If no invalid and indeterminate reasons are present status is VALID.
+     * If invalid reasons are present status is INVALID.
+     *
+     * @param binding KeyBinding to check validation reasons for
+     */
+    private void resolveValidationStatus(KeyBindingType binding) {
+        StatusType status = binding.getStatus();
+        status.setStatusValue(KeyBindingEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_INDETERMINATE);
+        if (!status.getValidReason().isEmpty() && status.getIndeterminateReason().isEmpty()) {
+            status.setStatusValue(KeyBindingEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_VALID);
+        }
+        if (!status.getInvalidReason().isEmpty()) {
+            status.setStatusValue(KeyBindingEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_INVALID);
+            // Only return invalid reasons
+            status.getValidReason().clear();
+        }
+    }
+
+    /**
+     * Sets encryption, signature and exchange as key usage for provided keyBinding.
+     *
+     * @param keyBinding KeyBinding to set KeyUsage within
+     */
+    protected void setKeyUsageAll(KeyBindingAbstractType keyBinding) {
+        keyBinding.getKeyUsage().add(KeyUsageEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_ENCRYPTION);
+        keyBinding.getKeyUsage().add(KeyUsageEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_SIGNATURE);
+        keyBinding.getKeyUsage().add(KeyUsageEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_EXCHANGE);
+    }
+
+    public void setEnableXKRSS(boolean enableXKRSS) {
+        this.enableXKRSS = enableXKRSS;
+        LOG.info("enableXKRSS:" + enableXKRSS);
+    }
+
+    private void assertXKRSSAllowed() {
+        if (!enableXKRSS) {
+            throw new UnsupportedOperationException("XKRSS Operations are disabled");
+        }
+    }
+}

Added: cxf/branches/2.7.x-fixes/services/xkms/xkms-service/src/test/java/org/apache/cxf/xkms/service/CheckXKRSS.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-service/src/test/java/org/apache/cxf/xkms/service/CheckXKRSS.java?rev=1512574&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/services/xkms/xkms-service/src/test/java/org/apache/cxf/xkms/service/CheckXKRSS.java (added)
+++ cxf/branches/2.7.x-fixes/services/xkms/xkms-service/src/test/java/org/apache/cxf/xkms/service/CheckXKRSS.java Sat Aug 10 07:52:35 2013
@@ -0,0 +1,159 @@
+/**
+ * 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.xkms.service;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.cxf.xkms.handlers.Register;
+import org.apache.cxf.xkms.handlers.XKMSConstants;
+import org.apache.cxf.xkms.model.extensions.ResultDetails;
+import org.apache.cxf.xkms.model.xkms.RecoverRequestType;
+import org.apache.cxf.xkms.model.xkms.RecoverResultType;
+import org.apache.cxf.xkms.model.xkms.RegisterRequestType;
+import org.apache.cxf.xkms.model.xkms.RegisterResultType;
+import org.apache.cxf.xkms.model.xkms.ReissueRequestType;
+import org.apache.cxf.xkms.model.xkms.ReissueResultType;
+import org.apache.cxf.xkms.model.xkms.RequestAbstractType;
+import org.apache.cxf.xkms.model.xkms.ResultMajorEnum;
+import org.apache.cxf.xkms.model.xkms.ResultMinorEnum;
+import org.apache.cxf.xkms.model.xkms.ResultType;
+import org.apache.cxf.xkms.model.xkms.RevokeRequestType;
+import org.apache.cxf.xkms.model.xkms.RevokeResultType;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class CheckXKRSS {
+    @Test
+    public void checkRegisterWithXKRSS() {
+        RegisterRequestType request = new RegisterRequestType();
+        request.setId("1");
+        request.setService(XKMSConstants.XKMS_ENDPOINT_NAME);
+        RegisterResultType result = createXKMSService(true).register(request);
+        showResult(result);
+        assertSuccess(result);
+    }
+
+    @Test
+    public void checkRegisterWithoutXKRSS() {
+        RegisterRequestType request = new RegisterRequestType();
+        request.setId("1");
+        request.setService(XKMSConstants.XKMS_ENDPOINT_NAME);
+        createXKMSService(false).register(request);
+        RegisterResultType result = createXKMSService(false).register(request);
+        assertNotSupported(result);
+    }
+
+    @Test
+    public void checkRevokeWithXKRSS() {
+        RegisterRequestType request = new RegisterRequestType();
+        request.setId("1");
+        request.setService(XKMSConstants.XKMS_ENDPOINT_NAME);
+        ResultType result = createXKMSService(true).register(request);
+        assertSuccess(result);
+    }
+
+    @Test
+    public void checkRevokeWithoutXKRSS() {
+        RevokeRequestType request = new RevokeRequestType();
+        request.setId("1");
+        request.setService(XKMSConstants.XKMS_ENDPOINT_NAME);
+        ResultType result = createXKMSService(false).revoke(request);
+        assertNotSupported(result);
+    }
+
+    @Test
+    public void checkRecoverWithXKRSS() {
+        RecoverRequestType request = new RecoverRequestType();
+        request.setId("1");
+        request.setService(XKMSConstants.XKMS_ENDPOINT_NAME);
+        ResultType result = createXKMSService(true).recover(request);
+        showResult(result);
+        assertSuccess(result);
+    }
+
+    @Test
+    public void checkRecoverWithoutXKRSS() {
+        RecoverRequestType request = new RecoverRequestType();
+        request.setId("1");
+        request.setService(XKMSConstants.XKMS_ENDPOINT_NAME);
+        ResultType result = createXKMSService(false).recover(request);
+        assertNotSupported(result);
+    }
+
+    private void assertNotSupported(ResultType result) {
+        Assert.assertEquals(ResultMajorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_SENDER.value(),
+                            result.getResultMajor());
+        Assert.assertEquals(ResultMinorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_MESSAGE_NOT_SUPPORTED.value(),
+                            result.getResultMinor());
+    }
+
+    private void assertSuccess(ResultType result) {
+        Assert.assertEquals(ResultMajorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_SUCCESS.value(),
+                            result.getResultMajor());
+        Assert.assertNull(result.getResultMinor());
+    }
+
+    XKMSService createXKMSService(boolean enableXKRSS) {
+        XKMSService xkmsService = new XKMSService();
+        List<Register> keyRegisterHandlers = new ArrayList<Register>();
+        keyRegisterHandlers.add(new Register() {
+
+            @Override
+            public RevokeResultType revoke(RevokeRequestType request, RevokeResultType response) {
+                return response;
+            }
+
+            @Override
+            public ReissueResultType reissue(ReissueRequestType request, ReissueResultType response) {
+                return response;
+            }
+
+            @Override
+            public RegisterResultType register(RegisterRequestType request, RegisterResultType response) {
+                return response;
+            }
+
+            @Override
+            public boolean canProcess(RequestAbstractType request) {
+                return true;
+            }
+
+            @Override
+            public RecoverResultType recover(RecoverRequestType request, RecoverResultType response) {
+                return response;
+            }
+        });
+        xkmsService.setKeyRegisterHandlers(keyRegisterHandlers);
+        xkmsService.setEnableXKRSS(enableXKRSS);
+        return xkmsService;
+    }
+
+    private void showResult(ResultType result) {
+        String message = "";
+        if (!ResultMajorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_SUCCESS.value().equals(result.getResultMajor())) {
+            ResultDetails details = (ResultDetails)result.getMessageExtension().get(0);
+            message = details.getDetails();
+        }
+
+        System.out.println("Major: " + result.getResultMajor() + ", Minor: " + result.getResultMinor()
+                           + ", Message: " + message);
+
+    }
+}

Propchange: cxf/branches/2.7.x-fixes/services/xkms/xkms-war/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 10 07:52:35 2013
@@ -0,0 +1,7 @@
+.settings
+
+.project
+
+.classpath
+
+target

Added: cxf/branches/2.7.x-fixes/services/xkms/xkms-war/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-war/pom.xml?rev=1512574&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/services/xkms/xkms-war/pom.xml (added)
+++ cxf/branches/2.7.x-fixes/services/xkms/xkms-war/pom.xml Sat Aug 10 07:52:35 2013
@@ -0,0 +1,114 @@
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.cxf.services.xkms</groupId>
+    <artifactId>cxf-services-xkms-war</artifactId>
+    <packaging>war</packaging>
+    <name>Apache CXF XKMS Service war deployment</name>
+    <url>http://cxf.apache.org</url>
+
+    <parent>
+        <groupId>org.apache.cxf</groupId>
+        <artifactId>cxf-parent</artifactId>
+        <version>2.7.7-SNAPSHOT</version>
+        <relativePath>../../../parent/pom.xml</relativePath>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-rt-frontend-jaxws</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-jdk14</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-web</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf.services.xkms</groupId>
+            <artifactId>cxf-services-xkms-common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf.services.xkms</groupId>
+            <artifactId>cxf-services-xkms-service</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf.services.xkms</groupId>
+            <artifactId>cxf-services-xkms-x509-handlers</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
+    </dependencies>
+
+    <profiles>
+        <profile>
+            <id>cxf25</id>
+            <dependencies>
+                <dependency>
+                    <groupId>org.apache.cxf</groupId>
+                    <artifactId>cxf-rt-ws-mex</artifactId>
+                    <version>${project.version}</version>
+                </dependency>
+            </dependencies>
+        </profile>
+        <profile>
+            <id>Tomcat6</id>
+            <properties>
+                <tomcat.url>http://localhost:8080/manager</tomcat.url>
+            </properties>
+        </profile>
+        <profile>
+            <id>Tomcat7</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <properties>
+                <tomcat.url>http://localhost:8080/manager/text</tomcat.url>
+            </properties>
+        </profile>
+    </profiles>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>tomcat-maven-plugin</artifactId>
+                <version>1.1</version>
+                <configuration>
+                    <server>myTomcat</server>
+                    <url>${tomcat.url}</url>
+                    <path>/${project.build.finalName}</path>
+                </configuration>
+            </plugin>
+        </plugins>
+        <!-- Name of the generated WAR file -->
+        <finalName>xkms</finalName>
+    </build>
+
+</project>

Added: cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/resources/log4j.properties
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/resources/log4j.properties?rev=1512574&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/resources/log4j.properties (added)
+++ cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/resources/log4j.properties Sat Aug 10 07:52:35 2013
@@ -0,0 +1,36 @@
+#
+# 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.
+#
+
+# Set root category priority to INFO and its only appender to CONSOLE.
+log4j.rootCategory=FATAL, CONSOLE
+#log4j.rootCategory=DEBUG, CONSOLE
+
+# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.Threshold=DEBUG
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n
+
+# LOGFILE is set to be a File appender using a PatternLayout.
+log4j.appender.LOGFILE=org.apache.log4j.FileAppender
+log4j.appender.LOGFILE.File=target/wss4j.log
+log4j.appender.LOGFILE.Append=false
+log4j.appender.LOGFILE.Threshold=DEBUG
+log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

Added: cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/resources/logging.properties
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/resources/logging.properties?rev=1512574&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/resources/logging.properties (added)
+++ cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/resources/logging.properties Sat Aug 10 07:52:35 2013
@@ -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.
+#
+
+############################################################
+#  	Default Logging Configuration File
+#
+# You can use a different file by specifying a filename
+# with the java.util.logging.config.file system property.  
+# For example java -Djava.util.logging.config.file=myfile
+############################################################
+
+############################################################
+#  	Global properties
+############################################################
+
+# "handlers" specifies a comma separated list of log Handler 
+# classes.  These handlers will be installed during VM startup.
+# Note that these classes must be on the system classpath.
+# By default we only configure a ConsoleHandler, which will only
+# show messages at the WARNING and above levels.
+handlers= java.util.logging.ConsoleHandler
+#handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandler
+
+# Default global logging level.
+# This specifies which kinds of events are logged across
+# all loggers.  For any given facility this global level
+# can be overridden by a facility specific level
+# Note that the ConsoleHandler also has a separate level
+# setting to limit messages printed to the console.
+.level= INFO
+
+############################################################
+# Handler specific properties.
+# Describes specific configuration info for Handlers.
+############################################################
+
+# default file output is in user's home directory.
+java.util.logging.FileHandler.pattern = %h/java%u.log
+java.util.logging.FileHandler.limit = 50000
+java.util.logging.FileHandler.count = 1
+java.util.logging.FileHandler.formatter = java.util.logging.XMLFormatter
+
+# Limit the message that are printed on the console to WARNING and above.
+java.util.logging.ConsoleHandler.level = INFO
+java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter
+
+
+############################################################
+# Facility specific properties.
+# Provides extra control for each logger.
+############################################################
+
+# For example, set the com.xyz.foo logger to only log SEVERE
+# messages:
+#com.xyz.foo.level = SEVERE

Added: cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/webapp/WEB-INF/cxf-servlet.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/webapp/WEB-INF/cxf-servlet.xml?rev=1512574&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/webapp/WEB-INF/cxf-servlet.xml (added)
+++ cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/webapp/WEB-INF/cxf-servlet.xml Sat Aug 10 07:52:35 2013
@@ -0,0 +1,43 @@
+<!--
+  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:cxf="http://cxf.apache.org/core" xmlns:jaxws="http://cxf.apache.org/jaxws"
+    xmlns:test="http://apache.org/hello_world_soap_http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:util="http://www.springframework.org/schema/util"
+    xsi:schemaLocation="
+        http://cxf.apache.org/core
+        http://cxf.apache.org/schemas/core.xsd
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+        http://cxf.apache.org/jaxws                                     
+        http://cxf.apache.org/schemas/jaxws.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util-2.0.xsd">
+    <import resource="classpath:META-INF/cxf/cxf.xml" />
+    <import resource="xkms-endpoint.xml" />
+    <import resource="xkms-key-handlers.xml" />
+
+    <cxf:bus>
+        <cxf:features>
+            <cxf:logging />
+        </cxf:features>
+    </cxf:bus>
+
+</beans>
+

Added: cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/webapp/WEB-INF/web.xml?rev=1512574&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/webapp/WEB-INF/web.xml (added)
+++ cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/webapp/WEB-INF/web.xml Sat Aug 10 07:52:35 2013
@@ -0,0 +1,41 @@
+<!--
+  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.
+-->
+<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>CXF STS</display-name>
+    <servlet>
+        <servlet-name>xkms</servlet-name>
+        <servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
+        <!-- <load-on-startup>1</load-on-startup> -->
+        <init-param>
+            <param-name>config-location</param-name>
+            <param-value>WEB-INF/cxf-servlet.xml</param-value>
+        </init-param>
+    </servlet>
+    <servlet-mapping>
+        <servlet-name>xkms</servlet-name>
+        <url-pattern>/*</url-pattern>
+    </servlet-mapping>
+    <session-config>
+        <session-timeout>60</session-timeout>
+    </session-config>
+
+</web-app>

Added: cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/webapp/WEB-INF/xkms-endpoint.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/webapp/WEB-INF/xkms-endpoint.xml?rev=1512574&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/webapp/WEB-INF/xkms-endpoint.xml (added)
+++ cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/webapp/WEB-INF/xkms-endpoint.xml Sat Aug 10 07:52:35 2013
@@ -0,0 +1,77 @@
+<?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:cxf="http://cxf.apache.org/core" xmlns:jaxws="http://cxf.apache.org/jaxws"
+    xmlns:test="http://apache.org/hello_world_soap_http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:util="http://www.springframework.org/schema/util"
+    xsi:schemaLocation="
+        http://cxf.apache.org/core
+        http://cxf.apache.org/schemas/core.xsd
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+        http://cxf.apache.org/jaxws                                     
+        http://cxf.apache.org/schemas/jaxws.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util-2.0.xsd">
+
+    <cxf:bus>
+        <cxf:features>
+            <cxf:logging />
+        </cxf:features>
+    </cxf:bus>
+
+    <bean id="xkmsProviderBean" class="org.apache.cxf.xkms.service.XKMSService">
+        <property name="validators">
+            <list>
+                <ref bean="dateValidator" />
+                <ref bean="trustedAuthorityValidator" />
+            </list>
+        </property>
+        <property name="locators">
+            <list>
+                <ref bean="x509Locator" />
+            </list>
+        </property>
+        <property name="keyRegisterHandlers">
+            <list>
+                <ref bean="x509Register" />
+            </list>
+        </property>
+    </bean>
+
+    <jaxws:endpoint id="XKMSService"
+        xmlns:serviceNamespace="http://www.w3.org/2002/03/xkms#wsdl"
+        serviceName="serviceNamespace:XKMSService" endpointName="serviceNamespace:XKMSPort"
+        implementor="#xkmsProviderBean" address="/XKMS">
+        <jaxws:properties>
+            <entry key="jaxb.additionalContextClasses">
+                <bean
+                    class="org.apache.cxf.xkms.model.extensions.ClassArrayFactoryBean">
+                    <property name="classNames">
+                        <list>
+                            <value>org.apache.cxf.xkms.model.extensions.ResultDetails</value>
+                        </list>
+                    </property>
+                </bean>
+            </entry>
+        </jaxws:properties>
+    </jaxws:endpoint>
+
+</beans>

Added: cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/webapp/WEB-INF/xkms-key-handlers.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/webapp/WEB-INF/xkms-key-handlers.xml?rev=1512574&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/webapp/WEB-INF/xkms-key-handlers.xml (added)
+++ cxf/branches/2.7.x-fixes/services/xkms/xkms-war/src/main/webapp/WEB-INF/xkms-key-handlers.xml Sat Aug 10 07:52:35 2013
@@ -0,0 +1,82 @@
+<?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:cxf="http://cxf.apache.org/core" xmlns:jaxws="http://cxf.apache.org/jaxws"
+    xmlns:test="http://apache.org/hello_world_soap_http" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:util="http://www.springframework.org/schema/util"
+    xsi:schemaLocation="
+        http://cxf.apache.org/core
+        http://cxf.apache.org/schemas/core.xsd
+        http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+        http://cxf.apache.org/jaxws                                     
+        http://cxf.apache.org/schemas/jaxws.xsd
+        http://www.springframework.org/schema/util
+        http://www.springframework.org/schema/util/spring-util-2.0.xsd">
+
+
+    <bean id="dateValidator" class="org.apache.cxf.xkms.x509.validator.DateValidator" />
+
+    <bean id="trustedAuthorityValidator"
+        class="org.apache.cxf.xkms.x509.validator.TrustedAuthorityValidator">
+        <constructor-arg ref="certificateRepo" />
+    </bean>
+
+    <bean id="x509Locator" class="org.apache.cxf.xkms.x509.handlers.X509Locator">
+        <constructor-arg ref="certificateRepo" />
+    </bean>
+
+    <bean id="x509Register"
+        class="org.apache.cxf.xkms.x509.handlers.X509Register">
+        <constructor-arg ref="certificateRepo" />
+    </bean>
+
+
+    <!-- LDAP based implementation -->
+
+    <bean id="certificateRepo"
+        class="org.apache.cxf.xkms.x509.repo.ldap.LdapCertificateRepo">
+        <constructor-arg ref="ldapSearch" />
+        <constructor-arg ref="ldapSchemaConfig" />
+        <constructor-arg value="dc=example,dc=com" />
+    </bean>
+
+    <bean id="ldapSearch" class="org.apache.cxf.xkms.x509.repo.ldap.LdapSearch">
+        <constructor-arg value="ldap://localhost:2389" />
+        <constructor-arg value="cn=Directory Manager,dc=example,dc=com" />
+        <constructor-arg value="test" />
+        <constructor-arg value="2" />
+    </bean>
+
+    <bean id="ldapSchemaConfig" class="org.apache.cxf.xkms.x509.repo.ldap.LdapSchemaConfig">
+        <property name="certObjectClass" value="inetOrgPerson" />
+        <property name="attrUID" value="uid" />
+        <property name="attrIssuerID" value="manager" />
+        <property name="attrSerialNumber" value="employeeNumber" />
+        <property name="attrCrtBinary" value="userCertificate;binary" />
+        <property name="constAttrNamesCSV" value="sn" />
+        <property name="constAttrValuesCSV" value="X509 certificate" />
+        <property name="serviceCertRDNTemplate" value="cn=%s,ou=services" />
+        <property name="serviceCertUIDTemplate" value="cn=%s" />
+	<property name="trustedAuthorityFilter" value="(&#038;(objectClass=inetOrgPerson)(ou:dn:=CAs))" />
+	<property name="intermediateFilter" value="(objectClass=inetOrgPerson)" />
+    </bean>
+
+
+    <!-- File based implementation -->
+
+    <!-- bean id="certificateRepo"
+        class="org.apache.cxf.xkms.x509.repo.file.FileCertificateRepo">
+        <constructor-arg value="../conf/certs" />
+    </bean-->
+
+</beans>

Propchange: cxf/branches/2.7.x-fixes/services/xkms/xkms-x509-handlers/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sat Aug 10 07:52:35 2013
@@ -0,0 +1,7 @@
+.classpath
+
+.project
+
+.settings
+
+target

Added: cxf/branches/2.7.x-fixes/services/xkms/xkms-x509-handlers/pom.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-x509-handlers/pom.xml?rev=1512574&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/services/xkms/xkms-x509-handlers/pom.xml (added)
+++ cxf/branches/2.7.x-fixes/services/xkms/xkms-x509-handlers/pom.xml Sat Aug 10 07:52:35 2013
@@ -0,0 +1,90 @@
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>org.apache.cxf.services.xkms</groupId>
+    <artifactId>cxf-services-xkms-x509-handlers</artifactId>
+    <packaging>bundle</packaging>
+    <name>Apache CXF XKMS X509 Handlers</name>
+    <url>http://cxf.apache.org</url>
+
+    <parent>
+        <groupId>org.apache.cxf</groupId>
+        <artifactId>cxf-parent</artifactId>
+        <version>2.7.7-SNAPSHOT</version>
+        <relativePath>../../../parent/pom.xml</relativePath>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.cxf</groupId>
+            <artifactId>cxf-api</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.cxf.services.xkms</groupId>
+            <artifactId>cxf-services-xkms-common</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.easymock</groupId>
+            <artifactId>easymock</artifactId>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.felix</groupId>
+                <artifactId>maven-bundle-plugin</artifactId>
+                <extensions>true</extensions>
+                <configuration>
+                    <instructions>
+                        <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
+                    </instructions>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.eclipse.tycho</groupId>
+                <artifactId>tycho-packaging-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>timestamp</id>
+                        <phase>validate</phase>
+                        <goals>
+                            <goal>build-qualifier</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>

Added: cxf/branches/2.7.x-fixes/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/handlers/X509Locator.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/handlers/X509Locator.java?rev=1512574&view=auto
==============================================================================
--- cxf/branches/2.7.x-fixes/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/handlers/X509Locator.java (added)
+++ cxf/branches/2.7.x-fixes/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/handlers/X509Locator.java Sat Aug 10 07:52:35 2013
@@ -0,0 +1,181 @@
+/**
+ * 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.xkms.x509.handlers;
+
+import java.security.cert.CertificateEncodingException;
+import java.security.cert.CertificateException;
+import java.security.cert.X509Certificate;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.cxf.xkms.exception.XKMSCertificateException;
+import org.apache.cxf.xkms.exception.XKMSException;
+import org.apache.cxf.xkms.handlers.Applications;
+import org.apache.cxf.xkms.handlers.Locator;
+import org.apache.cxf.xkms.model.xkms.LocateRequestType;
+import org.apache.cxf.xkms.model.xkms.QueryKeyBindingType;
+import org.apache.cxf.xkms.model.xkms.ResultMajorEnum;
+import org.apache.cxf.xkms.model.xkms.ResultMinorEnum;
+import org.apache.cxf.xkms.model.xkms.UnverifiedKeyBindingType;
+import org.apache.cxf.xkms.model.xkms.UseKeyWithType;
+import org.apache.cxf.xkms.model.xmldsig.KeyInfoType;
+import org.apache.cxf.xkms.model.xmldsig.X509DataType;
+import org.apache.cxf.xkms.model.xmldsig.X509IssuerSerialType;
+import org.apache.cxf.xkms.x509.repo.CertificateRepo;
+import org.apache.cxf.xkms.x509.utils.X509Utils;
+
+public class X509Locator implements Locator {
+
+    private CertificateRepo certRepo;
+
+    public X509Locator(CertificateRepo certRepo) throws CertificateException {
+        this.certRepo = certRepo;
+    }
+
+    @Override
+    public UnverifiedKeyBindingType locate(LocateRequestType request) {
+        List<UseKeyWithType> keyIDs = parse(request);
+        X509Certificate cert;
+        try {
+            cert = findCertificate(keyIDs);
+            if (cert == null) {
+                return null;
+            }
+            UnverifiedKeyBindingType result = new UnverifiedKeyBindingType();
+            result.setKeyInfo(X509Utils.getKeyInfo(cert));
+            return result;
+        } catch (CertificateEncodingException e) {
+            throw new XKMSCertificateException("Cannot encode certificate: " + e.getMessage(), e);
+        } catch (CertificateException e1) {
+            throw new XKMSCertificateException(e1.getMessage(), e1);
+        }
+    }
+
+    public X509Certificate findCertificate(List<UseKeyWithType> ids) throws CertificateException {
+        X509Certificate cert = null;
+        if (ids.size() == 0) {
+            throw new IllegalArgumentException("No UseKeyWithType elements found");
+        }
+        if (ids.size() == 1) {
+            Applications application = Applications.fromUri(ids.get(0).getApplication());
+            String id = ids.get(0).getIdentifier();
+            if (application == Applications.PKIX) {
+                cert = certRepo.findBySubjectDn(id);
+            } else if (application == Applications.SERVICE_SOAP) {
+                cert = certRepo.findByServiceName(id);
+            }
+        }
+        String issuer = getIdForApplication(Applications.ISSUER, ids);
+        String serial = getIdForApplication(Applications.SERIAL, ids);
+        if ((issuer != null) && (serial != null)) {
+            cert = certRepo.findByIssuerSerial(issuer, serial);
+        }
+        return cert;
+    }
+    
+    private String getIdForApplication(Applications application, List<UseKeyWithType> ids) {
+        for (UseKeyWithType id : ids) {
+            if (application.getUri().equalsIgnoreCase(id.getApplication())) {
+                return id.getIdentifier();
+            }
+        }
+        return null;
+    }
+    
+    private List<UseKeyWithType> parse(LocateRequestType request) {
+        List<UseKeyWithType> keyIDs = new ArrayList<UseKeyWithType>();
+        if (request == null) {
+            return keyIDs;
+        }
+
+        QueryKeyBindingType query = request.getQueryKeyBinding();
+        if (query == null) {
+            return keyIDs;
+        }
+
+        // http://www.w3.org/TR/xkms2/ [213]
+        if (query.getTimeInstant() != null) {
+            throw new XKMSException(ResultMajorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_RECEIVER,
+                    ResultMinorEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_TIME_INSTANT_NOT_SUPPORTED);
+        }
+
+        keyIDs.addAll(parse(query.getKeyInfo()));
+
+        List<UseKeyWithType> useKeyList = query.getUseKeyWith();
+        keyIDs.addAll(useKeyList);
+
+        return keyIDs;
+    }
+
+    private List<UseKeyWithType> parse(KeyInfoType keyInfo) {
+        List<UseKeyWithType> keyIDs = new ArrayList<UseKeyWithType>();
+
+        if (keyInfo == null) {
+            return keyIDs;
+        }
+
+        List<Object> content = keyInfo.getContent();
+        for (Object obj1 : content) {
+            if (obj1 instanceof JAXBElement) {
+                JAXBElement<?> keyInfoChild = (JAXBElement<?>) obj1;
+                if (X509Utils.X509_KEY_NAME.equals(keyInfoChild.getName())) {
+                    UseKeyWithType keyDN = new UseKeyWithType();
+                    keyDN.setApplication(Applications.PKIX.getUri());
+                    keyDN.setIdentifier((String) keyInfoChild.getValue());
+                    keyIDs.add(keyDN);
+
+                } else if (X509Utils.X509_DATA.equals(keyInfoChild.getName())) {
+                    X509DataType x509Data = (X509DataType) keyInfoChild.getValue();
+                    List<Object> x509DataContent = x509Data.getX509IssuerSerialOrX509SKIOrX509SubjectName();
+
+                    for (Object obj2 : x509DataContent) {
+                        if (obj2 instanceof JAXBElement) {
+                            JAXBElement<?> x509DataChild = (JAXBElement<?>) obj2;
+
+                            if (X509Utils.X509_ISSUER_SERIAL.equals(x509DataChild.getName())) {
+                                X509IssuerSerialType x509IssuerSerial = (X509IssuerSerialType) x509DataChild.getValue();
+
+                                UseKeyWithType issuer = new UseKeyWithType();
+                                issuer.setApplication(Applications.ISSUER.getUri());
+                                issuer.setIdentifier(x509IssuerSerial.getX509IssuerName());
+                                keyIDs.add(issuer);
+
+                                UseKeyWithType serial = new UseKeyWithType();
+                                serial.setApplication(Applications.SERIAL.getUri());
+                                serial.setIdentifier(x509IssuerSerial.getX509SerialNumber().toString());
+                                keyIDs.add(serial);
+
+                            } else if (X509Utils.X509_SUBJECT_NAME.equals(x509DataChild.getName())) {
+                                UseKeyWithType keyDN = new UseKeyWithType();
+                                keyDN.setApplication(Applications.PKIX.getUri());
+                                keyDN.setIdentifier((String) x509DataChild.getValue());
+                                keyIDs.add(keyDN);
+                            }
+                        }
+                    }
+                }
+            }
+        }
+        return keyIDs;
+    }
+
+}



Mime
View raw message