Botan 3.0.0-alpha0
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, const OCSP::Response &response)
 
 Certificate_Status (Handshake_IO &io, Handshake_Hash &hash, const std::vector< uint8_t > &raw_response_bytes)
 
const std::vector< uint8_t > & response () const
 
Handshake_Type type () const override
 
std::string type_string () const
 
virtual Handshake_Type wire_type () const
 

Detailed Description

Certificate Status (RFC 6066)

Definition at line 563 of file tls_messages.h.

Constructor & Destructor Documentation

◆ Certificate_Status() [1/3]

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

Definition at line 19 of file msg_cert_status.cpp.

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

References Botan::make_uint32().

◆ Certificate_Status() [2/3]

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

Definition at line 36 of file msg_cert_status.cpp.

38 :
39 m_response(ocsp.raw_bits())
40 {
41 hash.update(io.send(*this));
42 }
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,
const std::vector< uint8_t > &  raw_response_bytes 
)

Definition at line 44 of file msg_cert_status.cpp.

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

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 570 of file tls_messages.h.

570{ return m_response; }

Referenced by Botan::TLS::Certificate_Status_Request::Certificate_Status_Request().

◆ type()

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

Implements Botan::TLS::Handshake_Message.

Definition at line 566 of file tls_messages.h.

566{ return CERTIFICATE_STATUS; }
@ CERTIFICATE_STATUS
Definition: tls_magic.h:82

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 18 of file tls_handshake_state.cpp.

19 {
21 }
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().

◆ wire_type()

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

Definition at line 42 of file tls_handshake_msg.h.

43 {
44 // Usually equal to the Handshake_Type enum value,
45 // with the exception of TLS 1.3 Hello Retry Request.
46 return type();
47 }

References type.

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


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