Botan  2.8.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 555 of file tls_extensions.cpp.

555  : m_server_side(true)
556  {
557 
558  }

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

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

◆ Certificate_Status_Request() [3/3]

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

Definition at line 528 of file tls_extensions.cpp.

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

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

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

◆ 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.

References static_type().

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: