Skip to main content

Module pem

Module pem 

Source
Expand description

Minimal PEM (RFC 7468) encoding/decoding.

Implemented in-crate because the pinned rustls-pki-types on the current registry mirror has no pem feature, and because key/certificate PEM handling needs strict control over labels.

Structs§

Section
One decoded PEM section: label (e.g. "CERTIFICATE") and DER bytes.

Functions§

encode
Encode der into a PEM block with the given label, 64-char base64 lines.
first_section_with_label
Decode the first section whose label is in labels.
sections
Decode every PEM section found in data. Non-PEM content between blocks is ignored; malformed blocks are skipped (lenient semantics for leading garbage; strict enough for our trusted storage inputs).