Struct reqwest::Certificate

source ·
pub struct Certificate(_);
Expand description

Represent an X509 certificate.

Implementations

Create a Certificate from a binary DER encoded certificate

Examples
let mut buf = Vec::new();
File::open("my_cert.der")?
    .read_to_end(&mut buf)?;
let cert = reqwest::Certificate::from_der(&buf)?;
Errors

If the provided buffer is not valid DER, an error will be returned.

Create a Certificate from a PEM encoded certificate

Examples
let mut buf = Vec::new();
File::open("my_cert.pem")?
    .read_to_end(&mut buf)?;
let cert = reqwest::Certificate::from_pem(&buf)?;
Errors

If the provided buffer is not valid PEM, an error will be returned.

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.