pub struct SessionTicket {
pub lifetime: u32,
pub age_add: u32,
pub nonce: Vec<u8>,
pub ticket: Vec<u8>,
pub cipher_suite: CipherSuite,
pub resumption_secret: [u8; 32],
pub created_at: u64,
}Expand description
Session ticket for TLS 1.3 resumption (PSK-based)
Fields§
§lifetime: u32Ticket lifetime in seconds
age_add: u32Ticket age add (for obfuscation)
nonce: Vec<u8>Ticket nonce
ticket: Vec<u8>Opaque ticket data
cipher_suite: CipherSuiteCipher suite used in original session
resumption_secret: [u8; 32]Resumption master secret
created_at: u64Creation timestamp (kernel ticks or epoch seconds)
Implementations§
Source§impl SessionTicket
impl SessionTicket
Sourcepub fn from_message(
data: &[u8],
cipher_suite: CipherSuite,
resumption_secret: [u8; 32],
now: u64,
) -> Option<Self>
pub fn from_message( data: &[u8], cipher_suite: CipherSuite, resumption_secret: [u8; 32], now: u64, ) -> Option<Self>
Parse a NewSessionTicket handshake message
Sourcepub fn derive_psk(&self) -> [u8; 32]
pub fn derive_psk(&self) -> [u8; 32]
Derive the PSK for resumption
Sourcepub fn is_expired(&self, now: u64) -> bool
pub fn is_expired(&self, now: u64) -> bool
Check if the ticket has expired
Trait Implementations§
Source§impl Clone for SessionTicket
impl Clone for SessionTicket
Source§fn clone(&self) -> SessionTicket
fn clone(&self) -> SessionTicket
Returns a duplicate of the value. Read more
1.0.0§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 SessionTicket
impl RefUnwindSafe for SessionTicket
impl Send for SessionTicket
impl Sync for SessionTicket
impl Unpin for SessionTicket
impl UnwindSafe for SessionTicket
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)