Skip to main content

encode

Function encode 

Source
pub fn encode(
    header: &Header,
    header_aad: &[u8],
    slots: Vec<Slot>,
    payload: SealedPayload,
) -> Result<Vec<u8>, SealError>
Expand description

Encode a full bundle file (framing prefix + JSON body).

header_aad MUST be the exact bytes returned by Header::to_aad_bytes for header: the same bytes the payload/slots were sealed under.

ยงErrors

Returns SealError::Format on JSON serialization failure.