Function pem_rfc7468::encapsulated_len_wrapped
source · pub fn encapsulated_len_wrapped(
label: &str,
line_width: usize,
line_ending: LineEnding,
input_len: usize
) -> Result<usize>
Expand description
Compute the length of a PEM encoded document with the Base64 body
line wrapped at the specified width
.
This is the same as encapsulated_len
, which defaults to a width of 64.
Note that per RFC7468 § 2 encoding PEM with any other wrap width besides 64 is technically non-compliant:
Generators MUST wrap the base64-encoded lines so that each line consists of exactly 64 characters except for the final line, which will encode the remainder of the data (within the 64-character line boundary)