Botan  2.4.0
Crypto and TLS for C++11
Public Member Functions | Static Public Member Functions | List of all members
Botan::TLS::Certificate_Status_Request Class Referencefinal

#include <tls_extensions.h>

Inheritance diagram for Botan::TLS::Certificate_Status_Request:
Botan::TLS::Extension

Public Member Functions

 Certificate_Status_Request ()
 
 Certificate_Status_Request (const std::vector< X509_DN > &ocsp_responder_ids, const std::vector< std::vector< uint8_t >> &ocsp_key_ids)
 
 Certificate_Status_Request (TLS_Data_Reader &reader, uint16_t extension_size)
 
bool empty () const override
 
std::vector< uint8_t > serialize () const override
 
Handshake_Extension_Type type () const override
 

Static Public Member Functions

static Handshake_Extension_Type static_type ()
 

Detailed Description

Certificate Status Request (RFC 6066)

Definition at line 407 of file tls_extensions.h.

Constructor & Destructor Documentation

◆ Certificate_Status_Request() [1/3]

Botan::TLS::Certificate_Status_Request::Certificate_Status_Request ( )

Definition at line 730 of file tls_extensions.cpp.

730  : m_server_side(true)
731  {
732 
733  }

◆ Certificate_Status_Request() [2/3]

Botan::TLS::Certificate_Status_Request::Certificate_Status_Request ( const std::vector< X509_DN > &  ocsp_responder_ids,
const std::vector< std::vector< uint8_t >> &  ocsp_key_ids 
)

Definition at line 721 of file tls_extensions.cpp.

722  :
723  m_ocsp_names(ocsp_responder_ids),
724  m_ocsp_keys(ocsp_key_ids),
725  m_server_side(false)
726  {
727 
728  }

◆ Certificate_Status_Request() [3/3]

Botan::TLS::Certificate_Status_Request::Certificate_Status_Request ( TLS_Data_Reader reader,
uint16_t  extension_size 
)

Definition at line 703 of file tls_extensions.cpp.

References Botan::TLS::TLS_Data_Reader::discard_next(), Botan::TLS::TLS_Data_Reader::get_byte(), and type().

704  :
705  m_server_side(false)
706  {
707  if(extension_size > 0)
708  {
709  const uint8_t type = reader.get_byte();
710  if(type == 1)
711  {
712  reader.discard_next(extension_size - 1); // fixme
713  }
714  else
715  {
716  reader.discard_next(extension_size - 1);
717  }
718  }
719  }
Handshake_Extension_Type type() const override

Member Function Documentation

◆ empty()

bool Botan::TLS::Certificate_Status_Request::empty ( ) const
inlineoverridevirtual
Returns
if we should encode this extension or not

Implements Botan::TLS::Extension.

Definition at line 417 of file tls_extensions.h.

417 { return false; }

◆ serialize()

std::vector< uint8_t > Botan::TLS::Certificate_Status_Request::serialize ( ) const
overridevirtual
Returns
serialized binary for the extension

Implements Botan::TLS::Extension.

Definition at line 677 of file tls_extensions.cpp.

678  {
679  std::vector<uint8_t> buf;
680 
681  if(m_server_side)
682  return buf; // server reply is empty
683 
684  /*
685  opaque ResponderID<1..2^16-1>;
686  opaque Extensions<0..2^16-1>;
687 
688  CertificateStatusType status_type = ocsp(1)
689  ResponderID responder_id_list<0..2^16-1>
690  Extensions request_extensions;
691  */
692 
693  buf.push_back(1); // CertificateStatusType ocsp
694 
695  buf.push_back(0);
696  buf.push_back(0);
697  buf.push_back(0);
698  buf.push_back(0);
699 
700  return buf;
701  }

◆ static_type()

static Handshake_Extension_Type Botan::TLS::Certificate_Status_Request::static_type ( )
inlinestatic

◆ type()

Handshake_Extension_Type Botan::TLS::Certificate_Status_Request::type ( ) const
inlineoverridevirtual
Returns
code number of the extension

Implements Botan::TLS::Extension.

Definition at line 413 of file tls_extensions.h.

References Botan::TLS::Extension::serialize().

Referenced by Certificate_Status_Request().

413 { return static_type(); }
static Handshake_Extension_Type static_type()

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