Struct SslSession
pub struct SslSession(/* private fields */);
Expand description
An encoded SSL session.
These can be cached to share sessions across connections.
Implementations§
§impl SslSession
impl SslSession
pub fn from_der(der: &[u8]) -> Result<SslSession, ErrorStack>
pub fn from_der(der: &[u8]) -> Result<SslSession, ErrorStack>
Deserializes a DER-encoded session structure.
This corresponds to d2i_SSL_SESSION
.
Methods from Deref<Target = SslSessionRef>§
pub fn id(&self) -> &[u8] ⓘ
pub fn id(&self) -> &[u8] ⓘ
Returns the SSL session ID.
This corresponds to SSL_SESSION_get_id
.
pub 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
.
pub 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
.
pub fn time(&self) -> u64
pub fn time(&self) -> u64
Returns the time at which the session was established, in seconds since the Unix epoch.
This corresponds to SSL_SESSION_get_time
.
pub fn timeout(&self) -> u32
pub fn timeout(&self) -> u32
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
.
pub fn protocol_version(&self) -> SslVersion
pub fn protocol_version(&self) -> SslVersion
Returns the session’s TLS protocol version.
This corresponds to SSL_SESSION_get_protocol_version
.
pub 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§
§impl AsMut<SslSessionRef> for SslSession
impl AsMut<SslSessionRef> for SslSession
§fn as_mut(&mut self) -> &mut SslSessionRef
fn as_mut(&mut self) -> &mut SslSessionRef
§impl AsRef<SslSessionRef> for SslSession
impl AsRef<SslSessionRef> for SslSession
§fn as_ref(&self) -> &SslSessionRef
fn as_ref(&self) -> &SslSessionRef
§impl Borrow<SslSessionRef> for SslSession
impl Borrow<SslSessionRef> for SslSession
§fn borrow(&self) -> &SslSessionRef
fn borrow(&self) -> &SslSessionRef
§impl BorrowMut<SslSessionRef> for SslSession
impl BorrowMut<SslSessionRef> for SslSession
§fn borrow_mut(&mut self) -> &mut SslSessionRef
fn borrow_mut(&mut self) -> &mut SslSessionRef
§impl Clone for SslSession
impl Clone for SslSession
§fn clone(&self) -> SslSession
fn clone(&self) -> SslSession
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Deref for SslSession
impl Deref for SslSession
§type Target = SslSessionRef
type Target = SslSessionRef
§fn deref(&self) -> &SslSessionRef
fn deref(&self) -> &SslSessionRef
§impl DerefMut for SslSession
impl DerefMut for SslSession
§fn deref_mut(&mut self) -> &mut SslSessionRef
fn deref_mut(&mut self) -> &mut SslSessionRef
§impl ForeignType for SslSession
impl ForeignType for SslSession
§type Ref = SslSessionRef
type Ref = SslSessionRef
§unsafe fn from_ptr(ptr: *mut ssl_session_st) -> SslSession
unsafe fn from_ptr(ptr: *mut ssl_session_st) -> SslSession
impl Send for SslSession
impl Sync for SslSession
Auto Trait Implementations§
impl Freeze for SslSession
impl RefUnwindSafe for SslSession
impl Unpin for SslSession
impl UnwindSafe for SslSession
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more