pub struct Identity { /* private fields */ }Expand description
Represents a client certificate and its associated data for mutual TLS authentication.
Identity encapsulates the client certificate, its password.
It’s used to authenticate the client to the server during the
TLS handshake.
§Examples
use deboa::cert::Identity;
// Load a DER encoded PKCS#12 archive from a slice of bytes using a password
let cert = Identity::from_pkcs12(
&[1, 2, 3],
Some("cert-password".to_string()),
);
// Load a DER encoded certificate and key from a slice of bytes
let cert_with_ca = Identity::from_pkcs8(
&[1, 2, 3],
&[4, 5, 6],
ContentEncoding::DER,
);
Implementations§
Source§impl Identity
impl Identity
Sourcepub fn from_pkcs8(cert: &[u8], key: &[u8], encoding: ContentEncoding) -> Self
pub fn from_pkcs8(cert: &[u8], key: &[u8], encoding: ContentEncoding) -> Self
pub fn from_pkcs8_file( cert: &str, key: &str, encoding: ContentEncoding, ) -> Result<Self>
Trait Implementations§
Source§impl TryFrom<&Identity> for (CertificateDer<'static>, PrivateKeyDer<'static>)
Available on crate features tokio-rust-tls or smol-rust-tls only.
impl TryFrom<&Identity> for (CertificateDer<'static>, PrivateKeyDer<'static>)
Available on crate features
tokio-rust-tls or smol-rust-tls only.Auto Trait Implementations§
impl Freeze for Identity
impl RefUnwindSafe for Identity
impl Send for Identity
impl Sync for Identity
impl Unpin for Identity
impl UnwindSafe for Identity
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