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 Freeze for Identity
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