Struct isahc::config::PrivateKey
source · pub struct PrivateKey { /* private fields */ }
Expand description
A private key file.
Implementations
sourceimpl PrivateKey
impl PrivateKey
sourcepub fn pem<B, P>(bytes: B, password: P) -> Selfwhere
B: Into<Vec<u8>>,
P: Into<Option<String>>,
pub fn pem<B, P>(bytes: B, password: P) -> Selfwhere
B: Into<Vec<u8>>,
P: Into<Option<String>>,
Use a PEM-encoded private key stored in the given byte buffer.
The private key object takes ownership of the byte buffer. If a borrowed
type is supplied, such as &[u8]
, then the bytes will be copied.
The key is not parsed or validated here. If the key 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 key.
sourcepub fn der<B, P>(bytes: B, password: P) -> Selfwhere
B: Into<Vec<u8>>,
P: Into<Option<String>>,
pub fn der<B, P>(bytes: B, password: P) -> Selfwhere
B: Into<Vec<u8>>,
P: Into<Option<String>>,
Use a DER-encoded private key stored in the given byte buffer.
The private key object takes ownership of the byte buffer. If a borrowed
type is supplied, such as &[u8]
, then the bytes will be copied.
The key is not parsed or validated here. If the key 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 key.
sourcepub fn pem_file(
path: impl Into<PathBuf>,
password: impl Into<Option<String>>
) -> Self
pub fn pem_file(
path: impl Into<PathBuf>,
password: impl Into<Option<String>>
) -> Self
Get a PEM-encoded private key file.
The key 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 key.
sourcepub fn der_file(
path: impl Into<PathBuf>,
password: impl Into<Option<String>>
) -> Self
pub fn der_file(
path: impl Into<PathBuf>,
password: impl Into<Option<String>>
) -> Self
Get a DER-encoded private key file.
The key 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 key.
Trait Implementations
sourceimpl Clone for PrivateKey
impl Clone for PrivateKey
sourcefn clone(&self) -> PrivateKey
fn clone(&self) -> PrivateKey
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more