cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject svn commit: r1509584 - in /cxf/trunk/services/xkms: ./ xkms-client/ xkms-common/ xkms-common/src/main/java/org/apache/cxf/xkms/handlers/ xkms-features/ xkms-osgi/ xkms-osgi/src/main/resources/OSGI-INF/blueprint/ xkms-service/ xkms-service/src/main/java...
Date Fri, 02 Aug 2013 09:17:07 GMT
Author: cschneider
Date: Fri Aug  2 09:17:06 2013
New Revision: 1509584

URL: http://svn.apache.org/r1509584
Log:
CXF-5173 Add config to disable xkrss

Added:
    cxf/trunk/services/xkms/xkms-service/src/test/
    cxf/trunk/services/xkms/xkms-service/src/test/java/
    cxf/trunk/services/xkms/xkms-service/src/test/java/org/
    cxf/trunk/services/xkms/xkms-service/src/test/java/org/apache/
    cxf/trunk/services/xkms/xkms-service/src/test/java/org/apache/cxf/
    cxf/trunk/services/xkms/xkms-service/src/test/java/org/apache/cxf/xkms/
    cxf/trunk/services/xkms/xkms-service/src/test/java/org/apache/cxf/xkms/service/
    cxf/trunk/services/xkms/xkms-service/src/test/java/org/apache/cxf/xkms/service/CheckXKRSS.java
  (with props)
Removed:
    cxf/trunk/services/xkms/xkms-osgi/src/main/resources/OSGI-INF/blueprint/xkms-key-handlers.xml
Modified:
    cxf/trunk/services/xkms/   (props changed)
    cxf/trunk/services/xkms/xkms-client/   (props changed)
    cxf/trunk/services/xkms/xkms-common/   (props changed)
    cxf/trunk/services/xkms/xkms-common/src/main/java/org/apache/cxf/xkms/handlers/Register.java
    cxf/trunk/services/xkms/xkms-features/   (props changed)
    cxf/trunk/services/xkms/xkms-osgi/   (props changed)
    cxf/trunk/services/xkms/xkms-osgi/src/main/resources/OSGI-INF/blueprint/cxf-endpoint.xml
    cxf/trunk/services/xkms/xkms-service/   (props changed)
    cxf/trunk/services/xkms/xkms-service/pom.xml
    cxf/trunk/services/xkms/xkms-service/src/main/java/org/apache/cxf/xkms/service/XKMSService.java
    cxf/trunk/services/xkms/xkms-war/   (props changed)
    cxf/trunk/services/xkms/xkms-x509-handlers/   (props changed)
    cxf/trunk/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/handlers/X509Register.java

Propchange: cxf/trunk/services/xkms/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Aug  2 09:17:06 2013
@@ -0,0 +1,3 @@
+.project
+
+.settings

Propchange: cxf/trunk/services/xkms/xkms-client/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Aug  2 09:17:06 2013
@@ -1 +1,7 @@
 target
+
+.settings
+
+bin
+
+.project

Propchange: cxf/trunk/services/xkms/xkms-common/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Aug  2 09:17:06 2013
@@ -1 +1,9 @@
 target
+
+.settings
+
+bin
+
+.classpath
+
+.project

Modified: cxf/trunk/services/xkms/xkms-common/src/main/java/org/apache/cxf/xkms/handlers/Register.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/xkms/xkms-common/src/main/java/org/apache/cxf/xkms/handlers/Register.java?rev=1509584&r1=1509583&r2=1509584&view=diff
==============================================================================
--- cxf/trunk/services/xkms/xkms-common/src/main/java/org/apache/cxf/xkms/handlers/Register.java
(original)
+++ cxf/trunk/services/xkms/xkms-common/src/main/java/org/apache/cxf/xkms/handlers/Register.java
Fri Aug  2 09:17:06 2013
@@ -19,6 +19,8 @@
 
 package org.apache.cxf.xkms.handlers;
 
+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;
@@ -36,5 +38,7 @@ public interface Register {
     ReissueResultType reissue(ReissueRequestType request, ReissueResultType response);
 
     RevokeResultType revoke(RevokeRequestType request, RevokeResultType response);
+    
+    RecoverResultType recover(RecoverRequestType request, RecoverResultType response);
 
 }

Propchange: cxf/trunk/services/xkms/xkms-features/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Aug  2 09:17:06 2013
@@ -1 +1,5 @@
 target
