From a90070fa18533fd058c611fc2f06c2b814cbff13 Mon Sep 17 00:00:00 2001
From: Endi Sukma Dewata <edewata@redhat.com>
Date: Sat, 18 Aug 2012 02:30:44 -0500
Subject: [PATCH] Moved REST CLI into pki-tools.

The pki-client.jar has been split and merged into pki-certsrv.jar
and pki-tools.jar. The REST client classes are now packaged in
com.netscape.certsrv.<component> packages. The REST CLI classes
are now packaged in com.netscape.cmstools.<component> packages.
The "pki" script has been moved into pki-tools RPM package.

Ticket #215
---
 base/CMakeLists.txt                                |  6 +--
 .../src/com/netscape/cms/servlet/test/CATest.java  |  4 +-
 .../cms/servlet/test/ConfigurationTest.java        |  4 +-
 base/common/src/CMakeLists.txt                     | 47 ++---------------
 .../{cms/client => certsrv}/ca/CAClient.java       |  6 +--
 .../{cms/client => certsrv}/cert/CertClient.java   | 17 ++-----
 .../{cms => certsrv}/client/ClientConfig.java      |  2 +-
 .../{cms => certsrv}/client/PKIClient.java         |  2 +-
 .../client/PKIErrorInterceptor.java                |  2 +-
 .../{cms/client => certsrv}/group/GroupClient.java | 12 ++---
 .../{cms/client => certsrv}/kra/DRMClient.java     | 12 ++---
 ...ficateResource.java => SystemCertResource.java} |  2 +-
 .../system/SystemConfigClient.java                 | 11 ++--
 .../{cms/client => certsrv}/user/UserClient.java   | 12 ++---
 .../cms/servlet/admin/SystemCertService.java       |  4 +-
 .../cms/servlet/csadmin/ConfigurationUtils.java    |  4 +-
 base/deploy/src/scriptlets/configuration.jy        |  2 +-
 base/deploy/src/scriptlets/pkijython.py            |  2 +-
 base/java-tools/CMakeLists.txt                     | 12 +++++
 base/{setup => java-tools}/pki                     |  4 +-
 base/java-tools/src/CMakeLists.txt                 | 59 +++++++++++++++++++++-
 .../src/com/netscape/cmstools}/cert/CertCLI.java   |  7 +--
 .../com/netscape/cmstools}/cert/CertFindCLI.java   |  6 +--
 .../com/netscape/cmstools}/cert/CertHoldCLI.java   |  6 +--
 .../cmstools}/cert/CertReleaseHoldCLI.java         |  6 +--
 .../cmstools}/cert/CertRequestApproveCLI.java      |  6 +--
 .../cmstools}/cert/CertRequestReviewCLI.java       |  6 +--
 .../cmstools}/cert/CertRequestSubmitCLI.java       |  6 +--
 .../com/netscape/cmstools}/cert/CertRevokeCLI.java |  6 +--
 .../com/netscape/cmstools}/cert/CertShowCLI.java   |  6 +--
 .../src/com/netscape/cmstools}/cli/CLI.java        |  2 +-
 .../src/com/netscape/cmstools}/cli/MainCLI.java    | 10 ++--
 .../com/netscape/cmstools}/group/GroupAddCLI.java  |  6 +--
 .../cmstools}/group/GroupAddMemberCLI.java         |  6 +--
 .../src/com/netscape/cmstools}/group/GroupCLI.java |  7 +--
 .../com/netscape/cmstools}/group/GroupFindCLI.java |  6 +--
 .../cmstools}/group/GroupFindMemberCLI.java        |  6 +--
 .../netscape/cmstools}/group/GroupModifyCLI.java   |  6 +--
 .../netscape/cmstools}/group/GroupRemoveCLI.java   |  6 +--
 .../cmstools}/group/GroupRemoveMemberCLI.java      |  6 +--
 .../com/netscape/cmstools}/group/GroupShowCLI.java |  6 +--
 .../cmstools}/group/GroupShowMemberCLI.java        |  6 +--
 .../com/netscape/cmstools}/user/UserAddCLI.java    |  6 +--
 .../netscape/cmstools}/user/UserAddCertCLI.java    |  6 +--
 .../src/com/netscape/cmstools}/user/UserCLI.java   |  7 +--
 .../com/netscape/cmstools}/user/UserFindCLI.java   |  6 +--
 .../netscape/cmstools}/user/UserFindCertCLI.java   |  6 +--
 .../com/netscape/cmstools}/user/UserModifyCLI.java |  6 +--
 .../com/netscape/cmstools}/user/UserRemoveCLI.java |  6 +--
 .../netscape/cmstools}/user/UserRemoveCertCLI.java |  6 +--
 .../com/netscape/cmstools}/user/UserShowCLI.java   |  6 +--
 .../netscape/cmstools}/user/UserShowCertCLI.java   |  6 +--
 .../src/com/netscape/cms/servlet/test/DRMTest.java |  4 +-
 base/setup/CMakeLists.txt                          |  1 -
 scripts/compose_pki_core_packages                  |  2 +-
 specs/pki-core.spec                                |  9 ++--
 56 files changed, 217 insertions(+), 214 deletions(-)
 rename base/common/src/com/netscape/{cms/client => certsrv}/ca/CAClient.java (97%)
 rename base/common/src/com/netscape/{cms/client => certsrv}/cert/CertClient.java (77%)
 rename base/common/src/com/netscape/{cms => certsrv}/client/ClientConfig.java (99%)
 rename base/common/src/com/netscape/{cms => certsrv}/client/PKIClient.java (99%)
 rename base/common/src/com/netscape/{cms => certsrv}/client/PKIErrorInterceptor.java (98%)
 rename base/common/src/com/netscape/{cms/client => certsrv}/group/GroupClient.java (86%)
 rename base/common/src/com/netscape/{cms/client => certsrv}/kra/DRMClient.java (93%)
 rename base/common/src/com/netscape/certsrv/system/{SystemCertificateResource.java => SystemCertResource.java} (92%)
 rename base/common/src/com/netscape/{cms/client => certsrv}/system/SystemConfigClient.java (77%)
 rename base/common/src/com/netscape/{cms/client => certsrv}/user/UserClient.java (86%)
 rename base/{setup => java-tools}/pki (96%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/cert/CertCLI.java (96%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/cert/CertFindCLI.java (99%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/cert/CertHoldCLI.java (96%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/cert/CertReleaseHoldCLI.java (96%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/cert/CertRequestApproveCLI.java (94%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/cert/CertRequestReviewCLI.java (96%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/cert/CertRequestSubmitCLI.java (95%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/cert/CertRevokeCLI.java (97%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/cert/CertShowCLI.java (95%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/cli/CLI.java (98%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/cli/MainCLI.java (97%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/group/GroupAddCLI.java (94%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/group/GroupAddMemberCLI.java (93%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/group/GroupCLI.java (95%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/group/GroupFindCLI.java (95%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/group/GroupFindMemberCLI.java (96%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/group/GroupModifyCLI.java (94%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/group/GroupRemoveCLI.java (92%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/group/GroupRemoveMemberCLI.java (92%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/group/GroupShowCLI.java (92%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/group/GroupShowMemberCLI.java (93%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/user/UserAddCLI.java (96%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/user/UserAddCertCLI.java (95%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/user/UserCLI.java (96%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/user/UserFindCLI.java (95%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/user/UserFindCertCLI.java (96%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/user/UserModifyCLI.java (96%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/user/UserRemoveCLI.java (92%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/user/UserRemoveCertCLI.java (93%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/user/UserShowCLI.java (92%)
 rename base/{common/src/com/netscape/cms/client => java-tools/src/com/netscape/cmstools}/user/UserShowCertCLI.java (95%)

diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt
index 1c6e909ad8667f6609e669544ce9740c24f94528..d8fcecdb6ed10c1ab4ac602f13edbaa838d2e0ef 100644
--- a/base/CMakeLists.txt
+++ b/base/CMakeLists.txt
@@ -3,13 +3,13 @@ project(base)
 # The order is important!
 if (APPLICATION_FLAVOR_PKI_CORE)
     add_subdirectory(test)
-    add_subdirectory(deploy)
     add_subdirectory(setup)
     add_subdirectory(symkey)
-    add_subdirectory(native-tools)
     add_subdirectory(util)
-    add_subdirectory(java-tools)
     add_subdirectory(common)
+    add_subdirectory(native-tools)
+    add_subdirectory(java-tools)
+    add_subdirectory(deploy)
     add_subdirectory(selinux)
     add_subdirectory(ca)
     add_subdirectory(kra)
diff --git a/base/ca/functional/src/com/netscape/cms/servlet/test/CATest.java b/base/ca/functional/src/com/netscape/cms/servlet/test/CATest.java
index b00084d429667db0c1deaa38bab120933f16dc58..59293e81c9f21aad0d39bbddcc7d3edc0e7e0282 100644
--- a/base/ca/functional/src/com/netscape/cms/servlet/test/CATest.java
+++ b/base/ca/functional/src/com/netscape/cms/servlet/test/CATest.java
@@ -33,6 +33,7 @@ import org.mozilla.jss.crypto.AlreadyInitializedException;
 import org.mozilla.jss.crypto.CryptoToken;
 import org.mozilla.jss.util.Password;
 
+import com.netscape.certsrv.ca.CAClient;
 import com.netscape.certsrv.cert.CertData;
 import com.netscape.certsrv.cert.CertDataInfo;
 import com.netscape.certsrv.cert.CertDataInfos;
@@ -42,6 +43,7 @@ import com.netscape.certsrv.cert.CertRequestInfo;
 import com.netscape.certsrv.cert.CertRequestInfos;
 import com.netscape.certsrv.cert.CertReviewResponse;
 import com.netscape.certsrv.cert.CertSearchRequest;
+import com.netscape.certsrv.client.ClientConfig;
 import com.netscape.certsrv.dbs.certdb.CertId;
 import com.netscape.certsrv.profile.ProfileData;
 import com.netscape.certsrv.profile.ProfileDataInfo;
@@ -49,8 +51,6 @@ import com.netscape.certsrv.profile.ProfileDataInfos;
 import com.netscape.certsrv.profile.ProfileInput;
 import com.netscape.certsrv.request.RequestId;
 import com.netscape.certsrv.request.RequestNotFoundException;
-import com.netscape.cms.client.ClientConfig;
-import com.netscape.cms.client.ca.CAClient;
 
 public class CATest {
 
diff --git a/base/common/functional/src/com/netscape/cms/servlet/test/ConfigurationTest.java b/base/common/functional/src/com/netscape/cms/servlet/test/ConfigurationTest.java
index 462137ec76ed19d92b2f6bb54cbfda401a9e8253..c230815133e006cb85af17885a586a377f4119ac 100644
--- a/base/common/functional/src/com/netscape/cms/servlet/test/ConfigurationTest.java
+++ b/base/common/functional/src/com/netscape/cms/servlet/test/ConfigurationTest.java
@@ -56,11 +56,11 @@ import org.mozilla.jss.pkix.primitive.Name;
 import org.mozilla.jss.pkix.primitive.SubjectPublicKeyInfo;
 import org.mozilla.jss.util.Password;
 
+import com.netscape.certsrv.client.ClientConfig;
 import com.netscape.certsrv.system.ConfigurationRequest;
 import com.netscape.certsrv.system.ConfigurationResponse;
 import com.netscape.certsrv.system.SystemCertData;
-import com.netscape.cms.client.ClientConfig;
-import com.netscape.cms.client.system.SystemConfigClient;
+import com.netscape.certsrv.system.SystemConfigClient;
 import com.netscape.cmsutil.util.Utils;
 
 /**
diff --git a/base/common/src/CMakeLists.txt b/base/common/src/CMakeLists.txt
index fc6204b2aec0f012cb9e3f4d0b7d0fbb26b12901..dc61b4ca762ab3d543f1b65a0959ac0ff29c92fe 100644
--- a/base/common/src/CMakeLists.txt
+++ b/base/common/src/CMakeLists.txt
@@ -30,13 +30,6 @@ find_file(COMMONS_HTTPCLIENT_JAR
         /usr/share/java
 )
 
-find_file(APACHE_COMMONS_CLI_JAR
-    NAMES
-        apache-commons-cli.jar
-    PATHS
-        /usr/share/java
-)
-
 find_file(APACHE_COMMONS_LANG_JAR
     NAMES
         apache-commons-lang.jar
@@ -133,7 +126,7 @@ javac(pki-certsrv-classes
         ${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR}
         ${LDAPJDK_JAR} ${SERVLET_JAR} ${VELOCITY_JAR} ${XALAN_JAR} ${XERCES_JAR}
         ${JSS_JAR} ${COMMONS_CODEC_JAR} ${COMMONS_HTTPCLIENT_JAR}
-        ${APACHE_COMMONS_CLI_JAR} ${APACHE_COMMONS_LANG_JAR}
+        ${APACHE_COMMONS_LANG_JAR}
         ${TOMCAT_CATALINA_JAR} ${TOMCAT_UTIL_JAR} ${SYMKEY_JAR}
         ${JAXRS_API_JAR} ${RESTEASY_JAXRS_JAR} ${RESTEASY_ATOM_PROVIDER_JAR}
         ${HTTPCLIENT_JAR} ${HTTPCORE_JAR}
@@ -182,7 +175,7 @@ javac(pki-cms-classes
         ${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR}
         ${LDAPJDK_JAR} ${SERVLET_JAR} ${VELOCITY_JAR} ${XALAN_JAR} ${XERCES_JAR}
         ${JSS_JAR} ${COMMONS_CODEC_JAR} ${COMMONS_HTTPCLIENT_JAR}
-        ${APACHE_COMMONS_CLI_JAR} ${APACHE_COMMONS_LANG_JAR}
+        ${APACHE_COMMONS_LANG_JAR}
         ${TOMCAT_CATALINA_JAR} ${TOMCAT_UTIL_JAR} ${SYMKEY_JAR}
         ${JAXRS_API_JAR} ${RESTEASY_JAXRS_JAR} ${RESTEASY_ATOM_PROVIDER_JAR}
         ${HTTPCLIENT_JAR} ${HTTPCORE_JAR}
@@ -233,7 +226,7 @@ if(WITH_JAVADOC)
             ${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR}
             ${LDAPJDK_JAR} ${SERVLET_JAR} ${VELOCITY_JAR} ${XALAN_JAR} ${XERCES_JAR}
             ${JSS_JAR} ${COMMONS_CODEC_JAR} ${COMMONS_HTTPCLIENT_JAR}
-            ${APACHE_COMMONS_CLI_JAR} ${APACHE_COMMONS_LANG_JAR}
+            ${APACHE_COMMONS_LANG_JAR}
             ${TOMCAT_CATALINA_JAR} ${TOMCAT_UTIL_JAR} ${SYMKEY_JAR}
             ${JAXRS_API_JAR} ${RESTEASY_JAXRS_JAR} ${RESTEASY_ATOM_PROVIDER_JAR}
             ${HTTPCLIENT_JAR} ${HTTPCORE_JAR}
@@ -264,7 +257,7 @@ javac(pki-cmscore-classes
         ${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR}
         ${LDAPJDK_JAR} ${SERVLET_JAR} ${VELOCITY_JAR} ${XALAN_JAR} ${XERCES_JAR}
         ${JSS_JAR} ${COMMONS_CODEC_JAR} ${COMMONS_HTTPCLIENT_JAR}
-        ${APACHE_COMMONS_CLI_JAR} ${APACHE_COMMONS_LANG_JAR}
+        ${APACHE_COMMONS_LANG_JAR}
         ${TOMCAT_CATALINA_JAR} ${TOMCAT_UTIL_JAR} ${SYMKEY_JAR}
         ${JAXRS_API_JAR} ${RESTEASY_JAXRS_JAR} ${RESTEASY_ATOM_PROVIDER_JAR}
         ${HTTPCLIENT_JAR} ${HTTPCORE_JAR}
@@ -334,35 +327,3 @@ install(
 )
 
 set(PKI_CMSBUNDLE_JAR ${CMAKE_BINARY_DIR}/dist/pki-cmsbundle.jar INTERNAL "pki-cmsbundle jar file")
-
-
-# build pki-client
-jar(pki-client-jar
-    CREATE
-        ${CMAKE_BINARY_DIR}/dist/pki-client-${APPLICATION_VERSION}.jar
-    INPUT_DIR
-        ${CMAKE_BINARY_DIR}/classes
-    FILES
-        com/netscape/cms/client/*.class
-    DEPENDS
-        pki-cms
-)
-
-link(pki-client
-    SOURCE
-        ${CMAKE_BINARY_DIR}/dist/pki-client.jar
-    DEST
-        pki-client-${APPLICATION_VERSION}.jar
-    DEPENDS
-        pki-client-jar
-)
-
-install(
-    FILES
-        ${CMAKE_BINARY_DIR}/dist/pki-client.jar
-        ${CMAKE_BINARY_DIR}/dist/pki-client-${APPLICATION_VERSION}.jar
-    DESTINATION
-        ${JAVA_JAR_INSTALL_DIR}/pki
-)
-
-set(PKI_CLIENT_JAR ${CMAKE_BINARY_DIR}/dist/pki-client.jar CACHE INTERNAL "pki-client jar file")
diff --git a/base/common/src/com/netscape/cms/client/ca/CAClient.java b/base/common/src/com/netscape/certsrv/ca/CAClient.java
similarity index 97%
rename from base/common/src/com/netscape/cms/client/ca/CAClient.java
rename to base/common/src/com/netscape/certsrv/ca/CAClient.java
index a72f95962d7dbcfa882afe5aad88f21dfb21c743..62e7a24381ce6c3d964c811b43c5ff03f8f987d4 100644
--- a/base/common/src/com/netscape/cms/client/ca/CAClient.java
+++ b/base/common/src/com/netscape/certsrv/ca/CAClient.java
@@ -15,7 +15,7 @@
 //(C) 2012 Red Hat, Inc.
 //All rights reserved.
 //--- END COPYRIGHT BLOCK ---
-package com.netscape.cms.client.ca;
+package com.netscape.certsrv.ca;
 
 import java.net.URISyntaxException;
 import java.util.Collection;
@@ -29,13 +29,13 @@ import com.netscape.certsrv.cert.CertRequestResource;
 import com.netscape.certsrv.cert.CertResource;
 import com.netscape.certsrv.cert.CertReviewResponse;
 import com.netscape.certsrv.cert.CertSearchRequest;
+import com.netscape.certsrv.client.ClientConfig;
+import com.netscape.certsrv.client.PKIClient;
 import com.netscape.certsrv.dbs.certdb.CertId;
 import com.netscape.certsrv.profile.ProfileData;
 import com.netscape.certsrv.profile.ProfileDataInfos;
 import com.netscape.certsrv.profile.ProfileResource;
 import com.netscape.certsrv.request.RequestId;
-import com.netscape.cms.client.ClientConfig;
-import com.netscape.cms.client.PKIClient;
 
 public class CAClient extends PKIClient {
 
diff --git a/base/common/src/com/netscape/cms/client/cert/CertClient.java b/base/common/src/com/netscape/certsrv/cert/CertClient.java
similarity index 77%
rename from base/common/src/com/netscape/cms/client/cert/CertClient.java
rename to base/common/src/com/netscape/certsrv/cert/CertClient.java
index 1fcb9e40d034f25cbf639738755ff8b784b09a34..a92e63522eee62519cc24fcd97622d31abc811b8 100644
--- a/base/common/src/com/netscape/cms/client/cert/CertClient.java
+++ b/base/common/src/com/netscape/certsrv/cert/CertClient.java
@@ -15,25 +15,14 @@
 //(C) 2012 Red Hat, Inc.
 //All rights reserved.
 //--- END COPYRIGHT BLOCK ---
-package com.netscape.cms.client.cert;
+package com.netscape.certsrv.cert;
 
 import java.net.URISyntaxException;
 
-import com.netscape.certsrv.cert.CertData;
-import com.netscape.certsrv.cert.CertDataInfos;
-import com.netscape.certsrv.cert.CertEnrollmentRequest;
-import com.netscape.certsrv.cert.CertRequestInfo;
-import com.netscape.certsrv.cert.CertRequestInfos;
-import com.netscape.certsrv.cert.CertRequestResource;
-import com.netscape.certsrv.cert.CertResource;
-import com.netscape.certsrv.cert.CertReviewResponse;
-import com.netscape.certsrv.cert.CertRevokeRequest;
-import com.netscape.certsrv.cert.CertSearchRequest;
-import com.netscape.certsrv.cert.CertUnrevokeRequest;
+import com.netscape.certsrv.client.ClientConfig;
+import com.netscape.certsrv.client.PKIClient;
 import com.netscape.certsrv.dbs.certdb.CertId;
 import com.netscape.certsrv.request.RequestId;
-import com.netscape.cms.client.ClientConfig;
-import com.netscape.cms.client.PKIClient;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/ClientConfig.java b/base/common/src/com/netscape/certsrv/client/ClientConfig.java
similarity index 99%
rename from base/common/src/com/netscape/cms/client/ClientConfig.java
rename to base/common/src/com/netscape/certsrv/client/ClientConfig.java
index 7299d4d22e7392199f89fdb81b10f53768120e0a..885b60a269a01997798d5b9510ad8a6df0ba71a7 100644
--- a/base/common/src/com/netscape/cms/client/ClientConfig.java
+++ b/base/common/src/com/netscape/certsrv/client/ClientConfig.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client;
+package com.netscape.certsrv.client;
 
 import java.io.StringReader;
 import java.io.StringWriter;
diff --git a/base/common/src/com/netscape/cms/client/PKIClient.java b/base/common/src/com/netscape/certsrv/client/PKIClient.java
similarity index 99%
rename from base/common/src/com/netscape/cms/client/PKIClient.java
rename to base/common/src/com/netscape/certsrv/client/PKIClient.java
index ddd47dab624c7ca6e064a3644a573b95d216de69..5127c052df68d4ed38c2c8c65db3638df94968fb 100644
--- a/base/common/src/com/netscape/cms/client/PKIClient.java
+++ b/base/common/src/com/netscape/certsrv/client/PKIClient.java
@@ -1,4 +1,4 @@
-package com.netscape.cms.client;
+package com.netscape.certsrv.client;
 
 import java.io.File;
 import java.io.IOException;
diff --git a/base/common/src/com/netscape/cms/client/PKIErrorInterceptor.java b/base/common/src/com/netscape/certsrv/client/PKIErrorInterceptor.java
similarity index 98%
rename from base/common/src/com/netscape/cms/client/PKIErrorInterceptor.java
rename to base/common/src/com/netscape/certsrv/client/PKIErrorInterceptor.java
index 445778db41cadd033a3c4dadf15c61a39785ce80..7d29b9fd9d024f55166a4e68981b1c7a971de255 100644
--- a/base/common/src/com/netscape/cms/client/PKIErrorInterceptor.java
+++ b/base/common/src/com/netscape/certsrv/client/PKIErrorInterceptor.java
@@ -15,7 +15,7 @@
 // (C) 2007 Red Hat, Inc.
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
-package com.netscape.cms.client;
+package com.netscape.certsrv.client;
 
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.MultivaluedMap;
diff --git a/base/common/src/com/netscape/cms/client/group/GroupClient.java b/base/common/src/com/netscape/certsrv/group/GroupClient.java
similarity index 86%
rename from base/common/src/com/netscape/cms/client/group/GroupClient.java
rename to base/common/src/com/netscape/certsrv/group/GroupClient.java
index b3784ef46e087fdec548a4efad2e5da5d7ee3f86..43d0ae5d59f6068f1dca338fe255360b94c7f291 100644
--- a/base/common/src/com/netscape/cms/client/group/GroupClient.java
+++ b/base/common/src/com/netscape/certsrv/group/GroupClient.java
@@ -15,20 +15,14 @@
 //(C) 2012 Red Hat, Inc.
 //All rights reserved.
 //--- END COPYRIGHT BLOCK ---
-package com.netscape.cms.client.group;
+package com.netscape.certsrv.group;
 
 import java.net.URISyntaxException;
 
 import org.jboss.resteasy.client.ClientResponse;
 
-import com.netscape.certsrv.group.GroupCollection;
-import com.netscape.certsrv.group.GroupData;
-import com.netscape.certsrv.group.GroupMemberCollection;
-import com.netscape.certsrv.group.GroupMemberData;
-import com.netscape.certsrv.group.GroupMemberResource;
-import com.netscape.certsrv.group.GroupResource;
-import com.netscape.cms.client.ClientConfig;
-import com.netscape.cms.client.PKIClient;
+import com.netscape.certsrv.client.ClientConfig;
+import com.netscape.certsrv.client.PKIClient;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/kra/DRMClient.java b/base/common/src/com/netscape/certsrv/kra/DRMClient.java
similarity index 93%
rename from base/common/src/com/netscape/cms/client/kra/DRMClient.java
rename to base/common/src/com/netscape/certsrv/kra/DRMClient.java
index 4bcf52987131cbc57e5e8875b601d68cdee91cc1..3454e0995c505daa3d02b445b0237d1c70204c17 100644
--- a/base/common/src/com/netscape/cms/client/kra/DRMClient.java
+++ b/base/common/src/com/netscape/certsrv/kra/DRMClient.java
@@ -1,4 +1,4 @@
-package com.netscape.cms.client.kra;
+package com.netscape.certsrv.kra;
 
 import java.net.URISyntaxException;
 import java.util.Collection;
@@ -7,6 +7,8 @@ import java.util.Iterator;
 import org.jboss.resteasy.client.ClientResponse;
 
 import com.netscape.certsrv.cert.CertData;
+import com.netscape.certsrv.client.ClientConfig;
+import com.netscape.certsrv.client.PKIClient;
 import com.netscape.certsrv.dbs.keydb.KeyId;
 import com.netscape.certsrv.key.KeyArchivalRequest;
 import com.netscape.certsrv.key.KeyData;
@@ -18,21 +20,19 @@ import com.netscape.certsrv.key.KeyRequestInfos;
 import com.netscape.certsrv.key.KeyRequestResource;
 import com.netscape.certsrv.key.KeyResource;
 import com.netscape.certsrv.request.RequestId;
-import com.netscape.certsrv.system.SystemCertificateResource;
-import com.netscape.cms.client.ClientConfig;
-import com.netscape.cms.client.PKIClient;
+import com.netscape.certsrv.system.SystemCertResource;
 import com.netscape.cmsutil.util.Utils;
 
 public class DRMClient  extends PKIClient {
 
     private KeyResource keyClient;
     private KeyRequestResource keyRequestClient;
-    private SystemCertificateResource systemCertClient;
+    private SystemCertResource systemCertClient;
 
     public DRMClient(ClientConfig config) throws URISyntaxException {
         super(config);
 
-        systemCertClient = createProxy(SystemCertificateResource.class);
+        systemCertClient = createProxy(SystemCertResource.class);
         keyRequestClient = createProxy(KeyRequestResource.class);
         keyClient = createProxy(KeyResource.class);
     }
diff --git a/base/common/src/com/netscape/certsrv/system/SystemCertificateResource.java b/base/common/src/com/netscape/certsrv/system/SystemCertResource.java
similarity index 92%
rename from base/common/src/com/netscape/certsrv/system/SystemCertificateResource.java
rename to base/common/src/com/netscape/certsrv/system/SystemCertResource.java
index 1096520fc7a0dd0bbc3f2ecfbb26a7f2d322a2c2..d13be9ab4a2f3b8e6a73b9020b175b1c1f486ab4 100644
--- a/base/common/src/com/netscape/certsrv/system/SystemCertificateResource.java
+++ b/base/common/src/com/netscape/certsrv/system/SystemCertResource.java
@@ -11,7 +11,7 @@ import org.jboss.resteasy.annotations.ClientResponseType;
 import com.netscape.certsrv.cert.CertData;
 
 @Path("config/cert")
-public interface SystemCertificateResource {
+public interface SystemCertResource {
 
     /**
      * Used to retrieve the transport certificate
diff --git a/base/common/src/com/netscape/cms/client/system/SystemConfigClient.java b/base/common/src/com/netscape/certsrv/system/SystemConfigClient.java
similarity index 77%
rename from base/common/src/com/netscape/cms/client/system/SystemConfigClient.java
rename to base/common/src/com/netscape/certsrv/system/SystemConfigClient.java
index c9ee28718b5e323cafb07e245522c498abb418a5..876ed9bacc85d6da90eeddf38463852d8ac7a3d9 100644
--- a/base/common/src/com/netscape/cms/client/system/SystemConfigClient.java
+++ b/base/common/src/com/netscape/certsrv/system/SystemConfigClient.java
@@ -15,17 +15,12 @@
 // (C) 2012 Red Hat, Inc.
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
-package com.netscape.cms.client.system;
+package com.netscape.certsrv.system;
 
 import java.net.URISyntaxException;
 
-import com.netscape.certsrv.system.ConfigurationRequest;
-import com.netscape.certsrv.system.ConfigurationResponse;
-import com.netscape.certsrv.system.InstallToken;
-import com.netscape.certsrv.system.InstallTokenRequest;
-import com.netscape.certsrv.system.SystemConfigResource;
-import com.netscape.cms.client.ClientConfig;
-import com.netscape.cms.client.PKIClient;
+import com.netscape.certsrv.client.ClientConfig;
+import com.netscape.certsrv.client.PKIClient;
 
 
 /**
diff --git a/base/common/src/com/netscape/cms/client/user/UserClient.java b/base/common/src/com/netscape/certsrv/user/UserClient.java
similarity index 86%
rename from base/common/src/com/netscape/cms/client/user/UserClient.java
rename to base/common/src/com/netscape/certsrv/user/UserClient.java
index 010468e8ad781975392fec4912c4fd8f413e9a69..95960e53ff8f6b5438b1ebfadb082aed25f6627a 100644
--- a/base/common/src/com/netscape/cms/client/user/UserClient.java
+++ b/base/common/src/com/netscape/certsrv/user/UserClient.java
@@ -15,20 +15,14 @@
 //(C) 2012 Red Hat, Inc.
 //All rights reserved.
 //--- END COPYRIGHT BLOCK ---
-package com.netscape.cms.client.user;
+package com.netscape.certsrv.user;
 
 import java.net.URISyntaxException;
 
 import org.jboss.resteasy.client.ClientResponse;
 
-import com.netscape.certsrv.user.UserCertCollection;
-import com.netscape.certsrv.user.UserCertData;
-import com.netscape.certsrv.user.UserCertResource;
-import com.netscape.certsrv.user.UserCollection;
-import com.netscape.certsrv.user.UserData;
-import com.netscape.certsrv.user.UserResource;
-import com.netscape.cms.client.ClientConfig;
-import com.netscape.cms.client.PKIClient;
+import com.netscape.certsrv.client.ClientConfig;
+import com.netscape.certsrv.client.PKIClient;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/servlet/admin/SystemCertService.java b/base/common/src/com/netscape/cms/servlet/admin/SystemCertService.java
index bd84f114186bafd4fda74e17571b10cdf923d932..8c2d8d9b9ead44c236422543532c9136dbeca2e9 100644
--- a/base/common/src/com/netscape/cms/servlet/admin/SystemCertService.java
+++ b/base/common/src/com/netscape/cms/servlet/admin/SystemCertService.java
@@ -27,7 +27,7 @@ import com.netscape.certsrv.apps.CMS;
 import com.netscape.certsrv.cert.CertData;
 import com.netscape.certsrv.kra.IKeyRecoveryAuthority;
 import com.netscape.certsrv.security.ITransportKeyUnit;
-import com.netscape.certsrv.system.SystemCertificateResource;
+import com.netscape.certsrv.system.SystemCertResource;
 import com.netscape.cms.servlet.base.PKIService;
 
 /**
@@ -36,7 +36,7 @@ import com.netscape.cms.servlet.base.PKIService;
  * @author alee
  *
  */
-public class SystemCertService extends PKIService implements SystemCertificateResource {
+public class SystemCertService extends PKIService implements SystemCertResource {
 
     /**
      * Used to retrieve the transport certificate
diff --git a/base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java b/base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
index 4397251b5ca239e2306de83650d68427fcc5ef02..d63a35b312182222e598c49840827e6ac0b36223 100644
--- a/base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
+++ b/base/common/src/com/netscape/cms/servlet/csadmin/ConfigurationUtils.java
@@ -135,6 +135,7 @@ import com.netscape.certsrv.base.EPropertyNotFound;
 import com.netscape.certsrv.base.IConfigStore;
 import com.netscape.certsrv.base.ISubsystem;
 import com.netscape.certsrv.ca.ICertificateAuthority;
+import com.netscape.certsrv.client.ClientConfig;
 import com.netscape.certsrv.dbs.IDBSubsystem;
 import com.netscape.certsrv.dbs.crldb.ICRLIssuingPointRecord;
 import com.netscape.certsrv.ldap.ILdapConnFactory;
@@ -142,11 +143,10 @@ import com.netscape.certsrv.ocsp.IDefStore;
 import com.netscape.certsrv.ocsp.IOCSPAuthority;
 import com.netscape.certsrv.system.InstallToken;
 import com.netscape.certsrv.system.InstallTokenRequest;
+import com.netscape.certsrv.system.SystemConfigClient;
 import com.netscape.certsrv.usrgrp.IGroup;
 import com.netscape.certsrv.usrgrp.IUGSubsystem;
 import com.netscape.certsrv.usrgrp.IUser;
-import com.netscape.cms.client.ClientConfig;
-import com.netscape.cms.client.system.SystemConfigClient;
 import com.netscape.cmsutil.crypto.CryptoUtil;
 import com.netscape.cmsutil.http.HttpClient;
 import com.netscape.cmsutil.http.HttpRequest;
diff --git a/base/deploy/src/scriptlets/configuration.jy b/base/deploy/src/scriptlets/configuration.jy
index 7433ae4631577365ef73fbb4f6062c62efd2f66d..a53cf9d76c7ae7be678ff1e7f416dad547521f52 100644
--- a/base/deploy/src/scriptlets/configuration.jy
+++ b/base/deploy/src/scriptlets/configuration.jy
@@ -17,7 +17,7 @@ from java.lang import System as javasystem
 
 
 # PKI Java Imports
-from com.netscape.cms.client import ClientConfig
+from com.netscape.certsrv.client import ClientConfig
 
 
 def main(argv):
diff --git a/base/deploy/src/scriptlets/pkijython.py b/base/deploy/src/scriptlets/pkijython.py
index 503e687d040ed60cb1689aece61adf21b78dfdce..c489fb13ffb054450532000b50ead6c87059fbdf 100644
--- a/base/deploy/src/scriptlets/pkijython.py
+++ b/base/deploy/src/scriptlets/pkijython.py
@@ -141,7 +141,7 @@ from org.mozilla.jss.util import Password
 
 
 # PKI Java Imports
-from com.netscape.cms.client.system import SystemConfigClient
+from com.netscape.certsrv.system import SystemConfigClient
 from com.netscape.certsrv.system import SystemCertData
 from com.netscape.certsrv.system import ConfigurationRequest
 from com.netscape.certsrv.system import ConfigurationResponse
diff --git a/base/java-tools/CMakeLists.txt b/base/java-tools/CMakeLists.txt
index 427ded5554684e7e75754b2f3437d91bc4c10688..0ba83caa3e8c5c1bb4b4273740fb9e9b74c44e7d 100644
--- a/base/java-tools/CMakeLists.txt
+++ b/base/java-tools/CMakeLists.txt
@@ -1,4 +1,16 @@
 project(java-tools Java)
 
+
+install(
+    FILES
+        pki
+    DESTINATION
+        ${BIN_INSTALL_DIR}
+    PERMISSIONS
+        OWNER_EXECUTE OWNER_WRITE OWNER_READ
+        GROUP_EXECUTE GROUP_READ
+        WORLD_EXECUTE WORLD_READ
+)
+
 add_subdirectory(src)
 add_subdirectory(templates)
diff --git a/base/setup/pki b/base/java-tools/pki
similarity index 96%
rename from base/setup/pki
rename to base/java-tools/pki
index 598d8f310fdaf1dc8f544dca3aae1955d888e366..0cd6e741db0668582d2822a9d90ca8123a87983a 100755
--- a/base/setup/pki
+++ b/base/java-tools/pki
@@ -72,8 +72,8 @@ if( $ARCHITECTURE eq "i386" ) {
 ###############################################################################
 
 $ENV{CLASSPATH} = "/usr/share/java/${PRODUCT}/pki-certsrv.jar:"
-                . "/usr/share/java/${PRODUCT}/pki-client.jar:"
                 . "/usr/share/java/${PRODUCT}/pki-nsutil.jar:"
+                . "/usr/share/java/${PRODUCT}/pki-tools.jar:"
                 . "/usr/share/java/apache-commons-cli.jar:"
                 . "/usr/share/java/apache-commons-codec.jar:"
                 . "/usr/share/java/apache-commons-lang.jar:"
@@ -108,4 +108,4 @@ foreach (@ARGV) {
     push(@args, quotemeta($_));
 }
 
-system("java -cp $ENV{CLASSPATH} com.netscape.cms.client.cli.MainCLI @args");
+system("java -cp $ENV{CLASSPATH} com.netscape.cmstools.cli.MainCLI @args");
diff --git a/base/java-tools/src/CMakeLists.txt b/base/java-tools/src/CMakeLists.txt
index 8249a0086915936bec3f5c13ae0bac43cb5f8df2..9103d5297ac22c1d73bec8f54565c850adffa500 100644
--- a/base/java-tools/src/CMakeLists.txt
+++ b/base/java-tools/src/CMakeLists.txt
@@ -8,6 +8,20 @@ find_file(JSS_JAR
         /usr/share/java
 )
 
+find_file(APACHE_COMMONS_CLI_JAR
+    NAMES
+        apache-commons-cli.jar
+    PATHS
+        /usr/share/java
+)
+
+find_file(APACHE_COMMONS_LANG_JAR
+    NAMES
+        apache-commons-lang.jar
+    PATHS
+        /usr/share/java
+)
+
 find_file(COMMONS_CODEC_JAR
     NAMES
         commons-codec.jar
@@ -31,14 +45,52 @@ find_file(XERCES_JAR
         /usr/share/java
 )
 
+find_file(JAXRS_API_JAR
+    NAMES
+        jaxrs-api.jar
+    PATHS
+        /usr/share/java/resteasy
+)
+
+find_file(RESTEASY_JAXRS_JAR
+    NAMES
+        resteasy-jaxrs.jar
+    PATHS
+        /usr/share/java/resteasy
+)
+
+find_file(RESTEASY_ATOM_PROVIDER_JAR
+    NAMES
+        resteasy-atom-provider.jar
+    PATHS
+        /usr/share/java/resteasy
+)
+
+find_file(HTTPCLIENT_JAR
+    NAMES
+        httpclient.jar
+    PATHS
+        /usr/share/java/httpcomponents
+)
+
+find_file(HTTPCORE_JAR
+    NAMES
+        httpcore.jar
+    PATHS
+        /usr/share/java/httpcomponents
+)
+
 # build pki-tools
 javac(pki-tools-classes
     SOURCES
         com/netscape/cmstools/*.java
     CLASSPATH
-        ${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR}
+        ${PKI_CERTSRV_JAR} ${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR}
         ${XALAN_JAR} ${XERCES_JAR}
         ${JSS_JAR} ${COMMONS_CODEC_JAR}
+        ${APACHE_COMMONS_CLI_JAR} ${APACHE_COMMONS_LANG_JAR}
+        ${JAXRS_API_JAR} ${RESTEASY_JAXRS_JAR} ${RESTEASY_ATOM_PROVIDER_JAR}
+        ${HTTPCLIENT_JAR} ${HTTPCORE_JAR}
     OUTPUT_DIR
         ${CMAKE_BINARY_DIR}/classes
     DEPENDS
@@ -89,9 +141,12 @@ if(WITH_JAVADOC)
         SUBPACKAGES
             com.netscape.cmstools
         CLASSPATH
-            ${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR}
+            ${PKI_CERTSRV_JAR} ${PKI_NSUTIL_JAR} ${PKI_CMSUTIL_JAR}
             ${XALAN_JAR} ${XERCES_JAR}
             ${JSS_JAR} ${COMMONS_CODEC_JAR}
+            ${APACHE_COMMONS_CLI_JAR} ${APACHE_COMMONS_LANG_JAR}
+            ${JAXRS_API_JAR} ${RESTEASY_JAXRS_JAR} ${RESTEASY_ATOM_PROVIDER_JAR}
+            ${HTTPCLIENT_JAR} ${HTTPCORE_JAR}
         OPTIONS
             -windowtitle 'pki-java-tools'
             -doctitle '<h1>pki-java-tools</h1>'
diff --git a/base/common/src/com/netscape/cms/client/cert/CertCLI.java b/base/java-tools/src/com/netscape/cmstools/cert/CertCLI.java
similarity index 96%
rename from base/common/src/com/netscape/cms/client/cert/CertCLI.java
rename to base/java-tools/src/com/netscape/cmstools/cert/CertCLI.java
index f7bb27597ab249ecc22d7681d7a178c45b4d7389..6857b689ee6bb834f1560e9d806db939e9c34aee 100644
--- a/base/common/src/com/netscape/cms/client/cert/CertCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertCLI.java
@@ -16,18 +16,19 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.cert;
+package com.netscape.cmstools.cert;
 
 import java.util.Arrays;
 
 import org.apache.commons.lang.StringUtils;
 import org.jboss.resteasy.plugins.providers.atom.Link;
 
+import com.netscape.certsrv.cert.CertClient;
 import com.netscape.certsrv.cert.CertData;
 import com.netscape.certsrv.cert.CertDataInfo;
 import com.netscape.certsrv.cert.CertRequestInfo;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/cert/CertFindCLI.java b/base/java-tools/src/com/netscape/cmstools/cert/CertFindCLI.java
similarity index 99%
rename from base/common/src/com/netscape/cms/client/cert/CertFindCLI.java
rename to base/java-tools/src/com/netscape/cmstools/cert/CertFindCLI.java
index f695062246d5a0691b9dca2b0a895e548a502dc2..397df3f93dc98cc3caccd7fb9eaa53a902238a81 100644
--- a/base/common/src/com/netscape/cms/client/cert/CertFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertFindCLI.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.cert;
+package com.netscape.cmstools.cert;
 
 import java.io.FileNotFoundException;
 import java.io.FileReader;
@@ -32,8 +32,8 @@ import com.netscape.certsrv.base.PKIException;
 import com.netscape.certsrv.cert.CertDataInfo;
 import com.netscape.certsrv.cert.CertDataInfos;
 import com.netscape.certsrv.cert.CertSearchRequest;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/cert/CertHoldCLI.java b/base/java-tools/src/com/netscape/cmstools/cert/CertHoldCLI.java
similarity index 96%
rename from base/common/src/com/netscape/cms/client/cert/CertHoldCLI.java
rename to base/java-tools/src/com/netscape/cmstools/cert/CertHoldCLI.java
index 33667f3f0796539143114a0526d2df9727fa8f7e..b5c604a86f21f9ef88b975698a797ee53f59cc51 100644
--- a/base/common/src/com/netscape/cms/client/cert/CertHoldCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertHoldCLI.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.cert;
+package com.netscape.cmstools.cert;
 
 import java.io.BufferedReader;
 import java.io.InputStreamReader;
@@ -31,8 +31,8 @@ import com.netscape.certsrv.cert.CertRequestInfo;
 import com.netscape.certsrv.cert.CertRevokeRequest;
 import com.netscape.certsrv.dbs.certdb.CertId;
 import com.netscape.certsrv.request.RequestStatus;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/cert/CertReleaseHoldCLI.java b/base/java-tools/src/com/netscape/cmstools/cert/CertReleaseHoldCLI.java
similarity index 96%
rename from base/common/src/com/netscape/cms/client/cert/CertReleaseHoldCLI.java
rename to base/java-tools/src/com/netscape/cmstools/cert/CertReleaseHoldCLI.java
index 10408273fd23076636925bcb16eec03eaaa38130..184976f1ea6256c6d126870b9d7ae18c48954917 100644
--- a/base/common/src/com/netscape/cms/client/cert/CertReleaseHoldCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertReleaseHoldCLI.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.cert;
+package com.netscape.cmstools.cert;
 
 import java.io.BufferedReader;
 import java.io.InputStreamReader;
@@ -28,8 +28,8 @@ import com.netscape.certsrv.cert.CertRequestInfo;
 import com.netscape.certsrv.cert.CertUnrevokeRequest;
 import com.netscape.certsrv.dbs.certdb.CertId;
 import com.netscape.certsrv.request.RequestStatus;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/cert/CertRequestApproveCLI.java b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestApproveCLI.java
similarity index 94%
rename from base/common/src/com/netscape/cms/client/cert/CertRequestApproveCLI.java
rename to base/java-tools/src/com/netscape/cmstools/cert/CertRequestApproveCLI.java
index c96f482c8d18e83b6969be0673ba8204e8ab62e0..98a3a2b4f86cf22b931dfe995decb03651ef6f98 100644
--- a/base/common/src/com/netscape/cms/client/cert/CertRequestApproveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestApproveCLI.java
@@ -1,4 +1,4 @@
-package com.netscape.cms.client.cert;
+package com.netscape.cmstools.cert;
 
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
@@ -12,8 +12,8 @@ import org.apache.commons.cli.ParseException;
 
 import com.netscape.certsrv.base.PKIException;
 import com.netscape.certsrv.cert.CertReviewResponse;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 public class CertRequestApproveCLI extends CLI {
     CertCLI parent;
diff --git a/base/common/src/com/netscape/cms/client/cert/CertRequestReviewCLI.java b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestReviewCLI.java
similarity index 96%
rename from base/common/src/com/netscape/cms/client/cert/CertRequestReviewCLI.java
rename to base/java-tools/src/com/netscape/cmstools/cert/CertRequestReviewCLI.java
index 22b1faed39fbe7822b754ea876d824c748c533e7..682314b2545161285220fd4fe85089e97d6d9f6f 100644
--- a/base/common/src/com/netscape/cms/client/cert/CertRequestReviewCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestReviewCLI.java
@@ -1,4 +1,4 @@
-package com.netscape.cms.client.cert;
+package com.netscape.cmstools.cert;
 
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
@@ -14,8 +14,8 @@ import org.apache.commons.cli.ParseException;
 import com.netscape.certsrv.base.PKIException;
 import com.netscape.certsrv.cert.CertReviewResponse;
 import com.netscape.certsrv.request.RequestId;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 public class CertRequestReviewCLI extends CLI {
 
diff --git a/base/common/src/com/netscape/cms/client/cert/CertRequestSubmitCLI.java b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestSubmitCLI.java
similarity index 95%
rename from base/common/src/com/netscape/cms/client/cert/CertRequestSubmitCLI.java
rename to base/java-tools/src/com/netscape/cmstools/cert/CertRequestSubmitCLI.java
index cd974b031dffc405be90edc6af49c45efe2e4f40..3562d48f0206ebaecdc919563688043d1e0848e9 100644
--- a/base/common/src/com/netscape/cms/client/cert/CertRequestSubmitCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertRequestSubmitCLI.java
@@ -1,4 +1,4 @@
-package com.netscape.cms.client.cert;
+package com.netscape.cmstools.cert;
 
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
@@ -14,8 +14,8 @@ import org.apache.commons.cli.ParseException;
 import com.netscape.certsrv.cert.CertEnrollmentRequest;
 import com.netscape.certsrv.cert.CertRequestInfo;
 import com.netscape.certsrv.cert.CertRequestInfos;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 public class CertRequestSubmitCLI extends CLI {
 
diff --git a/base/common/src/com/netscape/cms/client/cert/CertRevokeCLI.java b/base/java-tools/src/com/netscape/cmstools/cert/CertRevokeCLI.java
similarity index 97%
rename from base/common/src/com/netscape/cms/client/cert/CertRevokeCLI.java
rename to base/java-tools/src/com/netscape/cmstools/cert/CertRevokeCLI.java
index de5dddc09cd7eecb0a82f848d8484a987abfcc9f..d8a4d5295cb723e0916253e96dcf06cd305661db 100644
--- a/base/common/src/com/netscape/cms/client/cert/CertRevokeCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertRevokeCLI.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.cert;
+package com.netscape.cmstools.cert;
 
 import java.io.BufferedReader;
 import java.io.InputStreamReader;
@@ -31,8 +31,8 @@ import com.netscape.certsrv.cert.CertRequestInfo;
 import com.netscape.certsrv.cert.CertRevokeRequest;
 import com.netscape.certsrv.dbs.certdb.CertId;
 import com.netscape.certsrv.request.RequestStatus;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/cert/CertShowCLI.java b/base/java-tools/src/com/netscape/cmstools/cert/CertShowCLI.java
similarity index 95%
rename from base/common/src/com/netscape/cms/client/cert/CertShowCLI.java
rename to base/java-tools/src/com/netscape/cmstools/cert/CertShowCLI.java
index 4fcfc8c3d918d5c80ccd31bf62ad5f7fd06a81c2..798514814efde6ecbd72333d4961d25bd7c781fa 100644
--- a/base/common/src/com/netscape/cms/client/cert/CertShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cert/CertShowCLI.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.cert;
+package com.netscape.cmstools.cert;
 
 import java.io.FileWriter;
 import java.io.PrintWriter;
@@ -26,8 +26,8 @@ import org.apache.commons.cli.Option;
 
 import com.netscape.certsrv.cert.CertData;
 import com.netscape.certsrv.dbs.certdb.CertId;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/cli/CLI.java b/base/java-tools/src/com/netscape/cmstools/cli/CLI.java
similarity index 98%
rename from base/common/src/com/netscape/cms/client/cli/CLI.java
rename to base/java-tools/src/com/netscape/cmstools/cli/CLI.java
index 1fd0c0dc42f19cfdafc8bc2fa53d24efd4ec1de0..a1fc4f7f95789b0f08fa4c23d78959270dce139e 100644
--- a/base/common/src/com/netscape/cms/client/cli/CLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cli/CLI.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.cli;
+package com.netscape.cmstools.cli;
 
 import java.util.LinkedHashMap;
 import java.util.Map;
diff --git a/base/common/src/com/netscape/cms/client/cli/MainCLI.java b/base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java
similarity index 97%
rename from base/common/src/com/netscape/cms/client/cli/MainCLI.java
rename to base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java
index 7df2224e9c50e72e34ab5a48561559c70817dc37..a6350e5d8b42e127d773e295805bbfdf6a1a48b9 100644
--- a/base/common/src/com/netscape/cms/client/cli/MainCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/cli/MainCLI.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.cli;
+package com.netscape.cmstools.cli;
 
 import java.io.File;
 import java.net.URISyntaxException;
@@ -30,10 +30,10 @@ import org.mozilla.jss.crypto.CryptoToken;
 import org.mozilla.jss.util.IncorrectPasswordException;
 import org.mozilla.jss.util.Password;
 
-import com.netscape.cms.client.ClientConfig;
-import com.netscape.cms.client.cert.CertCLI;
-import com.netscape.cms.client.group.GroupCLI;
-import com.netscape.cms.client.user.UserCLI;
+import com.netscape.certsrv.client.ClientConfig;
+import com.netscape.cmstools.cert.CertCLI;
+import com.netscape.cmstools.group.GroupCLI;
+import com.netscape.cmstools.user.UserCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/group/GroupAddCLI.java b/base/java-tools/src/com/netscape/cmstools/group/GroupAddCLI.java
similarity index 94%
rename from base/common/src/com/netscape/cms/client/group/GroupAddCLI.java
rename to base/java-tools/src/com/netscape/cmstools/group/GroupAddCLI.java
index f32fffd5d20aa584ea083c86bd5e05aec1277c0f..b4814fbcc378be55575ec06132a493d9a1c64cfb 100644
--- a/base/common/src/com/netscape/cms/client/group/GroupAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupAddCLI.java
@@ -16,14 +16,14 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.group;
+package com.netscape.cmstools.group;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 
 import com.netscape.certsrv.group.GroupData;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/group/GroupAddMemberCLI.java b/base/java-tools/src/com/netscape/cmstools/group/GroupAddMemberCLI.java
similarity index 93%
rename from base/common/src/com/netscape/cms/client/group/GroupAddMemberCLI.java
rename to base/java-tools/src/com/netscape/cmstools/group/GroupAddMemberCLI.java
index 965ad4ee9755d7dd5582f9ec4e42acae6c9172e5..92766cf99720e547de3bf526521ffea81ee8e09c 100644
--- a/base/common/src/com/netscape/cms/client/group/GroupAddMemberCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupAddMemberCLI.java
@@ -16,11 +16,11 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.group;
+package com.netscape.cmstools.group;
 
 import com.netscape.certsrv.group.GroupMemberData;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/group/GroupCLI.java b/base/java-tools/src/com/netscape/cmstools/group/GroupCLI.java
similarity index 95%
rename from base/common/src/com/netscape/cms/client/group/GroupCLI.java
rename to base/java-tools/src/com/netscape/cmstools/group/GroupCLI.java
index b106c6fc114c4cebcb5e62e9b765f309a3de7208..ce28af24375ab38e39da2d9cb2717a9ec12abcd8 100644
--- a/base/common/src/com/netscape/cms/client/group/GroupCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupCLI.java
@@ -16,17 +16,18 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.group;
+package com.netscape.cmstools.group;
 
 import java.util.Arrays;
 
 import org.apache.commons.lang.StringUtils;
 import org.jboss.resteasy.plugins.providers.atom.Link;
 
+import com.netscape.certsrv.group.GroupClient;
 import com.netscape.certsrv.group.GroupData;
 import com.netscape.certsrv.group.GroupMemberData;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/group/GroupFindCLI.java b/base/java-tools/src/com/netscape/cmstools/group/GroupFindCLI.java
similarity index 95%
rename from base/common/src/com/netscape/cms/client/group/GroupFindCLI.java
rename to base/java-tools/src/com/netscape/cmstools/group/GroupFindCLI.java
index 41263c7b92c10b3dbc2516f9d412df7e5b185b77..272e3a8fda0e4c1b2e5610d5b37e089f61e79f2a 100644
--- a/base/common/src/com/netscape/cms/client/group/GroupFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupFindCLI.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.group;
+package com.netscape.cmstools.group;
 
 import java.util.Collection;
 
@@ -25,8 +25,8 @@ import org.apache.commons.cli.Option;
 
 import com.netscape.certsrv.group.GroupCollection;
 import com.netscape.certsrv.group.GroupData;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/group/GroupFindMemberCLI.java b/base/java-tools/src/com/netscape/cmstools/group/GroupFindMemberCLI.java
similarity index 96%
rename from base/common/src/com/netscape/cms/client/group/GroupFindMemberCLI.java
rename to base/java-tools/src/com/netscape/cmstools/group/GroupFindMemberCLI.java
index ca8273270384fd5d7377f2334d1b0e701e121ff7..f0498f0d274227b8b0835a5d6e9895cc32c4f079 100644
--- a/base/common/src/com/netscape/cms/client/group/GroupFindMemberCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupFindMemberCLI.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.group;
+package com.netscape.cmstools.group;
 
 import java.util.Collection;
 
@@ -25,8 +25,8 @@ import org.apache.commons.cli.Option;
 
 import com.netscape.certsrv.group.GroupMemberCollection;
 import com.netscape.certsrv.group.GroupMemberData;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/group/GroupModifyCLI.java b/base/java-tools/src/com/netscape/cmstools/group/GroupModifyCLI.java
similarity index 94%
rename from base/common/src/com/netscape/cms/client/group/GroupModifyCLI.java
rename to base/java-tools/src/com/netscape/cmstools/group/GroupModifyCLI.java
index b2b5c8553b19cfb3cf73baa2ebafa611284dc931..2869ce19df1007309871c00a62210736e0da9bb1 100644
--- a/base/common/src/com/netscape/cms/client/group/GroupModifyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupModifyCLI.java
@@ -16,14 +16,14 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.group;
+package com.netscape.cmstools.group;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 
 import com.netscape.certsrv.group.GroupData;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/group/GroupRemoveCLI.java b/base/java-tools/src/com/netscape/cmstools/group/GroupRemoveCLI.java
similarity index 92%
rename from base/common/src/com/netscape/cms/client/group/GroupRemoveCLI.java
rename to base/java-tools/src/com/netscape/cmstools/group/GroupRemoveCLI.java
index 45e779860cedf1640231021e86a8de6bb4bdec57..744f13b8c72f8bcd55723bad71c659c82b7b8b5b 100644
--- a/base/common/src/com/netscape/cms/client/group/GroupRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupRemoveCLI.java
@@ -16,10 +16,10 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.group;
+package com.netscape.cmstools.group;
 
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 
 /**
diff --git a/base/common/src/com/netscape/cms/client/group/GroupRemoveMemberCLI.java b/base/java-tools/src/com/netscape/cmstools/group/GroupRemoveMemberCLI.java
similarity index 92%
rename from base/common/src/com/netscape/cms/client/group/GroupRemoveMemberCLI.java
rename to base/java-tools/src/com/netscape/cmstools/group/GroupRemoveMemberCLI.java
index 25807ae31cb3f04badd46efb90f7a0847cf67fc1..f46885631699411c2c714ec42365f9c9cff6cba3 100644
--- a/base/common/src/com/netscape/cms/client/group/GroupRemoveMemberCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupRemoveMemberCLI.java
@@ -16,10 +16,10 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.group;
+package com.netscape.cmstools.group;
 
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/group/GroupShowCLI.java b/base/java-tools/src/com/netscape/cmstools/group/GroupShowCLI.java
similarity index 92%
rename from base/common/src/com/netscape/cms/client/group/GroupShowCLI.java
rename to base/java-tools/src/com/netscape/cmstools/group/GroupShowCLI.java
index 3e24f3e5dd18fbd7e8e58f857236adf35a0e6c02..3209c2b37e52bb58b4ff2fcae5aa6f0d009e1dbb 100644
--- a/base/common/src/com/netscape/cms/client/group/GroupShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupShowCLI.java
@@ -16,11 +16,11 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.group;
+package com.netscape.cmstools.group;
 
 import com.netscape.certsrv.group.GroupData;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/group/GroupShowMemberCLI.java b/base/java-tools/src/com/netscape/cmstools/group/GroupShowMemberCLI.java
similarity index 93%
rename from base/common/src/com/netscape/cms/client/group/GroupShowMemberCLI.java
rename to base/java-tools/src/com/netscape/cmstools/group/GroupShowMemberCLI.java
index 9d828416ff85907952f044fc77f83225eec08947..8a4afb688bb1a6f305b52e4e33d90ba69868c492 100644
--- a/base/common/src/com/netscape/cms/client/group/GroupShowMemberCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/group/GroupShowMemberCLI.java
@@ -16,11 +16,11 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.group;
+package com.netscape.cmstools.group;
 
 import com.netscape.certsrv.group.GroupMemberData;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/user/UserAddCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserAddCLI.java
similarity index 96%
rename from base/common/src/com/netscape/cms/client/user/UserAddCLI.java
rename to base/java-tools/src/com/netscape/cmstools/user/UserAddCLI.java
index f65d75cd986d8d960d920d5210af83ca35baf03f..3db8fe5332713e45a936453bf89b8340e8e32a27 100644
--- a/base/common/src/com/netscape/cms/client/user/UserAddCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserAddCLI.java
@@ -16,14 +16,14 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.user;
+package com.netscape.cmstools.user;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 
 import com.netscape.certsrv.user.UserData;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/user/UserAddCertCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserAddCertCLI.java
similarity index 95%
rename from base/common/src/com/netscape/cms/client/user/UserAddCertCLI.java
rename to base/java-tools/src/com/netscape/cmstools/user/UserAddCertCLI.java
index 61ca60137c18d8e69e2af5d8afb3a4cd1682855d..7bec2ff19905438070ca86a3f56bffc86d74f2e8 100644
--- a/base/common/src/com/netscape/cms/client/user/UserAddCertCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserAddCertCLI.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.user;
+package com.netscape.cmstools.user;
 
 import java.io.File;
 import java.util.Scanner;
@@ -25,8 +25,8 @@ import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 
 import com.netscape.certsrv.user.UserCertData;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/user/UserCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserCLI.java
similarity index 96%
rename from base/common/src/com/netscape/cms/client/user/UserCLI.java
rename to base/java-tools/src/com/netscape/cmstools/user/UserCLI.java
index cc9bc8aa539efca07d25bedec700cff485c5f598..301754a22a00adeff3422c518d75f1b8036c1f31 100644
--- a/base/common/src/com/netscape/cms/client/user/UserCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserCLI.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.user;
+package com.netscape.cmstools.user;
 
 import java.util.Arrays;
 
@@ -24,9 +24,10 @@ import org.apache.commons.lang.StringUtils;
 import org.jboss.resteasy.plugins.providers.atom.Link;
 
 import com.netscape.certsrv.user.UserCertData;
+import com.netscape.certsrv.user.UserClient;
 import com.netscape.certsrv.user.UserData;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/user/UserFindCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserFindCLI.java
similarity index 95%
rename from base/common/src/com/netscape/cms/client/user/UserFindCLI.java
rename to base/java-tools/src/com/netscape/cmstools/user/UserFindCLI.java
index c4014987211beea7911945156013ad0e352bbc92..a5b96d1c3cd997db735a1923016cb707d2c72571 100644
--- a/base/common/src/com/netscape/cms/client/user/UserFindCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserFindCLI.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.user;
+package com.netscape.cmstools.user;
 
 import java.util.Collection;
 
@@ -25,8 +25,8 @@ import org.apache.commons.cli.Option;
 
 import com.netscape.certsrv.user.UserCollection;
 import com.netscape.certsrv.user.UserData;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/user/UserFindCertCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserFindCertCLI.java
similarity index 96%
rename from base/common/src/com/netscape/cms/client/user/UserFindCertCLI.java
rename to base/java-tools/src/com/netscape/cmstools/user/UserFindCertCLI.java
index c06d21faf9ddd2105927f6397fa9373902986643..08f6879331f389b78fc0df4126967da6f293d7ed 100644
--- a/base/common/src/com/netscape/cms/client/user/UserFindCertCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserFindCertCLI.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.user;
+package com.netscape.cmstools.user;
 
 import java.util.Collection;
 
@@ -25,8 +25,8 @@ import org.apache.commons.cli.Option;
 
 import com.netscape.certsrv.user.UserCertCollection;
 import com.netscape.certsrv.user.UserCertData;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/user/UserModifyCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserModifyCLI.java
similarity index 96%
rename from base/common/src/com/netscape/cms/client/user/UserModifyCLI.java
rename to base/java-tools/src/com/netscape/cmstools/user/UserModifyCLI.java
index 2eca31f01258ec52d3178a3897786149806b2df5..706224ef9385a9350efff50af528cfdb0c85de61 100644
--- a/base/common/src/com/netscape/cms/client/user/UserModifyCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserModifyCLI.java
@@ -16,14 +16,14 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.user;
+package com.netscape.cmstools.user;
 
 import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 
 import com.netscape.certsrv.user.UserData;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/user/UserRemoveCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserRemoveCLI.java
similarity index 92%
rename from base/common/src/com/netscape/cms/client/user/UserRemoveCLI.java
rename to base/java-tools/src/com/netscape/cmstools/user/UserRemoveCLI.java
index 6c367ec48049aba05e28ef351d12712c4d4b79f3..6bafba8a4689a48ed5d71173fab0f92d89abb1d7 100644
--- a/base/common/src/com/netscape/cms/client/user/UserRemoveCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserRemoveCLI.java
@@ -16,10 +16,10 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.user;
+package com.netscape.cmstools.user;
 
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/user/UserRemoveCertCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserRemoveCertCLI.java
similarity index 93%
rename from base/common/src/com/netscape/cms/client/user/UserRemoveCertCLI.java
rename to base/java-tools/src/com/netscape/cmstools/user/UserRemoveCertCLI.java
index 096e46d642ba419578f75b514e718fe533d7b983..203e48f524f8f6a7865e2e8f3b32abb3fb8ff368 100644
--- a/base/common/src/com/netscape/cms/client/user/UserRemoveCertCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserRemoveCertCLI.java
@@ -16,12 +16,12 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.user;
+package com.netscape.cmstools.user;
 
 import java.net.URLEncoder;
 
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 
 /**
diff --git a/base/common/src/com/netscape/cms/client/user/UserShowCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserShowCLI.java
similarity index 92%
rename from base/common/src/com/netscape/cms/client/user/UserShowCLI.java
rename to base/java-tools/src/com/netscape/cmstools/user/UserShowCLI.java
index d46c5578c4f9bb2e68a35878ebb2ec1cabeb2129..679b67791100a8f936703e88710455c005915931 100644
--- a/base/common/src/com/netscape/cms/client/user/UserShowCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserShowCLI.java
@@ -16,11 +16,11 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.user;
+package com.netscape.cmstools.user;
 
 import com.netscape.certsrv.user.UserData;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
diff --git a/base/common/src/com/netscape/cms/client/user/UserShowCertCLI.java b/base/java-tools/src/com/netscape/cmstools/user/UserShowCertCLI.java
similarity index 95%
rename from base/common/src/com/netscape/cms/client/user/UserShowCertCLI.java
rename to base/java-tools/src/com/netscape/cmstools/user/UserShowCertCLI.java
index 99bc55af0d6e050416af9f06a8efac0b2d467736..f30c72327410dc9552a9999011029d772abf2c4b 100644
--- a/base/common/src/com/netscape/cms/client/user/UserShowCertCLI.java
+++ b/base/java-tools/src/com/netscape/cmstools/user/UserShowCertCLI.java
@@ -16,7 +16,7 @@
 // All rights reserved.
 // --- END COPYRIGHT BLOCK ---
 
-package com.netscape.cms.client.user;
+package com.netscape.cmstools.user;
 
 import java.io.FileWriter;
 import java.io.PrintWriter;
@@ -26,8 +26,8 @@ import org.apache.commons.cli.CommandLine;
 import org.apache.commons.cli.Option;
 
 import com.netscape.certsrv.user.UserCertData;
-import com.netscape.cms.client.cli.CLI;
-import com.netscape.cms.client.cli.MainCLI;
+import com.netscape.cmstools.cli.CLI;
+import com.netscape.cmstools.cli.MainCLI;
 
 /**
  * @author Endi S. Dewata
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 7035803ab39c025e0d5f7715420a48049a88acf6..ec277e5dc144ea6ac705a2d68312656b06c42c4f 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
@@ -37,15 +37,15 @@ import org.mozilla.jss.crypto.KeyGenAlgorithm;
 import org.mozilla.jss.crypto.SymmetricKey;
 import org.mozilla.jss.util.Password;
 
+import com.netscape.certsrv.client.ClientConfig;
 import com.netscape.certsrv.dbs.keydb.KeyId;
 import com.netscape.certsrv.key.KeyData;
 import com.netscape.certsrv.key.KeyDataInfo;
 import com.netscape.certsrv.key.KeyRequestInfo;
 import com.netscape.certsrv.key.KeyRequestResource;
+import com.netscape.certsrv.kra.DRMClient;
 import com.netscape.certsrv.request.RequestId;
 import com.netscape.certsrv.request.RequestNotFoundException;
-import com.netscape.cms.client.ClientConfig;
-import com.netscape.cms.client.kra.DRMClient;
 import com.netscape.cms.servlet.base.PKIService;
 import com.netscape.cmsutil.crypto.CryptoUtil;
 import com.netscape.cmsutil.util.Utils;
diff --git a/base/setup/CMakeLists.txt b/base/setup/CMakeLists.txt
index 54fe3b7f6515d31bef209e36021e61beb6bfd827..05f18332ddddd8170709d97d969b109b41b0d0d0 100644
--- a/base/setup/CMakeLists.txt
+++ b/base/setup/CMakeLists.txt
@@ -2,7 +2,6 @@ project(setup)
 
 install(
     FILES
-        pki
         pkicreate
         pkiremove
         pki-setup-proxy
diff --git a/scripts/compose_pki_core_packages b/scripts/compose_pki_core_packages
index 8e8395180bd98f39865223523821dafa0b0b48cd..628462a2e2b98e97988207db770cad0f29251d66 100755
--- a/scripts/compose_pki_core_packages
+++ b/scripts/compose_pki_core_packages
@@ -39,7 +39,7 @@ PKI_CORE_VERSION="10.0.0.a1"
 ##
 
 PKI_SPECS_FILE="${PKI_DIR}/specs/${PKI_CORE}.spec"
-PKI_COMPONENT_LIST="test deploy setup symkey native-tools util java-tools common selinux ca kra ocsp tks silent"
+PKI_COMPONENT_LIST="test setup symkey util common native-tools java-tools deploy selinux ca kra ocsp tks silent"
 
 
 ##
diff --git a/specs/pki-core.spec b/specs/pki-core.spec
index c3333ae603b3ca1cfe93254852e8ebf9fa2e314a..1fba04cfce21e667bee24092425fd8132f6097bd 100644
--- a/specs/pki-core.spec
+++ b/specs/pki-core.spec
@@ -14,7 +14,7 @@ distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
 
 Name:             pki-core
 Version:          10.0.0
-Release:          %{?relprefix}25%{?prerel}%{?dist}
+Release:          %{?relprefix}26%{?prerel}%{?dist}
 Summary:          Certificate System - PKI Core Components
 URL:              http://pki.fedoraproject.org/
 License:          GPLv2
@@ -1103,7 +1103,6 @@ fi
 %files -n pki-setup
 %defattr(-,root,root,-)
 %doc base/setup/LICENSE
-%{_bindir}/pki
 %{_bindir}/pkicreate
 %{_bindir}/pkiremove
 %{_bindir}/pki-setup-proxy
@@ -1150,8 +1149,6 @@ fi
 %{_javadir}/pki/pki-nsutil.jar
 %{_javadir}/pki/pki-certsrv-%{version}.jar
 %{_javadir}/pki/pki-certsrv.jar
-%{_javadir}/pki/pki-client-%{version}.jar
-%{_javadir}/pki/pki-client.jar
 
 %if %{?_without_javadoc:0}%{!?_without_javadoc:1}
 %files -n pki-common-javadoc
@@ -1163,6 +1160,7 @@ fi
 %files -n pki-tools
 %defattr(-,root,root,-)
 %doc base/native-tools/LICENSE base/native-tools/doc/README
+%{_bindir}/pki
 %{_bindir}/p7tool
 %{_bindir}/revoker
 %{_bindir}/setpin
@@ -1426,6 +1424,9 @@ fi
 
 
 %changelog
+* Mon Aug 20 2012 Endi S. Dewata <edewata@redhat.com> 10.0.0-0.26.a1
+- Split pki-client.jar into pki-certsrv.jar and pki-tools.jar.
+
 * Mon Aug 20 2012 Endi S. Dewata <edewata@redhat.com> 10.0.0-0.25.a1
 - Merged pki-native-tools and pki-java-tools into pki-tools.
 - Modified pki-server to depend on pki-tools.
-- 
1.7.11.2

