Struct openssl::ssl::SslSessionRef
source · pub struct SslSessionRef(/* private fields */);
Expand description
Reference to SslSession
.
Implementations§
source§impl SslSessionRef
impl SslSessionRef
sourcepub fn id(&self) -> &[u8] ⓘ
pub fn id(&self) -> &[u8] ⓘ
Returns the SSL session ID.
This corresponds to SSL_SESSION_get_id
.
sourcepub fn master_key_len(&self) -> usize
pub fn master_key_len(&self) -> usize
Returns the length of the master key.
This corresponds to SSL_SESSION_get_master_key
.
sourcepub fn master_key(&self, buf: &mut [u8]) -> usize
pub fn master_key(&self, buf: &mut [u8]) -> usize
Copies the master key into the provided buffer.
Returns the number of bytes written, or the size of the master key if the buffer is empty.
This corresponds to SSL_SESSION_get_master_key
.
sourcepub fn max_early_data(&self) -> u32
pub fn max_early_data(&self) -> u32
Gets the maximum amount of early data that can be sent on this session.
Requires OpenSSL 1.1.1 or LibreSSL 3.4.0 or newer.
This corresponds to SSL_SESSION_get_max_early_data
.
sourcepub fn time(&self) -> c_long
pub fn time(&self) -> c_long
Returns the time at which the session was established, in seconds since the Unix epoch.
This corresponds to SSL_SESSION_get_time
.
sourcepub fn timeout(&self) -> i64
pub fn timeout(&self) -> i64
Returns the sessions timeout, in seconds.
A session older than this time should not be used for session resumption.
This corresponds to SSL_SESSION_get_timeout
.
sourcepub fn protocol_version(&self) -> SslVersion
pub fn protocol_version(&self) -> SslVersion
Returns the session’s TLS protocol version.
Requires OpenSSL 1.1.0 or LibreSSL 2.7.0 or newer.
This corresponds to SSL_SESSION_get_protocol_version
.
sourcepub fn to_der(&self) -> Result<Vec<u8>, ErrorStack>
pub fn to_der(&self) -> Result<Vec<u8>, ErrorStack>
Serializes the session into a DER-encoded structure.
This corresponds to i2d_SSL_SESSION
.