Struct Identity
pub struct Identity { /* private fields */ }
Represents a private key and X509 cert as a client certificate.
Implementations
impl Identity
fn from_pem(buf: &[u8]) -> Result<Identity>Parses PEM encoded private key and certificate.
The input should contain a PEM encoded private key and at least one PEM encoded certificate.
Note: The private key must be in RSA, SEC1 Elliptic Curve or PKCS#8 format.
Examples
# use std::fs::File; # use std::io::Read; # fn pem() -> Result<(), Box<dyn std::error::Error>> { let mut buf = Vec::new(); File::open("my-ident.pem")? .read_to_end(&mut buf)?; let id = reqwest::Identity::from_pem(&buf)?; # drop(id); # Ok(()) # }Optional
This requires the
rustls(-...)Cargo feature enabled.
Trait Implementations
impl Clone for Identity
fn clone(&self) -> Self
impl Debug for Identity
fn fmt(&self, f: &mut Formatter<'_>) -> Result