Skip to main content

pamoja_device_identity_sign_message

Function pamoja_device_identity_sign_message 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_device_identity_sign_message( identity: *const PamojaDeviceIdentity, payload: *const u8, payload_len: usize, out_buffer: *mut *mut PamojaBuffer, ) -> PamojaStatus
Expand description

Signs a payload and returns one buffer holding the signature and the payload.

This is the answering half of pamoja_public_identity_verify_message: the caller sends one blob instead of keeping a payload and a detached signature together and splitting them correctly at the far end.

§Returns

PamojaStatus::Ok on success, with *out_buffer set to a new buffer handle the caller must release with pamoja_buffer_free.

§Safety

identity must be a live handle from pamoja_device_identity_new; payload must point to at least payload_len readable bytes, or be null when payload_len is 0; and out_buffer must point to a writable *mut PamojaBuffer.