[−][src]Struct x509_parser::pem::Pem
Representation of PEM data
Fields
label: String
The PEM label
contents: Vec<u8>
The PEM decoded data
Methods
impl Pem
[src]
pub fn read(r: impl BufRead + Seek) -> Result<(Pem, usize), PEMError>
[src]
Read a PEM-encoded structure, and decode the base64 data
Returns the certificate (encoded in DER) and the number of bytes read. Allocates a new buffer for the decoded data.
Examples
let file = std::fs::File::open("assets/certificate.pem").unwrap(); let subject = x509_parser::pem::Pem::read(std::io::BufReader::new(file)) .unwrap().0 .parse_x509().unwrap() .tbs_certificate.subject.to_string(); assert_eq!(subject, "CN=lists.for-our.info");
pub fn parse_x509<'pem>(
&'pem self
) -> Result<X509Certificate<'pem>, Err<X509Error>>
[src]
&'pem self
) -> Result<X509Certificate<'pem>, Err<X509Error>>
Decode the PEM contents into a X.509 object
Trait Implementations
Auto Trait Implementations
impl Sync for Pem
impl Unpin for Pem
impl Send for Pem
impl UnwindSafe for Pem
impl RefUnwindSafe for Pem
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,