Botan
2.1.0
Crypto and TLS for C++11
Main Page
Namespaces
Classes
Files
File List
File Members
src
lib
x509
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
X509_Certificate;
16
17
/**
18
* X.509v2 CRL Reason Code.
19
*/
20
enum
CRL_Code
{
21
UNSPECIFIED
= 0,
22
KEY_COMPROMISE
= 1,
23
CA_COMPROMISE
= 2,
24
AFFILIATION_CHANGED
= 3,
25
SUPERSEDED
= 4,
26
CESSATION_OF_OPERATION
= 5,
27
CERTIFICATE_HOLD
= 6,
28
REMOVE_FROM_CRL
= 8,
29
PRIVLEDGE_WITHDRAWN
= 9,
30
AA_COMPROMISE
= 10,
31
32
DELETE_CRL_ENTRY
= 0xFF00,
33
OCSP_GOOD
= 0xFF01,
34
OCSP_UNKNOWN
= 0xFF02
35
};
36
37
/**
38
* This class represents CRL entries
39
*/
40
class
BOTAN_DLL
CRL_Entry
final :
public
ASN1_Object
41
{
42
public
:
43
void
encode_into(
class
DER_Encoder
&)
const override
;
44
void
decode_from(
class
BER_Decoder
&)
override
;
45
46
/**
47
* Get the serial number of the certificate associated with this entry.
48
* @return certificate's serial number
49
*/
50
std::vector<uint8_t>
serial_number
()
const
{
return
m_serial; }
51
52
/**
53
* Get the revocation date of the certificate associated with this entry
54
* @return certificate's revocation date
55
*/
56
X509_Time
expire_time
()
const
{
return
m_time; }
57
58
/**
59
* Get the entries reason code
60
* @return reason code
61
*/
62
CRL_Code
reason_code
()
const
{
return
m_reason; }
63
64
/**
65
* Construct an empty CRL entry.
66
* @param throw_on_unknown_critical_extension should we throw an exception
67
* if an unknown CRL extension marked as critical is encountered
68
*/
69
explicit
CRL_Entry
(
bool
throw_on_unknown_critical_extension =
false
);
70
71
/**
72
* Construct an CRL entry.
73
* @param cert the certificate to revoke
74
* @param reason the reason code to set in the entry
75
*/
76
CRL_Entry
(
const
X509_Certificate
& cert,
77
CRL_Code
reason =
UNSPECIFIED
);
78
79
private
:
80
bool
m_throw_on_unknown_critical;
81
std::vector<uint8_t> m_serial;
82
X509_Time
m_time;
83
CRL_Code
m_reason;
84
};
85
86
/**
87
* Test two CRL entries for equality in all fields.
88
*/
89
BOTAN_DLL
bool
operator==
(
const
CRL_Entry&,
const
CRL_Entry&);
90
91
/**
92
* Test two CRL entries for inequality in at least one field.
93
*/
94
BOTAN_DLL
bool
operator!=
(
const
CRL_Entry&,
const
CRL_Entry&);
95
96
}
97
98
#endif
Botan::DELETE_CRL_ENTRY
Definition:
crl_ent.h:32
Botan::AFFILIATION_CHANGED
Definition:
crl_ent.h:24
Botan::ASN1_Object
Definition:
asn1_obj.h:61
Botan::operator!=
bool operator!=(const AlgorithmIdentifier &a1, const AlgorithmIdentifier &a2)
Definition:
alg_id.cpp:82
Botan::operator==
bool operator==(const AlgorithmIdentifier &a1, const AlgorithmIdentifier &a2)
Definition:
alg_id.cpp:67
Botan::CRL_Entry::serial_number
std::vector< uint8_t > serial_number() const
Definition:
crl_ent.h:50
Botan::UNSPECIFIED
Definition:
crl_ent.h:21
Botan::OCSP_UNKNOWN
Definition:
crl_ent.h:34
Botan::PRIVLEDGE_WITHDRAWN
Definition:
crl_ent.h:29
Botan::CESSATION_OF_OPERATION
Definition:
crl_ent.h:26
Botan::DER_Encoder
Definition:
der_enc.h:22
Botan::X509_Certificate
Definition:
x509cert.h:36
Botan::CA_COMPROMISE
Definition:
crl_ent.h:23
Botan
Definition:
alg_id.cpp:13
Botan::CRL_Entry
Definition:
crl_ent.h:40
Botan::AA_COMPROMISE
Definition:
crl_ent.h:30
Botan::Usage_Type::UNSPECIFIED
Botan::KEY_COMPROMISE
Definition:
crl_ent.h:22
Botan::CERTIFICATE_HOLD
Definition:
crl_ent.h:27
Botan::CRL_Entry::expire_time
X509_Time expire_time() const
Definition:
crl_ent.h:56
Botan::CRL_Code
CRL_Code
Definition:
crl_ent.h:20
Botan::SUPERSEDED
Definition:
crl_ent.h:25
Botan::CRL_Entry::reason_code
CRL_Code reason_code() const
Definition:
crl_ent.h:62
Botan::BER_Decoder
Definition:
ber_dec.h:19
Botan::X509_Time
Definition:
asn1_time.h:19
Botan::REMOVE_FROM_CRL
Definition:
crl_ent.h:28
Botan::OCSP_GOOD
Definition:
crl_ent.h:33
Generated on Fri Aug 4 2017 19:29:39 for Botan by
1.8.9.1