pub struct Certificate<'a> { /* private fields */ }Expand description
An X509 certificate for a server or a client.
These are either used as trust roots, or client authentication.
The internal representation is DER form. The provided helpers for PEM translates to DER.
Implementations§
Source§impl<'a> Certificate<'a>
impl<'a> Certificate<'a>
Sourcepub fn from_der(der: &'a [u8]) -> Self
pub fn from_der(der: &'a [u8]) -> Self
Read an X509 certificate in DER form.
Does not immediately validate whether the data provided is a valid DER formatted X509. That validation is the responsibility of the TLS provider.
Sourcepub fn from_pem(pem: &'a [u8]) -> Result<Certificate<'static>, Error>
pub fn from_pem(pem: &'a [u8]) -> Result<Certificate<'static>, Error>
Read an X509 certificate in PEM form.
This is a shorthand for parse_pem followed by picking the first certificate.
Fails with an error if there is no certificate found in the PEM given.
Translates to DER format internally.
Sourcepub fn to_owned(&self) -> Certificate<'static>
pub fn to_owned(&self) -> Certificate<'static>
Clones (allocates) to produce a static copy.
Trait Implementations§
Source§impl<'a> Clone for Certificate<'a>
impl<'a> Clone for Certificate<'a>
Source§fn clone(&self) -> Certificate<'a>
fn clone(&self) -> Certificate<'a>
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 moreSource§impl<'a> Debug for Certificate<'a>
impl<'a> Debug for Certificate<'a>
Source§impl<'a> From<Certificate<'a>> for PemItem<'a>
impl<'a> From<Certificate<'a>> for PemItem<'a>
Source§fn from(value: Certificate<'a>) -> Self
fn from(value: Certificate<'a>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<'a> Freeze for Certificate<'a>
impl<'a> RefUnwindSafe for Certificate<'a>
impl<'a> Send for Certificate<'a>
impl<'a> Sync for Certificate<'a>
impl<'a> Unpin for Certificate<'a>
impl<'a> UnwindSafe for Certificate<'a>
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