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
impl TlsIdentity
Sourcepub fn new(
leaf: X509,
intermediates: Vec<X509>,
key: PKey<Private>,
) -> Result<Self>
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.
Sourcepub fn from_pem(chain: &[u8], key: &[u8]) -> Result<Self>
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.
Sourcepub fn into_context_builder(
self,
method: SslMethod,
) -> Result<SslContextBuilder, ErrorStack>
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§
impl Freeze for TlsIdentity
impl RefUnwindSafe for TlsIdentity
impl Send for TlsIdentity
impl Sync for TlsIdentity
impl Unpin for TlsIdentity
impl UnsafeUnpin for TlsIdentity
impl UnwindSafe for TlsIdentity
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
Mutably borrows from an owned value. Read more