+
+.settings
+
+.project

Propchange: cxf/trunk/services/xkms/xkms-osgi/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Aug  2 09:17:06 2013
@@ -1 +1,5 @@
 target
+
+.settings
+
+.project

Modified: cxf/trunk/services/xkms/xkms-osgi/src/main/resources/OSGI-INF/blueprint/cxf-endpoint.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/xkms/xkms-osgi/src/main/resources/OSGI-INF/blueprint/cxf-endpoint.xml?rev=1509584&r1=1509583&r2=1509584&view=diff
==============================================================================
--- cxf/trunk/services/xkms/xkms-osgi/src/main/resources/OSGI-INF/blueprint/cxf-endpoint.xml
(original)
+++ cxf/trunk/services/xkms/xkms-osgi/src/main/resources/OSGI-INF/blueprint/cxf-endpoint.xml
Fri Aug  2 09:17:06 2013
@@ -20,7 +20,57 @@
                         http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd
 ">
 
+	<cm:property-placeholder persistent-id="org.apache.cxf.xkms" />
+
+    <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="xkmsProviderBean" class="org.apache.cxf.xkms.service.XKMSService">
+    	<property name="enableXKRSS" value="${xkms.enableXKRSS}" />
         <property name="validators">
             <list>
                 <ref component-id="dateValidator" />

Propchange: cxf/trunk/services/xkms/xkms-service/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Aug  2 09:17:06 2013
@@ -1 +1,7 @@
 target
+
+.settings
+
+.classpath
+
+.project

Modified: cxf/trunk/services/xkms/xkms-service/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/services/xkms/xkms-service/pom.xml?rev=1509584&r1=1509583&r2=1509584&view=diff
==============================================================================
--- cxf/trunk/services/xkms/xkms-service/pom.xml (original)
+++ cxf/trunk/services/xkms/xkms-service/pom.xml Fri Aug  2 09:17:06 2013
@@ -44,6 +44,11 @@
             <artifactId>cxf-api</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+        	<groupId>junit</groupId>
+        	<artifactId>junit</artifactId>
+        	<scope>test</scope>
+        </dependency>
     </dependencies>
 
     <build>

Modified: cxf/trunk/services/xkms/xkms-service/src/main/java/org/apache/cxf/xkms/service/XKMSService.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/xkms/xkms-service/src/main/java/org/apache/cxf/xkms/service/XKMSService.java?rev=1509584&r1=1509583&r2=1509584&view=diff
==============================================================================
--- cxf/trunk/services/xkms/xkms-service/src/main/java/org/apache/cxf/xkms/service/XKMSService.java
(original)
+++ cxf/trunk/services/xkms/xkms-service/src/main/java/org/apache/cxf/xkms/service/XKMSService.java
Fri Aug  2 09:17:06 2013
@@ -69,9 +69,12 @@ public class XKMSService implements XKMS
     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());
