Generate predictable lines and exact boundaries
02A generator writes a form that other tools can read reliably. Its formatting duties are stricter than every parser’s possible acceptance policy.
Separate defective example: BEGIN PUBLIC KEY paired with END PRIVATE KEY violates the generator MUST. The shown checker rejects it; other parsers MAY ignore the closing label. Lowercase begin/end and legacy Proc-Type headers are not the prescribed format.
Source for this drawing: RFC 7468 · Read RFC section 3 ↗
New to this? Start hereA quick picture + helpful background
A message needs an address.
Think of a packet as a small addressed envelope. Devices pass it onward; transport protocols decide what delivery promises an application gets.
Helpful first, if these ideas are unfamiliar
These pictures are analogies to help you learn. The linked RFC explains the actual rules.
Terms in this drawing
Related RFCs and changes
“Updates” changes part of an earlier RFC. “Obsoletes” replaces it. This list shows selected related documents.
Generate the strict form; do not infer generator permission from tolerant readers.
- Generators MUST wrap Base64 at exactly 64 characters per line, except the final line, which contains the remainder within 64 characters. They MUST NOT emit extraneous whitespace. New implementations SHOULD emit Figure 3’s strict format, including the final newline.
- There is exactly one space after BEGIN or END and exactly five hyphens on each side. Verified technical erratum 4508 makes BEGIN and END themselves explicitly case-sensitive, correcting the ABNF (Augmented Backus–Naur Form grammar).
- Unlike legacy PEM, OpenPGP armor and OpenSSH key files, this format does not permit headers alongside the encoded data. Generators SHOULD NOT emit blank space between the opening boundary and Base64.
- A generator MUST match boundary labels. A parser MAY disregard a mismatching closing label; rejecting it is a permissible local policy, not a universal parser MUST.
The 51-byte fixture is only a formatting vector. Its 68 Base64 characters become a 64-character line and a four-character final line; line geometry is schematic.
Read the RFC section ↗