Module Netascii_armor

module Netascii_armor: sig .. end

Messages with ASCII armor


There are various forms of ASCII-armored messages:

type armor_type = [ `Base64 | `OpenPGP | `Plain ] 
type armored_message = [ `Base64 of Netmime.mime_body
| `OpenPGP of Netmime.mime_header * Netmime.mime_body * int
| `Plain of Netmime.mime_body ]

Messages:

type armored_message_ro = [ `Base64 of Netmime.mime_body_ro
| `OpenPGP of Netmime.mime_header_ro * Netmime.mime_body_ro * int
| `Plain of Netmime.mime_body_ro ]

The read-only version of armored_message

type armor_spec = (string * armor_type) list 

Which types of armor to decode, and how. The strings are the identifiers in the boundaries, e.g. include "PRIVACY-ENHANCED MESSAGE" if the boundaries are "-----BEGIN PRIVACY-ENHANCED MESSAGE-----" and "-----END PRIVACY-ENHANCED MESSAGE-----". For every type you can define the armor_type.

val parse : armor_spec ->
Netchannels.in_obj_channel ->
(string * armored_message_ro) list

Parses the channel, and returns all messages that are enabled in the specification.

The channel is read line-by-line.