Skip to main content

verify_token

Function verify_token 

Source
pub fn verify_token(
    token_hex: &str,
    secret: &[u8; 32],
) -> Result<(u64, u64), TokenError>
Expand description

Verify a hex-encoded token against secret. Returns the bound (for_node, expiry_unix_secs) on success.

The HMAC comparison is constant-time (via hmac::Mac::verify_slice which uses the subtle crate internally).