pub struct CertificateChain(/* private fields */);Expand description
A collection of Certificate.
Implementations§
Source§impl CertificateChain
impl CertificateChain
Sourcepub fn new(certificates: Vec<Certificate>) -> Self
pub fn new(certificates: Vec<Certificate>) -> Self
Constructs a new CertificateChain from a vector of certificates.
Sourcepub fn single(certificate: Certificate) -> Self
pub fn single(certificate: Certificate) -> Self
Constructs a new CertificateChain with a single certificate.
Sourcepub async fn load_pemfile(
filepath: impl AsRef<Path>,
) -> Result<Self, PemLoadError>
pub async fn load_pemfile( filepath: impl AsRef<Path>, ) -> Result<Self, PemLoadError>
Loads a certificate chain from a PEM-encoded file.
Filters out any PEM sections that are not certificates and yields error if a problem occurs while trying to parse any certificate.
Note: if the PEM file does not contain any certificate section this will return an empty chain.
Sourcepub async fn store_pemfile(&self, filepath: impl AsRef<Path>) -> Result<()>
pub async fn store_pemfile(&self, filepath: impl AsRef<Path>) -> Result<()>
Stores the certificate chain in PEM format into a file asynchronously.
If the file does not exist, it will be created. If the file exists, its contents will be truncated before writing.
Sourcepub fn as_slice(&self) -> &[Certificate]
pub fn as_slice(&self) -> &[Certificate]
Returns a slice containing references to the certificates in the chain.
Trait Implementations§
Source§impl AsRef<[Certificate]> for CertificateChain
impl AsRef<[Certificate]> for CertificateChain
Source§fn as_ref(&self) -> &[Certificate]
fn as_ref(&self) -> &[Certificate]
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for CertificateChain
impl Clone for CertificateChain
Source§fn clone(&self) -> CertificateChain
fn clone(&self) -> CertificateChain
Returns a duplicate 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 Debug for CertificateChain
impl Debug for CertificateChain
Source§impl FromIterator<Certificate> for CertificateChain
impl FromIterator<Certificate> for CertificateChain
Source§fn from_iter<T: IntoIterator<Item = Certificate>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = Certificate>>(iter: T) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl Freeze for CertificateChain
impl RefUnwindSafe for CertificateChain
impl Send for CertificateChain
impl Sync for CertificateChain
impl Unpin for CertificateChain
impl UnwindSafe for CertificateChain
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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