Skip to main content

cavage_verify

Function cavage_verify 

Source
pub fn cavage_verify<B, F>(
    req: &Request<B>,
    resolve_key: F,
) -> Result<CavageVerified, Error>
Expand description

Verifies a Cavage-signed request against a key returned by resolve_key(key_id).

The resolver closure is where the caller performs WebFinger lookup, a database fetch or any other means of turning a keyId URI into a VerifyingKey. The closure fails whenever the key cannot be found or the caller wants to reject the actor for policy reasons.

ยงErrors

Returns Error::MissingHeader if the request lacks a Signature: header; Error::MalformedSignatureHeader / Error::MissingSignatureParameter if the header is unparseable; Error::KeyResolution if the resolver fails; and Error::VerificationFailed if the signature does not match.