Botan 2.19.1
Crypto and TLS for C&
Public Member Functions | List of all members
Botan::TLS::Certificate_Status Class Referencefinal

#include <tls_messages.h>

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

Public Member Functions

 Certificate_Status (const std::vector< uint8_t > &buf)
 
 Certificate_Status (Handshake_IO &io, Handshake_Hash &hash, std::shared_ptr< const OCSP::Response > response)
 
 Certificate_Status (Handshake_IO &io, Handshake_Hash &hash, std::vector< uint8_t > const &raw_response_bytes)
 
const std::vector< uint8_t > & response () const
 
Handshake_Type type () const override
 
std::string type_string () const
 

Detailed Description

Certificate Status (RFC 6066)

Definition at line 395 of file tls_messages.h.

Constructor & Destructor Documentation

◆ Certificate_Status() [1/3]

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

Definition at line 20 of file msg_cert_status.cpp.

21 {
22 if(buf.size() < 5)
23 throw Decoding_Error("Invalid Certificate_Status message: too small");
24
25 if(buf[0] != 1) // not OCSP
26 throw Decoding_Error("Unexpected Certificate_Status message: unexpected response type");
27
28 size_t len = make_uint32(0, buf[1], buf[2], buf[3]);
29
30 // Verify the redundant length field...
31 if(buf.size() != len + 4)
32 throw Decoding_Error("Invalid Certificate_Status: invalid length field");
33
34 m_response.assign(buf.begin() + 4, buf.end());
35 }
constexpr uint32_t make_uint32(uint8_t i0, uint8_t i1, uint8_t i2, uint8_t i3)
Definition: loadstor.h:67

References Botan::make_uint32().

◆ Certificate_Status() [2/3]

Botan::TLS::Certificate_Status::Certificate_Status ( Handshake_IO io,
Handshake_Hash hash,
std::shared_ptr< const OCSP::Response response 
)

Definition at line 37 of file msg_cert_status.cpp.

39 :
40 m_response(ocsp->raw_bits())
41 {
42 hash.update(io.send(*this));
43 }
MechanismType hash

References hash, and Botan::TLS::Handshake_IO::send().

◆ Certificate_Status() [3/3]

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

Definition at line 45 of file msg_cert_status.cpp.

47 :
48 m_response(raw_response_bytes)
49 {
50 hash.update(io.send(*this));
51 }

References hash, and Botan::TLS::Handshake_IO::send().

Member Function Documentation

◆ response()

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

Definition at line 402 of file tls_messages.h.

402{ return m_response; }

◆ type()

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

Implements Botan::TLS::Handshake_Message.

Definition at line 398 of file tls_messages.h.

398{ return CERTIFICATE_STATUS; }
@ CERTIFICATE_STATUS
Definition: tls_magic.h:60

References Botan::TLS::CERTIFICATE_STATUS.

◆ type_string()

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

Definition at line 19 of file tls_handshake_state.cpp.

20 {
22 }
virtual Handshake_Type type() const =0
const char * handshake_type_to_string(Handshake_Type type)

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


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