Botan 3.11.0
Crypto and TLS for C&
Botan::TLS::Certificate_Status_12 Class Referencefinal

#include <tls_messages_12.h>

Inheritance diagram for Botan::TLS::Certificate_Status_12:
Botan::TLS::Certificate_Status Botan::TLS::Handshake_Message

Public Member Functions

 Certificate_Status_12 (Handshake_IO &io, Handshake_Hash &hash, std::vector< uint8_t > raw_response_bytes)
const std::vector< uint8_t > & response () const
std::vector< uint8_t > serialize () const final
Handshake_Type type () const final
std::string type_string () const
virtual Handshake_Type wire_type () const

Detailed Description

Certificate Status (RFC 6066)

Definition at line 289 of file tls_messages_12.h.

Constructor & Destructor Documentation

◆ Certificate_Status_12()

Botan::TLS::Certificate_Status_12::Certificate_Status_12 ( Handshake_IO & io,
Handshake_Hash & hash,
std::vector< uint8_t > raw_response_bytes )

Definition at line 15 of file msg_cert_status_12.cpp.

17 :
18 Certificate_Status(std::move(raw_response_bytes)) {
19 hash.update(io.send(*this));
20}
Certificate_Status(const std::vector< uint8_t > &buf, Connection_Side from)

References Botan::TLS::Certificate_Status::Certificate_Status(), Botan::TLS::Handshake_IO::send(), and Botan::TLS::Handshake_Hash::update().

Member Function Documentation

◆ response()

const std::vector< uint8_t > & Botan::TLS::Certificate_Status::response ( ) const
inlineinherited

Definition at line 239 of file tls_messages.h.

239{ return m_response; }

◆ serialize()

std::vector< uint8_t > Botan::TLS::Certificate_Status::serialize ( ) const
finalvirtualinherited
Returns
DER representation of this message

Implements Botan::TLS::Handshake_Message.

Definition at line 36 of file msg_cert_status.cpp.

36 {
37 if(m_response.size() > 0xFFFFFF) { // unlikely
38 throw Encoding_Error("OCSP response too long to encode in TLS");
39 }
40
41 const uint32_t response_len = static_cast<uint32_t>(m_response.size());
42
43 std::vector<uint8_t> buf;
44 buf.reserve(1 + 3 + m_response.size());
45 buf.push_back(1); // type OCSP
46 for(size_t i = 1; i < 4; ++i) {
47 buf.push_back(get_byte_var(i, response_len));
48 }
49
50 buf.insert(buf.end(), m_response.begin(), m_response.end());
51 return buf;
52}
constexpr uint8_t get_byte_var(size_t byte_num, T input)
Definition loadstor.h:69

References Botan::get_byte_var().

◆ type()

Handshake_Type Botan::TLS::Certificate_Status::type ( ) const
inlinefinalvirtualinherited
Returns
the message type

Implements Botan::TLS::Handshake_Message.

Definition at line 235 of file tls_messages.h.

References Botan::TLS::CertificateStatus.

◆ type_string()

std::string Botan::TLS::Handshake_Message::type_string ( ) const
inherited
Returns
string representation of this message type

Definition at line 21 of file tls_handshake_state.cpp.

21 {
23}
virtual Handshake_Type type() const =0
const char * handshake_type_to_string(Handshake_Type type)
Definition tls_magic.cpp:15

References Botan::TLS::handshake_type_to_string(), and type().

◆ wire_type()

virtual Handshake_Type Botan::TLS::Handshake_Message::wire_type ( ) const
inlinevirtualinherited
Returns
the wire representation of the message's type

Reimplemented in Botan::TLS::Hello_Retry_Request.

Definition at line 39 of file tls_handshake_msg.h.

39 {
40 // Usually equal to the Handshake_Type enum value,
41 // with the exception of TLS 1.3 Hello Retry Request.
42 return type();
43 }

References type().

Referenced by Botan::TLS::Stream_Handshake_IO::send().


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