Skip to main content

base64_ng_pem/
lib.rs

1#![cfg_attr(not(feature = "std"), no_std)]
2#![deny(unsafe_code)]
3#![deny(missing_docs)]
4#![deny(clippy::all)]
5#![deny(clippy::pedantic)]
6
7//! Optional `simd` and `checked-backend` features forward to the core's ordinary
8//! kernels without changing defaults or grammar. `checked-backend` implies
9//! `simd`; neither enables `std`, `alloc` or `secrets` on its own. Eligible
10//! sizes and CPU/build capabilities still govern acceleration. Secret/CT paths
11//! remain separate. Without core `std`, complete static ISA features are required.
12
13//! Bounded RFC 7468 textual encoding parsing and generation.
14//!
15//! This crate owns complete encapsulation boundaries, labels, Base64 bodies,
16//! adjacent text, multiple-block documents, and line-ending policy. It does
17//! not parse the ASN.1 payload and deliberately rejects legacy OpenSSL
18//! encapsulated headers.
19
20extern crate alloc;
21
22mod error;
23mod generator;
24mod label;
25mod limits;
26mod parser;
27#[cfg(feature = "secrets")]
28mod secret;
29mod types;
30
31pub use error::{PemError, PemErrorKind};
32pub use generator::{
33    PemBlockEncoder, encode_pem_block_into, encode_pem_block_to_string, pem_block_encoded_len,
34};
35pub use label::{PemLabel, PemLabelError};
36pub use limits::PemLimits;
37pub use parser::{PemDocumentParser, parse_pem_document};
38#[cfg(feature = "secrets")]
39pub use secret::{SecretPemBlock, parse_pem_secret_block};
40pub use types::{
41    PemBlock, PemDocument, PemGenerationOptions, PemLineEnding, PemParsePolicy, PemParseReport,
42};