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
.
Trait Implementations§
Source§impl AsRef<SslSessionRef> for SslSession
impl AsRef<SslSessionRef> for SslSession
Source§fn as_ref(&self) -> &SslSessionRef
fn as_ref(&self) -> &SslSessionRef
Source§impl Borrow<SslSessionRef> for SslSession
impl Borrow<SslSessionRef> for SslSession
Source§fn borrow(&self) -> &SslSessionRef
fn borrow(&self) -> &SslSessionRef
Source§impl ForeignTypeRef for SslSessionRef
impl ForeignTypeRef for SslSessionRef
Source§type CType = SSL_SESSION
type CType = SSL_SESSION
Source§unsafe fn from_ptr<'a>(ptr: *mut Self::CType) -> &'a Self
unsafe fn from_ptr<'a>(ptr: *mut Self::CType) -> &'a Self
Source§unsafe fn from_ptr_mut<'a>(ptr: *mut Self::CType) -> &'a mut Self
unsafe fn from_ptr_mut<'a>(ptr: *mut Self::CType) -> &'a mut Self
Source§impl ToOwned for SslSessionRef
impl ToOwned for SslSessionRef
Source§type Owned = SslSession
type Owned = SslSession
Source§fn to_owned(&self) -> SslSession
fn to_owned(&self) -> SslSession
1.63.0 · Source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
impl Send for SslSessionRef
impl Sync for SslSessionRef
Auto Trait Implementations§
impl !Freeze for SslSessionRef
impl !RefUnwindSafe for SslSessionRef
impl Unpin for SslSessionRef
impl UnwindSafe for SslSessionRef
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
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 0 bytes