pub fn sign_object_integrity_proof(
document: &Value,
verification_method: &str,
signing_key: &[u8; 32],
now: i64,
) -> Result<Value, Error>Expand description
Attach an eddsa-jcs-2022 integrity proof to document.
The inverse of verify_object_integrity_proof, and deliberately written
to be verified by it: the proof configuration is hashed, then the document
without its proof, and the Ed25519 signature covers both hashes in that
order.
A proof authenticates the activity rather than the transport that carried it, which is what lets a relayed or forwarded activity still be attributed. Mastodon 4.7 verifies these but does not produce them.
§Arguments
document– the activity to sign; must be a JSON objectverification_method– the id of the key, as published in the actor’sassertionMethodsigning_key– the raw 32-byte Ed25519 seednow– the time, in seconds since the Unix epoch, which becomes the proof’screated
§Errors
Returns an error if the document is not an object or cannot be canonicalized.