Skip to main content

verify_content_digest

Function verify_content_digest 

Source
pub fn verify_content_digest(header_value: &str, body: &[u8]) -> bool
Expand description

Checks a Content-Digest header value against body for the SHA-256 form.

Covering the content-digest header in a signature only integrity-protects the header string. To bind the actual body, the receiver MUST also call this (and MUST have covered content-digest in the signature). Returns true only if header_value exactly equals the recomputed sha-256=:<base64>: digest of body; other digest algorithms or multi-member values are not recognized and return false.