KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejbca > core > model > ca > crl > RevokedCertInfo


1 /*************************************************************************
2  * *
3  * EJBCA: The OpenSource Certificate Authority *
4  * *
5  * This software is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU Lesser General Public *
7  * License as published by the Free Software Foundation; either *
8  * version 2.1 of the License, or any later version. *
9  * *
10  * See terms of license at gnu.org. *
11  * *
12  *************************************************************************/

13  
14 package org.ejbca.core.model.ca.crl;
15
16 import java.math.BigInteger JavaDoc;
17 import java.util.Date JavaDoc;
18
19 /**
20  * Holds information about a revoked certificate. The information kept here is the
21  * information that goes into a CRLEntry.
22  *
23  * @version $Id: RevokedCertInfo.java,v 1.1 2006/01/17 20:28:08 anatom Exp $
24  **/

25 public class RevokedCertInfo extends java.lang.Object JavaDoc implements java.io.Serializable JavaDoc {
26     
27     /** Constants defining different revokation reasons. */
28     public static final int NOT_REVOKED = -1;
29     public static final int REVOKATION_REASON_UNSPECIFIED = 0;
30     public static final int REVOKATION_REASON_KEYCOMPROMISE = 1;
31     public static final int REVOKATION_REASON_CACOMPROMISE = 2;
32     public static final int REVOKATION_REASON_AFFILIATIONCHANGED = 3;
33     public static final int REVOKATION_REASON_SUPERSEDED = 4;
34     public static final int REVOKATION_REASON_CESSATIONOFOPERATION = 5;
35     public static final int REVOKATION_REASON_CERTIFICATEHOLD = 6;
36     public static final int REVOKATION_REASON_REMOVEFROMCRL = 8;
37     public static final int REVOKATION_REASON_PRIVILEGESWITHDRAWN = 9;
38     public static final int REVOKATION_REASON_AACOMPROMISE = 10;
39     
40
41     private BigInteger JavaDoc userCertificate;
42     private Date JavaDoc revocationDate;
43     private int reason;
44
45     /**
46      * Constuctor filling in the whole object.
47      *
48      **/

49     public RevokedCertInfo(BigInteger JavaDoc serno, Date JavaDoc date, int reason)
50     {
51         this.userCertificate = serno;
52         this.revocationDate = date;
53         this.reason = reason;
54     }
55
56     /**
57      * Certificate serial number
58      **/

59     public BigInteger JavaDoc getUserCertificate() {
60         return this.userCertificate;
61     }
62
63     /**
64      * Certificate serial number
65      **/

66     public void setUserCertificate( BigInteger JavaDoc serno ) {
67         this.userCertificate = serno;
68     }
69
70     /**
71      * Date when the certificate was revoked.
72      **/

73     public Date JavaDoc getRevocationDate() {
74         return this.revocationDate;
75     }
76
77     /**
78      * Date when the certificate was revoked.
79      **/

80     public void setRevocationDate( Date JavaDoc date ) {
81         this.revocationDate = date;
82     }
83
84
85     /**
86      * The reason the certificate was revoked.
87      * <pre>
88      * ReasonFlags ::= BIT STRING {
89      * unspecified(0),
90      * keyCompromise(1),
91      * cACompromise(2),
92      * affiliationChanged(3),
93      * superseded(4),
94      * cessationOfOperation(5),
95      * certficateHold(6)
96      * removeFromCRL(8)
97      * privilegeWithdrawn(9)
98      * aACompromise(10)
99      * }
100      * </pre>
101      **/

102     public int getReason() {
103         return this.reason;
104     }
105
106     /**
107      * The reason the certificate was revoked.
108      **/

109     public void setReason( int reason ) {
110         this.reason = reason;
111     }
112
113     public String JavaDoc toString() {
114         return this.userCertificate == null ? "null" : this.userCertificate.toString();
115     }
116 }
117
Popular Tags