Skip to main content

pamoja_envelope_verify

Function pamoja_envelope_verify 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_envelope_verify( bytes: *const u8, len: usize, public_key: *const u8, out_manifest: *mut PamojaManifest, ) -> PamojaStatus
Expand description

Verifies an envelope against a key and reads the manifest inside it.

§Arguments

  • bytes - the signed envelope.
  • len - the length of bytes.
  • public_key - the PAMOJA_KEY_LEN-byte key expected to have signed it.
  • out_manifest - receives the verified manifest.

§Returns

PamojaStatus::Ok if the signature is from that key, or PamojaStatus::Auth if it is not.

§Safety

bytes must point to at least len readable bytes or be null when len is 0, public_key must point to at least PAMOJA_KEY_LEN readable bytes, and out_manifest must be writable.