[]Struct openssl::ssl::SslSessionRef

pub struct SslSessionRef(_);

Reference to SslSession.

Methods

impl SslSessionRef[src]

pub fn id(&self) -> &[u8][src]

Returns the SSL session ID.

This corresponds to SSL_SESSION_get_id.

pub fn master_key_len(&self) -> usize[src]

Returns the length of the master key.

This corresponds to SSL_SESSION_get_master_key.

pub fn master_key(&self, buf: &mut [u8]) -> usize[src]

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) -> i64[src]

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) -> i64[src]

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[src]

Returns the session's TLS protocol version.

Requires OpenSSL 1.1.0 or newer.

This corresponds to SSL_SESSION_get_protocol_version.

pub fn to_der(&self) -> Result<Vec<u8>, ErrorStack>[src]

Serializes the session into a DER-encoded structure.

This corresponds to i2d_SSL_SESSION.

Trait Implementations

impl AsRef<SslSessionRef> for SslSession

impl ToOwned for SslSessionRef[src]

type Owned = SslSession

The resulting type after obtaining ownership.

fn clone_into(&self, target: &mut Self::Owned)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl Sync for SslSessionRef[src]

impl Send for SslSessionRef[src]

impl Borrow<SslSessionRef> for SslSession

impl ForeignTypeRef for SslSessionRef

type CType = SSL_SESSION

The raw C type.

unsafe fn from_ptr<'a>(ptr: *mut Self::CType) -> &'a Self[src]

Constructs a shared instance of this type from its raw type.

unsafe fn from_ptr_mut<'a>(ptr: *mut Self::CType) -> &'a mut Self[src]

Constructs a mutable reference of this type from its raw type.

fn as_ptr(&self) -> *mut Self::CType[src]

Returns a raw pointer to the wrapped value.

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]