aboutsummaryrefslogtreecommitdiffstats
path: root/src/x509/crl_ent.h
blob: 8aa567a2a4a50602126ed5eb9aa7afb6311d34ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*************************************************
* CRL Entry Header File                          *
* (C) 1999-2007 Jack Lloyd                       *
*************************************************/

#ifndef BOTAN_CRL_ENTRY_H__
#define BOTAN_CRL_ENTRY_H__

#include <botan/x509cert.h>

namespace Botan {

/*************************************************
* CRL Entry                                      *
*************************************************/
class BOTAN_DLL CRL_Entry : public ASN1_Object
   {
   public:
      void encode_into(class DER_Encoder&) const;
      void decode_from(class BER_Decoder&);

      MemoryVector<byte> serial_number() const { return serial; }
      X509_Time expire_time() const { return time; }
      CRL_Code reason_code() const { return reason; }

      CRL_Entry(bool throw_on_unknown_critical_extension = false);
      CRL_Entry(const X509_Certificate&, CRL_Code = UNSPECIFIED);

   private:
      bool throw_on_unknown_critical;
      MemoryVector<byte> serial;
      X509_Time time;
      CRL_Code reason;
   };

/*************************************************
* Comparison Operations                          *
*************************************************/
BOTAN_DLL bool operator==(const CRL_Entry&, const CRL_Entry&);
BOTAN_DLL bool operator!=(const CRL_Entry&, const CRL_Entry&);
BOTAN_DLL bool operator<(const CRL_Entry&, const CRL_Entry&);

}

#endif