Botan  1.11.15
Public Member Functions
Botan::CRL_Entry Class Reference

#include <crl_ent.h>

Inheritance diagram for Botan::CRL_Entry:
Botan::ASN1_Object

List of all members.

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< byteserial_number () const

Detailed Description

This class represents CRL entries

Definition at line 39 of file crl_ent.h.


Constructor & Destructor Documentation

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;
   }

Construct an CRL entry.

Parameters:
certthe certificate to revoke
reasonthe 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;
   }

Member Function Documentation

void Botan::CRL_Entry::decode_from ( class BER_Decoder from) [virtual]

Decode whatever this object is from from

Parameters:
fromthe 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

Parameters:
tothe 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();
   }

Get the revocation date of the certificate associated with this entry

Returns:
certificate's revocation date

Definition at line 55 of file crl_ent.h.

Referenced by Botan::operator==().

{ return time; }

Get the entries reason code

Returns:
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.

Returns:
certificate's serial number

Definition at line 49 of file crl_ent.h.

Referenced by Botan::operator==().

{ return serial; }

The documentation for this class was generated from the following files: