pub struct Identity { /* private fields */ }Expand description
Represents an TLS identity consisting of a certificate chain and a private key.
Implementations§
Source§impl Identity
impl Identity
Sourcepub fn new(certificate_chain: CertificateChain, private_key: PrivateKey) -> Self
pub fn new(certificate_chain: CertificateChain, private_key: PrivateKey) -> Self
Constructs a new Identity with the given certificate chain and private key.
Sourcepub async fn load_pemfiles(
cert_pemfile: impl AsRef<Path>,
private_key_pemfile: impl AsRef<Path>,
) -> Result<Self, PemLoadError>
pub async fn load_pemfiles( cert_pemfile: impl AsRef<Path>, private_key_pemfile: impl AsRef<Path>, ) -> Result<Self, PemLoadError>
Loads an identity from PEM-encoded certificate and private key files.
Sourcepub fn certificate_chain(&self) -> &CertificateChain
pub fn certificate_chain(&self) -> &CertificateChain
Returns a reference to the certificate chain associated with the identity.
Sourcepub fn private_key(&self) -> &PrivateKey
pub fn private_key(&self) -> &PrivateKey
Returns a reference to the private key associated with the identity.
Sourcepub fn clone_identity(&self) -> Self
pub fn clone_identity(&self) -> Self
Clones this identity.
§Note
Identity does not implement Clone directly to ensure that sensitive information,
specifically the inner private key, is not cloned inadvertently.
Implementing Clone directly could potentially lead to unintended cloning of sensitive data.
Trait Implementations§
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<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
Mutably borrows from an owned value. Read more