summaryrefslogtreecommitdiffstats
path: root/base/common/src/com/netscape/certsrv/dbs
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2012-05-23 14:14:38 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2012-07-11 09:21:09 -0500
commita25705a6fff3525b26a855d03f0c117bfadc1979 (patch)
treef7bd74cd3c9e866e784c6561bcc12a315959c77e /base/common/src/com/netscape/certsrv/dbs
parent778091c087b072a2e5c56ed1cffbee683d421363 (diff)
downloadpki-a25705a6fff3525b26a855d03f0c117bfadc1979.tar.gz
pki-a25705a6fff3525b26a855d03f0c117bfadc1979.tar.xz
pki-a25705a6fff3525b26a855d03f0c117bfadc1979.zip
Added cert revocation REST service.
The cert revocation REST service is based on DoRevoke and DoUnrevoke servlets. It provides an interface to manage certificate revocation. Ticket #161
Diffstat (limited to 'base/common/src/com/netscape/certsrv/dbs')
-rw-r--r--base/common/src/com/netscape/certsrv/dbs/certdb/CertIdAdapter.java7
-rw-r--r--base/common/src/com/netscape/certsrv/dbs/keydb/KeyIdAdapter.java7
2 files changed, 8 insertions, 6 deletions
diff --git a/base/common/src/com/netscape/certsrv/dbs/certdb/CertIdAdapter.java b/base/common/src/com/netscape/certsrv/dbs/certdb/CertIdAdapter.java
index cfafff064..f6e46cad5 100644
--- a/base/common/src/com/netscape/certsrv/dbs/certdb/CertIdAdapter.java
+++ b/base/common/src/com/netscape/certsrv/dbs/certdb/CertIdAdapter.java
@@ -19,19 +19,20 @@ package com.netscape.certsrv.dbs.certdb;
import javax.xml.bind.annotation.adapters.XmlAdapter;
+import org.apache.commons.lang.StringUtils;
+
/**
* The CertIdAdapter class provides custom marshaling for CertId.
*
* @author Endi S. Dewata
- * @version $Revision$ $Date$
*/
public class CertIdAdapter extends XmlAdapter<String, CertId> {
public CertId unmarshal(String value) throws Exception {
- return new CertId(value);
+ return StringUtils.isEmpty(value) ? null : new CertId(value);
}
public String marshal(CertId value) throws Exception {
- return value.toString();
+ return value == null ? null : value.toHexString();
}
}
diff --git a/base/common/src/com/netscape/certsrv/dbs/keydb/KeyIdAdapter.java b/base/common/src/com/netscape/certsrv/dbs/keydb/KeyIdAdapter.java
index 3232999fd..0f0c43c82 100644
--- a/base/common/src/com/netscape/certsrv/dbs/keydb/KeyIdAdapter.java
+++ b/base/common/src/com/netscape/certsrv/dbs/keydb/KeyIdAdapter.java
@@ -19,19 +19,20 @@ package com.netscape.certsrv.dbs.keydb;
import javax.xml.bind.annotation.adapters.XmlAdapter;
+import org.apache.commons.lang.StringUtils;
+
/**
* The KeyIdAdapter class provides custom marshaling for KeyId.
*
* @author Endi S. Dewata
- * @version $Revision$ $Date$
*/
public class KeyIdAdapter extends XmlAdapter<String, KeyId> {
public KeyId unmarshal(String value) throws Exception {
- return new KeyId(value);
+ return StringUtils.isEmpty(value) ? null : new KeyId(value);
}
public String marshal(KeyId value) throws Exception {
- return value.toString();
+ return value == null ? null : value.toString();
}
}