OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::TLSCryptV2ServerKey Class Reference

#include <tls_crypt_v2.hpp>

Collaboration diagram for openvpn::TLSCryptV2ServerKey:
[legend]

Public Member Functions

 OPENVPN_SIMPLE_EXCEPTION (tls_crypt_v2_server_key_parse_error)
 
 OPENVPN_SIMPLE_EXCEPTION (tls_crypt_v2_server_key_encode_error)
 
 OPENVPN_SIMPLE_EXCEPTION (tls_crypt_v2_server_key_bad_size)
 
 TLSCryptV2ServerKey ()
 
bool defined () const
 
void parse (const std::string &key_text)
 
void generate (StrongRandomAPI &rng)
 Mint a fresh server key, replacing any key already held.
 
void extract_key (OpenVPNStaticKey &tls_key) const
 
std::string render () const
 

Private Attributes

const size_t key_size
 
BufferAllocated key
 

Detailed Description

Definition at line 64 of file tls_crypt_v2.hpp.

Constructor & Destructor Documentation

◆ TLSCryptV2ServerKey()

openvpn::TLSCryptV2ServerKey::TLSCryptV2ServerKey ( )
inline

Definition at line 71 of file tls_crypt_v2.hpp.

Member Function Documentation

◆ defined()

bool openvpn::TLSCryptV2ServerKey::defined ( ) const
inline

Definition at line 77 of file tls_crypt_v2.hpp.

◆ extract_key()

void openvpn::TLSCryptV2ServerKey::extract_key ( OpenVPNStaticKey tls_key) const
inline

Definition at line 107 of file tls_crypt_v2.hpp.

Here is the caller graph for this function:

◆ generate()

void openvpn::TLSCryptV2ServerKey::generate ( StrongRandomAPI rng)
inline

Mint a fresh server key, replacing any key already held.

A server key is nothing but key_size random bytes, which unwrap_tls_crypt_wkc() slices into the HMAC half Ka and the cipher half Ke. Nothing is derived from it and there is no structure to get wrong, so the only requirement on a key is the strength of its source.

Parameters
rngStrong random source for the key material.

Definition at line 101 of file tls_crypt_v2.hpp.

Here is the caller graph for this function:

◆ OPENVPN_SIMPLE_EXCEPTION() [1/3]

openvpn::TLSCryptV2ServerKey::OPENVPN_SIMPLE_EXCEPTION ( tls_crypt_v2_server_key_bad_size  )

◆ OPENVPN_SIMPLE_EXCEPTION() [2/3]

openvpn::TLSCryptV2ServerKey::OPENVPN_SIMPLE_EXCEPTION ( tls_crypt_v2_server_key_encode_error  )

◆ OPENVPN_SIMPLE_EXCEPTION() [3/3]

openvpn::TLSCryptV2ServerKey::OPENVPN_SIMPLE_EXCEPTION ( tls_crypt_v2_server_key_parse_error  )

◆ parse()

void openvpn::TLSCryptV2ServerKey::parse ( const std::string &  key_text)
inline

Definition at line 82 of file tls_crypt_v2.hpp.

Here is the caller graph for this function:

◆ render()

std::string openvpn::TLSCryptV2ServerKey::render ( ) const
inline

Definition at line 112 of file tls_crypt_v2.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ key

BufferAllocated openvpn::TLSCryptV2ServerKey::key
private

Definition at line 124 of file tls_crypt_v2.hpp.

◆ key_size

const size_t openvpn::TLSCryptV2ServerKey::key_size
private

Definition at line 123 of file tls_crypt_v2.hpp.


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