Skip to main content

create

Function create 

Source
pub fn create(
    issuer: &str,
    audience: &str,
    capabilities: Vec<Capability>,
    id: &KeyPair,
    opts: CreateOpts,
) -> Result<Vec<u8>, UcanError>
Expand description

Mints a new UCAN token, self-issued and signed by id. issuer and audience are opaque DID strings (e.g. "did:macula:io.macula.acme") — this module does not validate or resolve DID structure, matching macula_ucan_nif:create/4,5’s own scope exactly (that’s macula_did_nif’s job on the Erlang side, out of scope here). id signs with its own Ed25519 private key; the resulting token verifies against id’s public key (KeyPair::node_id), the same convention every advertised capability in this SDK already uses.