summaryrefslogtreecommitdiffstats
path: root/base/common/src/com/netscape/certsrv/key/KeyClient.java
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-10-25 11:52:15 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2012-10-29 10:38:38 -0500
commitc1aa8b2d05cb1873990d1a3e9cf007cca240f135 (patch)
treef12c76eaa1c385a79e40e7b38123360279c05fc0 /base/common/src/com/netscape/certsrv/key/KeyClient.java
parent748605a324266bb515a3d1124bc55deb3be4df71 (diff)
downloadpki-c1aa8b2d05cb1873990d1a3e9cf007cca240f135.tar.gz
pki-c1aa8b2d05cb1873990d1a3e9cf007cca240f135.tar.xz
pki-c1aa8b2d05cb1873990d1a3e9cf007cca240f135.zip
Enabled authentication for key services.
The web.xml in KRA has been modified to enable the authentication for key and key request services. Some tools have been added to access the services via command-line. Ticket #376
Diffstat (limited to 'base/common/src/com/netscape/certsrv/key/KeyClient.java')
-rw-r--r--base/common/src/com/netscape/certsrv/key/KeyClient.java75
1 files changed, 75 insertions, 0 deletions
diff --git a/base/common/src/com/netscape/certsrv/key/KeyClient.java b/base/common/src/com/netscape/certsrv/key/KeyClient.java
new file mode 100644
index 000000000..ce2946c1e
--- /dev/null
+++ b/base/common/src/com/netscape/certsrv/key/KeyClient.java
@@ -0,0 +1,75 @@
+//--- 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) 2012 Red Hat, Inc.
+//All rights reserved.
+//--- END COPYRIGHT BLOCK ---
+package com.netscape.certsrv.key;
+
+import java.net.URISyntaxException;
+
+import com.netscape.certsrv.client.ClientConfig;
+import com.netscape.certsrv.client.PKIClient;
+import com.netscape.certsrv.client.PKIConnection;
+import com.netscape.certsrv.request.RequestId;
+
+/**
+ * @author Endi S. Dewata
+ */
+public class KeyClient extends PKIClient {
+
+ public KeyResource keyClient;
+ public KeyRequestResource keyRequestClient;
+
+ public KeyClient(PKIConnection connection) throws URISyntaxException {
+ super(connection);
+ init();
+ }
+
+ public KeyClient(ClientConfig config) throws URISyntaxException {
+ super(config);
+ init();
+ }
+
+ public void init() throws URISyntaxException {
+ keyClient = createProxy(KeyResource.class);
+ keyRequestClient = createProxy(KeyRequestResource.class);
+ }
+
+ public KeyDataInfos findKeys(String clientID, String status, Integer maxSize, Integer maxTime) {
+ return keyClient.listKeys(clientID, status, maxSize, maxTime);
+ }
+
+ public KeyData retrieveKey(KeyRecoveryRequest data) {
+ return keyClient.retrieveKey(data);
+ }
+
+ public KeyRequestInfos findKeyRequests(
+ String requestState,
+ String requestType,
+ String clientID,
+ RequestId start,
+ Integer pageSize,
+ Integer maxResults,
+ Integer maxTime) {
+ return keyRequestClient.listRequests(
+ requestState,
+ requestType,
+ clientID,
+ start,
+ pageSize,
+ maxResults,
+ maxTime);
+ }
+}