a Secarta project ...

HTTPsec Authentication Protocol


Preamble

4.12. digest

The the optional digest directive in a continuation request or a continuation response is a hash digest of the message entity-body. It's role is to enable message entity-body authentication: its value is an input to the computation of the mac directive (via the appropriate message transcript). This directive SHOULD be present in any continuation message for which it is feasible to calculate a hash digest of the entity-body (including, trivially, all those with an empty entity-body).

The value of the digest directive is a hash of the entity-body, computed using the Hash Algorithm. The hash MUST be computed on the entity-body as manifest after all encodings declared in the Content-Encoding [HTTP][ 14.11] header (including the cipher encoding with the identifier "x-httpsec/1.0-cipher" defined in the Message Body Ciphering section) and before Transfer-Encoding [HTTP][ 14.41].

The absence of the digest directive implies that the message entity-body is not authenticated. This may be the case if the entity-body cannot be hashed for some reason by the message sender, for instance if it is a stream of indeterminate length.

The value of the digest directive MUST be base64 encoded. For empty message bodies, it is the following constant (being the Base64 representation of the hash of zero bytes):

47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=