Botan  2.9.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 387 of file tls_extensions.h.

Constructor & Destructor Documentation

◆ Certificate_Status_Request() [1/3]

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

Definition at line 557 of file tls_extensions.cpp.

557  : m_server_side(true)
558  {
559 
560  }

◆ 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 548 of file tls_extensions.cpp.

549  :
550  m_ocsp_names(ocsp_responder_ids),
551  m_ocsp_keys(ocsp_key_ids),
552  m_server_side(false)
553  {
554 
555  }

◆ Certificate_Status_Request() [3/3]

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

Definition at line 530 of file tls_extensions.cpp.

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

531  :
532  m_server_side(false)
533  {
534  if(extension_size > 0)
535  {
536  const uint8_t type = reader.get_byte();
537  if(type == 1)
538  {
539  reader.discard_next(extension_size - 1); // fixme
540  }
541  else
542  {
543  reader.discard_next(extension_size - 1);
544  }
545  }
546  }
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 397 of file tls_extensions.h.

397 { 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 504 of file tls_extensions.cpp.

505  {
506  std::vector<uint8_t> buf;
507 
508  if(m_server_side)
509  return buf; // server reply is empty
510 
511  /*
512  opaque ResponderID<1..2^16-1>;
513  opaque Extensions<0..2^16-1>;
514 
515  CertificateStatusType status_type = ocsp(1)
516  ResponderID responder_id_list<0..2^16-1>
517  Extensions request_extensions;
518  */
519 
520  buf.push_back(1); // CertificateStatusType ocsp
521 
522  buf.push_back(0);
523  buf.push_back(0);
524  buf.push_back(0);
525  buf.push_back(0);
526 
527  return buf;
528  }

◆ 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 393 of file tls_extensions.h.

Referenced by Certificate_Status_Request().

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

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