Skip to main content

pamoja_envelope_body

Function pamoja_envelope_body 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_envelope_body( bytes: *const u8, len: usize, ) -> *mut PamojaBuffer
Expand description

Copies out the signed body of an envelope, without checking the signature.

This is what a gateway relays onward unchanged, and what a device hashes when it checks the signature itself.

§Arguments

  • bytes - the signed envelope.
  • len - the length of bytes.

§Returns

A buffer the caller must release with pamoja_buffer_free, or null if the envelope is malformed.

§Safety

bytes must point to at least len readable bytes, or be null when len is 0.