>From 0133193e384428879f60b2f81e326daa39cffc17 Mon Sep 17 00:00:00 2001
From: Ade Lee <alee@redhat.com>
Date: Mon, 3 Feb 2014 13:19:46 -0500
Subject: [PATCH] Address review comments

1. Remove Link attribute from ResourceMessage,
2. Rename KeyDataInfo and KeyDataInfoCollection.
3. Move KEYGEN_ALGORITHMS
4. Fix missing space in PKIException
5. Move properties to attributes in ResourceMessage
6. Add missing code to update the request and set IRequest.RESULT
---
 .../com/netscape/certsrv/base/PKIException.java    |  6 +-
 .../com/netscape/certsrv/base/ResourceMessage.java | 86 +++++++++-------------
 .../certsrv/base/UserNotFoundException.java        |  4 +-
 .../certsrv/cert/CertNotFoundException.java        |  4 +-
 .../certsrv/group/GroupNotFoundException.java      |  4 +-
 .../netscape/certsrv/key/KeyArchivalRequest.java   | 20 ++---
 .../src/com/netscape/certsrv/key/KeyClient.java    |  2 +-
 .../certsrv/key/{KeyDataInfo.java => KeyInfo.java} |  6 +-
 ...aInfoCollection.java => KeyInfoCollection.java} |  6 +-
 .../netscape/certsrv/key/KeyRecoveryRequest.java   | 44 +++++------
 .../src/com/netscape/certsrv/key/KeyResource.java  |  2 +-
 .../certsrv/key/SymKeyGenerationRequest.java       | 52 ++++++-------
 .../src/com/netscape/certsrv/kra/KRAClient.java    | 14 ++--
 .../certsrv/profile/ProfileNotFoundException.java  |  4 +-
 .../certsrv/request/RequestNotFoundException.java  |  4 +-
 .../src/com/netscape/cmstools/key/KeyCLI.java      |  4 +-
 .../src/com/netscape/cmstools/key/KeyFindCLI.java  | 10 +--
 .../src/com/netscape/cms/servlet/test/DRMTest.java |  6 +-
 .../netscape/kra/SecurityDataRecoveryService.java  |  5 +-
 .../src/com/netscape/kra/SecurityDataService.java  |  2 +
 .../kra/src/com/netscape/kra/SymKeyGenService.java |  6 +-
 .../netscape/cms/servlet/key/KeyRequestDAO.java    |  3 +-
 .../com/netscape/cms/servlet/key/KeyService.java   | 14 ++--
 .../cms/servlet/request/KeyRequestService.java     | 16 ++++
 24 files changed, 163 insertions(+), 161 deletions(-)
 rename base/common/src/com/netscape/certsrv/key/{KeyDataInfo.java => KeyInfo.java} (96%)
 rename base/common/src/com/netscape/certsrv/key/{KeyDataInfoCollection.java => KeyInfoCollection.java} (86%)

diff --git a/base/common/src/com/netscape/certsrv/base/PKIException.java b/base/common/src/com/netscape/certsrv/base/PKIException.java
index 65ff6db8ee39daf3de5fee4625ac089803ccca9f..f1f37735273c9fbae2cb5da5e2eaef705d4385c9 100644
--- a/base/common/src/com/netscape/certsrv/base/PKIException.java
+++ b/base/common/src/com/netscape/certsrv/base/PKIException.java
@@ -84,7 +84,7 @@ public class PKIException extends RuntimeException {
     }
 
     @XmlRootElement(name="PKIException")
