Botan 1.10.17
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
13namespace Botan {
14
15/**
16* This class represents CRL entries
17*/
18class 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*/
65BOTAN_DLL bool operator==(const CRL_Entry&, const CRL_Entry&);
66
67/**
68* Test two CRL entries for inequality in at least one field.
69*/
70BOTAN_DLL bool operator!=(const CRL_Entry&, const CRL_Entry&);
71
72}
73
74#endif
Definition crl_ent.h:19
void encode_into(class DER_Encoder &) const
Definition crl_ent.cpp:63
CRL_Code reason_code() const
Definition crl_ent.h:40
MemoryVector< byte > serial_number() const
Definition crl_ent.h:28
CRL_Entry(bool throw_on_unknown_critical_extension=false)
Definition crl_ent.cpp:21
X509_Time expire_time() const
Definition crl_ent.h:34
void decode_from(class BER_Decoder &)
Definition crl_ent.cpp:81
@ UNSPECIFIED
bool operator!=(const OctetString &s1, const OctetString &s2)
Definition symkey.cpp:106
bool operator==(const OctetString &s1, const OctetString &s2)
Definition symkey.cpp:98