pub struct Identity { /* private fields */ }
Expand description
Represents a private key and X509 cert as a client certificate.
Implementations§
source§impl Identity
impl Identity
sourcepub fn from_pem(buf: &[u8]) -> Result<Identity>
pub 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
let mut buf = Vec::new();
File::open("my-ident.pem")?
.read_to_end(&mut buf)?;
let id = reqwest::Identity::from_pem(&buf)?;
Optional
This requires the rustls-tls(-...)
Cargo feature enabled.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Identity
impl Send for Identity
impl Sync for Identity
impl Unpin for Identity
impl UnwindSafe for Identity
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more