Function sigv4_verify

Source
pub fn sigv4_verify<A1, A2>(
    req: &Request,
    signing_key: &SigningKey,
    allowed_mismatch: Option<Duration>,
    region: A1,
    service: A2,
) -> Result<(), SignatureError>
where A1: AsRef<str>, A2: AsRef<str>,
Expand description

Verify a SigV4 request. This verifies that the request timestamp is not beyond the allowed timestamp mismatch against the current time, and that the request signature matches our expected signature.

§Errors

If the request timestamp is outside the allowed timestamp mismatch, a SignatureError::TimestampOutOfRange error is returned.

If the request signature does not match the expected signature, a SignatureError::InvalidSignature error is returned.

§Panics

If the expected signature string is not 64 bytes long, this function will panic. This should never happen.