Botan 2.19.5 Crypto and TLS for C&

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 (const Context &)=delete
| Context (Context &&)=default
| Context (Credentials_Manager &credentials_manager, RandomNumberGenerator &rng, Session_Manager &session_manager, Policy &policy, Server_Information server_info=Server_Information())
const Verify_Callback & | get_verify_callback () const
bool | has_verify_callback () const
Context & | operator= (const Context &)=delete
Context & | operator= (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 ()

## Protected Attributes
Credentials_Manager & | m_credentials_manager
Policy & | m_policy
RandomNumberGenerator & | m_rng
Server_Information | m_server_info
Session_Manager & | m_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

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

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

Definition at line 53 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 {}
Botan::TLS::Context::m_credentials_manager
Credentials_Manager & m_credentials_manager
Definition: asio_context.h:107
Botan::TLS::Context::m_server_info
Server_Information m_server_info
Definition: asio_context.h:112
Botan::TLS::Context::m_rng
RandomNumberGenerator & m_rng
Definition: asio_context.h:108
Botan::TLS::Context::m_policy
Policy & m_policy
Definition: asio_context.h:110
Botan::TLS::Context::m_session_manager
Session_Manager & m_session_manager
Definition: asio_context.h:109

## ◆ ~Context()

virtual Botan::TLS::Context::~Context | ( |  | ) |
| inline virtual

Definition at line 68 of file asio_context.h.

68{}

## ◆ 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.

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

References m_verify_callback.

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

## ◆ has_verify_callback()

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

Definition at line 89 of file asio_context.h.

90 {
91 return static_cast<bool>(m_verify_callback);
92 }

References m_verify_callback.

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

## ◆ 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.

100 {
101 m_server_info = server_info;
102 }

References m_server_info.

## ◆ 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.

85 {
86 m_verify_callback = std::move(callback);
87 }

References m_verify_callback.

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

## 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

Definition at line 107 of file asio_context.h.

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

## ◆ m_policy

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

Definition at line 110 of file asio_context.h.

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

## ◆ m_rng

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

Definition at line 108 of file asio_context.h.

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

## ◆ m_server_info

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

Definition at line 112 of file asio_context.h.

Referenced by set_server_info(), and Botan::TLS::Stream< StreamLayer, ChannelT >::setup_native_handle().

## ◆ m_session_manager

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

Definition at line 109 of file asio_context.h.

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

## ◆ 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:

- src/lib/tls/asio/asio_context.h