Botan
2.6.0
Crypto and TLS for C++11
|
#include <tls_blocking.h>
Public Types | |
typedef std::function< size_t(uint8_t[], size_t)> | read_fn |
typedef std::function< void(const uint8_t[], size_t)> | write_fn |
Public Member Functions | |
Blocking_Client (read_fn reader, write_fn writer, Session_Manager &session_manager, Credentials_Manager &creds, const Policy &policy, RandomNumberGenerator &rng, const Server_Information &server_info=Server_Information(), const Protocol_Version &offer_version=Protocol_Version::latest_tls_version(), const std::vector< std::string > &next_protos={}) | |
void | close () |
void | do_handshake () |
bool | is_closed () const |
std::vector< X509_Certificate > | peer_cert_chain () const |
size_t | pending () const |
size_t | read (uint8_t buf[], size_t buf_len) |
const TLS::Channel & | underlying_channel () const |
TLS::Channel & | underlying_channel () |
void | write (const uint8_t buf[], size_t buf_len) |
virtual | ~Blocking_Client ()=default |
Protected Member Functions | |
virtual void | alert_notification (const Alert &) |
virtual bool | handshake_complete (const Session &) |
Blocking TLS Client Can be used directly, or subclass to get handshake and alert notifications
Definition at line 22 of file tls_blocking.h.
typedef std::function<size_t (uint8_t[], size_t)> Botan::TLS::Blocking_Client::read_fn |
Definition at line 29 of file tls_blocking.h.
typedef std::function<void (const uint8_t[], size_t)> Botan::TLS::Blocking_Client::write_fn |
Definition at line 30 of file tls_blocking.h.
Botan::TLS::Blocking_Client::Blocking_Client | ( | read_fn | reader, |
write_fn | writer, | ||
Session_Manager & | session_manager, | ||
Credentials_Manager & | creds, | ||
const Policy & | policy, | ||
RandomNumberGenerator & | rng, | ||
const Server_Information & | server_info = Server_Information() , |
||
const Protocol_Version & | offer_version = Protocol_Version::latest_tls_version() , |
||
const std::vector< std::string > & | next_protos = {} |
||
) |
Definition at line 17 of file tls_blocking.cpp.
|
virtualdefault |
|
inlineprotectedvirtual |
Application can override to get notification of alerts
Definition at line 83 of file tls_blocking.h.
|
inline |
Definition at line 65 of file tls_blocking.h.
void Botan::TLS::Blocking_Client::do_handshake | ( | ) |
Completes full handshake then returns
Definition at line 64 of file tls_blocking.cpp.
References Botan::TLS::Channel::is_active(), Botan::TLS::Channel::is_closed(), and Botan::TLS::Channel::received_data().
|
inlineprotectedvirtual |
Application can override to get the handshake complete notification
Definition at line 78 of file tls_blocking.h.
|
inline |
Definition at line 67 of file tls_blocking.h.
|
inline |
Definition at line 69 of file tls_blocking.h.
|
inline |
Number of bytes pending read in the plaintext buffer (bytes readable without blocking)
Definition at line 52 of file tls_blocking.h.
size_t Botan::TLS::Blocking_Client::read | ( | uint8_t | buf[], |
size_t | buf_len | ||
) |
Blocking read, will return at least 1 byte (eventually) or else 0 if the connection is closed.
Definition at line 75 of file tls_blocking.cpp.
References BOTAN_ASSERT_IMPLICATION, Botan::TLS::Channel::is_closed(), and Botan::TLS::Channel::received_data().
|
inline |
Definition at line 62 of file tls_blocking.h.
|
inline |
Definition at line 63 of file tls_blocking.h.
|
inline |
Definition at line 60 of file tls_blocking.h.