pub struct TlsSession {
pub version: u16,
pub cipher_suite_id: u16,
pub client_random: [u8; 32],
pub server_random: [u8; 32],
pub master_secret: Vec<u8>,
pub read_state: ConnState,
pub write_state: ConnState,
pub connection_end: ConnectionEnd,
pub transcript: Vec<u8>,
pub handshake_complete: bool,
pub extended_master_secret: bool,
pub encrypt_then_mac: bool,
}Expand description
TLS session state.
Fields§
§version: u16Negotiated TLS version.
cipher_suite_id: u16Selected cipher suite ID.
client_random: [u8; 32]Client random (32 bytes).
server_random: [u8; 32]Server random (32 bytes).
master_secret: Vec<u8>Master secret (48 bytes).
read_state: ConnStateRead (decryption) state.
write_state: ConnStateWrite (encryption) state.
connection_end: ConnectionEndOur connection end.
transcript: Vec<u8>Handshake transcript (for verify_data and TLS 1.3).
handshake_complete: boolWhether the handshake is complete.
extended_master_secret: boolExtended master secret enabled.
encrypt_then_mac: boolEncrypt-then-MAC enabled.
Implementations§
Source§impl TlsSession
impl TlsSession
Sourcepub fn new_client() -> Self
pub fn new_client() -> Self
Create a new client session.
Sourcepub fn new_server() -> Self
pub fn new_server() -> Self
Create a new server session.
Sourcepub fn update_transcript(&mut self, data: &[u8])
pub fn update_transcript(&mut self, data: &[u8])
Append handshake message bytes to the transcript.
Sourcepub fn derive_keys(&mut self)
pub fn derive_keys(&mut self)
Derive keys from master secret and install them.
Trait Implementations§
Source§impl Clone for TlsSession
impl Clone for TlsSession
Source§fn clone(&self) -> TlsSession
fn clone(&self) -> TlsSession
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TlsSession
impl RefUnwindSafe for TlsSession
impl Send for TlsSession
impl Sync for TlsSession
impl Unpin for TlsSession
impl UnsafeUnpin for TlsSession
impl UnwindSafe for TlsSession
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more