Botan: Botan::Certificate Class Reference

Botan 1.10.16

Public Member Functions | List of all members
Botan::Certificate Class Reference

`#include <tls_messages.h>`

Inheritance diagram for Botan::Certificate:

## Public Member Functions
std::vector< X509_Certificate > | cert_chain () const
| Certificate (Record_Writer &, const std::vector< X509_Certificate > &, HandshakeHash &)
| Certificate (const MemoryRegion< byte > &buf)
void | send (Record_Writer &, HandshakeHash &) const
Handshake_Type | type () const

## Detailed Description

Certificate Message

Definition at line 118 of file tls_messages.h.

## Constructor & Destructor Documentation

## ◆ Certificate() [1/2]

Botan::Certificate::Certificate | ( | Record_Writer & | writer,
|  | const std::vector< X509_Certificate > & | cert_list,
|  | HandshakeHash & | hash
| ) |  |

Create a new Certificate message

Definition at line 86 of file cert_req.cpp.

References Botan::make_u32bit(), Botan::MemoryRegion< T >::push_back(), Botan::SecureQueue::read(), Botan::HandshakeMessage::send(), Botan::MemoryRegion< T >::size(), Botan::SecureQueue::size(), and Botan::SecureQueue::write().

89 {
90 certs = cert_list;
91 send(writer, hash);
92 }
Botan::HandshakeMessage::send
void send(Record_Writer &, HandshakeHash &) const
Definition: hello.cpp:16

## ◆ Certificate() [2/2]

Botan::Certificate::Certificate | ( | const MemoryRegion< byte > & | buf | ) |
| inline

Definition at line 126 of file tls_messages.h.

126 { deserialize(buf); }

## Member Function Documentation

## ◆ cert_chain()

std::vector<X509_Certificate> Botan::Certificate::cert_chain | ( |  | ) | const
| inline

Definition at line 122 of file tls_messages.h.

122 { return certs; }

## ◆ send()

void Botan::HandshakeMessage::send | ( | Record_Writer & | writer,
|  | HandshakeHash & | hash
| ) |  | const
| inherited

Definition at line 16 of file hello.cpp.

References Botan::Record_Writer::flush(), Botan::HANDSHAKE, Botan::Record_Writer::send(), Botan::MemoryRegion< T >::size(), Botan::HandshakeMessage::type(), and Botan::HandshakeHash::update().

Referenced by Certificate(), Botan::Certificate_Req::Certificate_Req(), Botan::Finished::Finished(), Botan::Hello_Request::Hello_Request(), and Botan::Server_Hello_Done::Server_Hello_Done().

17 {
18 SecureVector<byte> buf = serialize();
19 SecureVector<byte> send_buf(4);
20
21 const size_t buf_size = buf.size();
22
23 send_buf[0] = type();
24
25 for(size_t i = 1; i != 4; ++i)
26 send_buf[i] = get_byte<u32bit>(i, buf_size);
27
28 send_buf += buf;
29
30 hash.update(send_buf);
31
32 writer.send(HANDSHAKE, &send_buf[0], send_buf.size());
33 writer.flush();
34 }
Botan::HANDSHAKE
Definition: tls_magic.h:36
Botan::HandshakeMessage::type
virtual Handshake_Type type() const =0

## ◆ type()

Handshake_Type Botan::Certificate::type | ( |  | ) | const
| inlinevirtual

Implements Botan::HandshakeMessage.

Definition at line 121 of file tls_messages.h.

References Botan::CERTIFICATE.

121 { return CERTIFICATE; }
Botan::CERTIFICATE
Definition: tls_magic.h:45

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

- src/ssl/tls_messages.h
- src/ssl/cert_req.cpp