pub struct PrivateKey { /* private fields */ }
Expand description
A private key file.
Implementations§
Source§impl PrivateKey
impl PrivateKey
Sourcepub fn pem<B, P>(bytes: B, password: P) -> Self
pub fn pem<B, P>(bytes: B, password: P) -> Self
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) -> Self
pub fn der<B, P>(bytes: B, password: P) -> Self
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§
Source§impl Clone for PrivateKey
impl Clone for PrivateKey
Source§fn clone(&self) -> PrivateKey
fn clone(&self) -> PrivateKey
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more