summaryrefslogtreecommitdiffstats
path: root/base/tks/src
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-03-24 02:27:47 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2012-03-26 11:43:54 -0500
commit621d9e5c413e561293d7484b93882d985b3fe15f (patch)
tree638f3d75761c121d9a8fb50b52a12a6686c5ac5c /base/tks/src
parent40d3643b8d91886bf210aa27f711731c81a11e49 (diff)
downloadpki-621d9e5c413e561293d7484b93882d985b3fe15f.tar.gz
pki-621d9e5c413e561293d7484b93882d985b3fe15f.tar.xz
pki-621d9e5c413e561293d7484b93882d985b3fe15f.zip
Removed unnecessary pki folder.
Previously the source code was located inside a pki folder. This folder was created during svn migration and is no longer needed. This folder has now been removed and the contents have been moved up one level. Ticket #131
Diffstat (limited to 'base/tks/src')
-rw-r--r--base/tks/src/CMakeLists.txt96
-rw-r--r--base/tks/src/com/netscape/tks/TKSAuthority.java160
2 files changed, 256 insertions, 0 deletions
diff --git a/base/tks/src/CMakeLists.txt b/base/tks/src/CMakeLists.txt
new file mode 100644
index 000000000..852ad7bf4
--- /dev/null
+++ b/base/tks/src/CMakeLists.txt
@@ -0,0 +1,96 @@
+project(pki-tks_java Java)
+
+# '/usr/share/java/pki' jars
+find_file(PKI_CERTSRV_JAR
+ NAMES
+ pki-certsrv.jar
+ PATHS
+ /usr/share/java/pki
+)
+
+find_file(PKI_CMS_JAR
+ NAMES
+ pki-cms.jar
+ PATHS
+ /usr/share/java/pki
+)
+
+find_file(PKI_CMSCORE_JAR
+ NAMES
+ pki-cmscore.jar
+ PATHS
+ /usr/share/java/pki
+)
+
+find_file(PKI_CMSUTIL_JAR
+ NAMES
+ pki-cmsutil.jar
+ PATHS
+ /usr/share/java/pki
+)
+
+find_file(PKI_NSUTIL_JAR
+ NAMES
+ pki-nsutil.jar
+ PATHS
+ ${JAVA_LIB_INSTALL_DIR}
+ /usr/share/java/pki
+)
+
+
+# '/usr/share/java' jars
+find_file(LDAPJDK_JAR
+ NAMES
+ ldapjdk.jar
+ PATHS
+ /usr/share/java
+)
+
+
+# '${JAVA_LIB_INSTALL_DIR}' jars
+find_file(JSS_JAR
+ NAMES
+ jss4.jar
+ PATHS
+ ${JAVA_LIB_INSTALL_DIR}
+)
+
+find_file(COMMONS_CODEC_JAR
+ NAMES
+ commons-codec.jar
+ PATHS
+ /usr/share/java
+)
+
+find_file(SYMKEY_JAR
+ NAMES
+ symkey.jar
+ PATHS
+ ${JAVA_LIB_INSTALL_DIR}
+)
+
+
+# identify java sources
+set(pki-tks_java_SRCS
+ com/netscape/tks/TKSAuthority.java
+)
+
+
+# set classpath
+set(CMAKE_JAVA_INCLUDE_PATH
+ ${PKI_CERTSRV_JAR} ${PKI_CMS_JAR} ${PKI_CMSCORE_JAR}
+ ${PKI_CMSUTIL_JAR} ${PKI_NSUTIL_JAR}
+ ${LDAPJDK_JAR}
+ ${JSS_JAR} ${COMMONS_CODEC_JAR} ${SYMKEY_JAR})
+
+
+# set version
+set(CMAKE_JAVA_TARGET_VERSION ${APPLICATION_VERSION})
+
+
+# build pki-tks.jar
+add_jar(pki-tks ${pki-tks_java_SRCS})
+add_dependencies(pki-tks symkey pki-nsutil pki-cmsutil pki-certsrv pki-cms pki-cmscore)
+install_jar(pki-tks ${JAVA_JAR_INSTALL_DIR}/pki)
+set(PKI_TKS_JAR ${pki-tks_JAR_FILE} CACHE INTERNAL "pki-tks jar file")
+
diff --git a/base/tks/src/com/netscape/tks/TKSAuthority.java b/base/tks/src/com/netscape/tks/TKSAuthority.java
new file mode 100644
index 000000000..1987659c4
--- /dev/null
+++ b/base/tks/src/com/netscape/tks/TKSAuthority.java
@@ -0,0 +1,160 @@
+// --- BEGIN COPYRIGHT BLOCK ---
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; version 2 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program; if not, write to the Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+//
+// (C) 2007 Red Hat, Inc.
+// All rights reserved.
+// --- END COPYRIGHT BLOCK ---
+package com.netscape.tks;
+
+import com.netscape.certsrv.apps.CMS;
+import com.netscape.certsrv.authority.IAuthority;
+import com.netscape.certsrv.base.EBaseException;
+import com.netscape.certsrv.base.IConfigStore;
+import com.netscape.certsrv.base.ISubsystem;
+import com.netscape.certsrv.logging.ILogger;
+import com.netscape.certsrv.request.IRequestListener;
+import com.netscape.certsrv.request.IRequestQueue;
+
+public class TKSAuthority implements IAuthority, ISubsystem {
+ protected ILogger mLogger = CMS.getLogger();
+ private String mNickname = null;
+ private ISubsystem mOwner;
+ private IConfigStore mConfig = null;
+ protected String mId = null;
+ public static final String PROP_NICKNAME = "nickName";
+
+ /**
+ * Retrieves the request queue for the Authority.
+ * <P>
+ *
+ * @return the request queue.
+ */
+ public IRequestQueue getRequestQueue() {
+ return null;
+ }
+
+ /**
+ * Registers request completed class.
+ */
+ public void registerRequestListener(IRequestListener listener) {
+ }
+
+ /**
+ * Registers pending request class.
+ */
+ public void registerPendingListener(IRequestListener listener) {
+ }
+
+ /**
+ * log interface
+ */
+ public void log(int level, String msg) {
+ mLogger.log(ILogger.EV_SYSTEM, ILogger.S_TKS,
+ level, msg);
+ }
+
+ /**
+ * nickname of signing (id) cert
+ */
+ public void setNickname(String nickname) {
+ mNickname = nickname;
+ }
+
+ public String getNickname() {
+ CMS.debug("Error: TKSAuthority::getNickname - nickname of signing (id) cert");
+ return mNickname;
+ }
+
+ public String getOfficialName() {
+ return "tks";
+ }
+
+ /**
+ * Initializes this subsystem.
+ * <P>
+ *
+ * @param owner owner of this subsystem
+ * @param config configuration of this subsystem
+ * @exception EBaseException failed to initialize this RA
+ */
+ public void init(ISubsystem owner, IConfigStore config) throws
+ EBaseException {
+ mOwner = owner;
+
+ mConfig = config;
+ //mNickname = mConfig.getString(PROP_NICKNAME);
+ CMS.debug("TKS Authority (" +
+ getId() + "): " + "Initialized Request Processor.");
+
+ }
+
+ /**
+ * Notifies this subsystem if owner is in running mode.
+ *
+ * @exception EBaseException failed to start up
+ */
+ public void startup() throws EBaseException {
+
+ // Note that we use our instance id for registration.
+ // This helps us to support multiple instances
+ // of a subsystem within server.
+
+ }
+
+ /**
+ * Stops this system. The owner may call shutdown
+ * anytime after initialization.
+ * <P>
+ */
+ public void shutdown() {
+
+ getLogger().log(ILogger.EV_SYSTEM, ILogger.S_TKS,
+ ILogger.LL_INFO, "TKSAuthority is stopped");
+
+ }
+
+ /**
+ * Returns the root configuration storage of this system.
+ * <P>
+ *
+ * @return configuration store of this subsystem
+ */
+ public IConfigStore getConfigStore() {
+ return mConfig;
+ }
+
+ public String getId() {
+ return mId;
+ }
+
+ /**
+ * Sets subsystem identifier.
+ *
+ * @param id subsystem id
+ * @exception EBaseException failed to set id
+ */
+ public void setId(String id) throws EBaseException {
+ mId = id;
+ }
+
+ /**
+ * Retrieves logger from escrow authority.
+ *
+ * @return logger
+ */
+ public ILogger getLogger() {
+ return CMS.getLogger();
+ }
+
+}