Botan  2.13.0
Crypto and TLS for C++11
crl_ent.h
Go to the documentation of this file.
1 /*
2 * CRL Entry
3 * (C) 1999-2007 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7 
8 #ifndef BOTAN_CRL_ENTRY_H_
9 #define BOTAN_CRL_ENTRY_H_
10 
11 #include <botan/asn1_time.h>
12 
13 namespace Botan {
14 
15 class Extensions;
16 class X509_Certificate;
17 struct CRL_Entry_Data;
18 
19 /**
20 * X.509v2 CRL Reason Code.
21 * This will become an enum class in a future major release
22 */
23 enum CRL_Code : uint32_t {
35 
36  DELETE_CRL_ENTRY = 0xFF00,
37  OCSP_GOOD = 0xFF01,
38  OCSP_UNKNOWN = 0xFF02
39 };
40 
41 /**
42 * This class represents CRL entries
43 */
45  {
46  public:
47  void encode_into(class DER_Encoder&) const override;
48  void decode_from(class BER_Decoder&) override;
49 
50  /**
51  * Get the serial number of the certificate associated with this entry.
52  * @return certificate's serial number
53  */
54  const std::vector<uint8_t>& serial_number() const;
55 
56  /**
57  * Get the revocation date of the certificate associated with this entry
58  * @return certificate's revocation date
59  */
60  const X509_Time& expire_time() const;
61 
62  /**
63  * Get the entries reason code
64  * @return reason code
65  */
66  CRL_Code reason_code() const;
67 
68  /**
69  * Get the extensions on this CRL entry
70  */
71  const Extensions& extensions() const;
72 
73  /**
74  * Create uninitialized CRL_Entry object
75  */
76  CRL_Entry() = default;
77 
78  /**
79  * Construct an CRL entry.
80  * @param cert the certificate to revoke
81  * @param reason the reason code to set in the entry
82  */
83  CRL_Entry(const X509_Certificate& cert,
84  CRL_Code reason = UNSPECIFIED);
85 
86  private:
87  friend class X509_CRL;
88 
89  const CRL_Entry_Data& data() const;
90 
91  std::shared_ptr<CRL_Entry_Data> m_data;
92  };
93 
94 /**
95 * Test two CRL entries for equality in all fields.
96 */
97 BOTAN_PUBLIC_API(2,0) bool operator==(const CRL_Entry&, const CRL_Entry&);
98 
99 /**
100 * Test two CRL entries for inequality in at least one field.
101 */
102 BOTAN_PUBLIC_API(2,0) bool operator!=(const CRL_Entry&, const CRL_Entry&);
103 
104 }
105 
106 #endif
CRL_Code
Definition: crl_ent.h:23
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
Definition: alg_id.cpp:13
Definition: crl_ent.h:44