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

Auto Trait Implementations

impl Freeze for Identity

impl RefUnwindSafe for Identity

impl Send for Identity

impl Sync for Identity

impl Unpin for Identity

impl UnsafeUnpin for Identity

impl UnwindSafe for Identity

Blanket Implementations

impl<T> Any for Identity where T: 'static + ?Sized,

impl<T> Borrow<T> for Identity where T: ?Sized,

impl<T> BorrowMut<T> for Identity where T: ?Sized,

impl<T> CloneToUninit for Identity where T: Clone,

impl<T> From<T> for Identity

impl<T> Instrument for Identity

impl<T> PolicyExt for Identity where T: ?Sized,

impl<T> ToOwned for Identity where T: Clone,

impl<T> WithSubscriber for Identity

impl<T, U> Into<U> for Identity where U: From<T>,

impl<T, U> TryFrom<U> for Identity where U: Into<T>,

impl<T, U> TryInto<U> for Identity where U: TryFrom<T>,