実現値ダイジェスト

Digest: ヘッダー (HTTP)

[1] Digest: ヘッダーは、 実現値のダイジェスト値を表します。

[6] auth-scheme の Digest (Digest認証) とは関係ありません。

仕様書

意味

[19] Digest: ヘッダーは、メッセージによって説明される実現値のダイジェストを表します >>18。 なおその実現値は全体がメッセージ本体に入っていることもあれば、 一部しか入っていないこともありますし、まったく入っていないこともあります >>18。

構文

[4] Digest: ヘッダーの値は、0個以上の実現値ダイジェストのリスト (#) です >>18。

  1. ?
    1. 実現値ダイジェスト
    2. *
      1. OWS
      2. ,
      3. OWS
      4. 実現値ダイジェスト
[20] 複数の実現値ダイジェストを指定できるのは、 複数の利用者やブラウザーで共有されるキャッシュなどで有用であろうことから >>18 とされています。

[11] 実現値ダイジェスト (instance digest) は、 ダイジェストアルゴリズムと =、 ダイジェストアルゴリズムの出力によって構成されます >>10。

  1. ダイジェストアルゴリズム
  2. =
  3. アルゴリズムの出力
[16] = の前後に空白を挿入できるかは定かではありません。 仕様書中の例示はすべて空白を含んでいません。

[28] ダイジェストアルゴリズムとして contentMD5 を使ってはなりません >>27。

[12] アルゴリズムの出力は、メッセージに関連付けられた実現値全体について計算したものです >>10。

実現値は、実現値操作の適用前のものです。差分符号化や範囲指定を行う前の状態であって、必ずしもメッセージ本体として含まれるものとは限りません。

文脈

[21] 送信者は、受信者がダイジェストアルゴリズムに対応しているかに関わらず、 実現値ダイジェストを送信できます >>18。

[30] Metalink/HTTP 鯖は実現値ダイジェストを含めなければなりません >>31。 SHA-256 を使わなければなりません。それ以外も含めても構いません。 >>31

処理

[23] 受信者は、 Digest: ヘッダーの一部または全部の実現値ダイジェストを無視して構いません >>18。

[32] Metalink/HTTP クライアントは、実現値ダイジェストの検証を行わなければなりません >>31。

[34] 実現値ダイジェストが含まれていなければ、Metalink/HTTP 関連の Link: ヘッダーは無視しなければなりません >>33。

歴史

[7] RFC 3230 (実現値要約) 4.3.2 Digest

The Digest message header field provides a message digest of the instance described by the message.

Digest メッセージ頭欄は、 そのメッセージが記述する実現値のメッセージ要約を提供します。

  • Digest = "Digest" ":" #(instance-digest)

The instance described by a message might be fully contained in the message-body, partially-contained in the message-body, or not at all contained in the message-body. The instance is specified by the Request-URI and any cache-validator contained in the message.

メッセージが記述する実現値は message-body に完全に含まれているかもしれませんし。 message-body に部分的に含まれているかもしれませんし、 message-body に全く含まれていないかもしれません。 実現値は Request-URI とメッセージに含まれる任意の cache-validator (キャッシュ検証子) によって指定されます。

A Digest header field MAY contain multiple instance-digest values. This could be useful for responses expected to reside in caches shared by users with different browsers, for example.

Digest 頭欄は、複数の instance-digest 値を含んで構いません。これは、たとえば異なるブラウザの利用者間でキャッシュを共有していると存じていると思われるような応答に有用でしょう。

A recipient MAY ignore any or all of the instance-digests in a Digest header field.

受信者は Digest 頭欄の instance-digest の一部または全部を無視して構いません。

A sender MAY send an instance-digest using a digest-algorithm without knowing whether the recipient supports the digest-algorithm, or even knowing that the recipient will ignore it.

送信者は、受信者がある digest-algorithm に対応しているかどうか知らない場合や、あるいは受信者がこれを無視することをしっていた場合ですら、 その digest-algorithm を使った instance-digest を送信して構いません。

Examples:

  • Digest: md5=HUXZLQLMuI/KZ5KDcJPcOA==
  • Digest: SHA=thvDyvhfIqlvFe+A9MYgxAfm1q5=,unixsum=30637

[35] RFC 3230 (実現値要約) 4.2 Instance digests

An instance digest is the representation of the output of a digest algorithm, together with an indication of the algorithm used (and any parameters).

実現値要約は、要約算法の出力の表現に、 使用している算法の標示 (と引数) を添えたものです。

  • instance-digest = digest-algorithm "=" <encoded digest output 符号化要約出力>

The digest is computed on the entire instance associated with the message. The instance is a snapshot of the resource prior to the application of of any instance manipulation or transfer-coding (see section 3). The byte order used to compute the digest is the transmission byte order defined for the content-type of the instance.

要約はメッセージに関連付けられた実現値全体について計算します。 実現値は実現値操作や転送符号化を適用する前の資源のスナップ写真です (3章参照)。要約を計算するのに使用するバイト順は実現値の内容型で定義されている転送バイト順です。

Note: the digest is computed before the application of any instance manipulation. If a range or a delta-coding [9] is used, the computation of the digest after the computation of the range or delta would not provide a digest useful for checking the integrity of the reassembled instance.

注意: 算法は実現値操作の適用の前に計算します。 範囲または差分符号化を使用する時は、 範囲や差分を計算した後に要約を計算するのであっては再組み立てした実現値の整合性を検査するために有用な要約を提供しません。

The encoded digest output uses the encoding format defined for the specific digest-algorithm. For example, if the digest-algorithm is "MD5", the encoding is base64; if the digest-algorithm is "UNIXsum", the encoding is an ASCII string of decimal digits.

符号化要約出力は指定 digest-algorithm で定義された符号化書式を使用します。例えば、 digest-algorithm が MD5 なら、符号化は base64 です。 digest-algorithm が UNIXsum なら、符号化は十進数の ASCII 文字列です。

Examples:

  • MD5=HUXZLQLMuI/KZ5KDcJPcOA==
  • sha=thvDyvhfIqlvFe+A9MYgxAfm1q5=
  • UNIXsum=30637

[22] RFC 3229 - Delta encoding in HTTP ( ( 版)) <http://tools.ietf.org/html/rfc3229#section-9>

[9] RFC 4229 はIANA登録簿に状態「標準」で登録しています >>8。

実装

[29] webdav: add support for RFC-3230 | Review Request | Review Board ( ( 版)) <https://rb.dcache.org/r/5153/>

例

[5] 次のような実現値ダイジェストの例があります >>10。

[3] 次のような Digest: ヘッダーの例があります。

関連

[2] MD5 を使った要約を入れる頭欄として Content-MD5 があり、MIME や HTTP で用いられています。 Digest はこれをより一般化したものです。

[17] Content-MD5: の他、ダイジェスト認証でもダイジェスト値を使いますが、 これらは payload body に関するものです。それに対して Digest: は実現値に関するものです。

[36] draft-yasskin-http-origin-signed-responses-02 - Signed HTTP Exchanges () <https://tools.ietf.org/html/draft-yasskin-http-origin-signed-responses-02>