pub struct Certificate(_);
Represent an X509 certificate.
Create a Certificate
from a binary DER encoded certificate
let mut buf = Vec::new();
File::open("my_cert.der")?
.read_to_end(&mut buf)?;
let cert = reqwest::Certificate::from_der(&buf)?;
If the provided buffer is not valid DER, an error will be returned.
Create a Certificate
from a PEM encoded certificate
let mut buf = Vec::new();
File::open("my_cert.pem")?
.read_to_end(&mut buf)?;
let cert = reqwest::Certificate::from_pem(&buf)?;
If the provided buffer is not valid PEM, an error will be returned.
Formats the value using the given formatter. Read more