pub struct Certificate { /* private fields */ }
Expand description
Represents a server X509 certificate.
Implementations§
source§impl Certificate
impl Certificate
sourcepub fn from_der(der: &[u8]) -> Result<Certificate>
pub fn from_der(der: &[u8]) -> Result<Certificate>
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)?;
sourcepub fn from_pem(pem: &[u8]) -> Result<Certificate>
pub fn from_pem(pem: &[u8]) -> Result<Certificate>
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)?;
sourcepub fn from_pem_bundle(pem_bundle: &[u8]) -> Result<Vec<Certificate>>
pub fn from_pem_bundle(pem_bundle: &[u8]) -> Result<Vec<Certificate>>
Create a collection of Certificate
s from a PEM encoded certificate bundle.
Example byte sources may be .crt
, .cer
or .pem
files.
§Examples
let mut buf = Vec::new();
File::open("ca-bundle.crt")?
.read_to_end(&mut buf)?;
let certs = reqwest::Certificate::from_pem_bundle(&buf)?;
Trait Implementations§
source§impl Clone for Certificate
impl Clone for Certificate
source§fn clone(&self) -> Certificate
fn clone(&self) -> Certificate
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for Certificate
impl RefUnwindSafe for Certificate
impl Send for Certificate
impl Sync for Certificate
impl Unpin for Certificate
impl UnwindSafe for Certificate
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)