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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)