11#ifndef BOTAN_TLS_CHANNEL_H_
12#define BOTAN_TLS_CHANNEL_H_
14#include <botan/tls_alert.h>
15#include <botan/tls_callbacks.h>
16#include <botan/tls_session.h>
17#include <botan/tls_session_manager.h>
18#include <botan/x509cert.h>
32 static constexpr size_t IO_BUF_DEFAULT_SIZE = 10 * 1024;
37 virtual size_t from_peer(std::span<const uint8_t> data) = 0;
38 virtual void to_peer(std::span<const uint8_t> data) = 0;
46 size_t received_data(std::span<const uint8_t> data) {
return this->from_peer(data); }
48 size_t received_data(
const uint8_t buf[],
size_t buf_size) {
return this->from_peer(std::span(buf, buf_size)); }
54 void send(std::span<const uint8_t> data) { this->to_peer(data); }
56 void send(
const uint8_t buf[],
size_t buf_size) { this->to_peer(std::span(buf, buf_size)); }
159 std::string_view context,
160 size_t length)
const = 0;
167 virtual void renegotiate(
bool force_full_renegotiation =
false) = 0;
virtual size_t from_peer(std::span< const uint8_t > data)=0
virtual bool secure_renegotiation_supported() const =0
virtual void update_traffic_keys(bool request_peer_update=false)=0
virtual void send_fatal_alert(Alert::Type type)=0
virtual ~Channel()=default
virtual bool timeout_check()=0
virtual bool is_handshake_complete() const =0
size_t received_data(std::span< const uint8_t > data)
virtual SymmetricKey key_material_export(std::string_view label, std::string_view context, size_t length) const =0
void send(const uint8_t buf[], size_t buf_size)
virtual std::string application_protocol() const =0
virtual std::vector< X509_Certificate > peer_cert_chain() const =0
virtual bool is_closed_for_writing() const =0
virtual bool is_closed_for_reading() const =0
virtual std::shared_ptr< const Public_Key > peer_raw_public_key() const =0
virtual void send_warning_alert(Alert::Type type)=0
virtual bool is_active() const =0
void send(std::string_view val)
size_t received_data(const uint8_t buf[], size_t buf_size)
virtual void to_peer(std::span< const uint8_t > data)=0
void send(std::span< const uint8_t > data)
virtual void send_alert(const Alert &alert)=0
virtual std::optional< std::string > external_psk_identity() const =0
virtual bool is_closed() const =0
virtual void renegotiate(bool force_full_renegotiation=false)=0
#define BOTAN_PUBLIC_API(maj, min)
const uint8_t * cast_char_ptr_to_uint8(const char *s)