pub fn write_extensions<W: Write>(
writer: &mut W,
version: u8,
extensions: Option<&[u8]>,
) -> Result<(), AescryptError>Expand description
Writes the v3 extension-block section, terminated by a zero-length record.
If extensions is Some(bytes), those bytes are written verbatim. If
None, the canonical “no extensions” terminator [0x00, 0x00] is written.
§Format
Each extension is a u16 big-endian length followed by length payload
bytes; a length of 0 ends the section. When extensions is Some, the
caller is responsible for emitting any payload extensions and the trailing
[0x00, 0x00] terminator.
§Errors
AescryptError::UnsupportedVersion—version < 3.AescryptError::Io—writerreturned an error.