Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

tls_session_key.h
Go to the documentation of this file.
1 /*
2 * TLS Session Key
3 * (C) 2004-2006,2011 Jack Lloyd
4 *
5 * Botan is released under the Simplified BSD License (see license.txt)
6 */
7
8 #ifndef BOTAN_TLS_SESSION_KEYS_H__
9 #define BOTAN_TLS_SESSION_KEYS_H__
10
11 #include <botan/symkey.h>
12
13 namespace Botan {
14
15 namespace TLS {
16
17 class Handshake_State;
18
19 /**
20 * TLS Session Keys
21 */
22 class Session_Keys
23 {
24 public:
25 /**
26 * @return client encipherment key
27 */
28 const SymmetricKey& client_cipher_key() const { return m_c_cipher; }
29
30 /**
31 * @return client encipherment key
32 */
33 const SymmetricKey& server_cipher_key() const { return m_s_cipher; }
34
35 /**
36 * @return client MAC key
37 */
38 const SymmetricKey& client_mac_key() const { return m_c_mac; }
39
40 /**
41 * @return server MAC key
42 */
43 const SymmetricKey& server_mac_key() const { return m_s_mac; }
44
45 /**
46 * @return client IV
47 */
48 const InitializationVector& client_iv() const { return m_c_iv; }
49
50 /**
51 * @return server IV
52 */
53 const InitializationVector& server_iv() const { return m_s_iv; }
54
55 /**
56 * @return TLS master secret
57 */
58 const secure_vector<uint8_t>& master_secret() const { return m_master_sec; }
59
60 Session_Keys() = default;
61
62 /**
63 * @param state state the handshake state
64 * @param pre_master_secret the pre-master secret
65 * @param resuming whether this TLS session is resumed
66 */
67 Session_Keys(const Handshake_State* state,
68 const secure_vector<uint8_t>& pre_master_secret,
69 bool resuming);
70
71 private:
72 secure_vector<uint8_t> m_master_sec;
73 SymmetricKey m_c_cipher, m_s_cipher, m_c_mac, m_s_mac;
74 InitializationVector m_c_iv, m_s_iv;
75 };
76
77 }
78
79 }
80
81 #endif
Botan::TLS::Session_Keys::client_iv
const InitializationVector & client_iv() const
Definition: tls_session_key.h:48
Botan::OctetString
Definition: symkey.h:19
Botan::TLS::Session_Keys::Session_Keys
Session_Keys()=default
Botan::TLS::Session_Keys
Definition: tls_session_key.h:22
Botan::secure_vector
std::vector< T, secure_allocator< T >> secure_vector
Definition: secmem.h:121
Botan::TLS::Session_Keys::client_mac_key
const SymmetricKey & client_mac_key() const
Definition: tls_session_key.h:38
Botan::TLS::Session_Keys::server_mac_key
const SymmetricKey & server_mac_key() const
Definition: tls_session_key.h:43
Botan
Definition: alg_id.cpp:13
Botan::TLS::Session_Keys::server_iv
const InitializationVector & server_iv() const
Definition: tls_session_key.h:53
Botan::TLS::Session_Keys::master_secret
const secure_vector< uint8_t > & master_secret() const
Definition: tls_session_key.h:58
Botan::TLS::Handshake_State
Definition: tls_handshake_state.h:47
Botan::TLS::Session_Keys::client_cipher_key
const SymmetricKey & client_cipher_key() const
Definition: tls_session_key.h:28
Botan::TLS::Session_Keys::server_cipher_key
const SymmetricKey & server_cipher_key() const
Definition: tls_session_key.h:33