Botan  2.11.0
Crypto and TLS for C++11
Public Types | Public Member Functions | Protected Attributes | Friends | List of all members
Botan::TLS::Context Class Reference

#include <asio_context.h>

Public Types

using Verify_Callback = detail::fn_signature_helper< decltype(&Callbacks::tls_verify_cert_chain)>::type
 

Public Member Functions

 Context (Credentials_Manager &credentials_manager, RandomNumberGenerator &rng, Session_Manager &session_manager, Policy &policy, Server_Information server_info=Server_Information())
 
 Context (Context &&)=default
 
 Context (const Context &)=delete
 
const Verify_Callbackget_verify_callback () const
 
bool has_verify_callback () const
 
Contextoperator= (const Context &)=delete
 
Contextoperator= (Context &&)=delete
 
void set_server_info (const Server_Information &server_info)
 
void set_verify_callback (Verify_Callback callback)
 Override the tls_verify_cert_chain callback. More...
 
virtual ~Context ()=default
 

Protected Attributes

Credentials_Managerm_credentials_manager
 
Policym_policy
 
RandomNumberGeneratorm_rng
 
Server_Information m_server_info
 
Session_Managerm_session_manager
 
Verify_Callback m_verify_callback
 

Friends

template<class S , class C >
class Stream
 

Detailed Description

A helper class to initialize and configure Botan::TLS::Stream

Definition at line 44 of file asio_context.h.

Member Typedef Documentation

◆ Verify_Callback

The signature of the callback function should correspond to the signature of Callbacks::tls_verify_cert_chain

Definition at line 54 of file asio_context.h.

Constructor & Destructor Documentation

◆ Context() [1/3]

Botan::TLS::Context::Context ( Credentials_Manager credentials_manager,
RandomNumberGenerator rng,
Session_Manager session_manager,
Policy policy,
Server_Information  server_info = Server_Information() 
)
inline

Definition at line 56 of file asio_context.h.

60  :
61  m_credentials_manager(credentials_manager),
62  m_rng(rng),
63  m_session_manager(session_manager),
64  m_policy(policy),
65  m_server_info(server_info)
66  {}
RandomNumberGenerator & m_rng
Definition: asio_context.h:108
Credentials_Manager & m_credentials_manager
Definition: asio_context.h:107
Server_Information m_server_info
Definition: asio_context.h:112
Session_Manager & m_session_manager
Definition: asio_context.h:109

◆ ~Context()

virtual Botan::TLS::Context::~Context ( )
virtualdefault

◆ Context() [2/3]

Botan::TLS::Context::Context ( Context &&  )
default

◆ Context() [3/3]

Botan::TLS::Context::Context ( const Context )
delete

Member Function Documentation

◆ get_verify_callback()

const Verify_Callback& Botan::TLS::Context::get_verify_callback ( ) const
inline

Definition at line 94 of file asio_context.h.

References m_verify_callback.

Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::StreamCore::tls_verify_cert_chain().

95  {
96  return m_verify_callback;
97  }
Verify_Callback m_verify_callback
Definition: asio_context.h:113

◆ has_verify_callback()

bool Botan::TLS::Context::has_verify_callback ( ) const
inline

Definition at line 89 of file asio_context.h.

References m_verify_callback.

Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::StreamCore::tls_verify_cert_chain().

90  {
91  return static_cast<bool>(m_verify_callback);
92  }
Verify_Callback m_verify_callback
Definition: asio_context.h:113

◆ operator=() [1/2]

Context& Botan::TLS::Context::operator= ( const Context )
delete

◆ operator=() [2/2]

Context& Botan::TLS::Context::operator= ( Context &&  )
delete

◆ set_server_info()

void Botan::TLS::Context::set_server_info ( const Server_Information server_info)
inline

Definition at line 99 of file asio_context.h.

References m_server_info.

100  {
101  m_server_info = server_info;
102  }
Server_Information m_server_info
Definition: asio_context.h:112

◆ set_verify_callback()

void Botan::TLS::Context::set_verify_callback ( Verify_Callback  callback)
inline

Override the tls_verify_cert_chain callback.

This changes the verify_callback in the stream's TLS::Context, and hence the tls_verify_cert_chain callback used in the handshake. Using this function is equivalent to setting the callback via

See also
Botan::TLS::Stream::set_verify_callback
Note
This function should only be called before initiating the TLS handshake

Definition at line 84 of file asio_context.h.

References m_verify_callback.

Referenced by Botan::TLS::Stream< StreamLayer, ChannelT >::set_verify_callback().

85  {
86  m_verify_callback = std::move(callback);
87  }
Verify_Callback m_verify_callback
Definition: asio_context.h:113

Friends And Related Function Documentation

◆ Stream

template<class S , class C >
friend class Stream
friend

Definition at line 105 of file asio_context.h.

Member Data Documentation

◆ m_credentials_manager

Credentials_Manager& Botan::TLS::Context::m_credentials_manager
protected

◆ m_policy

Policy& Botan::TLS::Context::m_policy
protected

◆ m_rng

RandomNumberGenerator& Botan::TLS::Context::m_rng
protected

◆ m_server_info

Server_Information Botan::TLS::Context::m_server_info
protected

◆ m_session_manager

Session_Manager& Botan::TLS::Context::m_session_manager
protected

◆ m_verify_callback

Verify_Callback Botan::TLS::Context::m_verify_callback
protected

Definition at line 113 of file asio_context.h.

Referenced by get_verify_callback(), has_verify_callback(), and set_verify_callback().


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