Skip to main content

sign

Function sign 

Source
pub fn sign(
    registry: &Registry,
    document: &Value,
    key_id: &str,
    private_key: &PrivateKey,
    created: i64,
    expires: i64,
) -> Result<Value, Error>
Expand description

Sign document as key_id, which private_key is the key of: the document with an RsaSignature2017 made at created and good until expires (Unix seconds), and the security context added to its @context, as ActivityPub::LinkedDataSignature#sign! gives it.

A signature the document already carries is replaced.

ยงErrors

When the document, or the options, cannot be turned into RDF: a context ojak does not ship, or a JSON-LD feature ojak does not turn into RDF.