Skip to main content

verify_answer_token

Function verify_answer_token 

Source
pub fn verify_answer_token(
    token: &str,
    call_id: &str,
    index: u32,
    conversation_id: &str,
    now_ms: u64,
    signer: &ApprovalSigner,
) -> bool
Expand description

Verify an answer token minted by mint_answer_token against the (call_id, index, conversation_id) a Respond call presents it for.

Returns true only when ALL hold: the token decodes; its embedded signature verifies against signer’s public key; its bound identity equals the ones supplied; and now_ms - minted_at_ms is within ANSWER_TOKEN_TTL_MS (a token minted in the future, by clock skew beyond the TTL, also fails — fail closed rather than trust an out-of-bounds clock). Fails closed on any malformed field.