Skip to main content

pamoja_updater_adopt

Function pamoja_updater_adopt 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn pamoja_updater_adopt( updater: *mut PamojaUpdater, bytes: *const u8, len: usize, has_now: bool, now: u64, out_delegation: *mut PamojaDelegation, ) -> PamojaStatus
Expand description

Adopts a delegation, so releases signed by the key it names are accepted.

§Arguments

  • updater - the updater.
  • bytes - the signed delegation envelope.
  • len - the length of bytes.
  • has_now - true if the device has a clock, false if it does not.
  • now - seconds since the Unix epoch, read only when has_now is true.
  • out_delegation - receives the adopted delegation, or may be null.

§Returns

PamojaStatus::Ok if the delegation was signed by the anchor, is newer than the one held, and has not expired.

§Safety

updater must be a live handle from pamoja_updater_new, bytes must point to at least len readable bytes or be null when len is 0, and out_delegation must be writable or null.