Struct isahc::config::ClientCertificate
source · 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
sourceimpl ClientCertificate
impl ClientCertificate
sourcepub fn pem<B, P>(bytes: B, private_key: P) -> Selfwhere
B: Into<Vec<u8>>,
P: Into<Option<PrivateKey>>,
pub fn pem<B, P>(bytes: B, private_key: P) -> Selfwhere
B: Into<Vec<u8>>,
P: Into<Option<PrivateKey>>,
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) -> Selfwhere
B: Into<Vec<u8>>,
P: Into<Option<PrivateKey>>,
pub fn der<B, P>(bytes: B, private_key: P) -> Selfwhere
B: Into<Vec<u8>>,
P: Into<Option<PrivateKey>>,
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) -> Selfwhere
B: Into<Vec<u8>>,
P: Into<Option<String>>,
pub fn pkcs12<B, P>(bytes: B, password: P) -> Selfwhere
B: Into<Vec<u8>>,
P: Into<Option<String>>,
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
sourceimpl Clone for ClientCertificate
impl Clone for ClientCertificate
sourcefn clone(&self) -> ClientCertificate
fn clone(&self) -> ClientCertificate
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more