Botan
1.11.15
|
#include <crl_ent.h>
Public Member Functions | |
CRL_Entry (bool throw_on_unknown_critical_extension=false) | |
CRL_Entry (const X509_Certificate &cert, CRL_Code reason=UNSPECIFIED) | |
void | decode_from (class BER_Decoder &) |
void | encode_into (class DER_Encoder &) const |
X509_Time | expire_time () const |
CRL_Code | reason_code () const |
std::vector< byte > | serial_number () const |
Botan::CRL_Entry::CRL_Entry | ( | bool | throw_on_unknown_critical_extension = false | ) |
Construct an empty CRL entry.
Definition at line 20 of file crl_ent.cpp.
References Botan::UNSPECIFIED.
: throw_on_unknown_critical(t_on_unknown_crit) { reason = UNSPECIFIED; }
Botan::CRL_Entry::CRL_Entry | ( | const X509_Certificate & | cert, |
CRL_Code | reason = UNSPECIFIED |
||
) |
Construct an CRL entry.
cert | the certificate to revoke |
reason | the reason code to set in the entry |
Definition at line 29 of file crl_ent.cpp.
References Botan::X509_Certificate::serial_number().
:
throw_on_unknown_critical(false)
{
serial = cert.serial_number();
time = X509_Time(std::chrono::system_clock::now());
reason = why;
}
void Botan::CRL_Entry::decode_from | ( | class BER_Decoder & | from | ) | [virtual] |
Decode whatever this object is from from
from | the BER_Decoder that will be read from |
Implements Botan::ASN1_Object.
Definition at line 80 of file crl_ent.cpp.
References Botan::Extensions::contents_to(), Botan::BER_Decoder::decode(), Botan::PEM_Code::encode(), Botan::BER_Decoder::end_cons(), Botan::Data_Store::get1_u32bit(), Botan::BER_Decoder::more_items(), Botan::SEQUENCE, Botan::BER_Decoder::start_cons(), and Botan::UNSPECIFIED.
{ BigInt serial_number_bn; reason = UNSPECIFIED; BER_Decoder entry = source.start_cons(SEQUENCE); entry.decode(serial_number_bn).decode(time); if(entry.more_items()) { Extensions extensions(throw_on_unknown_critical); entry.decode(extensions); Data_Store info; extensions.contents_to(info, info); reason = CRL_Code(info.get1_u32bit("X509v3.CRLReasonCode")); } entry.end_cons(); serial = BigInt::encode(serial_number_bn); }
void Botan::CRL_Entry::encode_into | ( | class DER_Encoder & | to | ) | const [virtual] |
Encode whatever this object is into to
to | the DER_Encoder that will be written to |
Implements Botan::ASN1_Object.
Definition at line 62 of file crl_ent.cpp.
References Botan::Extensions::add(), Botan::BigInt::decode(), Botan::DER_Encoder::encode(), Botan::DER_Encoder::end_cons(), Botan::SEQUENCE, and Botan::DER_Encoder::start_cons().
{ Extensions extensions; extensions.add(new Cert_Extension::CRL_ReasonCode(reason)); der.start_cons(SEQUENCE) .encode(BigInt::decode(serial)) .encode(time) .start_cons(SEQUENCE) .encode(extensions) .end_cons() .end_cons(); }
X509_Time Botan::CRL_Entry::expire_time | ( | ) | const [inline] |
Get the revocation date of the certificate associated with this entry
Definition at line 55 of file crl_ent.h.
Referenced by Botan::operator==().
{ return time; }
CRL_Code Botan::CRL_Entry::reason_code | ( | ) | const [inline] |
Get the entries reason code
Definition at line 61 of file crl_ent.h.
Referenced by Botan::operator==().
{ return reason; }
std::vector<byte> Botan::CRL_Entry::serial_number | ( | ) | const [inline] |
Get the serial number of the certificate associated with this entry.
Definition at line 49 of file crl_ent.h.
Referenced by Botan::operator==().
{ return serial; }