[][src]Trait rustls::StoresServerSessions

pub trait StoresServerSessions: Send + Sync {
    fn generate(&self) -> SessionID;
fn put(&self, key: Vec<u8>, value: Vec<u8>) -> bool;
fn get(&self, key: &[u8]) -> Option<Vec<u8>>; }

A trait for the ability to generate Session IDs, and store server session data. The keys and values are opaque.

Both the keys and values should be treated as highly sensitive data, containing enough key material to break all security of the corresponding session.

put is a mutating operation; this isn't expressed in the type system to allow implementations freedom in how to achieve interior mutability. Mutex is a common choice.

Required methods

fn generate(&self) -> SessionID

Generate a session ID.

fn put(&self, key: Vec<u8>, value: Vec<u8>) -> bool

Store session secrets encoded in value against key id, overwrites any existing value against id. Returns true if the value was stored.

fn get(&self, key: &[u8]) -> Option<Vec<u8>>

Find a session with the given id. Return it, or None if it doesn't exist.

Loading content...

Implementors

impl StoresServerSessions for NoServerSessionStorage[src]

impl StoresServerSessions for ServerSessionMemoryCache[src]

Loading content...