Botan  1.10.9
crl_ent.h
Go to the documentation of this file.
1 /*
2 * CRL Entry
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Distributed under the terms of the Botan license
6 */
7 
8 #ifndef BOTAN_CRL_ENTRY_H__
9 #define BOTAN_CRL_ENTRY_H__
10 
11 #include <botan/x509cert.h>
12 
13 namespace Botan {
14 
15 /**
16 * This class represents CRL entries
17 */
18 class BOTAN_DLL CRL_Entry : public ASN1_Object
19  {
20  public:
21  void encode_into(class DER_Encoder&) const;
22  void decode_from(class BER_Decoder&);
23 
24  /**
25  * Get the serial number of the certificate associated with this entry.
26  * @return certificate's serial number
27  */
28  MemoryVector<byte> serial_number() const { return serial; }
29 
30  /**
31  * Get the revocation date of the certificate associated with this entry
32  * @return certificate's revocation date
33  */
34  X509_Time expire_time() const { return time; }
35 
36  /**
37  * Get the entries reason code
38  * @return reason code
39  */
40  CRL_Code reason_code() const { return reason; }
41 
42  /**
43  * Construct an empty CRL entry.
44  */
45  CRL_Entry(bool throw_on_unknown_critical_extension = false);
46 
47  /**
48  * Construct an CRL entry.
49  * @param cert the certificate to revoke
50  * @param reason the reason code to set in the entry
51  */
52  CRL_Entry(const X509_Certificate& cert,
53  CRL_Code reason = UNSPECIFIED);
54 
55  private:
56  bool throw_on_unknown_critical;
57  MemoryVector<byte> serial;
58  X509_Time time;
59  CRL_Code reason;
60  };
61 
62 /**
63 * Test two CRL entries for equality in all fields.
64 */
65 BOTAN_DLL bool operator==(const CRL_Entry&, const CRL_Entry&);
66 
67 /**
68 * Test two CRL entries for inequality in at least one field.
69 */
70 BOTAN_DLL bool operator!=(const CRL_Entry&, const CRL_Entry&);
71 
72 }
73 
74 #endif
bool operator!=(const OctetString &s1, const OctetString &s2)
Definition: symkey.cpp:106
bool operator==(const OctetString &s1, const OctetString &s2)
Definition: symkey.cpp:98
Definition: crl_ent.h:18
X509_Time expire_time() const
Definition: crl_ent.h:34
MemoryVector< byte > serial_number() const
Definition: crl_ent.h:28
CRL_Code reason_code() const
Definition: crl_ent.h:40