[][src]Function wascap::wasm::embed_claims

pub fn embed_claims(
    orig_bytecode: &[u8],
    claims: &Claims<Actor>,
    kp: &KeyPair
) -> Result<Vec<u8>>

This function will embed a set of claims inside the bytecode of a WebAssembly module. The claims are converted into a JWT and signed using the provided KeyPair. According to the WebAssembly custom section specification, arbitary sets of bytes can be stored in a WebAssembly module without impacting parsers or interpreters. Returns a vector of bytes representing the new WebAssembly module which can be saved to a .wasm file