Skip to main content

TlsIdentity

Struct TlsIdentity 

Source
pub struct TlsIdentity { /* private fields */ }
Expand description

A leaf certificate, its intermediates in issuer order, and a matching signing key. The key can be a provider handle whose private material stays on a token.

Implementations§

Source§

impl TlsIdentity

Source

pub fn new( leaf: X509, intermediates: Vec<X509>, key: PKey<Private>, ) -> Result<Self>

Bind an already provisioned signing key using its public component. The leaf is presented first and the root belongs in the peer’s trust store.

Source

pub fn from_pem(chain: &[u8], key: &[u8]) -> Result<Self>

Read a leaf-first PEM certificate chain and an unencrypted PEM key or provider key reference. To use a PKCS#11 reference PEM, configure the OpenSSL provider and token login before constructing the identity. An already unlocked key handle can be supplied directly to Self::new.

Source

pub fn into_context_builder( self, method: SslMethod, ) -> Result<SslContextBuilder, ErrorStack>

Start a fresh OpenSSL context with this local identity. The transport configures its TLS profile, trust anchors and peer authentication on it.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.