8#ifndef BOTAN_TLS_SESSION_STATE_H_
9#define BOTAN_TLS_SESSION_STATE_H_
11#include <botan/x509cert.h>
12#include <botan/tls_version.h>
13#include <botan/tls_ciphersuite.h>
14#include <botan/tls_magic.h>
15#include <botan/tls_server_info.h>
16#include <botan/secmem.h>
17#include <botan/symkey.h>
35 m_start_time(
std::chrono::system_clock::time_point::min()),
40 m_extended_master_secret(false),
41 m_encrypt_then_mac(false)
47 Session(
const std::vector<uint8_t>& session_id,
52 bool supports_extended_master_secret,
53 bool supports_encrypt_then_mac,
54 const std::vector<X509_Certificate>& peer_certs,
55 const std::vector<uint8_t>& session_ticket,
57 const std::string& srp_identifier,
58 uint16_t srtp_profile);
65 Session(
const uint8_t ber[],
size_t ber_len);
71 explicit Session(
const std::string& pem);
149 const std::vector<uint8_t>&
session_id()
const {
return m_identifier; }
163 const std::vector<X509_Certificate>&
peer_certs()
const {
return m_peer_certs; }
168 std::chrono::system_clock::time_point
start_time()
const {
return m_start_time; }
173 std::chrono::seconds session_age()
const;
186 enum { TLS_SESSION_PARAM_STRUCT_VERSION = 20160812 };
188 std::chrono::system_clock::time_point m_start_time;
190 std::vector<uint8_t> m_identifier;
191 std::vector<uint8_t> m_session_ticket;
194 Protocol_Version m_version;
195 uint16_t m_ciphersuite;
197 uint16_t m_srtp_profile;
198 bool m_extended_master_secret;
199 bool m_encrypt_then_mac;
201 std::vector<X509_Certificate> m_peer_certs;
202 Server_Information m_server_info;
203 std::string m_srp_identifier;
static Ciphersuite by_id(uint16_t suite)
const Server_Information & server_info() const
bool supports_extended_master_secret() const
bool supports_encrypt_then_mac() const
uint16_t dtls_srtp_profile() const
Protocol_Version version() const
const std::vector< X509_Certificate > & peer_certs() const
const std::vector< uint8_t > & session_ticket() const
std::chrono::system_clock::time_point start_time() const
Connection_Side side() const
const secure_vector< uint8_t > & master_secret() const
static Session decrypt(const std::vector< uint8_t > &ctext, const SymmetricKey &key)
uint16_t ciphersuite_code() const
const std::string & srp_identifier() const
const std::vector< uint8_t > & session_id() const
Ciphersuite ciphersuite() const
static Session decrypt(const uint8_t ctext[], size_t ctext_size, const SymmetricKey &key)
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)
std::string decrypt(const uint8_t input[], size_t input_len, const std::string &passphrase)
std::string encrypt(const uint8_t input[], size_t input_len, const std::string &passphrase, RandomNumberGenerator &rng)
std::string PEM_encode(const Private_Key &key)
std::vector< T, secure_allocator< T > > secure_vector