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) -> Self where
B: Into<Vec<u8>>,
P: Into<Option<PrivateKey>>,
pub fn pem<B, P>(bytes: B, private_key: P) -> Self where
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) -> Self where
B: Into<Vec<u8>>,
P: Into<Option<PrivateKey>>,
pub fn der<B, P>(bytes: B, private_key: P) -> Self where
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) -> Self where
B: Into<Vec<u8>>,
P: Into<Option<String>>,
pub fn pkcs12<B, P>(bytes: B, password: P) -> Self where
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
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for ClientCertificate
impl Send for ClientCertificate
impl Sync for ClientCertificate
impl Unpin for ClientCertificate
impl UnwindSafe for ClientCertificate
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more