Function rocket::mtls::x509::parse_x509_pem

source ·
pub fn parse_x509_pem(i: &[u8]) -> Result<(&[u8], Pem), Err<PEMError>>
Available on crate feature mtls only.
Expand description

Read a PEM-encoded structure, and decode the base64 data

Return a structure describing the PEM object: the enclosing tag, and the data. Allocates a new buffer for the decoded data.

Note that only the first PEM block is decoded. To iterate all blocks from PEM data, use Pem::iter_from_buffer.

For X.509 (CERTIFICATE tag), the data is a certificate, encoded in DER. To parse the certificate content, use Pem::parse_x509 or parse_x509_certificate.