Beryl::Encoding::PrivacyEnhancedMail
Reads PEM, the textual encoding of RFC 7468: blocks of base64 between
-----BEGIN LABEL----- and -----END LABEL----- lines.
The reader takes the strict form of RFC 7468 §3 with the leniencies
its §5.2 allows: text outside the blocks is ignored (so a file can carry
comments or openssl x509 -text output), lines may end in LF or CRLF,
and base64 lines may be of any length. Inside a block only base64
characters and whitespace may appear, and the END label must match the
BEGIN label.
Beryl::Encoding::PEM.decode(File.read("chain.pem"), label: "CERTIFICATE") # => Array(Bytes)
Constants
LARGEST_TEXT_BYTESIZE = (4 * 1024) * 1024
The largest PEM text the reader takes, 4 MiB (the Mozilla root set is about 250 KB; a certificate chain a few KB).
Class methods
Returns the bytes of every block labeled label in text, ignoring blocks with other labels.