KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejbca > core > protocol > ws > objects > RevokeStatus


1 package org.ejbca.core.protocol.ws.objects;
2
3 import java.util.Date JavaDoc;
4
5 import org.ejbca.core.model.ca.crl.RevokedCertInfo;
6
7 /**
8  * Class used when checking the revokation status of a certificate.
9  *
10  * Contains the following data:
11  * IssuerDN
12  * CertificateSN (hex)
13  * RevokationDate
14  * Reason (One of the REVOKATION_REASON constants)
15  *
16  * @author Philip Vendil
17  * $id$
18  */

19
20 public class RevokeStatus {
21     
22     /** Constants defining different revokation reasons. */
23     public static final int NOT_REVOKED = RevokedCertInfo.NOT_REVOKED;
24     public static final int REVOKATION_REASON_UNSPECIFIED = RevokedCertInfo.REVOKATION_REASON_UNSPECIFIED;
25     public static final int REVOKATION_REASON_KEYCOMPROMISE = RevokedCertInfo.REVOKATION_REASON_KEYCOMPROMISE;
26     public static final int REVOKATION_REASON_CACOMPROMISE = RevokedCertInfo.REVOKATION_REASON_CACOMPROMISE;
27     public static final int REVOKATION_REASON_AFFILIATIONCHANGED = RevokedCertInfo.REVOKATION_REASON_AFFILIATIONCHANGED;
28     public static final int REVOKATION_REASON_SUPERSEDED = RevokedCertInfo.REVOKATION_REASON_SUPERSEDED;
29     public static final int REVOKATION_REASON_CESSATIONOFOPERATION = RevokedCertInfo.REVOKATION_REASON_CESSATIONOFOPERATION;
30     public static final int REVOKATION_REASON_CERTIFICATEHOLD = RevokedCertInfo.REVOKATION_REASON_CERTIFICATEHOLD;
31     public static final int REVOKATION_REASON_REMOVEFROMCRL = RevokedCertInfo.REVOKATION_REASON_REMOVEFROMCRL;
32     public static final int REVOKATION_REASON_PRIVILEGESWITHDRAWN = RevokedCertInfo.REVOKATION_REASON_PRIVILEGESWITHDRAWN;
33     public static final int REVOKATION_REASON_AACOMPROMISE = RevokedCertInfo.REVOKATION_REASON_AACOMPROMISE;
34     
35     private String JavaDoc issuerDN;
36     private String JavaDoc certificateSN;
37     private Date JavaDoc revocationDate;
38     private int reason;
39     
40     
41     /** Default Web Service Constuctor */
42     public RevokeStatus(){}
43     
44     public RevokeStatus(RevokedCertInfo info, String JavaDoc issuerDN){
45         certificateSN = info.getUserCertificate().toString(16);
46         this.issuerDN = issuerDN;
47         revocationDate = info.getRevocationDate();
48         reason = info.getReason();
49     }
50
51     /**
52      * @return Returns the reason.
53      */

54     public int getReason() {
55         return reason;
56     }
57
58     /**
59      * @param reason The reason to set.
60      */

61     public void setReason(int reason) {
62         this.reason = reason;
63     }
64
65     /**
66      * @return Returns the revocationDate.
67      */

68     public Date JavaDoc getRevocationDate() {
69         return revocationDate;
70     }
71
72     /**
73      * @param revocationDate The revocationDate to set.
74      */

75     public void setRevocationDate(Date JavaDoc revocationDate) {
76         this.revocationDate = revocationDate;
77     }
78
79     /**
80      * @return Returns the certificateSN in hex format.
81      */

82     public String JavaDoc getCertificateSN() {
83         return certificateSN;
84     }
85
86     /**
87      * @param certificateSN The certificateSN to set in hex format
88      */

89     public void setCertificateSN(String JavaDoc certificateSN) {
90         this.certificateSN = certificateSN;
91     }
92
93     /**
94      * @return Returns the issuerDN.
95      */

96     public String JavaDoc getIssuerDN() {
97         return issuerDN;
98     }
99
100     /**
101      * @param issuerDN The issuerDN to set.
102      */

103     public void setIssuerDN(String JavaDoc issuerDN) {
104         this.issuerDN = issuerDN;
105     }
106     
107
108
109 }
110
Popular Tags