summaryrefslogtreecommitdiffstats
path: root/base/common/src/com
diff options
context:
space:
mode:
authorEndi Sukma Dewata <edewata@redhat.com>2013-02-07 15:59:18 -0500
committerEndi Sukma Dewata <edewata@redhat.com>2013-02-12 19:00:07 -0500
commit12bd85dc50052107e5dccff56f4110b133aafdc1 (patch)
tree3e20240bdea5b008580585aef31d62472f4eff9d /base/common/src/com
parent8acab668775a85931c33e68eb79b2cf822b7c631 (diff)
downloadpki-12bd85dc50052107e5dccff56f4110b133aafdc1.tar.gz
pki-12bd85dc50052107e5dccff56f4110b133aafdc1.tar.xz
pki-12bd85dc50052107e5dccff56f4110b133aafdc1.zip
Added certificate status option for cert-find.
The cert-find command has been modified to provide an option to search by certificate status. Ticket #501
Diffstat (limited to 'base/common/src/com')
-rw-r--r--base/common/src/com/netscape/certsrv/cert/CertSearchRequest.java14
-rw-r--r--base/common/src/com/netscape/cms/servlet/cert/FilterBuilder.java11
2 files changed, 25 insertions, 0 deletions
diff --git a/base/common/src/com/netscape/certsrv/cert/CertSearchRequest.java b/base/common/src/com/netscape/certsrv/cert/CertSearchRequest.java
index 7939a02b4..33ff3fc68 100644
--- a/base/common/src/com/netscape/certsrv/cert/CertSearchRequest.java
+++ b/base/common/src/com/netscape/certsrv/cert/CertSearchRequest.java
@@ -81,6 +81,10 @@ public class CertSearchRequest {
@XmlElement
protected boolean matchExactly;
+ //Status
+ @XmlElement
+ protected String status;
+
//Revoked By
@XmlElement
@@ -366,6 +370,16 @@ public class CertSearchRequest {
this.matchExactly = matchExactly;
}
+ //Status
+
+ public String getStatus() {
+ return status;
+ }
+
+ public void setStatus(String status) {
+ this.status = status;
+ }
+
//Revoked On
public String getRevokedOnTo() {
diff --git a/base/common/src/com/netscape/cms/servlet/cert/FilterBuilder.java b/base/common/src/com/netscape/cms/servlet/cert/FilterBuilder.java
index b8e32295a..46c597b4d 100644
--- a/base/common/src/com/netscape/cms/servlet/cert/FilterBuilder.java
+++ b/base/common/src/com/netscape/cms/servlet/cert/FilterBuilder.java
@@ -42,6 +42,7 @@ public class FilterBuilder {
StringBuffer filter = new StringBuffer();
buildSerialNumberRangeFilter(filter);
buildSubjectFilter(filter);
+ buildStatusFilter(filter);
buildRevokedByFilter(filter);
buildRevokedOnFilter(filter);
buildRevocationReasonFilter(filter);
@@ -120,6 +121,16 @@ public class FilterBuilder {
}
}
+ private void buildStatusFilter(StringBuffer filter) {
+ String status = request.getStatus();
+ if (status == null || status.equals("")) {
+ return;
+ }
+ filter.append("(certStatus=");
+ filter.append(LDAPUtil.escapeFilter(status));
+ filter.append(")");
+ }
+
private void buildRevokedByFilter(StringBuffer filter) {
if (!request.getRevokedByInUse()) {
return;