4.2. Primary Mechanism: ASCII Delimiters (No New Code Points)
The delimiters are -----BEGIN CONTENT BINDING----- and -----END CONTENT BINDING-----.¶
Delimiter matching MUST be byte-for-byte and case-sensitive. The delimiter MUST occupy an entire line, with no leading or trailing characters other than an optional CR before LF. Visually similar code points (en-dash U+2013, em-dash U+2014, minus sign U+2212) MUST NOT match the ASCII hyphen-minus. Per-line matching needs no lookahead; malformed-block recovery (Section 4.6.2, step 7) rewinds to the recorded block-start, but that is recovery, not detection.¶
Normative rules:¶
- Each delimiter MUST appear on its own line. The start delimiter MUST be preceded by a blank line (or appear at the beginning of the text stream). The end delimiter MUST be followed by end-of-text, a blank line, or another start delimiter.¶
- Line endings within the content binding block (delimiters, headers, and Base64 payload) MUST use LF (U+000A). Implementations MUST accept CRLF and normalize to LF during parsing. The text content preceding the block MAY use any line-ending convention.¶
- The payload region contains an optional header section followed by Base64-encoded data. Headers, if present, are lines of the form
Name: valueusing only printable ASCII, terminated by a blank line before the Base64 data. Theheader-namegrammar (Section 4.6.1) admits any printable ASCII character except colon; this is deliberately more permissive than MIME tokens, so higher-level protocols with their own naming conventions can use content binding as a transport. Higher-level protocols MAY restrict header names further within their own namespace.¶ - Implementations MUST support multiple content binding blocks in a single text stream.¶
- Implementations MUST NOT modify the text content preceding the block.¶
- Aware implementations MUST NOT present the content binding block as ordinary text content and SHOULD provide a visual indication of its presence.¶
The delimiter string is theoretically possible in ordinary text, but PGP has shared this risk for three decades without a known collision.¶