>From 3031ac117cc6acc39c2240f9b1d82f45f6b4d916 Mon Sep 17 00:00:00 2001
From: Ade Lee <alee@redhat.com>
Date: Thu, 7 Mar 2013 11:18:55 -0500
Subject: [PATCH] Clean up various eclipse warnings

---
 .../com/netscape/cms/authentication/CMCAuth.java   |  2 -
 .../netscape/cms/servlet/admin/AdminServlet.java   |  4 -
 .../netscape/cms/servlet/admin/CAAdminServlet.java | 14 ----
 .../cms/servlet/admin/CMSAdminServlet.java         | 22 ------
 .../cms/servlet/admin/KRAAdminServlet.java         |  1 -
 .../cms/servlet/admin/LogAdminServlet.java         |  1 -
 .../cms/servlet/admin/OCSPAdminServlet.java        |  2 -
 .../cms/servlet/admin/PolicyAdminServlet.java      |  3 +-
 .../cms/servlet/admin/ProfileAdminServlet.java     | 11 ---
 .../cms/servlet/admin/PublisherAdminServlet.java   |  3 -
 .../netscape/cms/servlet/admin/RAAdminServlet.java |  9 ---
 .../netscape/cms/servlet/base/ProxyServlet.java    |  1 -
 .../cms/servlet/cert/RevocationProcessor.java      |  7 --
 .../cms/servlet/cert/scep/CRSEnrollment.java       |  1 -
 .../netscape/cms/servlet/common/CMSGateway.java    |  1 -
 .../netscape/cms/servlet/csadmin/BaseServlet.java  |  1 -
 .../servlet/profile/ProfileSubmitCMCServlet.java   |  1 -
 .../cms/servlet/request/ProcessCertReq.java        |  1 -
 .../netscape/cms/servlet/wizard/WizardServlet.java |  1 -
 .../src/com/netscape/cmstools/CMCRequest.java      |  4 -
 .../src/com/netscape/cmstools/CRMFPopClient.java   | 90 +++++++++++-----------
 .../src/com/netscape/cmstools/PKCS10Client.java    | 33 +++-----
 .../com/netscape/kra/TokenKeyRecoveryService.java  | 11 +--
 23 files changed, 60 insertions(+), 164 deletions(-)

diff --git a/base/common/src/com/netscape/cms/authentication/CMCAuth.java b/base/common/src/com/netscape/cms/authentication/CMCAuth.java
index 6ce4c26dd758bd818eed6801da89b69eea5f023e..3ed27167ec8145641c404a5e71f6d3275b29d6f6 100644
--- a/base/common/src/com/netscape/cms/authentication/CMCAuth.java
+++ b/base/common/src/com/netscape/cms/authentication/CMCAuth.java
@@ -41,8 +41,6 @@ import netscape.security.x509.X500Name;
 import netscape.security.x509.X509CertImpl;
 import netscape.security.x509.X509CertInfo;
 import netscape.security.x509.X509Key;
-import netscape.security.util.DerValue;
-
 import org.mozilla.jss.CryptoManager;
 import org.mozilla.jss.crypto.CryptoToken;
 import org.mozilla.jss.crypto.PrivateKey;
