Botan  2.4.0
Crypto and TLS for C++11
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)
 
std::shared_ptr< const OCSP::Responseresponse () const
 
Handshake_Type type () const override
 
std::string type_string () const
 

Detailed Description

Certificate Status (RFC 6066)

Definition at line 383 of file tls_messages.h.

Constructor & Destructor Documentation

◆ Certificate_Status() [1/2]

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

Definition at line 20 of file msg_cert_status.cpp.

References Botan::make_uint32().

21  {
22  if(buf.size() < 5)
23  throw Decoding_Error("Invalid Certificate_Status message: too small");
24 
25  if(buf[0] != 1)
26  throw Decoding_Error("Unexpected Certificate_Status message: unexpected message 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 = std::make_shared<OCSP::Response>(buf.data() + 4, buf.size() - 4);
35  }
uint32_t make_uint32(uint8_t i0, uint8_t i1, uint8_t i2, uint8_t i3)
Definition: loadstor.h:65

◆ Certificate_Status() [2/2]

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.

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

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

Member Function Documentation

◆ response()

std::shared_ptr<const OCSP::Response> Botan::TLS::Certificate_Status::response ( ) const
inline

Definition at line 388 of file tls_messages.h.

References hash.

388 { 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 386 of file tls_messages.h.

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.

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

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

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