Botan 2.13.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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 {
24 UNSPECIFIED = 0,
25 KEY_COMPROMISE = 1,
26 CA_COMPROMISE = 2,
27 AFFILIATION_CHANGED = 3,
28 SUPERSEDED = 4,
29 CESSATION_OF_OPERATION = 5,
30 CERTIFICATE_HOLD = 6,
31 REMOVE_FROM_CRL = 8,
32 PRIVLEDGE_WITHDRAWN = 9,
33 PRIVILEGE_WITHDRAWN = 9,
34 AA_COMPROMISE = 10,
35
36 DELETE_CRL_ENTRY = 0xFF00,
37 OCSP_GOOD = 0xFF01,
38 OCSP_UNKNOWN = 0xFF02
39 };
40
41 /**
42 * This class represents CRL entries
43 */
44 class BOTAN_PUBLIC_API(2,0) CRL_Entry final : public ASN1_Object
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
Botan::ASN1_Object
Definition: asn1_obj.h:66
Botan::CRL_Code
CRL_Code
Definition: crl_ent.h:23
final
int(* final)(unsigned char *, CTX *)
Definition: commoncrypto_hash.cpp:28
BOTAN_PUBLIC_API
#define BOTAN_PUBLIC_API(maj, min)
Definition: compiler.h:31
Botan::CA_COMPROMISE
Definition: crl_ent.h:26
Botan::Extensions
Definition: x509_ext.h:90
Botan::PRIVILEGE_WITHDRAWN
Definition: crl_ent.h:33
Botan::REMOVE_FROM_CRL
Definition: crl_ent.h:31
Botan::DER_Encoder
Definition: der_enc.h:23
Botan::X509_Certificate
Definition: x509cert.h:40
Botan::UNSPECIFIED
Definition: crl_ent.h:24
Botan::SUPERSEDED
Definition: crl_ent.h:28
Botan::KEY_COMPROMISE
Definition: crl_ent.h:25
Botan
Definition: alg_id.cpp:13
Botan::CRL_Entry
Definition: crl_ent.h:44
Botan::AA_COMPROMISE
Definition: crl_ent.h:34
Botan::Usage_Type::UNSPECIFIED
Botan::PRIVLEDGE_WITHDRAWN
Definition: crl_ent.h:32
Botan::OCSP_GOOD
Definition: crl_ent.h:37
Botan::AFFILIATION_CHANGED
Definition: crl_ent.h:27
Botan::X509_CRL
Definition: x509_crl.h:26
Botan::OCSP_UNKNOWN
Definition: crl_ent.h:38
Botan::CERTIFICATE_HOLD
Definition: crl_ent.h:30
Botan::BER_Decoder
Definition: ber_dec.h:21
Botan::CESSATION_OF_OPERATION
Definition: crl_ent.h:29
Botan::X509_Time
Definition: asn1_time.h:19
Botan::DELETE_CRL_ENTRY
Definition: crl_ent.h:36