Botan 2.19.1
Crypto and TLS for C&
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< uint8_t > &ocsp_responder_ids, const std::vector< std::vector< uint8_t > > &ocsp_key_ids)
 
 Certificate_Status_Request (TLS_Data_Reader &reader, uint16_t extension_size, Connection_Side side)
 
bool empty () const override
 
const std::vector< uint8_t > & get_request_extensions () const
 
const std::vector< uint8_t > & get_responder_id_list () const
 
std::vector< uint8_t > serialize (Connection_Side whoami) 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 394 of file tls_extensions.h.

Constructor & Destructor Documentation

◆ Certificate_Status_Request() [1/3]

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

Definition at line 417 of file tls_extensions.h.

417{}

◆ Certificate_Status_Request() [2/3]

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

Definition at line 570 of file tls_extensions.cpp.

571 :
572 m_ocsp_names(ocsp_responder_ids),
573 m_ocsp_keys(ocsp_key_ids)
574 {
575 }

◆ Certificate_Status_Request() [3/3]

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

Definition at line 544 of file tls_extensions.cpp.

547 {
548 if(from == Connection_Side::SERVER)
549 {
550 if(extension_size != 0)
551 throw Decoding_Error("Server sent non-empty Certificate_Status_Request extension");
552 }
553 else if(extension_size > 0)
554 {
555 const uint8_t type = reader.get_byte();
556 if(type == 1)
557 {
558 const size_t len_resp_id_list = reader.get_uint16_t();
559 m_ocsp_names = reader.get_fixed<uint8_t>(len_resp_id_list);
560 const size_t len_requ_ext = reader.get_uint16_t();
561 m_extension_bytes = reader.get_fixed<uint8_t>(len_requ_ext);
562 }
563 else
564 {
565 reader.discard_next(extension_size - 1);
566 }
567 }
568 }
Handshake_Extension_Type type() const override

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

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

404{ return false; }

◆ get_request_extensions()

const std::vector< uint8_t > & Botan::TLS::Certificate_Status_Request::get_request_extensions ( ) const
inline

Definition at line 411 of file tls_extensions.h.

412 {
413 return m_extension_bytes;
414 }

◆ get_responder_id_list()

const std::vector< uint8_t > & Botan::TLS::Certificate_Status_Request::get_responder_id_list ( ) const
inline

Definition at line 406 of file tls_extensions.h.

407 {
408 return m_ocsp_names;
409 }

◆ serialize()

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

Implements Botan::TLS::Extension.

Definition at line 518 of file tls_extensions.cpp.

519 {
520 std::vector<uint8_t> buf;
521
522 if(whoami == Connection_Side::SERVER)
523 return buf; // server reply is empty
524
525 /*
526 opaque ResponderID<1..2^16-1>;
527 opaque Extensions<0..2^16-1>;
528
529 CertificateStatusType status_type = ocsp(1)
530 ResponderID responder_id_list<0..2^16-1>
531 Extensions request_extensions;
532 */
533
534 buf.push_back(1); // CertificateStatusType ocsp
535
536 buf.push_back(0);
537 buf.push_back(0);
538 buf.push_back(0);
539 buf.push_back(0);
540
541 return buf;
542 }

References Botan::TLS::SERVER.

◆ static_type()

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

Definition at line 397 of file tls_extensions.h.

@ TLSEXT_CERT_STATUS_REQUEST

References Botan::TLS::TLSEXT_CERT_STATUS_REQUEST.

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

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

Referenced by Certificate_Status_Request().


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