Trait PemObject
trait PemObject: Sized
Items that can be decoded from PEM data.
Required Methods
fn from_pem(kind: SectionKind, der: Vec<u8>) -> Option<Self>Conversion from a PEM
SectionKindand body data.This inspects
kind, and if it matches this type's PEM section kind, convertsderinto this type.
Provided Methods
fn from_pem_slice(pem: &[u8]) -> Result<Self, Error>Decode the first section of this type from PEM contained in a byte slice.
Error::NoItemsFoundis returned if no such items are found.fn pem_slice_iter(pem: &[u8]) -> SliceIter<'_, Self>Iterate over all sections of this type from PEM contained in a byte slice.
fn from_pem_file<impl AsRef<std::path::Path>: AsRef<std::path::Path>>(file_name: impl AsRef<Path>) -> Result<Self, Error>Decode the first section of this type from the PEM contents of the named file.
Error::NoItemsFoundis returned if no such items are found.fn pem_file_iter<impl AsRef<std::path::Path>: AsRef<std::path::Path>>(file_name: impl AsRef<Path>) -> Result<ReadIter<BufReader<File>, Self>, Error>Iterate over all sections of this type from the PEM contents of the named file.
This reports errors in two phases:
- errors opening the file are reported from this function directly,
- errors reading from the file are reported from the returned iterator,
fn from_pem_reader<impl std::io::Read: std::io::Read>(rd: impl Read) -> Result<Self, Error>Decode the first section of this type from PEM read from an
io::Read.fn pem_reader_iter<R: std::io::Read>(rd: R) -> ReadIter<BufReader<R>, Self>Iterate over all sections of this type from PEM present in an
io::Read.
Implementors
impl<T> PemObject for PrivateSec1KeyDer<'a>impl<T: PemObjectFilter + From<alloc::vec::Vec<u8>>> PemObject for Timpl PemObject for PrivateKeyDer<'static>impl PemObject for (SectionKind, Vec<u8>)impl<T> PemObject for PrivatePkcs1KeyDer<'a>impl<T> PemObject for CertificateDer<'a>impl<T> PemObject for EchConfigListBytes<'a>impl<T> PemObject for PrivatePkcs8KeyDer<'a>impl<T> PemObject for CertificateRevocationListDer<'a>impl<T> PemObject for CertificateSigningRequestDer<'a>impl<T> PemObject for SubjectPublicKeyInfoDer<'a>