-    public static class Data extends ResourceMessage{
+    public static class Data extends ResourceMessage {
 
         @XmlElement(name="Code")
         public int code;
@@ -111,8 +111,8 @@ public class PKIException extends RuntimeException {
         data.className = PKIException.class.getName();
         data.code = Response.Status.INTERNAL_SERVER_ERROR.getStatusCode();
         data.message = "An error has occured";
-        data.setProperty("attr1", "value1");
-        data.setProperty("attr2", "value2");
+        data.setAttribute("attr1", "value1");
+        data.setAttribute("attr2", "value2");
 
         JAXBContext context = JAXBContext.newInstance(Data.class);
         Marshaller marshaller = context.createMarshaller();
diff --git a/base/common/src/com/netscape/certsrv/base/ResourceMessage.java b/base/common/src/com/netscape/certsrv/base/ResourceMessage.java
index dd2f48078285a6868bbf9490fcb0e9dc0f09e99c..57b5539b8f59982f46c33187b0c13cab2e61eaba 100644
--- a/base/common/src/com/netscape/certsrv/base/ResourceMessage.java
+++ b/base/common/src/com/netscape/certsrv/base/ResourceMessage.java
@@ -20,16 +20,13 @@ import javax.xml.bind.annotation.XmlValue;
 import javax.xml.bind.annotation.adapters.XmlAdapter;
 import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
 
-import org.jboss.resteasy.plugins.providers.atom.Link;
-
 /**
  * @author Ade Lee
  */
 @XmlRootElement(name="ResourceMessage")
 public class ResourceMessage {
 
-    protected Map<String, String> properties = new LinkedHashMap<String, String>();
-    Link link;
+    protected Map<String, String> attributes = new LinkedHashMap<String, String>();
     String className;
 
     public ResourceMessage() {
@@ -38,7 +35,7 @@ public class ResourceMessage {
 
     public ResourceMessage(MultivaluedMap<String, String> form) {
         for (Map.Entry<String, List<String>> entry: form.entrySet()) {
-            properties.put(entry.getKey(), entry.getValue().get(0));
+            attributes.put(entry.getKey(), entry.getValue().get(0));
         }
     }
 
@@ -51,61 +48,61 @@ public class ResourceMessage {
         this.className = className;
     }
 
-    @XmlElement(name = "Properties")
+    @XmlElement(name = "Attributes")
     @XmlJavaTypeAdapter(MapAdapter.class)
-    public Map<String, String> getProperties() {
-        return properties;
+    public Map<String, String> getAttributes() {
+        return attributes;
     }
 
-    public void setProperties(Map<String, String> properties) {
-        this.properties.clear();
-        this.properties.putAll(properties);
+    public void setAttributes(Map<String, String> attributes) {
+        this.attributes.clear();
+        this.attributes.putAll(attributes);
     }
 
-    public Collection<String> getPropertyNames() {
-        return properties.keySet();
+    public Collection<String> getAttributeNames() {
+        return attributes.keySet();
     }
 
-    public String getProperty(String name) {
-        return properties.get(name);
+    public String getAttribute(String name) {
+        return attributes.get(name);
     }
 
-    public void setProperty(String name, String value) {
-        properties.put(name, value);
+    public void setAttribute(String name, String value) {
+        attributes.put(name, value);
     }
 
-    public String removeProperty(String name) {
-        return properties.remove(name);
+    public String removeAttribute(String name) {
+        return attributes.remove(name);
     }
 
-    public static class MapAdapter extends XmlAdapter<PropertyList, Map<String, String>> {
+    public static class MapAdapter extends XmlAdapter<AttributeList, Map<String, String>> {
 
-        public PropertyList marshal(Map<String, String> map) {
-            PropertyList list = new PropertyList();
+        public AttributeList marshal(Map<String, String> map) {
+            AttributeList list = new AttributeList();
             for (Map.Entry<String, String> entry : map.entrySet()) {
-                Property property = new Property();
-                property.name = entry.getKey();
-                property.value = entry.getValue();
-                list.properties.add(property);
+                Attribute attribute = new Attribute();
+                attribute.name = entry.getKey();
+                attribute.value = entry.getValue();
+                list.attrs.add(attribute);
             }
             return list;
         }
 
-        public Map<String, String> unmarshal(PropertyList list) {
+        public Map<String, String> unmarshal(AttributeList list) {
             Map<String, String> map = new LinkedHashMap<String, String>();
-            for (Property property : list.properties) {
-                map.put(property.name, property.value);
+            for (Attribute attribute : list.attrs) {
+                map.put(attribute.name, attribute.value);
             }
             return map;
         }
     }
 
-    public static class PropertyList {
-        @XmlElement(name = "Property")
-        public List<Property> properties = new ArrayList<Property>();
+    public static class AttributeList {
+        @XmlElement(name = "Attribute")
+        public List<Attribute> attrs = new ArrayList<Attribute>();
     }
 
-    public static class Property {
+    public static class Attribute {
 
         @XmlAttribute
         public String name;
@@ -114,21 +111,11 @@ public class ResourceMessage {
         public String value;
     }
 
-    @XmlElement(name = "Link")
-    public Link getLink() {
-        return link;
-    }
-
-    public void setLink(Link link) {
-        this.link = link;
-    }
-
     @Override
     public int hashCode() {
         final int prime = 31;
         int result = 1;
-        result = prime * result + ((link == null) ? 0 : link.hashCode());
-        result = prime * result + ((properties == null) ? 0 : properties.hashCode());
+        result = prime * result + ((attributes == null) ? 0 : attributes.hashCode());
         result = prime * result + ((className == null) ? 0 : className.hashCode());
         return result;
     }
@@ -142,15 +129,10 @@ public class ResourceMessage {
         if (getClass() != obj.getClass())
             return false;
         ResourceMessage other = (ResourceMessage) obj;
-        if (link == null) {
-            if (other.link != null)
+        if (attributes == null) {
+            if (other.attributes != null)
                 return false;
-        } else if (!link.equals(other.link))
-            return false;
-        if (properties == null) {
-            if (other.properties != null)
-                return false;
-        } else if (!properties.equals(other.properties))
+        } else if (!attributes.equals(other.attributes))
             return false;
         if (className == null) {
             if (other.className != null)
diff --git a/base/common/src/com/netscape/certsrv/base/UserNotFoundException.java b/base/common/src/com/netscape/certsrv/base/UserNotFoundException.java
index ec14b59aad9628d29f45121b97c81b2cec5de8d4..63df7067ab2420f1e5dca62ef2e91b9618de924b 100644
--- a/base/common/src/com/netscape/certsrv/base/UserNotFoundException.java
+++ b/base/common/src/com/netscape/certsrv/base/UserNotFoundException.java
@@ -21,12 +21,12 @@ public class UserNotFoundException extends ResourceNotFoundException {
 
     public UserNotFoundException(Data data) {
         super(data);
-        userId = data.getProperty("userId");
+        userId = data.getAttribute("userId");
     }
 
     public Data getData() {
         Data data = super.getData();
-        data.setProperty("userId", userId);
+        data.setAttribute("userId", userId);
         return data;
     }
 
diff --git a/base/common/src/com/netscape/certsrv/cert/CertNotFoundException.java b/base/common/src/com/netscape/certsrv/cert/CertNotFoundException.java
index 5b694ad15e50a0a15bbd8264ded8fd7aa17a104b..171c2763d53b2b0c7dad2577e0b6269b62addfc0 100644
--- a/base/common/src/com/netscape/certsrv/cert/CertNotFoundException.java
+++ b/base/common/src/com/netscape/certsrv/cert/CertNotFoundException.java
@@ -42,12 +42,12 @@ public class CertNotFoundException extends ResourceNotFoundException {
 
     public CertNotFoundException(Data data) {
         super(data);
-        certId = new CertId(data.getProperty("certId"));
+        certId = new CertId(data.getAttribute("certId"));
     }
 
     public Data getData() {
         Data data = super.getData();
-        data.setProperty("certId", certId.toString());
+        data.setAttribute("certId", certId.toString());
         return data;
     }
 
diff --git a/base/common/src/com/netscape/certsrv/group/GroupNotFoundException.java b/base/common/src/com/netscape/certsrv/group/GroupNotFoundException.java
index c5167db8fe05b0620079bb27a9661c1c6ccdf567..3bd9241b69dfe62b21761638457b9a545937ce93 100644
--- a/base/common/src/com/netscape/certsrv/group/GroupNotFoundException.java
+++ b/base/common/src/com/netscape/certsrv/group/GroupNotFoundException.java
@@ -23,12 +23,12 @@ public class GroupNotFoundException extends ResourceNotFoundException {
 
     public GroupNotFoundException(Data data) {
         super(data);
-        groupId = data.getProperty("groupId");
+        groupId = data.getAttribute("groupId");
     }
 
     public Data getData() {
         Data data = super.getData();
-        data.setProperty("groupId", groupId);
+        data.setAttribute("groupId", groupId);
         return data;
     }
 
diff --git a/base/common/src/com/netscape/certsrv/key/KeyArchivalRequest.java b/base/common/src/com/netscape/certsrv/key/KeyArchivalRequest.java
index c72bad4b9077b5b8e98c4347b6e0ab41552156b6..1655fdb283fa0d7af0a12e29acc04e05e459e4d0 100644
--- a/base/common/src/com/netscape/certsrv/key/KeyArchivalRequest.java
+++ b/base/common/src/com/netscape/certsrv/key/KeyArchivalRequest.java
@@ -46,14 +46,14 @@ public class KeyArchivalRequest extends ResourceMessage {
     }
 
     public KeyArchivalRequest(MultivaluedMap<String, String> form) {
-        properties.put(CLIENT_ID, form.getFirst(CLIENT_ID));
-        properties.put(DATA_TYPE, form.getFirst(DATA_TYPE));
-        properties.put(WRAPPED_PRIVATE_DATA, form.getFirst(WRAPPED_PRIVATE_DATA));
+        attributes.put(CLIENT_ID, form.getFirst(CLIENT_ID));
+        attributes.put(DATA_TYPE, form.getFirst(DATA_TYPE));
+        attributes.put(WRAPPED_PRIVATE_DATA, form.getFirst(WRAPPED_PRIVATE_DATA));
         setClassName(getClass().getName());
     }
 
     public KeyArchivalRequest(ResourceMessage data) {
-        properties.putAll(data.getProperties());
+        attributes.putAll(data.getAttributes());
         setClassName(getClass().getName());
     }
 
@@ -61,42 +61,42 @@ public class KeyArchivalRequest extends ResourceMessage {
      * @return the clientId
      */
     public String getClientId() {
-        return properties.get(CLIENT_ID);
+        return attributes.get(CLIENT_ID);
     }
 
     /**
      * @param clientId the clientId to set
      */
     public void setClientId(String clientId) {
-        properties.put(CLIENT_ID, clientId);
+        attributes.put(CLIENT_ID, clientId);
     }
 
     /**
      * @return the dataType
      */
     public String getDataType() {
-        return properties.get(DATA_TYPE);
+        return attributes.get(DATA_TYPE);
     }
 
     /**
      * @param dataType the dataType to set
      */
     public void setDataType(String dataType) {
-        properties.put(DATA_TYPE, dataType);
+        attributes.put(DATA_TYPE, dataType);
     }
 
     /**
      * @return the wrappedPrivateData
      */
     public String getWrappedPrivateData() {
-        return properties.get(WRAPPED_PRIVATE_DATA);
+        return attributes.get(WRAPPED_PRIVATE_DATA);
     }
 
     /**
      * @param wrappedPrivateData the wrappedPrivateData to set
      */
     public void setWrappedPrivateData(String wrappedPrivateData) {
-        properties.put(WRAPPED_PRIVATE_DATA, wrappedPrivateData);
+        attributes.put(WRAPPED_PRIVATE_DATA, wrappedPrivateData);
     }
 
     public String toString() {
diff --git a/base/common/src/com/netscape/certsrv/key/KeyClient.java b/base/common/src/com/netscape/certsrv/key/KeyClient.java
index 06c7cfd797fabd0b1359ac60cb7b823c1c99ea9a..280b10c498c6ad2fe1e0dfb2532ebf27a667c97f 100644
--- a/base/common/src/com/netscape/certsrv/key/KeyClient.java
+++ b/base/common/src/com/netscape/certsrv/key/KeyClient.java
@@ -44,7 +44,7 @@ public class KeyClient extends Client {
         keyRequestClient = createProxy(KeyRequestResource.class);
     }
 
-    public KeyDataInfoCollection findKeys(String clientID, String status, Integer maxSize, Integer maxTime,
+    public KeyInfoCollection findKeys(String clientID, String status, Integer maxSize, Integer maxTime,
             Integer start, Integer size) {
         return keyClient.listKeys(clientID, status, maxSize, maxTime, start, size);
     }
diff --git a/base/common/src/com/netscape/certsrv/key/KeyDataInfo.java b/base/common/src/com/netscape/certsrv/key/KeyInfo.java
similarity index 96%
rename from base/common/src/com/netscape/certsrv/key/KeyDataInfo.java
rename to base/common/src/com/netscape/certsrv/key/KeyInfo.java
index 09d22871807bf3bf76ead7b5c5944eac6cec8531..a4f4e62f3cf5c7ee4d4b9ca2cedb09b2de8ff2ea 100644
--- a/base/common/src/com/netscape/certsrv/key/KeyDataInfo.java
+++ b/base/common/src/com/netscape/certsrv/key/KeyInfo.java
@@ -32,9 +32,9 @@ import com.netscape.certsrv.dbs.keydb.KeyId;
  * @author alee
  *
  */
-@XmlRootElement(name="KeyDataInfo")
+@XmlRootElement(name="KeyInfo")
 @XmlAccessorType(XmlAccessType.FIELD)
-public class KeyDataInfo {
+public class KeyInfo {
 
     @XmlElement
     protected String keyURL;
@@ -54,7 +54,7 @@ public class KeyDataInfo {
     @XmlElement
     protected String ownerName;
 
-    public KeyDataInfo() {
+    public KeyInfo() {
         // required for JAXB (defaults)
     }
 
diff --git a/base/common/src/com/netscape/certsrv/key/KeyDataInfoCollection.java b/base/common/src/com/netscape/certsrv/key/KeyInfoCollection.java
similarity index 86%
rename from base/common/src/com/netscape/certsrv/key/KeyDataInfoCollection.java
rename to base/common/src/com/netscape/certsrv/key/KeyInfoCollection.java
index 4e67e2a44a4a0ec139e4779e62c681e7c3df72d6..3d411da69d4bb9bb584a180173f421d3cf5ed3e9 100644
--- a/base/common/src/com/netscape/certsrv/key/KeyDataInfoCollection.java
+++ b/base/common/src/com/netscape/certsrv/key/KeyInfoCollection.java
@@ -24,11 +24,11 @@ import javax.xml.bind.annotation.XmlRootElement;
 
 import com.netscape.certsrv.base.DataCollection;
 
-@XmlRootElement(name = "KeyDataInfos")
-public class KeyDataInfoCollection extends DataCollection<KeyDataInfo> {
+@XmlRootElement(name = "KeyInfoCollection")
+public class KeyInfoCollection extends DataCollection<KeyInfo> {
 
     @XmlElementRef
-    public Collection<KeyDataInfo> getEntries() {
+    public Collection<KeyInfo> getEntries() {
         return super.getEntries();
     }
 }
diff --git a/base/common/src/com/netscape/certsrv/key/KeyRecoveryRequest.java b/base/common/src/com/netscape/certsrv/key/KeyRecoveryRequest.java
index 4b521a57cb02b5086906e5a19db6b93c19437409..e12b414b139f61d721286a359587ad240ed82bf5 100644
--- a/base/common/src/com/netscape/certsrv/key/KeyRecoveryRequest.java
+++ b/base/common/src/com/netscape/certsrv/key/KeyRecoveryRequest.java
@@ -53,21 +53,21 @@ public class KeyRecoveryRequest extends ResourceMessage {
 
     public KeyRecoveryRequest(MultivaluedMap<String, String> form) {
         if (form.containsKey(KEY_ID)) {
-            properties.put(KEY_ID, form.getFirst(KEY_ID));
+            attributes.put(KEY_ID, form.getFirst(KEY_ID));
         }
         if (form.containsKey(REQUEST_ID)) {
-            properties.put(REQUEST_ID, form.getFirst(REQUEST_ID));
+            attributes.put(REQUEST_ID, form.getFirst(REQUEST_ID));
         }
-        properties.put(TRANS_WRAPPED_SESSION_KEY, form.getFirst(TRANS_WRAPPED_SESSION_KEY));
-        properties.put(SESSION_WRAPPED_PASSPHRASE, form.getFirst(SESSION_WRAPPED_PASSPHRASE));
-        properties.put(NONCE_DATA, form.getFirst(NONCE_DATA));
-        properties.put(CERTIFICATE, form.getFirst(CERTIFICATE));
-        properties.put(PASSPHRASE, form.getFirst(PASSPHRASE));
+        attributes.put(TRANS_WRAPPED_SESSION_KEY, form.getFirst(TRANS_WRAPPED_SESSION_KEY));
+        attributes.put(SESSION_WRAPPED_PASSPHRASE, form.getFirst(SESSION_WRAPPED_PASSPHRASE));
+        attributes.put(NONCE_DATA, form.getFirst(NONCE_DATA));
+        attributes.put(CERTIFICATE, form.getFirst(CERTIFICATE));
+        attributes.put(PASSPHRASE, form.getFirst(PASSPHRASE));
         setClassName(getClass().getName());
     }
 
     public KeyRecoveryRequest(ResourceMessage data) {
-        properties.putAll(data.getProperties());
+        attributes.putAll(data.getAttributes());
         setClassName(getClass().getName());
     }
 
@@ -75,56 +75,56 @@ public class KeyRecoveryRequest extends ResourceMessage {
      * @return the keyId
      */
     public KeyId getKeyId() {
-        return new KeyId(properties.get(KEY_ID));
+        return new KeyId(attributes.get(KEY_ID));
     }
 
     /**
      * @param keyId the keyId to set
      */
     public void setKeyId(KeyId keyId) {
-        properties.put(KEY_ID, keyId.toString());
+        attributes.put(KEY_ID, keyId.toString());
     }
 
     /**
      * @return the requestId
      */
     public RequestId getRequestId() {
-        return new RequestId(properties.get(REQUEST_ID));
+        return new RequestId(attributes.get(REQUEST_ID));
     }
 
     /**
      * @param requestId the requestId to set
      */
     public void setRequestId(RequestId requestId) {
-        properties.put(REQUEST_ID, requestId.toString());
+        attributes.put(REQUEST_ID, requestId.toString());
     }
 
     /**
      * @return the transWrappedSessionKey
      */
     public String getTransWrappedSessionKey() {
-        return properties.get(TRANS_WRAPPED_SESSION_KEY);
+        return attributes.get(TRANS_WRAPPED_SESSION_KEY);
     }
 
     /**
      * @param transWrappedSessionKey the transWrappedSessionKey to set
      */
     public void setTransWrappedSessionKey(String transWrappedSessionKey) {
-        properties.put(TRANS_WRAPPED_SESSION_KEY, transWrappedSessionKey);
+        attributes.put(TRANS_WRAPPED_SESSION_KEY, transWrappedSessionKey);
     }
 
     /**
      * @return the sessionWrappedPassphrase
      */
     public String getSessionWrappedPassphrase() {
-        return properties.get(SESSION_WRAPPED_PASSPHRASE);
+        return attributes.get(SESSION_WRAPPED_PASSPHRASE);
     }
 
     /**
      * @param sessionWrappedPassphrase the sessionWrappedPassphrase to set
      */
     public void setSessionWrappedPassphrase(String sessionWrappedPassphrase) {
-        properties.put(SESSION_WRAPPED_PASSPHRASE, sessionWrappedPassphrase);
+        attributes.put(SESSION_WRAPPED_PASSPHRASE, sessionWrappedPassphrase);
     }
 
     /**
@@ -132,7 +132,7 @@ public class KeyRecoveryRequest extends ResourceMessage {
      */
 
     public String getNonceData() {
-        return properties.get(NONCE_DATA);
+        return attributes.get(NONCE_DATA);
     }
 
     /**
@@ -140,35 +140,35 @@ public class KeyRecoveryRequest extends ResourceMessage {
      */
 
     public void setNonceData(String nonceData) {
-        properties.put(NONCE_DATA, nonceData);
+        attributes.put(NONCE_DATA, nonceData);
     }
 
     /**
      * @return the certificate
      */
     public String getCertificate() {
-        return properties.get(CERTIFICATE);
+        return attributes.get(CERTIFICATE);
     }
 
     /**
      * @param certificate the certificate to set
      */
     public void setCertificate(String certificate) {
-        properties.put(CERTIFICATE, certificate);
+        attributes.put(CERTIFICATE, certificate);
     }
 
     /**
      * @return the passphrase
      */
     public String getPassphrase() {
-        return properties.get(PASSPHRASE);
+        return attributes.get(PASSPHRASE);
     }
 
     /**
      * @param passphrase the passphrase to set
      */
     public void setPassphrase(String passphrase) {
-        properties.put(PASSPHRASE, passphrase);
+        attributes.put(PASSPHRASE, passphrase);
     }
 
 
diff --git a/base/common/src/com/netscape/certsrv/key/KeyResource.java b/base/common/src/com/netscape/certsrv/key/KeyResource.java
index 68efb77703c86ef8dd48cbe8f252411d2f39b560..04d57fd2b4a5c2851546ca08bfd2c2349a1bb493 100644
--- a/base/common/src/com/netscape/certsrv/key/KeyResource.java
+++ b/base/common/src/com/netscape/certsrv/key/KeyResource.java
@@ -20,7 +20,7 @@ public interface KeyResource {
 
     @GET
     @Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
-    public KeyDataInfoCollection listKeys(@QueryParam("clientID") String clientID,
+    public KeyInfoCollection listKeys(@QueryParam("clientID") String clientID,
                                  @QueryParam("status") String status,
                                  @QueryParam("maxResults") Integer maxResults,
                                  @QueryParam("maxTime") Integer maxTime,
diff --git a/base/common/src/com/netscape/certsrv/key/SymKeyGenerationRequest.java b/base/common/src/com/netscape/certsrv/key/SymKeyGenerationRequest.java
index 88f3e238167c3d6ad14887359dda37397d8afc43..f9feb6410c2b0b47084ceeebc0355c6d7940b95a 100644
--- a/base/common/src/com/netscape/certsrv/key/SymKeyGenerationRequest.java
+++ b/base/common/src/com/netscape/certsrv/key/SymKeyGenerationRequest.java
@@ -2,9 +2,7 @@ package com.netscape.certsrv.key;
 
 import java.util.ArrayList;
 import java.util.Arrays;
-import java.util.HashMap;
 import java.util.List;
-import java.util.Map;
 
 import javax.ws.rs.core.MultivaluedMap;
 import javax.xml.bind.annotation.XmlAccessType;
@@ -12,7 +10,6 @@ import javax.xml.bind.annotation.XmlAccessorType;
 import javax.xml.bind.annotation.XmlRootElement;
 
 import org.apache.commons.lang.StringUtils;
-import org.mozilla.jss.crypto.KeyGenAlgorithm;
 
 import com.netscape.certsrv.base.ResourceMessage;
 
@@ -29,6 +26,14 @@ public class SymKeyGenerationRequest extends ResourceMessage {
     private static final String KEY_ALGORITHM = "keyAlgorithm";
     private static final String KEY_USAGE = "keyUsage";
 
+    /* Symmetric Key Algorithms */
+    public static final String DES_ALGORITHM = "DES";
+    public static final String DESEDE_ALGORITHM = "DESede";
+    public static final String DES3_ALGORITHM = "DES3";
+    public static final String RC2_ALGORITHM = "RC2";
+    public static final String RC4_ALGORITHM = "RC4";
+    public static final String AES_ALGORITHM = "AES";
+
     /* Symmetric Key usages */
     public static final String UWRAP_USAGE = "unwrap";
     public static final String WRAP_USAGE = "wrap";
@@ -37,19 +42,8 @@ public class SymKeyGenerationRequest extends ResourceMessage {
     public static final String DECRYPT_USAGE = "decrypt";
     public static final String ENCRYPT_USAGE = "encrypt";
 
-    public static final Map<String, KeyGenAlgorithm> KEYGEN_ALGORITHMS;
-    static {
-        KEYGEN_ALGORITHMS = new HashMap<String, KeyGenAlgorithm>();
-        KEYGEN_ALGORITHMS.put("DES", KeyGenAlgorithm.DES);
-        KEYGEN_ALGORITHMS.put("DESede", KeyGenAlgorithm.DESede);
-        KEYGEN_ALGORITHMS.put("DES3", KeyGenAlgorithm.DES3);
-        KEYGEN_ALGORITHMS.put("RC2", KeyGenAlgorithm.RC2);
-        KEYGEN_ALGORITHMS.put("RC4", KeyGenAlgorithm.RC4);
-        KEYGEN_ALGORITHMS.put("AES", KeyGenAlgorithm.AES);
-    }
-
     public List<String> getUsages() {
-        String usageString = properties.get(KEY_USAGE);
+        String usageString = attributes.get(KEY_USAGE);
         if (! StringUtils.isBlank(usageString)) {
             return new ArrayList<String>(Arrays.asList(usageString.split(",")));
         }
@@ -57,7 +51,7 @@ public class SymKeyGenerationRequest extends ResourceMessage {
     }
 
     public void setUsages(List<String> usages) {
-        properties.put(KEY_USAGE, StringUtils.join(usages, ","));
+        attributes.put(KEY_USAGE, StringUtils.join(usages, ","));
     }
 
     public void addUsage(String usage) {
@@ -75,12 +69,12 @@ public class SymKeyGenerationRequest extends ResourceMessage {
     }
 
     public SymKeyGenerationRequest(MultivaluedMap<String, String> form) {
-        properties.put(CLIENT_ID, form.getFirst(CLIENT_ID));
-        properties.put(KEY_SIZE, form.getFirst(KEY_SIZE));
-        properties.put(KEY_ALGORITHM, form.getFirst(KEY_ALGORITHM));
-        properties.put(KEY_USAGE, form.getFirst(KEY_USAGE));
+        attributes.put(CLIENT_ID, form.getFirst(CLIENT_ID));
+        attributes.put(KEY_SIZE, form.getFirst(KEY_SIZE));
+        attributes.put(KEY_ALGORITHM, form.getFirst(KEY_ALGORITHM));
+        attributes.put(KEY_USAGE, form.getFirst(KEY_USAGE));
 
-        String usageString = properties.get(KEY_USAGE);
+        String usageString = attributes.get(KEY_USAGE);
         if (! StringUtils.isBlank(usageString)) {
             setUsages(new ArrayList<String>(Arrays.asList(usageString.split(","))));
         }
@@ -88,7 +82,7 @@ public class SymKeyGenerationRequest extends ResourceMessage {
     }
 
     public SymKeyGenerationRequest(ResourceMessage data) {
-        properties.putAll(data.getProperties());
+        attributes.putAll(data.getAttributes());
         setClassName(getClass().getName());
     }
 
@@ -96,42 +90,42 @@ public class SymKeyGenerationRequest extends ResourceMessage {
      * @return the clientId
      */
     public String getClientId() {
-        return properties.get(CLIENT_ID);
+        return attributes.get(CLIENT_ID);
     }
 
     /**
      * @param clientId the clientId to set
      */
     public void setClientId(String clientId) {
-        properties.put(CLIENT_ID, clientId);
+        attributes.put(CLIENT_ID, clientId);
     }
 
     /**
      * @return the keySize
      */
     public int getKeySize() {
-        return Integer.parseInt(properties.get(KEY_SIZE));
+        return Integer.parseInt(attributes.get(KEY_SIZE));
     }
 
     /**
      * @param keySize the key size to set
      */
     public void setKeySize(int keySize) {
-        properties.put(KEY_SIZE, Integer.toString(keySize));
+        attributes.put(KEY_SIZE, Integer.toString(keySize));
     }
 
     /**
      * @return the keyAlgorithm
      */
     public String getKeyAlgorithm() {
-        return properties.get(KEY_ALGORITHM);
+        return attributes.get(KEY_ALGORITHM);
     }
 
     /**
      * @param keyAlgorithm the key algorithm to set
      */
     public void setKeyAlgorithm(String keyAlgorithm) {
-        properties.put(KEY_ALGORITHM, keyAlgorithm);
+        attributes.put(KEY_ALGORITHM, keyAlgorithm);
     }
 
     public String toString() {
@@ -154,7 +148,7 @@ public class SymKeyGenerationRequest extends ResourceMessage {
 
         SymKeyGenerationRequest before = new SymKeyGenerationRequest();
         before.setClientId("vek 12345");
-        before.setKeyAlgorithm("AES");
+        before.setKeyAlgorithm(SymKeyGenerationRequest.AES_ALGORITHM);
         before.setKeySize(128);
         before.addUsage(SymKeyGenerationRequest.DECRYPT_USAGE);
         before.addUsage(SymKeyGenerationRequest.ENCRYPT_USAGE);
diff --git a/base/common/src/com/netscape/certsrv/kra/KRAClient.java b/base/common/src/com/netscape/certsrv/kra/KRAClient.java
index 2522820f479d28e2d604407a0a9fa41c4402f6b1..943a6f21f0b3f675cb0c5e6fe40569277c6593ef 100644
--- a/base/common/src/com/netscape/certsrv/kra/KRAClient.java
+++ b/base/common/src/com/netscape/certsrv/kra/KRAClient.java
@@ -14,8 +14,8 @@ import com.netscape.certsrv.dbs.keydb.KeyId;
 import com.netscape.certsrv.group.GroupClient;
 import com.netscape.certsrv.key.KeyArchivalRequest;
 import com.netscape.certsrv.key.KeyData;
-import com.netscape.certsrv.key.KeyDataInfo;
-import com.netscape.certsrv.key.KeyDataInfoCollection;
+import com.netscape.certsrv.key.KeyInfo;
+import com.netscape.certsrv.key.KeyInfoCollection;
 import com.netscape.certsrv.key.KeyRecoveryRequest;
 import com.netscape.certsrv.key.KeyRequestInfo;
 import com.netscape.certsrv.key.KeyRequestInfoCollection;
@@ -83,13 +83,13 @@ public class KRAClient extends SubsystemClient {
         return client.getEntity(response);
     }
 
-    public KeyDataInfo getKeyData(String clientId, String status) {
-        KeyDataInfoCollection infos = keyClient.listKeys(clientId, status, null, null, null, null);
-        Collection<KeyDataInfo> list = infos.getEntries();
-        Iterator<KeyDataInfo> iter = list.iterator();
+    public KeyInfo getKeyData(String clientId, String status) {
+        KeyInfoCollection infos = keyClient.listKeys(clientId, status, null, null, null, null);
+        Collection<KeyInfo> list = infos.getEntries();
+        Iterator<KeyInfo> iter = list.iterator();
 
         while (iter.hasNext()) {
-            KeyDataInfo info = iter.next();
+            KeyInfo info = iter.next();
             if (info != null) {
                 // return the first one
                 return info;
diff --git a/base/common/src/com/netscape/certsrv/profile/ProfileNotFoundException.java b/base/common/src/com/netscape/certsrv/profile/ProfileNotFoundException.java
index 25c6d4bfddd800bf3c7cde644bc1193db5a6d7f6..c6a549b07e7808c516bf177a1ea87b75fffb9a5b 100644
--- a/base/common/src/com/netscape/certsrv/profile/ProfileNotFoundException.java
+++ b/base/common/src/com/netscape/certsrv/profile/ProfileNotFoundException.java
@@ -41,12 +41,12 @@ public class ProfileNotFoundException extends ResourceNotFoundException {
 
     public ProfileNotFoundException(Data data) {
         super(data);
-        profileId = data.getProperty("profileId");
+        profileId = data.getAttribute("profileId");
     }
 
     public Data getData() {
         Data data = super.getData();
-        data.setProperty("profileId", profileId);
+        data.setAttribute("profileId", profileId);
         return data;
     }
 
diff --git a/base/common/src/com/netscape/certsrv/request/RequestNotFoundException.java b/base/common/src/com/netscape/certsrv/request/RequestNotFoundException.java
index d1032dc2b6df945554aacff7375247398f301636..478675ab0d56a3557600bfc53740efd500ea480e 100644
--- a/base/common/src/com/netscape/certsrv/request/RequestNotFoundException.java
+++ b/base/common/src/com/netscape/certsrv/request/RequestNotFoundException.java
@@ -24,12 +24,12 @@ public class RequestNotFoundException extends ResourceNotFoundException {
 
     public RequestNotFoundException(Data data) {
         super(data);
-        requestId = new RequestId(data.getProperty("requestId"));
+        requestId = new RequestId(data.getAttribute("requestId"));
     }
 
     public Data getData() {
         Data data = super.getData();
-        data.setProperty("requestId", requestId.toString());
+        data.setAttribute("requestId", requestId.toString());
         return data;
     }
 
diff --git a/base/java-tools/src/com/netscape/cmstools/key/KeyCLI.java b/base/java-tools/src/com/netscape/cmstools/key/KeyCLI.java
index e93cc32f0fa1d15b0826739caef01347705a7558..f205506aa428bd83f86f6880b7d171fa8eb2b48a 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyCLI.java
@@ -19,7 +19,7 @@
 package com.netscape.cmstools.key;
 
 import com.netscape.certsrv.key.KeyClient;
-import com.netscape.certsrv.key.KeyDataInfo;
+import com.netscape.certsrv.key.KeyInfo;
 import com.netscape.certsrv.key.KeyRequestInfo;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
@@ -61,7 +61,7 @@ public class KeyCLI extends CLI {
         super.execute(args);
     }
 
-    public static void printKeyInfo(KeyDataInfo info) {
+    public static void printKeyInfo(KeyInfo info) {
         System.out.println("  Key ID: "+info.getKeyId().toHexString());
         if (info.getClientID() != null) System.out.println("  Client ID: "+info.getClientID());
         if (info.getStatus() != null) System.out.println("  Status: "+info.getStatus());
diff --git a/base/java-tools/src/com/netscape/cmstools/key/KeyFindCLI.java b/base/java-tools/src/com/netscape/cmstools/key/KeyFindCLI.java
index b2eb0ce387c4706fe0ebe294fba8d581e09c2e13..f3c9badbdf9d10c1dd919296ba12ff5bc10d98b4 100644
--- a/base/java-tools/src/com/netscape/cmstools/key/KeyFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/key/KeyFindCLI.java
@@ -24,8 +24,8 @@ import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 import org.apache.commons.cli.ParseException;
 
-import com.netscape.certsrv.key.KeyDataInfo;
-import com.netscape.certsrv.key.KeyDataInfoCollection;
+import com.netscape.certsrv.key.KeyInfo;
+import com.netscape.certsrv.key.KeyInfoCollection;
 import com.netscape.cmstools.cli.CLI;
 import com.netscape.cmstools.cli.MainCLI;
 
@@ -97,15 +97,15 @@ public class KeyFindCLI extends CLI {
         s = cmd.getOptionValue("size");
         Integer size = s == null ? null : Integer.valueOf(s);
 
-        KeyDataInfoCollection keys = keyCLI.keyClient.findKeys(clientID, status, maxResults, maxTime, start, size);
+        KeyInfoCollection keys = keyCLI.keyClient.findKeys(clientID, status, maxResults, maxTime, start, size);
 
-        Collection<KeyDataInfo> entries = keys.getEntries();
+        Collection<KeyInfo> entries = keys.getEntries();
 
         MainCLI.printMessage(entries.size() + " key(s) matched");
 
         boolean first = true;
 
-        for (KeyDataInfo info : entries) {
+        for (KeyInfo info : entries) {
 
             if (first) {
                 first = false;
diff --git a/base/kra/functional/src/com/netscape/cms/servlet/test/DRMTest.java b/base/kra/functional/src/com/netscape/cms/servlet/test/DRMTest.java
index d0773950fab512e25ce4d37116de81632d41a632..e1e730d82219799fdec465a321aef70489a5d86c 100644
--- a/base/kra/functional/src/com/netscape/cms/servlet/test/DRMTest.java
+++ b/base/kra/functional/src/com/netscape/cms/servlet/test/DRMTest.java
@@ -43,7 +43,7 @@ import com.netscape.certsrv.client.ClientConfig;
 import com.netscape.certsrv.client.PKIClient;
 import com.netscape.certsrv.dbs.keydb.KeyId;
 import com.netscape.certsrv.key.KeyData;
-import com.netscape.certsrv.key.KeyDataInfo;
+import com.netscape.certsrv.key.KeyInfo;
 import com.netscape.certsrv.key.KeyRequestInfo;
 import com.netscape.certsrv.key.KeyRequestResource;
 import com.netscape.certsrv.key.SymKeyGenerationRequest;
@@ -168,7 +168,7 @@ public class DRMTest {
         // Variables for data structures from calls
         KeyRequestInfo requestInfo = null;
         KeyData keyData = null;
-        KeyDataInfo keyInfo = null;
+        KeyInfo keyInfo = null;
 
         // Initialize token
         try {
@@ -560,7 +560,7 @@ public class DRMTest {
         List<String> usages = new ArrayList<String>();
         usages.add(SymKeyGenerationRequest.DECRYPT_USAGE);
         usages.add(SymKeyGenerationRequest.ENCRYPT_USAGE);
-        KeyRequestInfo genKeyInfo = client.generateKey(clientId, "AES", 128, usages);
+        KeyRequestInfo genKeyInfo = client.generateKey(clientId, SymKeyGenerationRequest.AES_ALGORITHM, 128, usages);
         printRequestInfo(genKeyInfo);
         keyId = genKeyInfo.getKeyId();
 
diff --git a/base/kra/src/com/netscape/kra/SecurityDataRecoveryService.java b/base/kra/src/com/netscape/kra/SecurityDataRecoveryService.java
index 0ec4ed335663112904bf5a573c1b5743c44ef2f3..50f163dfa274db51e8fa5ca4fd231257a9d39db9 100644
--- a/base/kra/src/com/netscape/kra/SecurityDataRecoveryService.java
+++ b/base/kra/src/com/netscape/kra/SecurityDataRecoveryService.java
@@ -264,7 +264,10 @@ public class SecurityDataRecoveryService implements IService {
             params.put(IRequest.SECURITY_DATA_IV_STRING_OUT, ivStr);
 
         }
-        auditRecoveryRequestProcessed(subjectID, ILogger.SUCCESS, requestID, serialno.toString(), "None");
+        auditRecoveryRequestProcessed(subjectID, ILogger.SUCCESS, requestID, serialno.toString(),
+                "None");
+        request.setExtData(IRequest.RESULT, IRequest.RES_SUCCESS);
+        mKRA.getRequestQueue().updateRequest(request);
         return false; //return true ? TODO
     }
 
diff --git a/base/kra/src/com/netscape/kra/SecurityDataService.java b/base/kra/src/com/netscape/kra/SecurityDataService.java
index 9fc737529e87c9bf83bdbdca522b758bae109f81..428dd660bfe41d42e24ac6d44890003c5e465080 100644
--- a/base/kra/src/com/netscape/kra/SecurityDataService.java
+++ b/base/kra/src/com/netscape/kra/SecurityDataService.java
@@ -183,6 +183,8 @@ public class SecurityDataService implements IService {
 
         auditArchivalRequestProcessed(subjectID, ILogger.SUCCESS, request.getRequestId(),
                 clientId, serialNo.toString(), "None");
+        request.setExtData(IRequest.RESULT, IRequest.RES_SUCCESS);
+        mKRA.getRequestQueue().updateRequest(request);
 
         return true;
 
diff --git a/base/kra/src/com/netscape/kra/SymKeyGenService.java b/base/kra/src/com/netscape/kra/SymKeyGenService.java
index 877d2ed068851cd17941af5b964d94ea6cf350cf..3ebf1bed02080d9a3bb1115862b6382536785671 100644
--- a/base/kra/src/com/netscape/kra/SymKeyGenService.java
+++ b/base/kra/src/com/netscape/kra/SymKeyGenService.java
@@ -44,6 +44,7 @@ import com.netscape.certsrv.request.IRequest;
 import com.netscape.certsrv.request.IService;
 import com.netscape.certsrv.request.RequestId;
 import com.netscape.certsrv.security.IStorageKeyUnit;
+import com.netscape.cms.servlet.request.KeyRequestService;
 import com.netscape.cmscore.dbs.KeyRecord;
 
 /**
@@ -110,7 +111,7 @@ public class SymKeyGenService implements IService {
         }
 
         CryptoToken token = mStorageUnit.getToken();
-        KeyGenAlgorithm kgAlg = SymKeyGenerationRequest.KEYGEN_ALGORITHMS.get(algorithm);
+        KeyGenAlgorithm kgAlg = KeyRequestService.KEYGEN_ALGORITHMS.get(algorithm);
         if (kgAlg == null) {
             throw new EBaseException("Invalid algorithm");
         }
@@ -216,6 +217,9 @@ public class SymKeyGenService implements IService {
         auditSymKeyGenRequestProcessed(subjectID, ILogger.SUCCESS, request.getRequestId(),
                 clientId, serialNo.toString(), "None");
 
+        request.setExtData(IRequest.RESULT, IRequest.RES_SUCCESS);
+        mKRA.getRequestQueue().updateRequest(request);
+
         return true;
     }
 
diff --git a/base/server/cms/src/com/netscape/cms/servlet/key/KeyRequestDAO.java b/base/server/cms/src/com/netscape/cms/servlet/key/KeyRequestDAO.java
index 8ecf11074932a80e9cf5253ad87eb3a400cd4189..536e43fc0c6e958b29ca4e67876651b0f94ecec5 100644
--- a/base/server/cms/src/com/netscape/cms/servlet/key/KeyRequestDAO.java
+++ b/base/server/cms/src/com/netscape/cms/servlet/key/KeyRequestDAO.java
@@ -50,6 +50,7 @@ import com.netscape.certsrv.request.IRequest;
 import com.netscape.certsrv.request.RequestId;
 import com.netscape.certsrv.request.RequestStatus;
 import com.netscape.cms.servlet.request.CMSRequestDAO;
+import com.netscape.cms.servlet.request.KeyRequestService;
 
 /**
  * @author alee
@@ -218,7 +219,7 @@ public class KeyRequestDAO extends CMSRequestDAO {
             throw new BadRequestException("Can not archive already active existing key!");
         }
 
-        KeyGenAlgorithm alg = SymKeyGenerationRequest.KEYGEN_ALGORITHMS.get(algName);
+        KeyGenAlgorithm alg = KeyRequestService.KEYGEN_ALGORITHMS.get(algName);
         if (alg == null) {
             throw new BadRequestException("Invalid Algorithm");
         }
diff --git a/base/server/cms/src/com/netscape/cms/servlet/key/KeyService.java b/base/server/cms/src/com/netscape/cms/servlet/key/KeyService.java
index fdcd7d7c51b21e004f95326eeb9bf1ec7cca76e9..56e4f3c4d42d63ff9b77494478d74eaddd474954 100644
--- a/base/server/cms/src/com/netscape/cms/servlet/key/KeyService.java
+++ b/base/server/cms/src/com/netscape/cms/servlet/key/KeyService.java
@@ -47,8 +47,8 @@ import com.netscape.certsrv.dbs.keydb.IKeyRecord;
 import com.netscape.certsrv.dbs.keydb.IKeyRepository;
 import com.netscape.certsrv.dbs.keydb.KeyId;
 import com.netscape.certsrv.key.KeyData;
-import com.netscape.certsrv.key.KeyDataInfo;
-import com.netscape.certsrv.key.KeyDataInfoCollection;
+import com.netscape.certsrv.key.KeyInfo;
+import com.netscape.certsrv.key.KeyInfoCollection;
 import com.netscape.certsrv.key.KeyRecoveryRequest;
 import com.netscape.certsrv.key.KeyRequestInfo;
 import com.netscape.certsrv.key.KeyResource;
@@ -312,7 +312,7 @@ public class KeyService extends PKIService implements KeyResource {
      * Used to generate list of key infos based on the search parameters
      */
     @Override
-    public KeyDataInfoCollection listKeys(String clientID, String status, Integer maxResults, Integer maxTime,
+    public KeyInfoCollection listKeys(String clientID, String status, Integer maxResults, Integer maxTime,
             Integer start, Integer size) {
 
         start = start == null ? 0 : start;
@@ -325,7 +325,7 @@ public class KeyService extends PKIService implements KeyResource {
         maxResults = maxResults == null ? DEFAULT_MAXRESULTS : maxResults;
         maxTime = maxTime == null ? DEFAULT_MAXTIME : maxTime;
 
-        KeyDataInfoCollection infos = new KeyDataInfoCollection();
+        KeyInfoCollection infos = new KeyInfoCollection();
         try {
             Enumeration<IKeyRecord> e = repo.searchKeys(filter, maxResults, maxTime);
             if (e == null) {
@@ -333,7 +333,7 @@ public class KeyService extends PKIService implements KeyResource {
             }
 
             // store non-null results in a list
-            List<KeyDataInfo> results = new ArrayList<KeyDataInfo>();
+            List<KeyInfo> results = new ArrayList<KeyInfo>();
             while (e.hasMoreElements()) {
                 IKeyRecord rec = e.nextElement();
                 if (rec == null) continue;
@@ -367,8 +367,8 @@ public class KeyService extends PKIService implements KeyResource {
     }
 
 
-    public KeyDataInfo createKeyDataInfo(IKeyRecord rec) throws EBaseException {
-        KeyDataInfo ret = new KeyDataInfo();
+    public KeyInfo createKeyDataInfo(IKeyRecord rec) throws EBaseException {
+        KeyInfo ret = new KeyInfo();
         ret.setClientID(rec.getClientId());
         ret.setStatus(rec.getKeyStatus());
         ret.setAlgorithm(rec.getAlgorithm());
diff --git a/base/server/cms/src/com/netscape/cms/servlet/request/KeyRequestService.java b/base/server/cms/src/com/netscape/cms/servlet/request/KeyRequestService.java
index dc24a4c0e7eb18bb0f785b4a9fb12bc63a85ad73..fccfaaab4690d8ddde6676d041403e80e47cafe7 100644
--- a/base/server/cms/src/com/netscape/cms/servlet/request/KeyRequestService.java
+++ b/base/server/cms/src/com/netscape/cms/servlet/request/KeyRequestService.java
@@ -23,6 +23,8 @@ import java.math.BigInteger;
 import java.net.URI;
 import java.net.URISyntaxException;
 import java.security.cert.CertificateException;
+import java.util.HashMap;
+import java.util.Map;
 
 import javax.servlet.http.HttpServletRequest;
 import javax.ws.rs.core.Context;
@@ -35,6 +37,8 @@ import javax.ws.rs.core.UriInfo;
 
 import netscape.security.x509.X509CertImpl;
 
+import org.mozilla.jss.crypto.KeyGenAlgorithm;
+
 import com.netscape.certsrv.apps.CMS;
 import com.netscape.certsrv.base.BadRequestException;
 import com.netscape.certsrv.base.EBaseException;
@@ -98,6 +102,18 @@ public class KeyRequestService extends PKIService implements KeyRequestResource
     private IRequestQueue queue;
     private IKeyService service;
 
+    public static final Map<String, KeyGenAlgorithm> KEYGEN_ALGORITHMS;
+
+    static {
+        KEYGEN_ALGORITHMS = new HashMap<String, KeyGenAlgorithm>();
+        KEYGEN_ALGORITHMS.put(SymKeyGenerationRequest.DES_ALGORITHM, KeyGenAlgorithm.DES);
+        KEYGEN_ALGORITHMS.put(SymKeyGenerationRequest.DESEDE_ALGORITHM, KeyGenAlgorithm.DESede);
+        KEYGEN_ALGORITHMS.put(SymKeyGenerationRequest.DES3_ALGORITHM, KeyGenAlgorithm.DES3);
+        KEYGEN_ALGORITHMS.put(SymKeyGenerationRequest.RC2_ALGORITHM, KeyGenAlgorithm.RC2);
+        KEYGEN_ALGORITHMS.put(SymKeyGenerationRequest.RC4_ALGORITHM, KeyGenAlgorithm.RC4);
+        KEYGEN_ALGORITHMS.put(SymKeyGenerationRequest.AES_ALGORITHM, KeyGenAlgorithm.AES);
+    }
+
     public KeyRequestService() {
         kra = ( IKeyRecoveryAuthority ) CMS.getSubsystem( "kra" );
         queue = kra.getRequestQueue();
-- 
1.8.4.2