@@ -95,13 +98,15 @@ public class XKMSService implements XKMS
     public CompoundResultType compound(CompoundRequestType request) {
         validateRequest(request);
 
-        return ExceptionMapper.toResponse(new UnsupportedOperationException("XKMS request
is currently not supported"),
-                XKMSResponseFactory.createResponse(request, new CompoundResultType()));
+        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 {
@@ -131,6 +136,7 @@ public class XKMSService implements XKMS
     @Override
     public RevokeResultType revoke(RevokeRequestType request) {
         try {
+            assertXKRSSAllowed();
             validateRequest(request);
             RevokeResultType response = XKMSResponseFactory.createResponse(request, new RevokeResultType());
             try {
@@ -156,7 +162,7 @@ public class XKMSService implements XKMS
             // Create basic response
             LocateResultType result = XKMSResponseFactory.createResponse(request, new LocateResultType());
             // Search
-            for (Locator locator : getLocators()) {
+            for (Locator locator : locators) {
                 UnverifiedKeyBindingType keyBinding = locator.locate(request);
                 if (keyBinding != null) {
                     result.getUnverifiedKeyBinding().add(keyBinding);
@@ -173,10 +179,24 @@ public class XKMSService implements XKMS
 
     @Override
     public RecoverResultType recover(RecoverRequestType request) {
-        validateRequest(request);
-
-        return ExceptionMapper.toResponse(new UnsupportedOperationException("XKMS request
is currently not supported"),
-                XKMSResponseFactory.createResponse(request, new RecoverResultType()));
+        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
@@ -223,20 +243,12 @@ public class XKMSService implements XKMS
             throw new IllegalArgumentException("Message Id is not set");
         }
         // Check if Service matches this instance
-        if (!getServiceName().equals(request.getService())) {
+        if (!serviceName.equals(request.getService())) {
             throw new IllegalArgumentException("Service " + request.getService()
                                                + " is not responsible to process request");
         }
     }
 
-    public String getServiceName() {
-        return serviceName;
-    }
-
-    public void setServiceName(String serviceName) {
-        this.serviceName = serviceName;
-    }
-
     // TODO refactoring into factory class?
     public static KeyBindingType createKeyBinding(ValidateResultType result) {
         KeyBindingType binding = new KeyBindingType();
@@ -255,6 +267,10 @@ public class XKMSService implements XKMS
         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;
@@ -301,12 +317,13 @@ public class XKMSService implements XKMS
         keyBinding.getKeyUsage().add(KeyUsageEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_EXCHANGE);
     }
 
-    public List<Validator> getValidators() {
-        return validators;
+    public void setEnableXKRSS(boolean enableXKRSS) {
+        this.enableXKRSS = enableXKRSS;
     }
 
-    public List<Locator> getLocators() {
-        return locators;
+    private void assertXKRSSAllowed() {
+        if (!enableXKRSS) {
+            throw new UnsupportedOperationException("XKRSS Operations are disabled");
+        }
     }
-
 }

Added: cxf/trunk/services/xkms/xkms-service/src/test/java/org/apache/cxf/xkms/service/CheckXKRSS.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/xkms/xkms-service/src/test/java/org/apache/cxf/xkms/service/CheckXKRSS.java?rev=1509584&view=auto
==============================================================================
--- cxf/trunk/services/xkms/xkms-service/src/test/java/org/apache/cxf/xkms/service/CheckXKRSS.java
(added)
+++ cxf/trunk/services/xkms/xkms-service/src/test/java/org/apache/cxf/xkms/service/CheckXKRSS.java
Fri Aug  2 09:17:06 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/trunk/services/xkms/xkms-service/src/test/java/org/apache/cxf/xkms/service/CheckXKRSS.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Propchange: cxf/trunk/services/xkms/xkms-war/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Aug  2 09:17:06 2013
@@ -1 +1,5 @@
 target
+
+.settings
+
+.project

Propchange: cxf/trunk/services/xkms/xkms-x509-handlers/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Aug  2 09:17:06 2013
@@ -1 +1,9 @@
 target
+
+.settings
+
+bin
+
+.classpath
+
+.project

Modified: cxf/trunk/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/handlers/X509Register.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/handlers/X509Register.java?rev=1509584&r1=1509583&r2=1509584&view=diff
==============================================================================
--- cxf/trunk/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/handlers/X509Register.java
(original)
+++ cxf/trunk/services/xkms/xkms-x509-handlers/src/main/java/org/apache/cxf/xkms/x509/handlers/X509Register.java
Fri Aug  2 09:17:06 2013
@@ -31,6 +31,8 @@ import org.apache.cxf.xkms.handlers.Regi
 import org.apache.cxf.xkms.model.xkms.KeyBindingEnum;
 import org.apache.cxf.xkms.model.xkms.KeyBindingType;
 import org.apache.cxf.xkms.model.xkms.PrototypeKeyBindingType;
+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;
@@ -58,6 +60,9 @@ public class X509Register implements Reg
 
     @Override
     public boolean canProcess(RequestAbstractType request) {
+        if (request instanceof RecoverRequestType) {
+            return false;
+        }
         List<String> respondWithList = request.getRespondWith();
         if ((respondWithList != null) && !(respondWithList.isEmpty())) {
             return respondWithList.contains(RespondWithEnum.HTTP_WWW_W_3_ORG_2002_03_XKMS_X_509_CERT);
@@ -138,4 +143,9 @@ public class X509Register implements Reg
         return certList;
     }
 
+    @Override
+    public RecoverResultType recover(RecoverRequestType request, RecoverResultType response)
{
+        throw new UnsupportedOperationException("Recover is currently not supported");
+    }
+
 }



Mime
View raw message