[][src]Function wascap::wasm::extract_claims

pub fn extract_claims(
    contents: impl AsRef<[u8]>
) -> Result<Option<Token<Actor>>>

Extracts a set of claims from the raw bytes of a WebAssembly module. In the case where no JWT is discovered in the module, this function returns None. If there is a token in the file with a valid hash, then you will get a Token back containing both the raw JWT and the decoded claims.

Errors

Will return errors if the file cannot be read, cannot be parsed, contains an improperly forms JWT, or the module_hash claim inside the decoded JWT does not match the hash of the file.