Function wascap::wasm::extract_claims

source ·
pub fn extract_claims(
    contents: impl AsRef<[u8]>,
) -> Result<Option<Token<Component>>>
Expand description

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 an error if hash computation fails or it can’t read the JWT from inside a section’s data, etc