Botan  2.9.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 */
22 enum CRL_Code : uint32_t {
34 
35  DELETE_CRL_ENTRY = 0xFF00,
36  OCSP_GOOD = 0xFF01,
37  OCSP_UNKNOWN = 0xFF02
38 };
39 
40 /**
41 * This class represents CRL entries
42 */
44  {
45  public:
46  void encode_into(class DER_Encoder&) const override;
47  void decode_from(class BER_Decoder&) override;
48 
49  /**
50  * Get the serial number of the certificate associated with this entry.
51  * @return certificate's serial number
52  */
53  const std::vector<uint8_t>& serial_number() const;
54 
55  /**
56  * Get the revocation date of the certificate associated with this entry
57  * @return certificate's revocation date
58  */
59  const X509_Time& expire_time() const;
60 
61  /**
62  * Get the entries reason code
63  * @return reason code
64  */
65  CRL_Code reason_code() const;
66 
67  /**
68  * Get the extensions on this CRL entry
69  */
70  const Extensions& extensions() const;
71 
72  /**
73  * Create uninitialized CRL_Entry object
74  */
75  CRL_Entry() = default;
76 
77  /**
78  * Construct an CRL entry.
79  * @param cert the certificate to revoke
80  * @param reason the reason code to set in the entry
81  */
82  CRL_Entry(const X509_Certificate& cert,
83  CRL_Code reason = UNSPECIFIED);
84 
85  private:
86  friend class X509_CRL;
87 
88  const CRL_Entry_Data& data() const;
89 
90  std::shared_ptr<CRL_Entry_Data> m_data;
91  };
92 
93 /**
94 * Test two CRL entries for equality in all fields.
95 */
96 BOTAN_PUBLIC_API(2,0) bool operator==(const CRL_Entry&, const CRL_Entry&);
97 
98 /**
99 * Test two CRL entries for inequality in at least one field.
100 */
101 BOTAN_PUBLIC_API(2,0) bool operator!=(const CRL_Entry&, const CRL_Entry&);
102 
103 }
104 
105 #endif
CRL_Code
Definition: crl_ent.h:22
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
Definition: alg_id.cpp:13
Definition: crl_ent.h:43