pub struct ClientCertificate { /* private fields */ }
Expand description
A client certificate for SSL/TLS client validation.
Note that this isn’t merely an X.509 certificate, but rather a certificate and private key pair.
Implementations§
Source§impl ClientCertificate
impl ClientCertificate
Sourcepub fn pem<B, P>(bytes: B, private_key: P) -> Self
pub fn pem<B, P>(bytes: B, private_key: P) -> Self
Use a PEM-encoded certificate stored in the given byte buffer.
The certificate object takes ownership of the byte buffer. If a borrowed
type is supplied, such as &[u8]
, then the bytes will be copied.
The certificate is not parsed or validated here. If the certificate is malformed or the format is not supported by the underlying SSL/TLS engine, an error will be returned when attempting to send a request using the offending certificate.
Sourcepub fn der<B, P>(bytes: B, private_key: P) -> Self
pub fn der<B, P>(bytes: B, private_key: P) -> Self
Use a DER-encoded certificate stored in the given byte buffer.
The certificate object takes ownership of the byte buffer. If a borrowed
type is supplied, such as &[u8]
, then the bytes will be copied.
The certificate is not parsed or validated here. If the certificate is malformed or the format is not supported by the underlying SSL/TLS engine, an error will be returned when attempting to send a request using the offending certificate.
Sourcepub fn pkcs12<B, P>(bytes: B, password: P) -> Self
pub fn pkcs12<B, P>(bytes: B, password: P) -> Self
Use a certificate and private key from a PKCS #12 archive stored in the given byte buffer.
The certificate object takes ownership of the byte buffer. If a borrowed
type is supplied, such as &[u8]
, then the bytes will be copied.
The certificate is not parsed or validated here. If the certificate is malformed or the format is not supported by the underlying SSL/TLS engine, an error will be returned when attempting to send a request using the offending certificate.
Sourcepub fn pem_file(
path: impl Into<PathBuf>,
private_key: impl Into<Option<PrivateKey>>,
) -> Self
pub fn pem_file( path: impl Into<PathBuf>, private_key: impl Into<Option<PrivateKey>>, ) -> Self
Get a certificate from a PEM-encoded file.
The certificate file is not loaded or validated here. If the file does not exist or the format is not supported by the underlying SSL/TLS engine, an error will be returned when attempting to send a request using the offending certificate.
Sourcepub fn der_file(
path: impl Into<PathBuf>,
private_key: impl Into<Option<PrivateKey>>,
) -> Self
pub fn der_file( path: impl Into<PathBuf>, private_key: impl Into<Option<PrivateKey>>, ) -> Self
Get a certificate from a DER-encoded file.
The certificate file is not loaded or validated here. If the file does not exist or the format is not supported by the underlying SSL/TLS engine, an error will be returned when attempting to send a request using the offending certificate.
Sourcepub fn pkcs12_file(
path: impl Into<PathBuf>,
password: impl Into<Option<String>>,
) -> Self
pub fn pkcs12_file( path: impl Into<PathBuf>, password: impl Into<Option<String>>, ) -> Self
Get a certificate and private key from a PKCS #12-encoded file.
The certificate file is not loaded or validated here. If the file does not exist or the format is not supported by the underlying SSL/TLS engine, an error will be returned when attempting to send a request using the offending certificate.
Trait Implementations§
Source§impl Clone for ClientCertificate
impl Clone for ClientCertificate
Source§fn clone(&self) -> ClientCertificate
fn clone(&self) -> ClientCertificate
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more