diff --git a/base/common/src/com/netscape/cms/servlet/admin/AdminServlet.java b/base/common/src/com/netscape/cms/servlet/admin/AdminServlet.java
index 072436a47fa0bde2eac6df8f07e479e4db079f2d..ab7af9ec3d38b4b7e7215c4e006d0758657e80f4 100644
--- a/base/common/src/com/netscape/cms/servlet/admin/AdminServlet.java
+++ b/base/common/src/com/netscape/cms/servlet/admin/AdminServlet.java
@@ -200,7 +200,6 @@ public class AdminServlet extends HttpServlet {
 
     public void outputHttpParameters(HttpServletRequest httpReq) {
         CMS.debug("AdminServlet:service() uri = " + httpReq.getRequestURI());
-        @SuppressWarnings("unchecked")
         Enumeration<String> paramNames = httpReq.getParameterNames();
         while (paramNames.hasMoreElements()) {
             String pn = paramNames.nextElement();
@@ -847,7 +846,6 @@ public class AdminServlet extends HttpServlet {
             HttpServletResponse resp) throws ServletException,
             IOException, EBaseException {
         NameValuePairs params = new NameValuePairs();
-        @SuppressWarnings("unchecked")
         Enumeration<String> e = req.getParameterNames();
 
         while (e.hasMoreElements()) {
@@ -879,7 +877,6 @@ public class AdminServlet extends HttpServlet {
             HttpServletResponse resp) throws ServletException,
             IOException, EBaseException {
         NameValuePairs params = new NameValuePairs();
-        @SuppressWarnings("unchecked")
         Enumeration<String> e = req.getParameterNames();
 
         while (e.hasMoreElements()) {
@@ -1078,7 +1075,6 @@ public class AdminServlet extends HttpServlet {
         // identify any remaining request parameters
         Map<String, String> params = new LinkedHashMap<String, String>();
 
-        @SuppressWarnings("unchecked")
         Enumeration<String> e = req.getParameterNames();
 
         while (e.hasMoreElements()) {
diff --git a/base/common/src/com/netscape/cms/servlet/admin/CAAdminServlet.java b/base/common/src/com/netscape/cms/servlet/admin/CAAdminServlet.java
index 27cd91c30b44e08f7f389f1101d34af9dd503e2d..9e06f04bdb0213576680cf5ae1c0d58deccaf555 100644
--- a/base/common/src/com/netscape/cms/servlet/admin/CAAdminServlet.java
+++ b/base/common/src/com/netscape/cms/servlet/admin/CAAdminServlet.java
@@ -229,7 +229,6 @@ public class CAAdminServlet extends AdminServlet {
             IOException, EBaseException {
 
         NameValuePairs params = new NameValuePairs();
-        @SuppressWarnings("unchecked")
         Enumeration<String> e = req.getParameterNames();
 
         while (e.hasMoreElements()) {
@@ -290,7 +289,6 @@ public class CAAdminServlet extends AdminServlet {
 
         IConfigStore riq = nc.getSubStore(ICertificateAuthority.PROP_REQ_IN_Q_SUBSTORE);
 
-        @SuppressWarnings("unchecked")
         Enumeration<String> e = req.getParameterNames();
 
         while (e.hasMoreElements()) {
@@ -325,7 +323,6 @@ public class CAAdminServlet extends AdminServlet {
         IConfigStore riq = nc.getSubStore(ICertificateAuthority.PROP_REQ_IN_Q_SUBSTORE);
 
         //set rest of the parameters
-        @SuppressWarnings("unchecked")
         Enumeration<String> e = req.getParameterNames();
 
         while (e.hasMoreElements()) {
@@ -378,7 +375,6 @@ public class CAAdminServlet extends AdminServlet {
             IOException, EBaseException {
 
         //set rest of the parameters
-        @SuppressWarnings("unchecked")
         Enumeration<String> e = req.getParameterNames();
 
         while (e.hasMoreElements()) {
@@ -483,7 +479,6 @@ public class CAAdminServlet extends AdminServlet {
 
             if (ip != null) {
 
-                @SuppressWarnings("unchecked")
                 Enumeration<String> e = req.getParameterNames();
                 String value = "";
 
@@ -942,7 +937,6 @@ public class CAAdminServlet extends AdminServlet {
         NameValuePairs params = new NameValuePairs();
 
         String ipId = null;
-        @SuppressWarnings("unchecked")
         Enumeration<String> e = req.getParameterNames();
 
         while (e.hasMoreElements()) {
@@ -1018,7 +1012,6 @@ public class CAAdminServlet extends AdminServlet {
             if (id != null) {
                 IConfigStore crlExtSubStore = crlExtsSubStore.getSubStore(id);
 
-                @SuppressWarnings("unchecked")
                 Enumeration<String> e = req.getParameterNames();
 
                 while (e.hasMoreElements()) {
@@ -1229,7 +1222,6 @@ public class CAAdminServlet extends AdminServlet {
             IConfigStore crlSubStore = crlsSubStore.getSubStore(id);
 
             //set reset of the parameters
-            @SuppressWarnings("unchecked")
             Enumeration<String> e = req.getParameterNames();
 
             while (e.hasMoreElements()) {
@@ -1320,7 +1312,6 @@ public class CAAdminServlet extends AdminServlet {
                 mCA.getConfigStore().getSubStore(ICertificateAuthority.PROP_CRL_SUBSTORE);
         IConfigStore crlSubStore = crlsSubStore.getSubStore(id);
 
-        @SuppressWarnings("unchecked")
         Enumeration<String> e = req.getParameterNames();
 
         while (e.hasMoreElements()) {
@@ -1354,7 +1345,6 @@ public class CAAdminServlet extends AdminServlet {
             caConnectorConfig = connectorConfig.getSubStore("CLA");
         }
 
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
         NameValuePairs params = new NameValuePairs();
 
@@ -1391,7 +1381,6 @@ public class CAAdminServlet extends AdminServlet {
             caConnectorConfig = connectorConfig.getSubStore("CLA");
         }
 
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
 
         if (caConnectorConfig != null) {
@@ -1427,7 +1416,6 @@ public class CAAdminServlet extends AdminServlet {
     }
 
     private boolean isKRAConnector(HttpServletRequest req) {
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
 
         while (enum1.hasMoreElements()) {
@@ -1446,7 +1434,6 @@ public class CAAdminServlet extends AdminServlet {
     }
 
     private boolean isCLAConnector(HttpServletRequest req) {
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
 
         while (enum1.hasMoreElements()) {
@@ -1533,7 +1520,6 @@ public class CAAdminServlet extends AdminServlet {
          SubsystemRegistry.getInstance().get("eeGateway");
          */
 
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
         boolean restart = false;
 
diff --git a/base/common/src/com/netscape/cms/servlet/admin/CMSAdminServlet.java b/base/common/src/com/netscape/cms/servlet/admin/CMSAdminServlet.java
index f0aeb22959f06cb3a1ea6d403e6ec306425fd4ca..74c1a94a608fa3c3188ff4dda8b69a014f3f454e 100644
--- a/base/common/src/com/netscape/cms/servlet/admin/CMSAdminServlet.java
+++ b/base/common/src/com/netscape/cms/servlet/admin/CMSAdminServlet.java
@@ -523,7 +523,6 @@ public final class CMSAdminServlet extends AdminServlet {
         // ensure that any low-level exceptions are reported
         // to the signed audit log and stored as failures
         try {
-            @SuppressWarnings("unchecked")
             Enumeration<String> enum1 = req.getParameterNames();
             NameValuePairs params = new NameValuePairs();
             ICryptoSubsystem jssSubSystem = (ICryptoSubsystem)
@@ -840,7 +839,6 @@ public final class CMSAdminServlet extends AdminServlet {
             IOException, EBaseException {
 
         IConfigStore dbConfig = mConfig.getSubStore(PROP_INTERNAL_DB);
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
 
         while (enum1.hasMoreElements()) {
@@ -868,7 +866,6 @@ public final class CMSAdminServlet extends AdminServlet {
             IOException, EBaseException {
 
         NameValuePairs params = new NameValuePairs();
-        @SuppressWarnings("unchecked")
         Enumeration<String> e = req.getParameterNames();
         String newKeyName = null, selectedToken = null;
         while (e.hasMoreElements()) {
@@ -902,7 +899,6 @@ public final class CMSAdminServlet extends AdminServlet {
             IOException, EBaseException {
 
         NameValuePairs params = new NameValuePairs();
-        @SuppressWarnings("unchecked")
         Enumeration<String> e = req.getParameterNames();
 
         while (e.hasMoreElements()) {
@@ -951,7 +947,6 @@ public final class CMSAdminServlet extends AdminServlet {
         IConfigStore dbConfig = mConfig.getSubStore(PROP_DB);
         IConfigStore ldapConfig = dbConfig.getSubStore("ldap");
         NameValuePairs params = new NameValuePairs();
-        @SuppressWarnings("unchecked")
         Enumeration<String> e = req.getParameterNames();
 
         while (e.hasMoreElements()) {
@@ -1014,7 +1009,6 @@ public final class CMSAdminServlet extends AdminServlet {
     private void loggedInToken(HttpServletRequest req,
             HttpServletResponse resp) throws ServletException,
             IOException, EBaseException {
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
         String tokenName = "";
         String pwd = "";
@@ -1043,7 +1037,6 @@ public final class CMSAdminServlet extends AdminServlet {
     private void checkTokenStatus(HttpServletRequest req,
             HttpServletResponse resp) throws ServletException,
             IOException, EBaseException {
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
         String key = "";
         String value = "";
@@ -1090,7 +1083,6 @@ public final class CMSAdminServlet extends AdminServlet {
         // to the signed audit log and stored as failures
         try {
             NameValuePairs params = new NameValuePairs();
-            @SuppressWarnings("unchecked")
             Enumeration<String> enum1 = req.getParameterNames();
             String tokenName = Constants.PR_INTERNAL_TOKEN_NAME;
             String keyType = "";
@@ -1461,7 +1453,6 @@ public final class CMSAdminServlet extends AdminServlet {
         // ensure that any low-level exceptions are reported
         // to the signed audit log and stored as failures
         try {
-            @SuppressWarnings("unchecked")
             Enumeration<String> enum1 = req.getParameterNames();
             String tokenName = Constants.PR_INTERNAL_TOKEN_NAME;
             String keyType = "RSA";
@@ -1885,7 +1876,6 @@ public final class CMSAdminServlet extends AdminServlet {
             String serverRoot = "";
             String serverID = "";
             String certpath = "";
-            @SuppressWarnings("unchecked")
             Enumeration<String> enum1 = req.getParameterNames();
 
             while (enum1.hasMoreElements()) {
@@ -2302,7 +2292,6 @@ public final class CMSAdminServlet extends AdminServlet {
             String serverRoot = "";
             String serverID = "";
             String certpath = "";
-            @SuppressWarnings("unchecked")
             Enumeration<String> enum1 = req.getParameterNames();
             NameValuePairs results = new NameValuePairs();
 
@@ -2528,7 +2517,6 @@ public final class CMSAdminServlet extends AdminServlet {
     private void getCertInfo(HttpServletRequest req,
             HttpServletResponse resp) throws ServletException,
             IOException, EBaseException {
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
         NameValuePairs results = new NameValuePairs();
         String pkcs = "";
@@ -2626,7 +2614,6 @@ public final class CMSAdminServlet extends AdminServlet {
     private void getCertPrettyPrint(HttpServletRequest req,
             HttpServletResponse resp) throws ServletException,
             IOException, EBaseException {
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
         ICryptoSubsystem jssSubSystem = (ICryptoSubsystem)
                 CMS.getSubsystem(CMS.SUBSYSTEM_CRYPTO);
@@ -2670,7 +2657,6 @@ public final class CMSAdminServlet extends AdminServlet {
     private void getRootCertTrustBit(HttpServletRequest req,
             HttpServletResponse resp) throws ServletException,
             IOException, EBaseException {
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
         ICryptoSubsystem jssSubSystem = (ICryptoSubsystem)
                 CMS.getSubsystem(CMS.SUBSYSTEM_CRYPTO);
@@ -2786,7 +2772,6 @@ public final class CMSAdminServlet extends AdminServlet {
     private void deleteCerts(HttpServletRequest req,
             HttpServletResponse resp) throws ServletException,
             IOException, EBaseException {
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
         ICryptoSubsystem jssSubSystem = (ICryptoSubsystem)
                 CMS.getSubsystem(CMS.SUBSYSTEM_CRYPTO);
@@ -2819,7 +2804,6 @@ public final class CMSAdminServlet extends AdminServlet {
     private void validateSubjectName(HttpServletRequest req,
             HttpServletResponse resp) throws ServletException,
             IOException, EBaseException {
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
 
         while (enum1.hasMoreElements()) {
@@ -2847,7 +2831,6 @@ public final class CMSAdminServlet extends AdminServlet {
     private void validateCurveName(HttpServletRequest req,
             HttpServletResponse resp) throws ServletException,
             IOException, EBaseException {
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
         String curveName = null;
 
@@ -2878,7 +2861,6 @@ public final class CMSAdminServlet extends AdminServlet {
     private void validateCertExtension(HttpServletRequest req,
             HttpServletResponse resp) throws ServletException,
             IOException, EBaseException {
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
         String certExt = "";
 
@@ -2903,7 +2885,6 @@ public final class CMSAdminServlet extends AdminServlet {
             HttpServletResponse resp) throws ServletException,
             IOException, EBaseException {
         NameValuePairs params = new NameValuePairs();
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
 
         String nickname = "";
@@ -2930,7 +2911,6 @@ public final class CMSAdminServlet extends AdminServlet {
             HttpServletResponse resp) throws ServletException,
             IOException, EBaseException {
         NameValuePairs params = new NameValuePairs();
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
 
         String nickname = "";
@@ -3016,7 +2996,6 @@ public final class CMSAdminServlet extends AdminServlet {
         // ensure that any low-level exceptions are reported
         // to the signed audit log and stored as failures
         try {
-            @SuppressWarnings("unchecked")
             Enumeration<String> enum1 = req.getParameterNames();
             ICryptoSubsystem jssSubSystem = (ICryptoSubsystem)
                     CMS.getSubsystem(CMS.SUBSYSTEM_CRYPTO);
@@ -3117,7 +3096,6 @@ public final class CMSAdminServlet extends AdminServlet {
                 CMS.debug("CMSAdminServlet::runSelfTestsOnDemand():"
                         + "  ENTERING . . .");
             }
-            @SuppressWarnings("unchecked")
             Enumeration<String> enum1 = req.getParameterNames();
             String request = "";
             NameValuePairs results = new NameValuePairs();
diff --git a/base/common/src/com/netscape/cms/servlet/admin/KRAAdminServlet.java b/base/common/src/com/netscape/cms/servlet/admin/KRAAdminServlet.java
index c6e6f9e1c3e4fbcac9c5331fd82a301a192d4ad7..3f9f558e086266fdec35fd8b6111b828ebdb0d78 100644
--- a/base/common/src/com/netscape/cms/servlet/admin/KRAAdminServlet.java
+++ b/base/common/src/com/netscape/cms/servlet/admin/KRAAdminServlet.java
@@ -188,7 +188,6 @@ public class KRAAdminServlet extends AdminServlet {
     private void setGeneralConfig(HttpServletRequest req,
             HttpServletResponse resp) throws ServletException,
             IOException, EBaseException {
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
         boolean restart = false;
 
diff --git a/base/common/src/com/netscape/cms/servlet/admin/LogAdminServlet.java b/base/common/src/com/netscape/cms/servlet/admin/LogAdminServlet.java
index a9661eedb80147d45fa6d90e04186f6bf76afa63..d665224212b1a9eb0f1f9689dad8154d99d350e4 100644
--- a/base/common/src/com/netscape/cms/servlet/admin/LogAdminServlet.java
+++ b/base/common/src/com/netscape/cms/servlet/admin/LogAdminServlet.java
@@ -2316,7 +2316,6 @@ public class LogAdminServlet extends AdminServlet {
             HttpServletResponse resp) throws ServletException,
             IOException, EBaseException {
 
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
         boolean restart = false;
 
diff --git a/base/common/src/com/netscape/cms/servlet/admin/OCSPAdminServlet.java b/base/common/src/com/netscape/cms/servlet/admin/OCSPAdminServlet.java
index a7c2c6c50ed715692b82ef4f9deb8c86fd5e0917..a7ff9227492f1915a203c67d23b935240071bbde 100644
--- a/base/common/src/com/netscape/cms/servlet/admin/OCSPAdminServlet.java
+++ b/base/common/src/com/netscape/cms/servlet/admin/OCSPAdminServlet.java
@@ -344,7 +344,6 @@ public class OCSPAdminServlet extends AdminServlet {
 
             IOCSPStore store = mOCSP.getOCSPStore(id);
 
-            @SuppressWarnings("unchecked")
             Enumeration<String> e = req.getParameterNames();
 
             while (e.hasMoreElements()) {
@@ -489,7 +488,6 @@ public class OCSPAdminServlet extends AdminServlet {
         // ensure that any low-level exceptions are reported
         // to the signed audit log and stored as failures
         try {
-            @SuppressWarnings("unchecked")
             Enumeration<String> enum1 = req.getParameterNames();
 
             while (enum1.hasMoreElements()) {
diff --git a/base/common/src/com/netscape/cms/servlet/admin/PolicyAdminServlet.java b/base/common/src/com/netscape/cms/servlet/admin/PolicyAdminServlet.java
index c1da868c81bc8f269f108e71345e139fea87907b..bfc1e6f4af1c74e518616d3715278352854348b1 100644
--- a/base/common/src/com/netscape/cms/servlet/admin/PolicyAdminServlet.java
+++ b/base/common/src/com/netscape/cms/servlet/admin/PolicyAdminServlet.java
@@ -1183,8 +1183,7 @@ public class PolicyAdminServlet extends AdminServlet {
                 return;
             }
             // XXX
-            for (@SuppressWarnings("unchecked")
-            Enumeration<String> n = req.getParameterNames(); n.hasMoreElements();) {
+            for (Enumeration<String> n = req.getParameterNames(); n.hasMoreElements();) {
                 String p = n.nextElement();
                 String l = req.getParameter(p);
 
diff --git a/base/common/src/com/netscape/cms/servlet/admin/ProfileAdminServlet.java b/base/common/src/com/netscape/cms/servlet/admin/ProfileAdminServlet.java
index 72bc8d5e6e47a9c13a4233d72db32fa485a62588..57489c1245245a1c516e9298a919a8ed98c02496 100644
--- a/base/common/src/com/netscape/cms/servlet/admin/ProfileAdminServlet.java
+++ b/base/common/src/com/netscape/cms/servlet/admin/ProfileAdminServlet.java
@@ -579,7 +579,6 @@ public class ProfileAdminServlet extends AdminServlet {
                 return;
             }
 
-            @SuppressWarnings("unchecked")
             Enumeration<String> names = req.getParameterNames();
             NameValuePairs nvps = new NameValuePairs();
 
@@ -705,7 +704,6 @@ public class ProfileAdminServlet extends AdminServlet {
                 return;
             }
 
-            @SuppressWarnings("unchecked")
             Enumeration<String> names = req.getParameterNames();
             NameValuePairs nvps = new NameValuePairs();
 
@@ -807,7 +805,6 @@ public class ProfileAdminServlet extends AdminServlet {
         try {
             String profileId = "";
             String policyId = "";
-            @SuppressWarnings("unchecked")
             Enumeration<String> names = req.getParameterNames();
 
             while (names.hasMoreElements()) {
@@ -928,7 +925,6 @@ public class ProfileAdminServlet extends AdminServlet {
         try {
             String profileId = "";
             String inputId = "";
-            @SuppressWarnings("unchecked")
             Enumeration<String> names = req.getParameterNames();
 
             while (names.hasMoreElements()) {
@@ -1046,7 +1042,6 @@ public class ProfileAdminServlet extends AdminServlet {
         try {
             String profileId = "";
             String outputId = "";
-            @SuppressWarnings("unchecked")
             Enumeration<String> names = req.getParameterNames();
 
             while (names.hasMoreElements()) {
@@ -1195,7 +1190,6 @@ public class ProfileAdminServlet extends AdminServlet {
             IProfilePolicy policy = profile.getProfilePolicy(setId, pId);
             IPolicyDefault def = policy.getDefault();
 
-            @SuppressWarnings("unchecked")
             Enumeration<String> names = req.getParameterNames();
 
             while (names.hasMoreElements()) {
@@ -1332,7 +1326,6 @@ public class ProfileAdminServlet extends AdminServlet {
             IProfilePolicy policy = profile.getProfilePolicy(setId, pId);
             IPolicyConstraint con = policy.getConstraint();
 
-            @SuppressWarnings("unchecked")
             Enumeration<String> names = req.getParameterNames();
 
             while (names.hasMoreElements()) {
@@ -1470,7 +1463,6 @@ public class ProfileAdminServlet extends AdminServlet {
             IProfilePolicy policy = profile.getProfilePolicy(setId, pId);
             IPolicyDefault def = policy.getDefault();
 
-            @SuppressWarnings("unchecked")
             Enumeration<String> names = req.getParameterNames();
 
             while (names.hasMoreElements()) {
@@ -1599,7 +1591,6 @@ public class ProfileAdminServlet extends AdminServlet {
             IProfileInput input = profile.getProfileInput(inputId);
             IConfigStore inputConfig = input.getConfigStore();
 
-            @SuppressWarnings("unchecked")
             Enumeration<String> names = req.getParameterNames();
 
             while (names.hasMoreElements()) {
@@ -1719,7 +1710,6 @@ public class ProfileAdminServlet extends AdminServlet {
             IProfileOutput output = profile.getProfileOutput(outputId);
             IConfigStore outputConfig = output.getConfigStore();
 
-            @SuppressWarnings("unchecked")
             Enumeration<String> names = req.getParameterNames();
 
             while (names.hasMoreElements()) {
@@ -1843,7 +1833,6 @@ public class ProfileAdminServlet extends AdminServlet {
             IProfilePolicy policy = profile.getProfilePolicy(setId, pId);
             IPolicyConstraint con = policy.getConstraint();
 
-            @SuppressWarnings("unchecked")
             Enumeration<String> names = req.getParameterNames();
 
             CMS.debug("ProfileAdminServlet: modifyPolicyConstraintConfig policy " + policy + " con " + con);
diff --git a/base/common/src/com/netscape/cms/servlet/admin/PublisherAdminServlet.java b/base/common/src/com/netscape/cms/servlet/admin/PublisherAdminServlet.java
index 7d06ee5aec39854c19128e3061d93044b7dc9b44..423fad3606b33068a65839b9430cf9d490d579ae 100644
--- a/base/common/src/com/netscape/cms/servlet/admin/PublisherAdminServlet.java
+++ b/base/common/src/com/netscape/cms/servlet/admin/PublisherAdminServlet.java
@@ -433,7 +433,6 @@ public class PublisherAdminServlet extends AdminServlet {
         IConfigStore ldapcfg = publishcfg.getSubStore(IPublisherProcessor.PROP_LDAP_PUBLISH_SUBSTORE);
         IConfigStore ldap = ldapcfg.getSubStore(IPublisherProcessor.PROP_LDAP);
 
-        @SuppressWarnings("unchecked")
         Enumeration<String> e = req.getParameterNames();
 
         while (e.hasMoreElements()) {
@@ -515,7 +514,6 @@ public class PublisherAdminServlet extends AdminServlet {
         }
 
         //set reset of the parameters
-        @SuppressWarnings("unchecked")
         Enumeration<String> e = req.getParameterNames();
         String pwd = null;
 
@@ -636,7 +634,6 @@ public class PublisherAdminServlet extends AdminServlet {
         }
 
         //set reset of the parameters
-        @SuppressWarnings("unchecked")
         Enumeration<String> e = req.getParameterNames();
         String pwd = null;
 
diff --git a/base/common/src/com/netscape/cms/servlet/admin/RAAdminServlet.java b/base/common/src/com/netscape/cms/servlet/admin/RAAdminServlet.java
index b2e27123647ed95744be273f4cbb9193bceb53ec..763f421fb7ce395288dcb8757a44d1bb935fbe90 100644
--- a/base/common/src/com/netscape/cms/servlet/admin/RAAdminServlet.java
+++ b/base/common/src/com/netscape/cms/servlet/admin/RAAdminServlet.java
@@ -185,7 +185,6 @@ public class RAAdminServlet extends AdminServlet {
             HttpServletResponse resp, IConfigStore rc) throws ServletException,
             IOException, EBaseException {
         NameValuePairs params = new NameValuePairs();
-        @SuppressWarnings("unchecked")
         Enumeration<String> e = req.getParameterNames();
 
         while (e.hasMoreElements()) {
@@ -251,7 +250,6 @@ public class RAAdminServlet extends AdminServlet {
 
         IConfigStore riq = nc.getSubStore(IRegistrationAuthority.PROP_REQ_IN_Q_SUBSTORE);
 
-        @SuppressWarnings("unchecked")
         Enumeration<String> e = req.getParameterNames();
 
         while (e.hasMoreElements()) {
@@ -287,7 +285,6 @@ public class RAAdminServlet extends AdminServlet {
         IConfigStore riq = nc.getSubStore(IRegistrationAuthority.PROP_REQ_IN_Q_SUBSTORE);
 
         //set rest of the parameters
-        @SuppressWarnings("unchecked")
         Enumeration<String> e = req.getParameterNames();
 
         while (e.hasMoreElements()) {
@@ -325,7 +322,6 @@ public class RAAdminServlet extends AdminServlet {
             HttpServletResponse resp, IConfigStore rc, IRequestListener thisListener) throws ServletException,
             IOException, EBaseException {
         //set rest of the parameters
-        @SuppressWarnings("unchecked")
         Enumeration<String> e = req.getParameterNames();
 
         while (e.hasMoreElements()) {
@@ -408,7 +404,6 @@ public class RAAdminServlet extends AdminServlet {
          }
          */
 
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
         NameValuePairs params = new NameValuePairs();
 
@@ -446,7 +441,6 @@ public class RAAdminServlet extends AdminServlet {
             caConnectorConfig = connectorConfig.getSubStore("KRA");
         }
 
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
 
         if (caConnectorConfig != null) {
@@ -475,7 +469,6 @@ public class RAAdminServlet extends AdminServlet {
 
     private boolean isCAConnector(HttpServletRequest req) {
 
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
 
         while (enum1.hasMoreElements()) {
@@ -495,7 +488,6 @@ public class RAAdminServlet extends AdminServlet {
 
     private boolean isRAConnector(HttpServletRequest req) {
 
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
 
         while (enum1.hasMoreElements()) {
@@ -515,7 +507,6 @@ public class RAAdminServlet extends AdminServlet {
 
     private boolean isKRAConnector(HttpServletRequest req) {
 
-        @SuppressWarnings("unchecked")
         Enumeration<String> enum1 = req.getParameterNames();
 
         while (enum1.hasMoreElements()) {
diff --git a/base/common/src/com/netscape/cms/servlet/base/ProxyServlet.java b/base/common/src/com/netscape/cms/servlet/base/ProxyServlet.java
index c348405883051ed6927c6ecccd5c6340f42de296..315d330a9b3b980bcd7b021143f174e246921b65 100644
--- a/base/common/src/com/netscape/cms/servlet/base/ProxyServlet.java
+++ b/base/common/src/com/netscape/cms/servlet/base/ProxyServlet.java
@@ -185,7 +185,6 @@ class ProxyWrapper extends HttpServletRequestWrapper {
             mValueMap = v;
     }
 
-    @SuppressWarnings("unchecked")
     public Map<String, String[]> getParameterMap() {
         try {
             // If we haven't specified any parameter mapping, just
diff --git a/base/common/src/com/netscape/cms/servlet/cert/RevocationProcessor.java b/base/common/src/com/netscape/cms/servlet/cert/RevocationProcessor.java
index e555d1ac65608bfd2ad0d86bfab704bc1c813553..93b7531c810ac7992db94c09e227c33cd6a542a5 100644
--- a/base/common/src/com/netscape/cms/servlet/cert/RevocationProcessor.java
+++ b/base/common/src/com/netscape/cms/servlet/cert/RevocationProcessor.java
@@ -26,12 +26,7 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
 import java.util.Locale;
-import java.util.Map;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-import com.netscape.certsrv.authorization.EAuthzException;
 import netscape.security.x509.CRLExtensions;
 import netscape.security.x509.CRLReasonExtension;
 import netscape.security.x509.InvalidityDateExtension;
@@ -43,8 +38,6 @@ import com.netscape.certsrv.apps.CMS;
 import com.netscape.certsrv.base.BadRequestException;
 import com.netscape.certsrv.base.EBaseException;
 import com.netscape.certsrv.base.EPropertyNotFound;
-import com.netscape.certsrv.base.ForbiddenException;
-import com.netscape.certsrv.base.PKIException;
 import com.netscape.certsrv.base.UnauthorizedException;
 import com.netscape.certsrv.ca.ICertificateAuthority;
 import com.netscape.certsrv.dbs.certdb.CertId;
diff --git a/base/common/src/com/netscape/cms/servlet/cert/scep/CRSEnrollment.java b/base/common/src/com/netscape/cms/servlet/cert/scep/CRSEnrollment.java
index c3d36561dc46cac062e0d79834fa4ee2ad635e50..30c07d1c1e0b4a34ae5d35090355b4c032f8dad4 100644
--- a/base/common/src/com/netscape/cms/servlet/cert/scep/CRSEnrollment.java
+++ b/base/common/src/com/netscape/cms/servlet/cert/scep/CRSEnrollment.java
@@ -206,7 +206,6 @@ public class CRSEnrollment extends HttpServlet {
 
     public static Hashtable<String, String> toHashtable(HttpServletRequest req) {
         Hashtable<String, String> httpReqHash = new Hashtable<String, String>();
-        @SuppressWarnings("unchecked")
         Enumeration<String> names = req.getParameterNames();
         while (names.hasMoreElements()) {
             String name = names.nextElement();
diff --git a/base/common/src/com/netscape/cms/servlet/common/CMSGateway.java b/base/common/src/com/netscape/cms/servlet/common/CMSGateway.java
index 8d03ca37c5fa35937041c90f09daaa735d60446d..3c8f88e89c110649e48d6b36dd064a1158d4cc6e 100644
--- a/base/common/src/com/netscape/cms/servlet/common/CMSGateway.java
+++ b/base/common/src/com/netscape/cms/servlet/common/CMSGateway.java
@@ -78,7 +78,6 @@ public class CMSGateway {
 
     public static Hashtable<String, String> toHashtable(HttpServletRequest req) {
         Hashtable<String, String> httpReqHash = new Hashtable<String, String>();
-        @SuppressWarnings("unchecked")
         Enumeration<String> names = req.getParameterNames();
 
         while (names.hasMoreElements()) {
diff --git a/base/common/src/com/netscape/cms/servlet/csadmin/BaseServlet.java b/base/common/src/com/netscape/cms/servlet/csadmin/BaseServlet.java
index e6b5f3c13c049da94cf288b35bef8aa9ad9130ef..3b3ae4033f067468039d137bb86ea405a73f0a53 100644
--- a/base/common/src/com/netscape/cms/servlet/csadmin/BaseServlet.java
+++ b/base/common/src/com/netscape/cms/servlet/csadmin/BaseServlet.java
@@ -61,7 +61,6 @@ public class BaseServlet extends VelocityServlet {
 
     public void outputHttpParameters(HttpServletRequest httpReq) {
         CMS.debug("BaseServlet:service() uri = " + httpReq.getRequestURI());
-        @SuppressWarnings("unchecked")
         Enumeration<String> paramNames = httpReq.getParameterNames();
 
         while (paramNames.hasMoreElements()) {
diff --git a/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitCMCServlet.java b/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitCMCServlet.java
index 16fa2a3949bf26218c4a8682de83cc260b468cab..1ee527c978e81721d3f9948081c46307271c7488 100644
--- a/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitCMCServlet.java
+++ b/base/common/src/com/netscape/cms/servlet/profile/ProfileSubmitCMCServlet.java
@@ -248,7 +248,6 @@ public class ProfileSubmitCMCServlet extends ProfileServlet {
 
         if (CMS.debugOn()) {
             CMS.debug("Start of ProfileSubmitCMCServlet Input Parameters");
-            @SuppressWarnings("unchecked")
             Enumeration<String> paramNames = request.getParameterNames();
 
             while (paramNames.hasMoreElements()) {
diff --git a/base/common/src/com/netscape/cms/servlet/request/ProcessCertReq.java b/base/common/src/com/netscape/cms/servlet/request/ProcessCertReq.java
index fa33f3eb13d520deb07c6ce2a5dc166dbd1c395d..9259d40e667c955392a35b6f76bc023dfa452133 100644
--- a/base/common/src/com/netscape/cms/servlet/request/ProcessCertReq.java
+++ b/base/common/src/com/netscape/cms/servlet/request/ProcessCertReq.java
@@ -757,7 +757,6 @@ public class ProcessCertReq extends CMSServlet {
                                 }
 
                                 if (mExtraAgentParams) {
-                                    @SuppressWarnings("unchecked")
                                     Enumeration<String> extraparams = req.getParameterNames();
                                     int l = IRequest.AGENT_PARAMS.length() + 1;
                                     int ap_counter = 0;
diff --git a/base/common/src/com/netscape/cms/servlet/wizard/WizardServlet.java b/base/common/src/com/netscape/cms/servlet/wizard/WizardServlet.java
index b4e03a7cc096ce1f53fa7ba6ee5bb7dd24a1a83d..6deab6bc0389b2f62c23b72956d94192086999f8 100644
--- a/base/common/src/com/netscape/cms/servlet/wizard/WizardServlet.java
+++ b/base/common/src/com/netscape/cms/servlet/wizard/WizardServlet.java
@@ -419,7 +419,6 @@ public class WizardServlet extends VelocityServlet {
 
     public void outputHttpParameters(HttpServletRequest httpReq) {
         CMS.debug("WizardServlet:service() uri = " + httpReq.getRequestURI());
-        @SuppressWarnings("unchecked")
         Enumeration<String> paramNames = httpReq.getParameterNames();
         while (paramNames.hasMoreElements()) {
             String pn = paramNames.nextElement();
diff --git a/base/java-tools/src/com/netscape/cmstools/CMCRequest.java b/base/java-tools/src/com/netscape/cmstools/CMCRequest.java
index c2382d67145df1b5e88d006ad4c478100d9a912b..fd3b2a29d1645099a6b544f10270e23867627698 100644
--- a/base/java-tools/src/com/netscape/cmstools/CMCRequest.java
+++ b/base/java-tools/src/com/netscape/cmstools/CMCRequest.java
@@ -30,7 +30,6 @@ import java.io.PrintStream;
 import java.math.BigInteger;
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
-import java.security.SignatureException;
 import java.util.Date;
 import java.util.StringTokenizer;
 
@@ -52,7 +51,6 @@ import org.mozilla.jss.asn1.SEQUENCE;
 import org.mozilla.jss.asn1.SET;
 import org.mozilla.jss.asn1.UTF8String;
 import org.mozilla.jss.crypto.CryptoToken;
-import org.mozilla.jss.crypto.CryptoStore;
 import org.mozilla.jss.crypto.DigestAlgorithm;
 import org.mozilla.jss.crypto.ObjectNotFoundException;
 import org.mozilla.jss.crypto.SignatureAlgorithm;
@@ -1040,8 +1038,6 @@ public class CMCRequest {
                 System.exit(1);
             }
 
-            CryptoStore store = token.getCryptoStore();
-            X509Certificate[] list = store.getCertificates();
             X509Certificate signerCert = null;
 
             StringBuffer certname = new StringBuffer();
diff --git a/base/java-tools/src/com/netscape/cmstools/CRMFPopClient.java b/base/java-tools/src/com/netscape/cmstools/CRMFPopClient.java
index 204d234c0c0444e7114507869136d07b82122ac5..79c8a74897022db48e863e7161ff3fe87b1c8510 100644
--- a/base/java-tools/src/com/netscape/cmstools/CRMFPopClient.java
+++ b/base/java-tools/src/com/netscape/cmstools/CRMFPopClient.java
@@ -19,8 +19,8 @@ package com.netscape.cmstools;
 
 import java.io.BufferedReader;
 import java.io.ByteArrayOutputStream;
-import java.io.FileReader;
 import java.io.FileOutputStream;
+import java.io.FileReader;
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
@@ -50,7 +50,6 @@ import org.mozilla.jss.crypto.KeyGenAlgorithm;
 import org.mozilla.jss.crypto.KeyGenerator;
 import org.mozilla.jss.crypto.KeyPairAlgorithm;
 import org.mozilla.jss.crypto.KeyPairGenerator;
-import org.mozilla.jss.crypto.KeyPairGeneratorSpi.Usage.*;
 import org.mozilla.jss.crypto.KeyWrapAlgorithm;
 import org.mozilla.jss.crypto.KeyWrapper;
 import org.mozilla.jss.crypto.Signature;
@@ -71,10 +70,9 @@ import org.mozilla.jss.pkix.primitive.Name;
 import org.mozilla.jss.pkix.primitive.SubjectPublicKeyInfo;
 import org.mozilla.jss.util.Password;
 
-import com.netscape.cmsutil.util.HMACDigest;
-import com.netscape.cmsutil.util.Utils;
-import com.netscape.cmsutil.crypto.CryptoUtil;
 import com.netscape.certsrv.apps.CMS;
+import com.netscape.cmsutil.crypto.CryptoUtil;
+import com.netscape.cmsutil.util.HMACDigest;
 
 /**
  * A command-line utility used to generate a Certificate Request Message
@@ -167,13 +165,12 @@ public class CRMFPopClient {
         int ec_extractable = -1; /* -1, 0, or 1 */
         boolean ec_ssl_ecdh = false;
 
-        int PORT = 0;
         String USER_NAME = null;
         String REQUESTOR_NAME = null;
         String PROFILE_NAME = null;
- 
+
         // format: "host:port"
-        String HOST_PORT = null; 
+        String HOST_PORT = null;
         String SUBJ_DN = null;
         int doServerHit = 0;
 
@@ -213,7 +210,7 @@ public class CRMFPopClient {
             } else if (name.equals("-s")) {
                 String ec_sensitive_s = args[i+1];
                 ec_sensitive = Integer.parseInt(ec_sensitive_s);
-                if ((ec_sensitive != 0) && 
+                if ((ec_sensitive != 0) &&
                     (ec_sensitive != 1) &&
                     (ec_sensitive != -1)) {
                       System.out.println("PKCS10Client: Illegal input parameters for -s.");
@@ -223,7 +220,7 @@ public class CRMFPopClient {
             } else if (name.equals("-e")) {
                 String ec_extractable_s = args[i+1];
                 ec_extractable = Integer.parseInt(ec_extractable_s);
-                if ((ec_extractable != 0) && 
+                if ((ec_extractable != 0) &&
                     (ec_extractable != 1) &&
                     (ec_extractable != -1)) {
                       System.out.println("PKCS10Client: Illegal input parameters for -e.");
@@ -248,7 +245,7 @@ public class CRMFPopClient {
             } else if (name.equals("-q")) {
                 POP_OPTION = args[i+1];
                 if (!POP_OPTION.equals("POP_SUCCESS") &&
-                    !POP_OPTION.equals("POP_FAIL") && 
+                    !POP_OPTION.equals("POP_FAIL") &&
                     !POP_OPTION.equals("POP_NONE")) {
                     System.out.println("CRMFPopClient: ERROR: invalid POP option: "+ POP_OPTION);
                     System.exit(1);
@@ -270,7 +267,6 @@ public class CRMFPopClient {
         InputStream is = null;
         BufferedReader reader = null;
         boolean success = false;
-        int num = 1;
         long total_time = 0;
         KeyPair pair = null;
 
@@ -295,18 +291,18 @@ public class CRMFPopClient {
              }
         }
 
-        try { 
+        try {
             CryptoManager.initialize( DB_DIR );
         } catch (AlreadyInitializedException ae) {
-            // it is ok if it is already initialized 
+            // it is ok if it is already initialized
             System.out.println("CRMFPopClient: already initialized, continue");
-        } catch (Exception e) { 
+        } catch (Exception e) {
             System.out.println("CRMFPopClient: INITIALIZATION ERROR: " + e.toString());
             System.exit(1);
         }
 
         try {
-            CryptoManager manager = CryptoManager.getInstance(); 
+            CryptoManager manager = CryptoManager.getInstance();
             String token_pwd = TOKEN_PWD;
             if (token_pwd == null) {
                System.out.println("missing password");
@@ -322,9 +318,9 @@ public class CRMFPopClient {
             }
             System.out.println("CRMFPopClient: getting token: "+TOKEN_NAME);
             manager.setThreadToken(token);
-            Password password = new Password(token_pwd.toCharArray()); 
+            Password password = new Password(token_pwd.toCharArray());
             try {
-                token.login(password); 
+                token.login(password);
             } catch (Exception e) {
                 System.out.println("CRMFPopClient: login Exception: " + e.toString());
                 System.exit(1);
@@ -347,10 +343,10 @@ public class CRMFPopClient {
 
             if (alg.equals("rsa")) {
                 KeyPairGenerator kg = token.getKeyPairGenerator(
-                KeyPairAlgorithm.RSA); 
+                KeyPairAlgorithm.RSA);
                 kg.initialize(RSA_keylen);
 
-                pair = kg.genKeyPair(); 
+                pair = kg.genKeyPair();
             } else if (alg.equals("ec")) {
                 /*
                  * used with SSL server cert that does ECDH ECDSA
@@ -388,7 +384,7 @@ public class CRMFPopClient {
             System.out.println(".before KeyWrapper");
 
             // wrap private key using session
-            KeyWrapper wrapper1 = 
+            KeyWrapper wrapper1 =
                 token.getKeyWrapper(KeyWrapAlgorithm.DES3_CBC_PAD);
 
             System.out.println(".key wrapper created");
@@ -404,11 +400,11 @@ public class CRMFPopClient {
             // currently, a transport cert has to be an RSA cert,
             // regardless of the key you are wrapping
             KeyWrapper rsaWrap = token.getKeyWrapper(
-            KeyWrapAlgorithm.RSA); 
+            KeyWrapAlgorithm.RSA);
 
             System.out.println(".got rsaWrapper");
 
-            rsaWrap.initWrap(tcert.getPublicKey(), null); 
+            rsaWrap.initWrap(tcert.getPublicKey(), null);
 
             System.out.println(".rsaWrap inited");
 
@@ -423,10 +419,10 @@ public class CRMFPopClient {
 
                 Name n1 = getJssName(SUBJ_DN);
 
-                Name n = new Name(); 
+                Name n = new Name();
 
-                n.addCommonName("Me"); 
-                n.addCountryName("US"); 
+                n.addCommonName("Me");
+                n.addCountryName("US");
                 n.addElement(new AVA(new OBJECT_IDENTIFIER("0.9.2342.19200300.100.1.1"),  new PrintableString("MyUid")));
 
                 if (n1 != null)
@@ -463,7 +459,7 @@ public class CRMFPopClient {
                 }
 
                 /* Example of adding the POP link witness control to CRMF */
-                byte[] b = 
+                byte[] b =
                 { 0x10, 0x53, 0x42, 0x24, 0x1a, 0x2a, 0x35, 0x3c,
                      0x7a, 0x52, 0x54, 0x56, 0x71, 0x65, 0x66, 0x4c,
                      0x51, 0x34, 0x35, 0x23, 0x3c, 0x42, 0x43, 0x45,
@@ -491,7 +487,7 @@ public class CRMFPopClient {
                 ByteArrayOutputStream bo = new ByteArrayOutputStream();
                 certReq.encode(bo);
                 byte[] toBeVerified = bo.toByteArray();
-                                    
+
                 byte popdata[] = ASN1Util.encode(certReq);
                 byte signature[];
 
@@ -539,7 +535,7 @@ public class CRMFPopClient {
                     if (alg.equals("rsa")) {
                         algID = new AlgorithmIdentifier(SignatureAlgorithm.RSASignatureWithMD5Digest.toOID(), null );
                     } else { // "ec"
-                        algID = new AlgorithmIdentifier(SignatureAlgorithm.ECSignatureWithSHA1Digest.toOID(), null ); 
+                        algID = new AlgorithmIdentifier(SignatureAlgorithm.ECSignatureWithSHA1Digest.toOID(), null );
                     }
                     POPOSigningKey popoKey = new POPOSigningKey(null,algID, new BIT_STRING(signature,0));
 
@@ -554,7 +550,7 @@ public class CRMFPopClient {
 
                 SEQUENCE s1 = new SEQUENCE();
                 s1.addElement(crmfMsg);
-                byte encoded[] = ASN1Util.encode(s1); 
+                byte encoded[] = ASN1Util.encode(s1);
 
                 String Req1 = CMS.BtoA(encoded);
 
@@ -579,10 +575,10 @@ public class CRMFPopClient {
                     if (doServerHit == 0)
                         return;
                     }
-                                    
+
                     String Req = URLEncoder.encode(Req1);
 
-                    url = 
+                    url =
                             new URL("http://"
                                 + HOST_PORT + "/ca/ee/ca/profileSubmit?cert_request_type=crmf&cert_request="
                                 + Req + "&renewal=false&uid=" + USER_NAME + "&xmlOutput=false&&profileId="
@@ -591,33 +587,33 @@ public class CRMFPopClient {
 
                     System.out.println("CRMFPopClient: Posting " + url);
 
-                    System.out.println(""); 
+                    System.out.println("");
                     System.out.println("CRMFPopClient: Server Response.....");
                     System.out.println("--------------------");
                     System.out.println("");
 
-                    long start_time = (new Date()).getTime(); 
-                    conn = url.openConnection(); 
-                    is = conn.getInputStream(); 
-                    reader = new BufferedReader(new InputStreamReader(is)); 
-                    String line = null; 
+                    long start_time = (new Date()).getTime();
+                    conn = url.openConnection();
+                    is = conn.getInputStream();
+                    reader = new BufferedReader(new InputStreamReader(is));
+                    String line = null;
 
-                    while ((line = reader.readLine()) != null) { 
+                    while ((line = reader.readLine()) != null) {
                         System.out.println(line);
-                        if (line.equals("CMS Enroll Request Success")) { 
-                            success = true; 
+                        if (line.equals("CMS Enroll Request Success")) {
+                            success = true;
                             System.out.println("CRMFPopClient: Enrollment Successful: ......");
                             System.out.println("");
-                        } 
-                    } /* while */ 
+                        }
+                    } /* while */
 
-                    long end_time = (new Date()).getTime(); 
-                    total_time += (end_time - start_time); 
-                } catch (Exception e) { 
+                    long end_time = (new Date()).getTime();
+                    total_time += (end_time - start_time);
+                } catch (Exception e) {
                     System.out.println("CRMFPopClient: WARNING: " + e.toString());
                     e.printStackTrace();
                 }
-        } catch (Exception e) { 
+        } catch (Exception e) {
                 System.out.println("CRMFPopClient: ERROR: " + e.toString());
                 e.printStackTrace();
         }
diff --git a/base/java-tools/src/com/netscape/cmstools/PKCS10Client.java b/base/java-tools/src/com/netscape/cmstools/PKCS10Client.java
index 6b2c0535e8117feea364878e10af978ca6e731b3..a138ae29d661033d747272272ff56fa2183e8112 100644
--- a/base/java-tools/src/com/netscape/cmstools/PKCS10Client.java
+++ b/base/java-tools/src/com/netscape/cmstools/PKCS10Client.java
@@ -22,13 +22,12 @@ import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.PrintStream;
 import java.security.KeyPair;
-import java.security.PublicKey;
-import java.security.PrivateKey;
 import java.security.MessageDigest;
+import java.security.PublicKey;
 
+import netscape.security.pkcs.PKCS10;
 import netscape.security.x509.X500Name;
 import netscape.security.x509.X509Key;
-import netscape.security.pkcs.PKCS10;
 
 import org.mozilla.jss.CryptoManager;
 import org.mozilla.jss.asn1.INTEGER;
@@ -37,11 +36,9 @@ import org.mozilla.jss.asn1.OCTET_STRING;
 import org.mozilla.jss.asn1.PrintableString;
 import org.mozilla.jss.asn1.SET;
 import org.mozilla.jss.crypto.CryptoToken;
-import org.mozilla.jss.crypto.CryptoStore;
 import org.mozilla.jss.crypto.KeyPairAlgorithm;
 import org.mozilla.jss.crypto.KeyPairGenerator;
 import org.mozilla.jss.crypto.SignatureAlgorithm;
-import org.mozilla.jss.crypto.KeyPairGeneratorSpi.Usage.*;
 import org.mozilla.jss.pkcs10.CertificationRequest;
 import org.mozilla.jss.pkcs10.CertificationRequestInfo;
 import org.mozilla.jss.pkix.primitive.AVA;
@@ -50,10 +47,9 @@ import org.mozilla.jss.pkix.primitive.Name;
 import org.mozilla.jss.pkix.primitive.SubjectPublicKeyInfo;
 import org.mozilla.jss.util.Password;
 
-import com.netscape.cmsutil.util.HMACDigest;
-import com.netscape.cmsutil.util.Utils;
-import com.netscape.cmsutil.crypto.CryptoUtil;
 import com.netscape.certsrv.apps.CMS;
+import com.netscape.cmsutil.crypto.CryptoUtil;
+import com.netscape.cmsutil.util.HMACDigest;
 
 /**
  * Generates an ECC or RSA key pair in the security database, constructs a
@@ -135,7 +131,7 @@ public class PKCS10Client {
             } else if (name.equals("-s")) {
                 String ec_sensitive_s = args[i+1];
                 ec_sensitive = Integer.parseInt(ec_sensitive_s);
-                if ((ec_sensitive != 0) && 
+                if ((ec_sensitive != 0) &&
                     (ec_sensitive != 1) &&
                     (ec_sensitive != -1)) {
                       System.out.println("PKCS10Client: Illegal input parameters for -s.");
@@ -145,7 +141,7 @@ public class PKCS10Client {
             } else if (name.equals("-e")) {
                 String ec_extractable_s = args[i+1];
                 ec_extractable = Integer.parseInt(ec_extractable_s);
-                if ((ec_extractable != 0) && 
+                if ((ec_extractable != 0) &&
                     (ec_extractable != 1) &&
                     (ec_extractable != -1)) {
                       System.out.println("PKCS10Client: Illegal input parameters for -e.");
@@ -179,7 +175,7 @@ public class PKCS10Client {
         if (dbdir == null)
             dbdir = ".";
 
-        try { 
+        try {
             // initialize CryptoManager
             String mPrefix = "";
             CryptoManager.InitializationValues vals =
@@ -210,9 +206,9 @@ public class PKCS10Client {
             KeyPair pair = null;
 
             if (alg.equals("rsa")) {
-                KeyPairGenerator kg = token.getKeyPairGenerator(KeyPairAlgorithm.RSA); 
+                KeyPairGenerator kg = token.getKeyPairGenerator(KeyPairAlgorithm.RSA);
                 kg.initialize(rsa_keylen);
-                pair = kg.genKeyPair(); 
+                pair = kg.genKeyPair();
             }  else if (alg.equals("ec")) {
                 // used with SSL server cert that does ECDH ECDSA
                 org.mozilla.jss.crypto.KeyPairGeneratorSpi.Usage usages_mask_ECDH[] = {
@@ -277,11 +273,6 @@ public class PKCS10Client {
                 certRequest = new CertificationRequest(certReqInfo,
                 pair.getPrivate(), SignatureAlgorithm.RSASignatureWithMD5Digest);
                 System.out.println("PKCS10Client: CertificationRequest created.");
-                if (certRequest == null) {
-                    System.out.println("PKCS10Client: certRequest null.");
-                    System.exit(1);
-                } else
-                    System.out.println("PKCS10Client: certRequest not null.");
 
                 ByteArrayOutputStream bos = new ByteArrayOutputStream();
                 certRequest.encode(bos);
@@ -304,7 +295,7 @@ public class PKCS10Client {
                 xKey = CryptoUtil.getPublicX509ECCKey(pubk_encoded);
                 System.out.println("PKCS10Client: calling CryptoUtil.createCertificationRequest");
                 PKCS10 certReq = CryptoUtil.createCertificationRequest(
-                    subjectName, xKey, (org.mozilla.jss.crypto.PrivateKey) pair.getPrivate(), 
+                    subjectName, xKey, (org.mozilla.jss.crypto.PrivateKey) pair.getPrivate(),
                     "SHA256withEC");
 
                 System.out.println("PKCS10Client: created cert request");
@@ -316,11 +307,11 @@ public class PKCS10Client {
                 byte[] certReqb = certReq.toByteArray();
                 b64E = CryptoUtil.base64Encode(certReqb);
             }
- 
+
             System.out.println("-----BEGIN NEW CERTIFICATE REQUEST-----");
             System.out.println(b64E);
             System.out.println("-----END NEW CERTIFICATE REQUEST-----");
-    
+
             PrintStream ps = null;
             ps = new PrintStream(new FileOutputStream(ofilename));
             ps.println("-----BEGIN NEW CERTIFICATE REQUEST-----");
diff --git a/base/kra/src/com/netscape/kra/TokenKeyRecoveryService.java b/base/kra/src/com/netscape/kra/TokenKeyRecoveryService.java
index 8109cee68439e7e9cb72fe8f5917c05b845eb59b..6ce8d11a44fa197a24f14714947ea179a9ed0bee 100644
--- a/base/kra/src/com/netscape/kra/TokenKeyRecoveryService.java
+++ b/base/kra/src/com/netscape/kra/TokenKeyRecoveryService.java
@@ -22,8 +22,8 @@ import java.io.ByteArrayOutputStream;
 import java.io.FilterOutputStream;
 import java.io.IOException;
 import java.io.PrintStream;
-import java.security.SecureRandom;
 import java.security.PublicKey;
+import java.security.SecureRandom;
 import java.util.Hashtable;
 
 import netscape.security.util.BigInt;
@@ -39,7 +39,6 @@ import org.mozilla.jss.crypto.KeyWrapAlgorithm;
 import org.mozilla.jss.crypto.KeyWrapper;
 import org.mozilla.jss.crypto.PrivateKey;
 import org.mozilla.jss.crypto.SymmetricKey;
-import org.mozilla.jss.CryptoManager;
 import org.mozilla.jss.pkcs11.PK11SymKey;
 import org.mozilla.jss.util.Base64OutputStream;
 
@@ -208,9 +207,7 @@ public class TokenKeyRecoveryService implements IService {
         String iv_s = "";
 
         CMS.debug("KRA services token key recovery request");
-        CryptoManager cm = null;
         IConfigStore config = null;
-        String tokName = "";
         Boolean allowEncDecrypt_recovery = false;
 
         try {
@@ -485,7 +482,7 @@ public class TokenKeyRecoveryService implements IService {
                 PrivateKey privKey = recoverKey(params, keyRecord, allowEncDecrypt_recovery);
                 KeyWrapper wrapper = token.getKeyWrapper(
                     KeyWrapAlgorithm.DES3_CBC_PAD);
- 
+
                 wrapper.initWrap(sk, algParam);
                 wrapped = wrapper.wrap(privKey);
                 iv_s = /*base64Encode(iv);*/com.netscape.cmsutil.util.Utils.SpecialEncode(iv);
@@ -610,7 +607,7 @@ public class TokenKeyRecoveryService implements IService {
      * Recovers key.
      *     - with allowEncDecrypt_archival == false
      */
-    public synchronized PrivateKey recoverKey(Hashtable<String, Object> request, KeyRecord keyRecord, boolean allowEncDecrypt_archival) 
+    public synchronized PrivateKey recoverKey(Hashtable<String, Object> request, KeyRecord keyRecord, boolean allowEncDecrypt_archival)
         throws EBaseException {
         CMS.debug( "TokenKeyRecoveryService: recoverKey() - with allowEncDecrypt_archival being false");
         if (allowEncDecrypt_archival) {
@@ -642,7 +639,7 @@ public class TokenKeyRecoveryService implements IService {
                 keyRecord.getAlgorithm(),
                 iv,
                 pri,
-                (PublicKey) pubkey);
+                pubkey);
             if (privKey == null) {
                 CMS.debug( "TokenKeyRecoveryService: recoverKey() - recovery failure");
                 throw new EKRAException(CMS.getUserMessage("CMS_KRA_RECOVERY_FAILED_1", "private key recovery/unwrapping failure"));
-- 
1.8.1.2

