Function verify_nonce

Source
pub fn verify_nonce<S>(
    secret: S,
    nonce_b64: &str,
    now_unix: i64,
    max_age_secs: i64,
    ctx: &NonceCtx<'_>,
) -> Result<(), DpopError>
where S: IntoSecretBox,
Expand description

Verify a nonce with age & skew limits, re-binding to the given context. On success returns Ok(()); on failure returns a DpopError (NonceMismatch/NonceStale/FutureSkew).

Accepts either a SecretBox<[u8]> or any type that can be converted to bytes (e.g., &[u8], Vec<u8>). Non-boxed types will be automatically converted to SecretBox internally.