CINXE.COM

RFC 9530 - Digest Fields

<!DOCTYPE html SYSTEM "about:legacy-compat"> <html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>RFC 9530 - Digest Fields</title><script> function getMeta(rfcno, container) { var xhr = new XMLHttpRequest(); xhr.open("GET", "https://www.rfc-editor.org/rfc/rfc" + rfcno + ".json", true); xhr.onload = function (e) { if (xhr.readyState === 4) { if (xhr.status === 200) { var data = JSON.parse(xhr.response); var cont = document.getElementById(container); // empty the container while (cont.firstChild) { cont.removeChild(myNode.firstChild); } var c = data.status; if (c) { var bld = newElementWithText("b", c); cont.appendChild(bld); } else { cont.appendChild(newElementWithText("i", "(document status unknown)")); } c = data.updated_by; if (c && c.length > 0 && c[0] !== null && c[0].length > 0) { cont.appendChild(newElement("br")); cont.appendChild(newText("Updated by: ")); appendRfcLinks(cont, c); } c = data.obsoleted_by; if (c && c.length > 0 && c[0] !== null && c[0].length > 0) { cont.appendChild(newElement("br")); cont.appendChild(newText("Obsoleted by: ")); appendRfcLinks(cont, c); } c = data.errata_url; if (c) { cont.appendChild(newElement("br")); var link = newElementWithText("a", "errata"); link.setAttribute("href", c); var errata = newElementWithText("i", "This document has "); errata.appendChild(link); errata.appendChild(newText(".")); cont.appendChild(errata); } cont.style.display = "block"; } else { console.error(xhr.statusText); } } }; xhr.onerror = function (e) { console.error(xhr.status + " " + xhr.statusText); }; xhr.send(null); } function appendRfcLinks(parent, updates) { var template = "https://www.rfc-editor.org/rfc/rfc{rfc}.html"; for (var i = 0; i < updates.length; i++) { var rfc = updates[i].trim().toLowerCase(); if (rfc.substring(0, 3) == "rfc") { var no = parseInt(rfc.substring(3), 10); var link = newElement("a"); link.setAttribute("href", template.replace("{rfc}", no)); link.appendChild(newText(no)); parent.appendChild(link); } else { parent.appendChild(newText(rfc)); } if (i != updates.length - 1) { parent.appendChild(newText(", ")); } } } // DOM helpers function newElement(name) { return document.createElement(name); } function newElementWithText(name, txt) { var e = document.createElement(name); e.appendChild(newText(txt)); return e; } function newText(text) { return document.createTextNode(text); } </script><script> function anchorRewrite() { map = { }; if (window.location.hash.length >= 1) { var fragid = window.location.hash.substr(1); if (fragid) { if (! document.getElementById(fragid)) { var prefix = "rfc."; var mapped = map[fragid]; if (mapped) { window.location.hash = mapped; } else if (fragid.indexOf("section-") == 0) { window.location.hash = prefix + "section." + fragid.substring(8).replace("-",".p."); } else if (fragid.indexOf("appendix-") == 0) { window.location.hash = prefix + "section." + fragid.substring(9).replace("-",".p."); } else if (fragid.indexOf("s-") == 0) { var postfix = fragid.substring(2); if (postfix.startsWith("abstract")) { window.location.hash = prefix + postfix; } else if (postfix.startsWith("note-")) { window.location.hash = prefix + "note." + postfix.substring(5).replace("-",".p."); } else { window.location.hash = prefix + "section." + postfix.replace("-",".p."); } } else if (fragid.indexOf("p-") == 0) { var r = fragid.substring(2); var p = r.indexOf("-"); if (p >= 0) { window.location.hash = prefix + "section." + r.substring(0, p) + ".p." + r.substring(p + 1); } } } } } } window.addEventListener('hashchange', anchorRewrite); window.addEventListener('DOMContentLoaded', anchorRewrite); </script><meta name="viewport" content="width=device-width, initial-scale=1"><meta property="og:type" content="article"><meta property="og:title" content="RFC9530"><meta property="og:description" content="Digest Fields"><meta property="og:url" content="https://httpwg.org/specs/rfc9530.html"><meta property="og:site_name" content="IETF HTTP Working Group Specifications"><meta property="og:image" content="https://httpwg.org/assets/favicon/apple-icon-180x180.png"><link rel="stylesheet" type="text/css" href="/assets/node_modules/bootstrap/dist/css/bootstrap.min.css"><style type="text/css"> body { padding-top: 80px; padding-bottom: 80px; position: relative; } .table.header th, .table.header td { border-top: none; padding: 0; } #sidebar { margin-top: -10px; height: 90%; overflow-y: auto; font-size: 90%; } #rfc\.meta { width: 40%; float: right } .toc ul { list-style: none; } .filename { color: rgb(119, 119, 119); font-size: 23px; font-weight: normal; height: auto; line-height: 23px; } dl { margin-left: 1em; } dl.dl-horizontal: { margin-left: 0; } dl > dt { float: left; margin-right: 1em; } dl.nohang > dt { float: none; } dl > dd { margin-bottom: .5em; } dl.compact > dd { margin-bottom: 0em; } dl > dd > dl { margin-top: 0.5em; margin-bottom: 0em; } ul.empty { list-style-type: none; } ul.empty li { margin-top: .5em; } td.reference { padding-right: 1em; vertical-align: top; } .feedback { position: fixed; bottom: 5px; right: 5px; } .fbbutton { margin-left: 5px; } h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { color: rgb(51, 51, 51); } span.tt { font: 11pt consolas, monospace; font-size-adjust: none; } </style><link rel="stylesheet" type="text/css" href="/assets/site.css"><link rel="Contents" href="#rfc.toc"><link rel="Author" href="#rfc.authors"><link rel="License" href="#rfc.copyrightnotice"><link rel="Chapter" title="1 Introduction" href="#rfc.section.1"><link rel="Chapter" title="2 The Content-Digest Field" href="#rfc.section.2"><link rel="Chapter" title="3 The Repr-Digest Field" href="#rfc.section.3"><link rel="Chapter" title="4 Integrity Preference Fields" href="#rfc.section.4"><link rel="Chapter" title="5 Hash Algorithm Considerations and Registration" href="#rfc.section.5"><link rel="Chapter" title="6 Security Considerations" href="#rfc.section.6"><link rel="Chapter" title="7 IANA Considerations" href="#rfc.section.7"><link rel="Chapter" title="8 References" href="#rfc.section.8"><link rel="Appendix" title="A Resource Representation and Representation Data" href="#rfc.section.A"><link rel="Appendix" title="B Examples of Unsolicited Digest" href="#rfc.section.B"><link rel="Appendix" title="C Examples of Want-Repr-Digest Solicited Digest" href="#rfc.section.C"><link rel="Appendix" title="D Sample Digest Values" href="#rfc.section.D"><link rel="Appendix" title="E Migrating from RFC 3230" href="#rfc.section.E"><link rel="Appendix" title="Acknowledgements" href="#rfc.section.unnumbered-4"><link href="https://datatracker.ietf.org/doc/draft-ietf-httpbis-digest-headers-13" rel="prev"><link href="https://dx.doi.org/10.17487/rfc9530" rel="alternate"><link href="urn:issn:2070-1721" rel="alternate"><link rel="Alternate" title="Plain Text Version" href="http://www.ietf.org/rfc/rfc9530.txt"><link rel="Help" title="RFC-Editor's Status Page" href="https://www.rfc-editor.org/info/rfc9530"><meta name="viewport" content="initial-scale=1"><meta name="generator" content="https://github.com/mnot/RFCBootstrap XSLT vendor: Saxonica http://www.saxonica.com/"><meta name="keywords" content="Digest"><link rel="schema.dcterms" href="http://purl.org/dc/terms/"><meta name="dcterms.creator" content="Polli, R."><meta name="dcterms.creator" content="Pardue, L."><meta name="dcterms.identifier" content="urn:ietf:rfc:9530"><meta name="dcterms.issued" content="2024-02"><meta name="dct.replaces" content="urn:ietf:rfc:3230"><meta name="dcterms.abstract" content="This document defines HTTP fields that support integrity digests. The Content-Digest field can be used for the integrity of HTTP message content. The Repr-Digest field can be used for the integrity of HTTP representations. Want-Content-Digest and Want-Repr-Digest can be used to indicate a sender's interest and preferences for receiving the respective Integrity fields.This document obsoletes RFC 3230 and the Digest and Want-Digest HTTP fields."><meta name="dcterms.isPartOf" content="urn:issn:2070-1721"><meta name="description" content="This document defines HTTP fields that support integrity digests. The Content-Digest field can be used for the integrity of HTTP message content. The Repr-Digest field can be used for the integrity of HTTP representations. Want-Content-Digest and Want-Repr-Digest can be used to indicate a sender's interest and preferences for receiving the respective Integrity fields.This document obsoletes RFC 3230 and the Digest and Want-Digest HTTP fields."></head><body onload="getMeta(9530,&#34;rfc.meta&#34;);"><nav class="navbar navbar-dark bg-dark d-print-none navbar-expand-lg fixed-top ps-3 pe-3" role="navigation"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-collapse" aria-controls="navbarToggler" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button> <a class="navbar-brand" href="https://httpwg.org/"><img src="https://httpwg.org/assets/http.svg" height="23"></a> </div> <div class="collapse navbar-collapse" id="navbar-collapse"> <div class="navbar-nav me-auto"> <a class="nav-item ms-1 text-white" href="https://httpwg.org/specs/">📄 Documentation</a> <div class="dropdown ms-4"> <a href="#" class="nav-item dropdown-toggle text-white" data-bs-toggle="dropdown">Work in Progress</a> <ul class="dropdown-menu"><li class="dropdown-item"><a href="https://httpwg.org/http-extensions/">HTTP Extensions</a></li><li class="dropdown-item"><a href="https://github.com/httpwg/admin/issues?q=is%3Aissue+is%3Aopen+label%3Aadoption">Future Work</a></li></ul> </div> <div class="dropdown ms-4"> <a href="#" class="nav-item dropdown-toggle text-white" data-bs-toggle="dropdown">Participate</a> <ul class="dropdown-menu"><li class="dropdown-item"><a href="https://httpwg.org/about/">About the HTTP Working Group</a></li><li class="divider"></li><li class="dropdown-item"><a href="https://httpwg.org/CONTRIBUTING.html">Contribution Policy</a></li><li class="dropdown-item"><a href="http://datatracker.ietf.org/wg/httpbis/charter/">WG Charter</a></li><li class="dropdown-item"><a href="http://lists.w3.org/Archives/Public/ietf-http-wg/">Group Mailing List 📨</a></li><li class="dropdown-item"><a href="https://httpwg.org/wg-materials/">Meeting Materials</a></li><li class="dropdown-item"><a href="https://httpwg.org/admin/editors/">Document Editor Resources</a></li></ul> </div> </div> </div> </nav><div class="container" id="top"><div class="row"><div class="col-lg-4 order-last d-none d-lg-block" id="sidebar" role="navigation"><div class="navbar"><div class="navbar-brand"><a href="#top"><strong>RFC </strong>9530</a></div><br clear="all"><div class=""><div class="toc "><ul><li><a href="#rfc.section.1">1.</a>&nbsp;&nbsp;&nbsp;<a href="#introduction">Introduction</a><ul><li><a href="#rfc.section.1.1">1.1.</a>&nbsp;&nbsp;&nbsp;<a href="#document-structure">Document Structure</a></li><li><a href="#rfc.section.1.2">1.2.</a>&nbsp;&nbsp;&nbsp;<a href="#concept-overview">Concept Overview</a></li><li><a href="#rfc.section.1.3">1.3.</a>&nbsp;&nbsp;&nbsp;<a href="#obsolete-3230">Obsoleting RFC 3230</a></li><li><a href="#rfc.section.1.4">1.4.</a>&nbsp;&nbsp;&nbsp;<a href="#notational-conventions">Notational Conventions</a></li></ul></li><li><a href="#rfc.section.2">2.</a>&nbsp;&nbsp;&nbsp;<a href="#content-digest">The <span class="tt">Content-Digest</span> Field</a></li><li><a href="#rfc.section.3">3.</a>&nbsp;&nbsp;&nbsp;<a href="#representation-digest">The <span class="tt">Repr-Digest</span> Field</a><ul><li><a href="#rfc.section.3.1">3.1.</a>&nbsp;&nbsp;&nbsp;<a href="#state-changing-requests">Using <span class="tt">Repr-Digest</span> in State-Changing Requests</a></li><li><a href="#rfc.section.3.2">3.2.</a>&nbsp;&nbsp;&nbsp;<a href="#digest-and-content-location"><span class="tt">Repr-Digest</span> and Content-Location in Responses</a></li></ul></li><li><a href="#rfc.section.4">4.</a>&nbsp;&nbsp;&nbsp;<a href="#want-fields">Integrity Preference Fields</a></li><li><a href="#rfc.section.5">5.</a>&nbsp;&nbsp;&nbsp;<a href="#algorithms">Hash Algorithm Considerations and Registration</a></li><li><a href="#rfc.section.6">6.</a>&nbsp;&nbsp;&nbsp;<a href="#security">Security Considerations</a><ul><li><a href="#rfc.section.6.1">6.1.</a>&nbsp;&nbsp;&nbsp;<a href="#sec-limitations">HTTP Messages Are Not Protected in Full</a></li><li><a href="#rfc.section.6.2">6.2.</a>&nbsp;&nbsp;&nbsp;<a href="#end-to-end-integrity">End-to-End Integrity</a></li><li><a href="#rfc.section.6.3">6.3.</a>&nbsp;&nbsp;&nbsp;<a href="#usage-in-signatures">Usage in Signatures</a></li><li><a href="#rfc.section.6.4">6.4.</a>&nbsp;&nbsp;&nbsp;<a href="#usage-in-trailer-fields">Usage in Trailer Fields</a></li><li><a href="#rfc.section.6.5">6.5.</a>&nbsp;&nbsp;&nbsp;<a href="#variations-within-content-encoding">Variations within Content-Encoding</a></li><li><a href="#rfc.section.6.6">6.6.</a>&nbsp;&nbsp;&nbsp;<a href="#sec-agility">Algorithm Agility</a></li><li><a href="#rfc.section.6.7">6.7.</a>&nbsp;&nbsp;&nbsp;<a href="#sec-exhaustion">Resource Exhaustion</a></li></ul></li><li><a href="#rfc.section.7">7.</a>&nbsp;&nbsp;&nbsp;<a href="#iana-considerations">IANA Considerations</a><ul><li><a href="#rfc.section.7.1">7.1.</a>&nbsp;&nbsp;&nbsp;<a href="#http-field-name-registration">HTTP Field Name Registration</a></li><li><a href="#rfc.section.7.2">7.2.</a>&nbsp;&nbsp;&nbsp;<a href="#establish-hash-algorithm-registry">Creation of the Hash Algorithms for HTTP Digest Fields Registry</a></li><li><a href="#rfc.section.7.3">7.3.</a>&nbsp;&nbsp;&nbsp;<a href="#deprecate-the-hypertext-transfer-protocol-http-digest-algorithm-values-registry">Deprecate the Hypertext Transfer Protocol (HTTP) Digest Algorithm Values Registry</a></li></ul></li><li><a href="#rfc.section.8">8.</a>&nbsp;&nbsp;&nbsp;<a href="#rfc.references">References</a><ul><li><a href="#rfc.section.8.1">8.1.</a>&nbsp;&nbsp;&nbsp;<a href="#rfc.references.2">Normative References</a></li><li><a href="#rfc.section.8.2">8.2.</a>&nbsp;&nbsp;&nbsp;<a href="#rfc.references.3">Informative References</a></li></ul></li><li><a href="#rfc.section.A">Appendix A.</a>&nbsp;&nbsp;&nbsp;<a href="#resource-representation">Resource Representation and Representation Data</a></li><li><a href="#rfc.section.B">Appendix B.</a>&nbsp;&nbsp;&nbsp;<a href="#examples-unsolicited">Examples of Unsolicited <span class="tt">Digest</span></a><ul><li><a href="#rfc.section.B.1">B.1.</a>&nbsp;&nbsp;&nbsp;<a href="#example-full-representation">Server Returns Full Representation Data</a></li><li><a href="#rfc.section.B.2">B.2.</a>&nbsp;&nbsp;&nbsp;<a href="#server-returns-no-representation-data">Server Returns No Representation Data</a></li><li><a href="#rfc.section.B.3">B.3.</a>&nbsp;&nbsp;&nbsp;<a href="#server-returns-partial-representation-data">Server Returns Partial Representation Data</a></li><li><a href="#rfc.section.B.4">B.4.</a>&nbsp;&nbsp;&nbsp;<a href="#client-and-server-provide-full-representation-data">Client and Server Provide Full Representation Data</a></li><li><a href="#rfc.section.B.5">B.5.</a>&nbsp;&nbsp;&nbsp;<a href="#client-provides-full-representation-data-server-provides-no-representation-data">Client Provides Full Representation Data and Server Provides No Representation Data</a></li><li><a href="#rfc.section.B.6">B.6.</a>&nbsp;&nbsp;&nbsp;<a href="#client-and-server-provide-full-representation-data-1">Client and Server Provide Full Representation Data</a></li><li><a href="#rfc.section.B.7">B.7.</a>&nbsp;&nbsp;&nbsp;<a href="#post-not-request-uri">POST Response Does Not Reference the Request URI</a></li><li><a href="#rfc.section.B.8">B.8.</a>&nbsp;&nbsp;&nbsp;<a href="#post-referencing-status">POST Response Describes the Request Status</a></li><li><a href="#rfc.section.B.9">B.9.</a>&nbsp;&nbsp;&nbsp;<a href="#digest-with-patch"><span class="tt">Digest</span> with PATCH</a></li><li><a href="#rfc.section.B.10">B.10.</a>&nbsp;&nbsp;&nbsp;<a href="#error-responses">Error Responses</a></li><li><a href="#rfc.section.B.11">B.11.</a>&nbsp;&nbsp;&nbsp;<a href="#use-with-trailer-fields-and-transfer-coding">Use with Trailer Fields and Transfer Coding</a></li></ul></li><li><a href="#rfc.section.C">Appendix C.</a>&nbsp;&nbsp;&nbsp;<a href="#examples-solicited">Examples of <span class="tt">Want-Repr-Digest</span> Solicited <span class="tt">Digest</span></a><ul><li><a href="#rfc.section.C.1">C.1.</a>&nbsp;&nbsp;&nbsp;<a href="#server-selects-clients-least-preferred-algorithm">Server Selects Client's Least Preferred Algorithm</a></li><li><a href="#rfc.section.C.2">C.2.</a>&nbsp;&nbsp;&nbsp;<a href="#ex-server-selects-unsupported-algorithm">Server Selects Algorithm Unsupported by Client</a></li><li><a href="#rfc.section.C.3">C.3.</a>&nbsp;&nbsp;&nbsp;<a href="#server-does-not-support-client-algorithm-and-returns-an-error">Server Does Not Support Client Algorithm and Returns an Error</a></li></ul></li><li><a href="#rfc.section.D">Appendix D.</a>&nbsp;&nbsp;&nbsp;<a href="#sample-digest-values">Sample <span class="tt">Digest</span> Values</a></li><li><a href="#rfc.section.E">Appendix E.</a>&nbsp;&nbsp;&nbsp;<a href="#migrating">Migrating from RFC 3230</a></li><li><a href="#acknowledgements">Acknowledgements</a></li><li><a href="#rfc.authors">Authors' Addresses</a></li></ul></div></div></div></div><div class="col-lg-8 order-first main" role="main"><header><table class="table table-condensed header" id="rfc.headerblock"><tbody><tr><td class="text-left">Internet Engineering Task Force (IETF)</td><td class="text-right">R. Polli</td></tr><tr><td class="text-left">Request for Comments: 9530</td><td class="text-right">Team Digitale, Italian Government</td></tr><tr><td class="text-left">Obsoletes: <a href="#RFC3230">3230</a></td><td class="text-right">L. Pardue</td></tr><tr><td class="text-left">Category: Standards Track</td><td class="text-right">Cloudflare</td></tr><tr><td class="text-left">ISSN: 2070-1721</td><td class="text-right">February 2024</td></tr></tbody></table><div id="rfc.title"><h1>Digest Fields</h1></div></header><hr><h2 id="rfc.abstract"><a href="#rfc.abstract">Abstract</a></h2><div class="lead"><div id="rfc.abstract.p.1"><p>This document defines HTTP fields that support integrity digests. The <span class="tt">Content-Digest</span> field can be used for the integrity of HTTP message content. The <span class="tt">Repr-Digest</span> field can be used for the integrity of HTTP representations. <span class="tt">Want-Content-Digest</span> and <span class="tt">Want-Repr-Digest</span> can be used to indicate a sender's interest and preferences for receiving the respective Integrity fields.</p></div><div id="rfc.abstract.p.2"><p>This document obsoletes RFC 3230 and the <span class="tt">Digest</span> and <span class="tt">Want-Digest</span> HTTP fields.</p></div></div><aside id="rfc.meta" class="alert alert-info"></aside><section id="rfc.status"><h2><a href="#rfc.status">Status of This Memo</a></h2><div id="rfc.boilerplate.1.p.1"><p>This is an Internet Standards Track document.</p></div><div id="rfc.boilerplate.1.p.2"><p>This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Further information on Internet Standards is available in <a href="https://www.rfc-editor.org/rfc/rfc7841.html#section-2">Section 2 of RFC 7841</a>.</p></div><div id="rfc.boilerplate.1.p.3"><p>Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at <a href="https://www.rfc-editor.org/info/rfc9530">https://www.rfc-editor.org/info/rfc9530</a>.</p></div></section><section id="rfc.copyrightnotice"><h2><a href="#rfc.copyrightnotice">Copyright Notice</a></h2><div id="rfc.boilerplate.2.p.1"><p>Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved.</p></div><div id="rfc.boilerplate.2.p.2"><p>This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (<a href="https://trustee.ietf.org/license-info">https://trustee.ietf.org/license-info</a>) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.</p></div></section><div class="toc d-lg-none"><ul><li><a href="#rfc.section.1">1.</a>&nbsp;&nbsp;&nbsp;<a href="#introduction">Introduction</a><ul><li><a href="#rfc.section.1.1">1.1.</a>&nbsp;&nbsp;&nbsp;<a href="#document-structure">Document Structure</a></li><li><a href="#rfc.section.1.2">1.2.</a>&nbsp;&nbsp;&nbsp;<a href="#concept-overview">Concept Overview</a></li><li><a href="#rfc.section.1.3">1.3.</a>&nbsp;&nbsp;&nbsp;<a href="#obsolete-3230">Obsoleting RFC 3230</a></li><li><a href="#rfc.section.1.4">1.4.</a>&nbsp;&nbsp;&nbsp;<a href="#notational-conventions">Notational Conventions</a></li></ul></li><li><a href="#rfc.section.2">2.</a>&nbsp;&nbsp;&nbsp;<a href="#content-digest">The <span class="tt">Content-Digest</span> Field</a></li><li><a href="#rfc.section.3">3.</a>&nbsp;&nbsp;&nbsp;<a href="#representation-digest">The <span class="tt">Repr-Digest</span> Field</a><ul><li><a href="#rfc.section.3.1">3.1.</a>&nbsp;&nbsp;&nbsp;<a href="#state-changing-requests">Using <span class="tt">Repr-Digest</span> in State-Changing Requests</a></li><li><a href="#rfc.section.3.2">3.2.</a>&nbsp;&nbsp;&nbsp;<a href="#digest-and-content-location"><span class="tt">Repr-Digest</span> and Content-Location in Responses</a></li></ul></li><li><a href="#rfc.section.4">4.</a>&nbsp;&nbsp;&nbsp;<a href="#want-fields">Integrity Preference Fields</a></li><li><a href="#rfc.section.5">5.</a>&nbsp;&nbsp;&nbsp;<a href="#algorithms">Hash Algorithm Considerations and Registration</a></li><li><a href="#rfc.section.6">6.</a>&nbsp;&nbsp;&nbsp;<a href="#security">Security Considerations</a><ul><li><a href="#rfc.section.6.1">6.1.</a>&nbsp;&nbsp;&nbsp;<a href="#sec-limitations">HTTP Messages Are Not Protected in Full</a></li><li><a href="#rfc.section.6.2">6.2.</a>&nbsp;&nbsp;&nbsp;<a href="#end-to-end-integrity">End-to-End Integrity</a></li><li><a href="#rfc.section.6.3">6.3.</a>&nbsp;&nbsp;&nbsp;<a href="#usage-in-signatures">Usage in Signatures</a></li><li><a href="#rfc.section.6.4">6.4.</a>&nbsp;&nbsp;&nbsp;<a href="#usage-in-trailer-fields">Usage in Trailer Fields</a></li><li><a href="#rfc.section.6.5">6.5.</a>&nbsp;&nbsp;&nbsp;<a href="#variations-within-content-encoding">Variations within Content-Encoding</a></li><li><a href="#rfc.section.6.6">6.6.</a>&nbsp;&nbsp;&nbsp;<a href="#sec-agility">Algorithm Agility</a></li><li><a href="#rfc.section.6.7">6.7.</a>&nbsp;&nbsp;&nbsp;<a href="#sec-exhaustion">Resource Exhaustion</a></li></ul></li><li><a href="#rfc.section.7">7.</a>&nbsp;&nbsp;&nbsp;<a href="#iana-considerations">IANA Considerations</a><ul><li><a href="#rfc.section.7.1">7.1.</a>&nbsp;&nbsp;&nbsp;<a href="#http-field-name-registration">HTTP Field Name Registration</a></li><li><a href="#rfc.section.7.2">7.2.</a>&nbsp;&nbsp;&nbsp;<a href="#establish-hash-algorithm-registry">Creation of the Hash Algorithms for HTTP Digest Fields Registry</a></li><li><a href="#rfc.section.7.3">7.3.</a>&nbsp;&nbsp;&nbsp;<a href="#deprecate-the-hypertext-transfer-protocol-http-digest-algorithm-values-registry">Deprecate the Hypertext Transfer Protocol (HTTP) Digest Algorithm Values Registry</a></li></ul></li><li><a href="#rfc.section.8">8.</a>&nbsp;&nbsp;&nbsp;<a href="#rfc.references">References</a><ul><li><a href="#rfc.section.8.1">8.1.</a>&nbsp;&nbsp;&nbsp;<a href="#rfc.references.2">Normative References</a></li><li><a href="#rfc.section.8.2">8.2.</a>&nbsp;&nbsp;&nbsp;<a href="#rfc.references.3">Informative References</a></li></ul></li><li><a href="#rfc.section.A">Appendix A.</a>&nbsp;&nbsp;&nbsp;<a href="#resource-representation">Resource Representation and Representation Data</a></li><li><a href="#rfc.section.B">Appendix B.</a>&nbsp;&nbsp;&nbsp;<a href="#examples-unsolicited">Examples of Unsolicited <span class="tt">Digest</span></a><ul><li><a href="#rfc.section.B.1">B.1.</a>&nbsp;&nbsp;&nbsp;<a href="#example-full-representation">Server Returns Full Representation Data</a></li><li><a href="#rfc.section.B.2">B.2.</a>&nbsp;&nbsp;&nbsp;<a href="#server-returns-no-representation-data">Server Returns No Representation Data</a></li><li><a href="#rfc.section.B.3">B.3.</a>&nbsp;&nbsp;&nbsp;<a href="#server-returns-partial-representation-data">Server Returns Partial Representation Data</a></li><li><a href="#rfc.section.B.4">B.4.</a>&nbsp;&nbsp;&nbsp;<a href="#client-and-server-provide-full-representation-data">Client and Server Provide Full Representation Data</a></li><li><a href="#rfc.section.B.5">B.5.</a>&nbsp;&nbsp;&nbsp;<a href="#client-provides-full-representation-data-server-provides-no-representation-data">Client Provides Full Representation Data and Server Provides No Representation Data</a></li><li><a href="#rfc.section.B.6">B.6.</a>&nbsp;&nbsp;&nbsp;<a href="#client-and-server-provide-full-representation-data-1">Client and Server Provide Full Representation Data</a></li><li><a href="#rfc.section.B.7">B.7.</a>&nbsp;&nbsp;&nbsp;<a href="#post-not-request-uri">POST Response Does Not Reference the Request URI</a></li><li><a href="#rfc.section.B.8">B.8.</a>&nbsp;&nbsp;&nbsp;<a href="#post-referencing-status">POST Response Describes the Request Status</a></li><li><a href="#rfc.section.B.9">B.9.</a>&nbsp;&nbsp;&nbsp;<a href="#digest-with-patch"><span class="tt">Digest</span> with PATCH</a></li><li><a href="#rfc.section.B.10">B.10.</a>&nbsp;&nbsp;&nbsp;<a href="#error-responses">Error Responses</a></li><li><a href="#rfc.section.B.11">B.11.</a>&nbsp;&nbsp;&nbsp;<a href="#use-with-trailer-fields-and-transfer-coding">Use with Trailer Fields and Transfer Coding</a></li></ul></li><li><a href="#rfc.section.C">Appendix C.</a>&nbsp;&nbsp;&nbsp;<a href="#examples-solicited">Examples of <span class="tt">Want-Repr-Digest</span> Solicited <span class="tt">Digest</span></a><ul><li><a href="#rfc.section.C.1">C.1.</a>&nbsp;&nbsp;&nbsp;<a href="#server-selects-clients-least-preferred-algorithm">Server Selects Client's Least Preferred Algorithm</a></li><li><a href="#rfc.section.C.2">C.2.</a>&nbsp;&nbsp;&nbsp;<a href="#ex-server-selects-unsupported-algorithm">Server Selects Algorithm Unsupported by Client</a></li><li><a href="#rfc.section.C.3">C.3.</a>&nbsp;&nbsp;&nbsp;<a href="#server-does-not-support-client-algorithm-and-returns-an-error">Server Does Not Support Client Algorithm and Returns an Error</a></li></ul></li><li><a href="#rfc.section.D">Appendix D.</a>&nbsp;&nbsp;&nbsp;<a href="#sample-digest-values">Sample <span class="tt">Digest</span> Values</a></li><li><a href="#rfc.section.E">Appendix E.</a>&nbsp;&nbsp;&nbsp;<a href="#migrating">Migrating from RFC 3230</a></li><li><a href="#acknowledgements">Acknowledgements</a></li><li><a href="#rfc.authors">Authors' Addresses</a></li></ul></div><hr class="hidden-print"><section id="introduction"><h2 id="rfc.section.1" class="np"><a href="#rfc.section.1">1.</a>&nbsp;<a href="#introduction">Introduction</a></h2><div id="rfc.section.1.p.1"><p>HTTP does not define the means to protect the data integrity of content or representations. When HTTP messages are transferred between endpoints, lower-layer features or properties such as TCP checksums or TLS records <a href="#RFC8446"><cite title="The Transport Layer Security (TLS) Protocol Version 1.3">[TLS]</cite></a> can provide some integrity protection. However, transport-oriented integrity provides a limited utility because it is opaque to the application layer and only covers the extent of a single connection. HTTP messages often travel over a chain of separate connections. In between connections, there is a possibility for data corruption. An HTTP integrity mechanism can provide the means for endpoints, or applications using HTTP, to detect data corruption and make a choice about how to act on it. An example use case is to aid fault detection and diagnosis across system boundaries.</p></div><div id="rfc.section.1.p.2"><p>This document defines two digest integrity mechanisms for HTTP. First, content integrity, which acts on conveyed content (<a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-6.4">Section 6.4</a> of <a href="#RFC9110"><cite title="HTTP Semantics">[HTTP]</cite></a>). Second, representation data integrity, which acts on representation data (<a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-8.1">Section 8.1</a> of <a href="#RFC9110"><cite title="HTTP Semantics">[HTTP]</cite></a>). This supports advanced use cases, such as validating the integrity of a resource that was reconstructed from parts retrieved using multiple requests or connections.</p></div><div id="rfc.section.1.p.3"><p>This document obsoletes <a href="#RFC3230"><cite title="Instance Digests in HTTP">[RFC3230]</cite></a> and therefore the <span class="tt">Digest</span> and <span class="tt">Want-Digest</span> HTTP fields; see <a href="#obsolete-3230" title="Obsoleting RFC 3230">Section 1.3</a>.</p></div><section id="document-structure"><h3 id="rfc.section.1.1"><a href="#rfc.section.1.1">1.1.</a>&nbsp;<a href="#document-structure">Document Structure</a></h3><div id="rfc.section.1.1.p.1" class="avoidbreakafter"><p>This document is structured as follows:</p></div><div id="rfc.section.1.1.p.2"><ul><li><div><p>New request and response header and trailer field definitions.</p></div> <div><ul><li><a href="#content-digest" title="The Content-Digest Field">Section 2</a> (<span class="tt">Content-Digest</span>),</li><li><a href="#representation-digest" title="The Repr-Digest Field">Section 3</a> (<span class="tt">Repr-Digest</span>), and</li><li><a href="#want-fields" title="Integrity Preference Fields">Section 4</a> (<span class="tt">Want-Content-Digest</span> and <span class="tt">Want-Repr-Digest</span>).</li></ul></div> </li><li><div><p>Considerations specific to representation data integrity.</p></div> <div><ul><li><a href="#state-changing-requests" title="Using Repr-Digest in State-Changing Requests">Section 3.1</a> (State-changing requests),</li><li><a href="#digest-and-content-location" title="Repr-Digest and Content-Location in Responses">Section 3.2</a> (Content-Location),</li><li><a href="#resource-representation" title="Resource Representation and Representation Data">Appendix A</a> contains worked examples of representation data in message exchanges, and</li><li>Appendixes <a href="#examples-unsolicited" title="Examples of Unsolicited Digest">B</a> and <a href="#examples-solicited" title="Examples of Want-Repr-Digest Solicited Digest">C</a> contain worked examples of <span class="tt">Repr-Digest</span> and <span class="tt">Want-Repr-Digest</span> fields in message exchanges.</li></ul></div> </li><li><a href="#algorithms" title="Hash Algorithm Considerations and Registration">Section 5</a> presents hash algorithm considerations and defines registration procedures for future entries.</li></ul></div></section><section id="concept-overview"><h3 id="rfc.section.1.2"><a href="#rfc.section.1.2">1.2.</a>&nbsp;<a href="#concept-overview">Concept Overview</a></h3><div id="rfc.section.1.2.p.1"><p>The HTTP fields defined in this document can be used for HTTP integrity. Senders choose a hashing algorithm and calculate a digest from an input related to the HTTP message. The algorithm identifier and digest are transmitted in an HTTP field. Receivers can validate the digest for integrity purposes. Hashing algorithms are registered in the "Hash Algorithms for HTTP Digest Fields" registry (see <a href="#establish-hash-algorithm-registry" title="Creation of the Hash Algorithms for HTTP Digest Fields Registry">Section 7.2</a>).</p></div><div id="rfc.section.1.2.p.2"><p>Selecting the data on which digests are calculated depends on the use case of the HTTP messages. This document provides different fields for HTTP representation data and HTTP content.</p></div><div id="rfc.section.1.2.p.3"><p>There are use cases where a simple digest of the HTTP content bytes is required. The <span class="tt">Content-Digest</span> request and response header and trailer field is defined to support digests of content (<a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-6.4">Section 6.4</a> of <a href="#RFC9110"><cite title="HTTP Semantics">[HTTP]</cite></a>); see <a href="#content-digest" title="The Content-Digest Field">Section 2</a>.</p></div><div id="rfc.section.1.2.p.4"><p>For more advanced use cases, the <span class="tt">Repr-Digest</span> request and response header and trailer field (<a href="#representation-digest" title="The Repr-Digest Field">Section 3</a>) is defined. It contains a digest value computed by applying a hashing algorithm to selected representation data (<a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-8.1">Section 8.1</a> of <a href="#RFC9110"><cite title="HTTP Semantics">[HTTP]</cite></a>). Basing <span class="tt">Repr-Digest</span> on the selected representation makes it straightforward to apply it to use cases where the message content requires some sort of manipulation to be considered as representation of the resource or the content conveys a partial representation of a resource, such as range requests (see <a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-14">Section 14</a> of <a href="#RFC9110"><cite title="HTTP Semantics">[HTTP]</cite></a>).</p></div><div id="rfc.section.1.2.p.5"><p><span class="tt">Content-Digest</span> and <span class="tt">Repr-Digest</span> support hashing algorithm agility. The <span class="tt">Want-Content-Digest</span> and <span class="tt">Want-Repr-Digest</span> fields allow endpoints to express interest in <span class="tt">Content-Digest</span> and <span class="tt">Repr-Digest</span>, respectively, and to express algorithm preferences in either.</p></div><div id="rfc.section.1.2.p.6"><p><span class="tt">Content-Digest</span> and <span class="tt">Repr-Digest</span> are collectively termed "Integrity fields". <span class="tt">Want-Content-Digest</span> and <span class="tt">Want-Repr-Digest</span> are collectively termed "Integrity preference fields".</p></div><div id="rfc.section.1.2.p.7"><p>Integrity fields are tied to the <span class="tt">Content-Encoding</span> and <span class="tt">Content-Type</span> header fields. Therefore, a given resource may have multiple different digest values when transferred with HTTP.</p></div><div id="rfc.section.1.2.p.8"><p>Integrity fields apply to HTTP message content or HTTP representations. They do not apply to HTTP messages or fields. However, they can be combined with other mechanisms that protect metadata, such as digital signatures, in order to protect the phases of an HTTP exchange in whole or in part. For example, HTTP Message Signatures <a href="#RFC9421"><cite title="HTTP Message Signatures">[SIGNATURES]</cite></a> could be used to sign Integrity fields, thus providing coverage for HTTP content or representation data.</p></div><div id="rfc.section.1.2.p.9"><p>This specification does not define means for authentication, authorization, or privacy.</p></div></section><section id="obsolete-3230"><h3 id="rfc.section.1.3"><a href="#rfc.section.1.3">1.3.</a>&nbsp;<a href="#obsolete-3230">Obsoleting RFC 3230</a></h3><div id="rfc.section.1.3.p.1"><p><a href="#RFC3230"><cite title="Instance Digests in HTTP">[RFC3230]</cite></a> defined the <span class="tt">Digest</span> and <span class="tt">Want-Digest</span> HTTP fields for HTTP integrity. It also coined the terms "instance" and "instance manipulation" in order to explain concepts, such as selected representation data (<a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-8.1">Section 8.1</a> of <a href="#RFC9110"><cite title="HTTP Semantics">[HTTP]</cite></a>), that are now more universally defined and implemented as HTTP semantics.</p></div><div id="rfc.section.1.3.p.2"><p>Experience has shown that implementations of <a href="#RFC3230"><cite title="Instance Digests in HTTP">[RFC3230]</cite></a> have interpreted the meaning of "instance" inconsistently, leading to interoperability issues. The most common issue relates to the mistake of calculating the digest using (what we now call) message content, rather than using (what we now call) representation data as was originally intended. Interestingly, time has also shown that a digest of message content can be beneficial for some use cases, so it is difficult to detect if non-conformance to <a href="#RFC3230"><cite title="Instance Digests in HTTP">[RFC3230]</cite></a> is intentional or unintentional.</p></div><div id="rfc.section.1.3.p.3"><p>In order to address potential inconsistencies and ambiguity across implementations of <span class="tt">Digest</span> and <span class="tt">Want-Digest</span>, this document obsoletes <a href="#RFC3230"><cite title="Instance Digests in HTTP">[RFC3230]</cite></a>. The Integrity fields (Sections <a href="#content-digest" title="The Content-Digest Field">2</a> and <a href="#representation-digest" title="The Repr-Digest Field">3</a>) and Integrity preference fields (<a href="#want-fields" title="Integrity Preference Fields">Section 4</a>) defined in this document are better aligned with current HTTP semantics and have names that more clearly articulate the intended usages.</p></div></section><section id="notational-conventions"><h3 id="rfc.section.1.4"><a href="#rfc.section.1.4">1.4.</a>&nbsp;<a href="#notational-conventions">Notational Conventions</a></h3><div id="rfc.section.1.4.p.1"><p>The key words "<em class="bcp14">MUST</em>", "<em class="bcp14">MUST NOT</em>", "<em class="bcp14">REQUIRED</em>", "<em class="bcp14">SHALL</em>", "<em class="bcp14">SHALL NOT</em>", "<em class="bcp14">SHOULD</em>", "<em class="bcp14">SHOULD NOT</em>", "<em class="bcp14">RECOMMENDED</em>", "<em class="bcp14">NOT RECOMMENDED</em>", "<em class="bcp14">MAY</em>", and "<em class="bcp14">OPTIONAL</em>" in this document are to be interpreted as described in <span class="nobr">BCP 14</span> <a href="#RFC2119"><cite title="Key words for use in RFCs to Indicate Requirement Levels">[RFC2119]</cite></a> <a href="#RFC8174"><cite title="Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words">[RFC8174]</cite></a> when, and only when, they appear in all capitals, as shown here.</p></div><div id="rfc.section.1.4.p.2"><p>This document uses the Augmented BNF defined in <a href="#RFC5234"><cite title="Augmented BNF for Syntax Specifications: ABNF">[RFC5234]</cite></a> and updated by <a href="#RFC7405"><cite title="Case-Sensitive String Support in ABNF">[RFC7405]</cite></a>. This includes the rules CR (carriage return), LF (line feed), and CRLF (CR LF).</p></div><div id="rfc.section.1.4.p.3"><p>This document uses the following terminology from <a href="https://www.rfc-editor.org/rfc/rfc8941.html#section-3">Section 3</a> of <a href="#RFC8941"><cite title="Structured Field Values for HTTP">[STRUCTURED-FIELDS]</cite></a> to specify syntax and parsing: Boolean, Byte Sequence, Dictionary, Integer, and List.</p></div><div id="rfc.section.1.4.p.4"><p>The definitions "representation", "selected representation", "representation data", "representation metadata", "user agent", and "content" in this document are to be interpreted as described in <a href="#RFC9110"><cite title="HTTP Semantics">[HTTP]</cite></a>.</p></div><div id="rfc.section.1.4.p.5"><p>This document uses the line folding strategies described in <a href="#RFC8792"><cite title="Handling Long Lines in Content of Internet-Drafts and RFCs">[FOLDING]</cite></a>.</p></div><div id="rfc.section.1.4.p.6"><p>Hashing algorithm names respect the casing used in their definition document (e.g., SHA-1, CRC32c).</p></div><div id="rfc.section.1.4.p.7"><p>HTTP messages indicate hashing algorithms using an Algorithm Key (algorithms). Where the document refers to an Algorithm Key in prose, it is quoted (e.g., "sha", "crc32c").</p></div><div id="rfc.section.1.4.p.8"><p>The term "checksum" describes the output of applying an algorithm to a sequence of bytes, whereas "digest" is only used in relation to the value contained in the fields.</p></div><div id="rfc.section.1.4.p.9"><p>"Integrity fields" is the collective term for <span class="tt">Content-Digest</span> and <span class="tt">Repr-Digest</span>.</p></div><div id="rfc.section.1.4.p.10"><p>"Integrity preference fields" is the collective term for <span class="tt">Want-Repr-Digest</span> and <span class="tt">Want-Content-Digest</span>.</p></div></section></section><hr class="hidden-print"><section id="content-digest"><h2 id="rfc.section.2" class="np"><a href="#rfc.section.2">2.</a>&nbsp;<a href="#content-digest">The <span class="tt">Content-Digest</span> Field</a></h2><div id="rfc.section.2.p.1" class="avoidbreakafter"><p>The <span class="tt">Content-Digest</span> HTTP field can be used in requests and responses to communicate digests that are calculated using a hashing algorithm applied to the actual message content (see <a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-6.4">Section 6.4</a> of <a href="#RFC9110"><cite title="HTTP Semantics">[HTTP]</cite></a>). It is a Dictionary (see <a href="https://www.rfc-editor.org/rfc/rfc8941.html#section-3.2">Section 3.2</a> of <a href="#RFC8941"><cite title="Structured Field Values for HTTP">[STRUCTURED-FIELDS]</cite></a>), where each:</p></div><div id="rfc.section.2.p.2"><ul><li>key conveys the hashing algorithm (see <a href="#algorithms" title="Hash Algorithm Considerations and Registration">Section 5</a>) used to compute the digest;</li><li>value is a Byte Sequence (<a href="https://www.rfc-editor.org/rfc/rfc8941.html#section-3.3.5">Section 3.3.5</a> of <a href="#RFC8941"><cite title="Structured Field Values for HTTP">[STRUCTURED-FIELDS]</cite></a>) that conveys an encoded version of the byte output produced by the digest calculation.</li></ul></div><div id="rfc.section.2.p.3" class="avoidbreakafter"><p>For example:</p></div><div id="rfc.section.2.p.4"><pre class="text"> NOTE: '\' line wrapping per RFC 8792 Content-Digest: \ sha-512=:YMAam51Jz/jOATT6/zvHrLVgOYTGFy1d6GJiOHTohq4yP+pgk4vf2aCs\ yRZOtw8MjkM7iw7yZ/WkppmM44T3qg==: </pre></div><div id="rfc.section.2.p.5"><p>The Dictionary type can be used, for example, to attach multiple digests calculated using different hashing algorithms in order to support a population of endpoints with different or evolving capabilities. Such an approach could support transitions away from weaker algorithms (see <a href="#sec-agility" title="Algorithm Agility">Section 6.6</a>).</p></div><div id="rfc.section.2.p.6"><pre class="text"> NOTE: '\' line wrapping per RFC 8792 Content-Digest: \ sha-256=:d435Qo+nKZ+gLcUHn7GQtQ72hiBVAgqoLsZnZPiTGPk=:,\ sha-512=:YMAam51Jz/jOATT6/zvHrLVgOYTGFy1d6GJiOHTohq4yP+pgk4vf2aCs\ yRZOtw8MjkM7iw7yZ/WkppmM44T3qg==: </pre></div><div id="rfc.section.2.p.7"><p>A recipient <em class="bcp14">MAY</em> ignore any or all digests. Application-specific behavior or local policy <em class="bcp14">MAY</em> set additional constraints on the processing and validation practices of the conveyed digests. The security considerations cover some of the issues related to ignoring digests (see <a href="#sec-agility" title="Algorithm Agility">Section 6.6</a>) and validating multiple digests (see <a href="#sec-exhaustion" title="Resource Exhaustion">Section 6.7</a>).</p></div><div id="rfc.section.2.p.8"><p>A sender <em class="bcp14">MAY</em> send a digest without knowing whether the recipient supports a given hashing algorithm. A sender <em class="bcp14">MAY</em> send a digest if it knows the recipient will ignore it.</p></div><div id="rfc.section.2.p.9"><p><span class="tt">Content-Digest</span> can be sent in a trailer section. In this case, <span class="tt">Content-Digest</span> <em class="bcp14">MAY</em> be merged into the header section; see <a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-6.5.1">Section 6.5.1</a> of <a href="#RFC9110"><cite title="HTTP Semantics">[HTTP]</cite></a>.</p></div></section><hr class="hidden-print"><section id="representation-digest"><h2 id="rfc.section.3" class="np"><a href="#rfc.section.3">3.</a>&nbsp;<a href="#representation-digest">The <span class="tt">Repr-Digest</span> Field</a></h2><div id="rfc.section.3.p.1"><p>The <span class="tt">Repr-Digest</span> HTTP field can be used in requests and responses to communicate digests that are calculated using a hashing algorithm applied to the entire selected representation data (see <a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-8.1">Section 8.1</a> of <a href="#RFC9110"><cite title="HTTP Semantics">[HTTP]</cite></a>).</p></div><div id="rfc.section.3.p.2"><p>Representations take into account the effect of the HTTP semantics on messages. For example, the content can be affected by range requests or methods, such as HEAD, while the way the content is transferred "on the wire" is dependent on other transformations (e.g., transfer codings for HTTP/1.1; see <a href="https://www.rfc-editor.org/rfc/rfc9112.html#section-6.1">Section 6.1</a> of <a href="#RFC9112"><cite title="HTTP/1.1">[HTTP/1.1]</cite></a>). To help illustrate HTTP representation concepts, several examples are provided in <a href="#resource-representation" title="Resource Representation and Representation Data">Appendix A</a>.</p></div><div id="rfc.section.3.p.3"><p>When a message has no representation data, it is still possible to assert that no representation data was sent by computing the digest on an empty string (see <a href="#usage-in-signatures" title="Usage in Signatures">Section 6.3</a>).</p></div><div id="rfc.section.3.p.4" class="avoidbreakafter"><p><span class="tt">Repr-Digest</span> is a Dictionary (see <a href="https://www.rfc-editor.org/rfc/rfc8941.html#section-3.2">Section 3.2</a> of <a href="#RFC8941"><cite title="Structured Field Values for HTTP">[STRUCTURED-FIELDS]</cite></a>), where each:</p></div><div id="rfc.section.3.p.5"><ul><li>key conveys the hashing algorithm (see <a href="#algorithms" title="Hash Algorithm Considerations and Registration">Section 5</a>) used to compute the digest;</li><li>value is a Byte Sequence that conveys an encoded version of the byte output produced by the digest calculation.</li></ul></div><div id="rfc.section.3.p.6" class="avoidbreakafter"><p>For example:</p></div><div id="rfc.section.3.p.7"><pre class="text"> NOTE: '\' line wrapping per RFC 8792 Repr-Digest: \ sha-512=:YMAam51Jz/jOATT6/zvHrLVgOYTGFy1d6GJiOHTohq4yP+pgk4vf2aCs\ yRZOtw8MjkM7iw7yZ/WkppmM44T3qg==: </pre></div><div id="rfc.section.3.p.8"><p>The Dictionary type can be used to attach multiple digests calculated using different hashing algorithms in order to support a population of endpoints with different or evolving capabilities. Such an approach could support transitions away from weaker algorithms (see <a href="#sec-agility" title="Algorithm Agility">Section 6.6</a>).</p></div><div id="rfc.section.3.p.9"><pre class="text"> NOTE: '\' line wrapping per RFC 8792 Repr-Digest: \ sha-256=:d435Qo+nKZ+gLcUHn7GQtQ72hiBVAgqoLsZnZPiTGPk=:,\ sha-512=:YMAam51Jz/jOATT6/zvHrLVgOYTGFy1d6GJiOHTohq4yP+pgk4vf2aCs\ yRZOtw8MjkM7iw7yZ/WkppmM44T3qg==: </pre></div><div id="rfc.section.3.p.10"><p>A recipient <em class="bcp14">MAY</em> ignore any or all digests. Application-specific behavior or local policy <em class="bcp14">MAY</em> set additional constraints on the processing and validation practices of the conveyed digests. The security considerations cover some of the issues related to ignoring digests (see <a href="#sec-agility" title="Algorithm Agility">Section 6.6</a>) and validating multiple digests (see <a href="#sec-exhaustion" title="Resource Exhaustion">Section 6.7</a>).</p></div><div id="rfc.section.3.p.11"><p>A sender <em class="bcp14">MAY</em> send a digest without knowing whether the recipient supports a given hashing algorithm. A sender <em class="bcp14">MAY</em> send a digest if it knows the recipient will ignore it.</p></div><div id="rfc.section.3.p.12"><p><span class="tt">Repr-Digest</span> can be sent in a trailer section. In this case, <span class="tt">Repr-Digest</span> <em class="bcp14">MAY</em> be merged into the header section; see <a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-6.5.1">Section 6.5.1</a> of <a href="#RFC9110"><cite title="HTTP Semantics">[HTTP]</cite></a>.</p></div><section id="state-changing-requests"><h3 id="rfc.section.3.1"><a href="#rfc.section.3.1">3.1.</a>&nbsp;<a href="#state-changing-requests">Using <span class="tt">Repr-Digest</span> in State-Changing Requests</a></h3><div id="rfc.section.3.1.p.1"><p>When the representation enclosed in a state-changing request does not describe the target resource, the representation digest <em class="bcp14">MUST</em> be computed on the representation data. This is the only possible choice because representation digest requires complete representation metadata (see <a href="#representation-digest" title="The Repr-Digest Field">Section 3</a>).</p></div><div id="rfc.section.3.1.p.2"><p>In responses,</p></div><div id="rfc.section.3.1.p.3"><ul><li>if the representation describes the status of the request, <span class="tt">Repr-Digest</span> <em class="bcp14">MUST</em> be computed on the enclosed representation (see <a href="#post-referencing-status" title="POST Response Describes the Request Status">Appendix B.8</a>);</li><li>if there is a referenced resource, <span class="tt">Repr-Digest</span> <em class="bcp14">MUST</em> be computed on the selected representation of the referenced resource even if that is different from the target resource. This might or might not result in computing <span class="tt">Repr-Digest</span> on the enclosed representation.</li></ul></div><div id="rfc.section.3.1.p.4"><p>The latter case is done according to the HTTP semantics of the given method, for example, using the <span class="tt">Content-Location</span> header field (see <a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-8.7">Section 8.7</a> of <a href="#RFC9110"><cite title="HTTP Semantics">[HTTP]</cite></a>). In contrast, the <span class="tt">Location</span> header field does not affect <span class="tt">Repr-Digest</span> because it is not representation metadata.</p></div><div id="rfc.section.3.1.p.5"><p>For example, in PATCH requests, the representation digest will be computed on the patch document because the representation metadata refers to the patch document and not the target resource (see <a href="https://www.rfc-editor.org/rfc/rfc5789.html#section-2">Section 2</a> of <a href="#RFC5789"><cite title="PATCH Method for HTTP">[PATCH]</cite></a>). In responses, instead, the representation digest will be computed on the selected representation of the patched resource.</p></div></section><section id="digest-and-content-location"><h3 id="rfc.section.3.2"><a href="#rfc.section.3.2">3.2.</a>&nbsp;<a href="#digest-and-content-location"><span class="tt">Repr-Digest</span> and Content-Location in Responses</a></h3><div id="rfc.section.3.2.p.1"><p>When a state-changing method returns the <span class="tt">Content-Location</span> header field, the enclosed representation refers to the resource identified by its value and <span class="tt">Repr-Digest</span> is computed accordingly. An example is given in <a href="#post-not-request-uri" title="POST Response Does Not Reference the Request URI">Appendix B.7</a>.</p></div></section></section><hr class="hidden-print"><section id="want-fields"><h2 id="rfc.section.4" class="np"><a href="#rfc.section.4">4.</a>&nbsp;<a href="#want-fields">Integrity Preference Fields</a></h2><div id="rfc.section.4.p.1"><p>Senders can indicate their interest in Integrity fields and hashing algorithm preferences using the <span class="tt">Want-Content-Digest</span> or <span class="tt">Want-Repr-Digest</span> HTTP fields. These can be used in both requests and responses.</p></div><div id="rfc.section.4.p.2"><p><span class="tt">Want-Content-Digest</span> indicates that the sender would like to receive (via the <span class="tt">Content-Digest</span> field) a content digest on messages associated with the request URI and representation metadata. <span class="tt">Want-Repr-Digest</span> indicates that the sender would like to receive (via the <span class="tt">Repr-Digest</span> field) a representation digest on messages associated with the request URI and representation metadata.</p></div><div id="rfc.section.4.p.3"><p>If <span class="tt">Want-Content-Digest</span> or <span class="tt">Want-Repr-Digest</span> are used in a response, it indicates that the server would like the client to provide the respective Integrity field on future requests.</p></div><div id="rfc.section.4.p.4"><p>Integrity preference fields are only a hint. The receiver of the field can ignore it and send an Integrity field using any algorithm or omit the field entirely; for example, see <a href="#ex-server-selects-unsupported-algorithm" title="Server Selects Algorithm Unsupported by Client">Appendix C.2</a>. It is not a protocol error if preferences are ignored. Applications that use Integrity fields and Integrity preferences can define expectations or constraints that operate in addition to this specification. Ignored preferences are an application-specific concern.</p></div><div id="rfc.section.4.p.5" class="avoidbreakafter"><p><span class="tt">Want-Content-Digest</span> and <span class="tt">Want-Repr-Digest</span> are of type Dictionary where each:</p></div><div id="rfc.section.4.p.6"><ul><li>key conveys the hashing algorithm (see <a href="#algorithms" title="Hash Algorithm Considerations and Registration">Section 5</a>);</li><li>value is an <span class="tt">Integer</span> (<a href="https://www.rfc-editor.org/rfc/rfc8941.html#section-3.3.1">Section 3.3.1</a> of <a href="#RFC8941"><cite title="Structured Field Values for HTTP">[STRUCTURED-FIELDS]</cite></a>) that conveys an ascending, relative, weighted preference. It must be in the range 0 to 10 inclusive. 1 is the least preferred, 10 is the most preferred, and a value of 0 means "not acceptable".</li></ul></div><div id="rfc.section.4.p.7" class="avoidbreakafter"><p>Examples:</p></div><div id="rfc.section.4.p.8"><pre class="text"> Want-Repr-Digest: sha-256=1 Want-Repr-Digest: sha-512=3, sha-256=10, unixsum=0 Want-Content-Digest: sha-256=1 Want-Content-Digest: sha-512=3, sha-256=10, unixsum=0 </pre></div></section><hr class="hidden-print"><section id="algorithms"><h2 id="rfc.section.5" class="np"><a href="#rfc.section.5">5.</a>&nbsp;<a href="#algorithms">Hash Algorithm Considerations and Registration</a></h2><div id="rfc.section.5.p.1"><p>There are a wide variety of hashing algorithms that can be used for the purposes of integrity. The choice of algorithm depends on several factors such as the integrity use case, implementation needs or constraints, or application design and workflows.</p></div><div id="rfc.section.5.p.2"><p>An initial set of algorithms will be registered with IANA in the "Hash Algorithms for HTTP Digest Fields" registry; see <a href="#establish-hash-algorithm-registry" title="Creation of the Hash Algorithms for HTTP Digest Fields Registry">Section 7.2</a>. Additional algorithms can be registered in accordance with the policies set out in this section.</p></div><div id="rfc.section.5.p.3"><p>Each algorithm has a status field that is intended to provide an aid to implementation selection.</p></div><div id="rfc.section.5.p.4"><p>Algorithms with a status value of "Active" are suitable for many purposes and it is <em class="bcp14">RECOMMENDED</em> that applications use these algorithms. These can be used in adversarial situations where hash functions might need to provide resistance to collision, first-preimage, and second-preimage attacks. For adversarial situations, selection of the acceptable "Active" algorithms will depend on the level of protection the circumstances demand. More considerations are presented in <a href="#sec-agility" title="Algorithm Agility">Section 6.6</a>.</p></div><div id="rfc.section.5.p.5"><p>Algorithms with a status value of "Deprecated" either provide none of these properties or are known to be weak (see <a href="#RFC6151"><cite title="Updated Security Considerations for the MD5 Message-Digest and the HMAC-MD5 Algorithms">[NO-MD5]</cite></a> and <a href="#RFC6194"><cite title="Security Considerations for the SHA-0 and SHA-1 Message-Digest Algorithms">[NO-SHA]</cite></a>). These algorithms <em class="bcp14">MAY</em> be used to preserve integrity against corruption, but <em class="bcp14">MUST NOT</em> be used in a potentially adversarial setting, for example, when signing Integrity fields' values for authenticity. Permitting the use of these algorithms can help some applications (such as those that previously used <a href="#RFC3230"><cite title="Instance Digests in HTTP">[RFC3230]</cite></a>, are migrating to this specification (<a href="#migrating" title="Migrating from RFC 3230">Appendix E</a>), and have existing stored collections of computed digest values) avoid undue operational overhead caused by recomputation using other more-secure algorithms. Such applications are not exempt from the requirements in this section. Furthermore, applications without such legacy or history ought to follow the guidance for using algorithms with the status value "Active".</p></div><div id="rfc.section.5.p.6"><p>Discussion of algorithm agility is presented in <a href="#sec-agility" title="Algorithm Agility">Section 6.6</a>.</p></div><div id="rfc.section.5.p.7" class="avoidbreakafter"><p>Registration requests for the "Hash Algorithms for HTTP Digest Fields" registry use the Specification Required policy (<a href="https://www.rfc-editor.org/rfc/rfc8126.html#section-4.6">Section 4.6</a> of <a href="#RFC8126"><cite title="Guidelines for Writing an IANA Considerations Section in RFCs">[RFC8126]</cite></a>). Requests should use the following template:</p></div><div id="rfc.section.5.p.8"><dl><dt>Algorithm Key:</dt><dd style="margin-left: 1.5em">The Structured Fields key value used in <span class="tt">Content-Digest</span>, <span class="tt">Repr-Digest</span>, <span class="tt">Want-Content-Digest</span>, or <span class="tt">Want-Repr-Digest</span> field Dictionary member keys.</dd><dt>Status:</dt><dd style="margin-left: 1.5em">The status of the algorithm. The options are:</dd><dt></dt><dd style="margin-left: 1.5em"><div><dl><dt>"Active":</dt><dd style="margin-left: 1.5em">Algorithms without known problems</dd><dt>"Provisional":</dt><dd style="margin-left: 1.5em">Unproven algorithms</dd><dt>"Deprecated":</dt><dd style="margin-left: 1.5em">Deprecated or insecure algorithms</dd></dl></div></dd><dt>Description:</dt><dd style="margin-left: 1.5em">A short description of the algorithm.</dd><dt>Reference(s):</dt><dd style="margin-left: 1.5em">Pointer(s) to the primary document(s) defining the Algorithm Key and technical details of the algorithm.</dd></dl></div><div id="rfc.section.5.p.9"><p>When reviewing registration requests, the designated expert(s) should pay attention to the requested status. The status value should reflect standardization status and the broad opinion of relevant interest groups such as the IETF or security-related Standards Development Organizations (SDOs). The "Active" status is not suitable for an algorithm that is known to be weak, broken, or experimental. If a registration request attempts to register such an algorithm as "Active", the designated expert(s) should suggest an alternative status of "Deprecated" or "Provisional".</p></div><div id="rfc.section.5.p.10"><p>When reviewing registration requests, the designated expert(s) cannot use a status of "Deprecated" or "Provisional" as grounds for rejection.</p></div><div id="rfc.section.5.p.11"><p>Requests to update or change the fields in an existing registration are permitted. For example, this could allow for the transition of an algorithm status from "Active" to "Deprecated" as the security environment evolves.</p></div></section><hr class="hidden-print"><section id="security"><h2 id="rfc.section.6" class="np"><a href="#rfc.section.6">6.</a>&nbsp;<a href="#security">Security Considerations</a></h2><section id="sec-limitations"><h3 id="rfc.section.6.1"><a href="#rfc.section.6.1">6.1.</a>&nbsp;<a href="#sec-limitations">HTTP Messages Are Not Protected in Full</a></h3><div id="rfc.section.6.1.p.1"><p>This document specifies a data integrity mechanism that protects HTTP representation data or content, but not HTTP header and trailer fields, from certain kinds of corruption.</p></div><div id="rfc.section.6.1.p.2"><p>Integrity fields are not intended to be a general protection against malicious tampering with HTTP messages. In the absence of additional security mechanisms, an on-path malicious actor can either remove a digest value entirely or substitute it with a new digest value computed over manipulated representation data or content. This attack can be mitigated by combining mechanisms described in this document with other approaches such as Transport Layer Security (TLS) or digital signatures (for example, HTTP Message Signatures <a href="#RFC9421"><cite title="HTTP Message Signatures">[SIGNATURES]</cite></a>).</p></div></section><section id="end-to-end-integrity"><h3 id="rfc.section.6.2"><a href="#rfc.section.6.2">6.2.</a>&nbsp;<a href="#end-to-end-integrity">End-to-End Integrity</a></h3><div id="rfc.section.6.2.p.1"><p>Integrity fields can help detect representation data or content modification due to implementation errors, undesired "transforming proxies" (see <a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-7.7">Section 7.7</a> of <a href="#RFC9110"><cite title="HTTP Semantics">[HTTP]</cite></a>), or other actions as the data passes across multiple hops or system boundaries. Even a simple mechanism for end-to-end representation data integrity is valuable because a user agent can validate that resource retrieval succeeded before handing off to an HTML parser, video player, etc., for parsing.</p></div><div id="rfc.section.6.2.p.2"><p>Note that using these mechanisms alone does not provide end-to-end integrity of HTTP messages over multiple hops since metadata could be manipulated at any stage. Methods to protect metadata are discussed in <a href="#usage-in-signatures" title="Usage in Signatures">Section 6.3</a>.</p></div></section><section id="usage-in-signatures"><h3 id="rfc.section.6.3"><a href="#rfc.section.6.3">6.3.</a>&nbsp;<a href="#usage-in-signatures">Usage in Signatures</a></h3><div id="rfc.section.6.3.p.1"><p>Digital signatures are widely used together with checksums to provide the certain identification of the origin of a message <a href="#FIPS186-5"><cite title="Digital Signature Standard (DSS)">[FIPS186-5]</cite></a>. Such signatures can protect one or more HTTP fields and there are additional considerations when Integrity fields are included in this set.</p></div><div id="rfc.section.6.3.p.2"><p>There are no restrictions placed on the type or format of digital signature that Integrity fields can be used with. One possible approach is to combine them with HTTP Message Signatures <a href="#RFC9421"><cite title="HTTP Message Signatures">[SIGNATURES]</cite></a>.</p></div><div id="rfc.section.6.3.p.3"><p>Digests explicitly depend on the "representation metadata" (e.g., the values of <span class="tt">Content-Type</span>, <span class="tt">Content-Encoding</span>, etc.). A signature that protects Integrity fields but not other "representation metadata" can expose the communication to tampering. For example, an actor could manipulate the <span class="tt">Content-Type</span> field-value and cause a digest validation failure at the recipient, preventing the application from accessing the representation. Such an attack consumes the resources of both endpoints. See also <a href="#digest-and-content-location" title="Repr-Digest and Content-Location in Responses">Section 3.2</a>.</p></div><div id="rfc.section.6.3.p.4"><p>Signatures are likely to be deemed an adversarial setting when applying Integrity fields; see <a href="#algorithms" title="Hash Algorithm Considerations and Registration">Section 5</a>. <span class="tt">Repr-Digest</span> offers an interesting possibility when combined with signatures. In the scenario where there is no content to send, the digest of an empty string can be included in the message and, if signed, can help the recipient detect if content was added either as a result of accident or purposeful manipulation. The opposite scenario is also supported; including an Integrity field for content and signing it can help a recipient detect where the content was removed.</p></div><div id="rfc.section.6.3.p.5"><p>Any mangling of Integrity fields might affect signature validation. Examples of such mangling include de-duplicating digests or combining different field values (see <a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-5.2">Section 5.2</a> of <a href="#RFC9110"><cite title="HTTP Semantics">[HTTP]</cite></a>).</p></div></section><section id="usage-in-trailer-fields"><h3 id="rfc.section.6.4"><a href="#rfc.section.6.4">6.4.</a>&nbsp;<a href="#usage-in-trailer-fields">Usage in Trailer Fields</a></h3><div id="rfc.section.6.4.p.1"><p>Before sending Integrity fields in a trailer section, the sender should consider that intermediaries are explicitly allowed to drop any trailer (see <a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-6.5.2">Section 6.5.2</a> of <a href="#RFC9110"><cite title="HTTP Semantics">[HTTP]</cite></a>).</p></div><div id="rfc.section.6.4.p.2"><p>When Integrity fields are used in a trailer section, the field-values are received after the content. Eager processing of content before the trailer section prevents digest validation, possibly leading to processing of invalid data.</p></div><div id="rfc.section.6.4.p.3"><p>One of the benefits of using Integrity fields in a trailer section is that it allows hashing of bytes as they are sent. However, it is possible to design a hashing algorithm that requires processing of content in such a way that would negate these benefits. For example, Merkle Integrity Content Encoding <a href="#I-D.thomson-http-mice"><cite title="Merkle Integrity Content Encoding">[MICE]</cite></a> requires content to be processed in reverse order. This means the complete data needs to be available, which means there is negligible processing difference in sending an Integrity field in a header versus a trailer section.</p></div></section><section id="variations-within-content-encoding"><h3 id="rfc.section.6.5"><a href="#rfc.section.6.5">6.5.</a>&nbsp;<a href="#variations-within-content-encoding">Variations within Content-Encoding</a></h3><div id="rfc.section.6.5.p.1"><p>Content coding mechanisms can support different encoding parameters, meaning that the same input content can produce different outputs. For example, GZIP supports multiple compression levels. Such encoding parameters are generally not communicated as representation metadata. For instance, different compression levels would all use the same "Content-Encoding: gzip" field. Other examples include where encoding relies on nonces or timestamps, such as the aes128gcm content coding defined in <a href="#RFC8188"><cite title="Encrypted Content-Encoding for HTTP">[RFC8188]</cite></a>.</p></div><div id="rfc.section.6.5.p.2"><p>Since it is possible for there to be variation within content coding, the checksum conveyed by the Integrity fields cannot be used to provide a proof of integrity "at rest" unless the whole content is persisted.</p></div></section><section id="sec-agility"><h3 id="rfc.section.6.6"><a href="#rfc.section.6.6">6.6.</a>&nbsp;<a href="#sec-agility">Algorithm Agility</a></h3><div id="rfc.section.6.6.p.1"><p>The security properties of hashing algorithms are not fixed. Algorithm agility (see <a href="#RFC7696"><cite title="Guidelines for Cryptographic Algorithm Agility and Selecting Mandatory-to-Implement Algorithms">[RFC7696]</cite></a>) is achieved by providing implementations with flexibility to choose hashing algorithms from the IANA Hash Algorithms for HTTP Digest Fields registry; see <a href="#establish-hash-algorithm-registry" title="Creation of the Hash Algorithms for HTTP Digest Fields Registry">Section 7.2</a>.</p></div><div id="rfc.section.6.6.p.2"><p>Transition from weak algorithms is supported by negotiation of hashing algorithm using <span class="tt">Want-Content-Digest</span> or <span class="tt">Want-Repr-Digest</span> (see <a href="#want-fields" title="Integrity Preference Fields">Section 4</a>) or by sending multiple digests from which the receiver chooses. A receiver that depends on a digest for security will be vulnerable to attacks on the weakest algorithm it is willing to accept. Endpoints are advised that sending multiple values consumes resources that may be wasted if the receiver ignores them (see <a href="#representation-digest" title="The Repr-Digest Field">Section 3</a>).</p></div><div id="rfc.section.6.6.p.3"><p>While algorithm agility allows the migration to stronger algorithms, it does not prevent the use of weaker algorithms. Integrity fields do not provide any mitigations for downgrade or substitution attacks (see <a href="https://www.rfc-editor.org/rfc/rfc6211.html#section-1">Section 1</a> of <a href="#RFC6211"><cite title="Cryptographic Message Syntax (CMS) Algorithm Identifier Protection Attribute">[RFC6211]</cite></a>) of the hashing algorithm. To protect against such attacks, endpoints could restrict their set of supported algorithms to stronger ones and protect the fields' values by using TLS and/or digital signatures.</p></div></section><section id="sec-exhaustion"><h3 id="rfc.section.6.7"><a href="#rfc.section.6.7">6.7.</a>&nbsp;<a href="#sec-exhaustion">Resource Exhaustion</a></h3><div id="rfc.section.6.7.p.1"><p>Integrity field validation consumes computational resources. In order to avoid resource exhaustion, implementations can restrict validation of the algorithm types, the number of validations, or the size of content. In these cases, skipping validation entirely or ignoring validation failure of a more-preferred algorithm leaves the possibility of a downgrade attack (see <a href="#sec-agility" title="Algorithm Agility">Section 6.6</a>).</p></div></section></section><hr class="hidden-print"><section id="iana-considerations"><h2 id="rfc.section.7" class="np"><a href="#rfc.section.7">7.</a>&nbsp;<a href="#iana-considerations">IANA Considerations</a></h2><section id="http-field-name-registration"><h3 id="rfc.section.7.1"><a href="#rfc.section.7.1">7.1.</a>&nbsp;<a href="#http-field-name-registration">HTTP Field Name Registration</a></h3><div id="rfc.section.7.1.p.1" class="avoidbreakafter"><p>IANA has updated the "Hypertext Transfer Protocol (HTTP) Field Name Registry" <a href="#RFC9110"><cite title="HTTP Semantics">[HTTP]</cite></a> as shown in the table below:</p></div><div class="table table-condensed table-striped"><table class="v3 text-center"><caption>Table 1: Hypertext Transfer Protocol (HTTP) Field Name Registry Update</caption><thead><tr><th class="text-left" colspan="1" rowspan="1">Field Name</th><th class="text-left" colspan="1" rowspan="1">Status</th><th class="text-left" colspan="1" rowspan="1">Reference</th></tr></thead><tbody><tr><td class="text-left" colspan="1" rowspan="1"><span class="tt">Content-Digest</span></td><td class="text-left" colspan="1" rowspan="1">permanent</td><td class="text-left" colspan="1" rowspan="1"><a href="#content-digest" title="The Content-Digest Field">Section 2</a> of RFC 9530</td></tr><tr><td class="text-left" colspan="1" rowspan="1"><span class="tt">Repr-Digest</span></td><td class="text-left" colspan="1" rowspan="1">permanent</td><td class="text-left" colspan="1" rowspan="1"><a href="#representation-digest" title="The Repr-Digest Field">Section 3</a> of RFC 9530</td></tr><tr><td class="text-left" colspan="1" rowspan="1"><span class="tt">Want-Content-Digest</span></td><td class="text-left" colspan="1" rowspan="1">permanent</td><td class="text-left" colspan="1" rowspan="1"><a href="#want-fields" title="Integrity Preference Fields">Section 4</a> of RFC 9530</td></tr><tr><td class="text-left" colspan="1" rowspan="1"><span class="tt">Want-Repr-Digest</span></td><td class="text-left" colspan="1" rowspan="1">permanent</td><td class="text-left" colspan="1" rowspan="1"><a href="#want-fields" title="Integrity Preference Fields">Section 4</a> of RFC 9530</td></tr><tr><td class="text-left" colspan="1" rowspan="1"><span class="tt">Digest</span></td><td class="text-left" colspan="1" rowspan="1">obsoleted</td><td class="text-left" colspan="1" rowspan="1"><a href="#RFC3230"><cite title="Instance Digests in HTTP">[RFC3230]</cite></a>, <a href="#obsolete-3230" title="Obsoleting RFC 3230">Section 1.3</a> of RFC 9530</td></tr><tr><td class="text-left" colspan="1" rowspan="1"><span class="tt">Want-Digest</span></td><td class="text-left" colspan="1" rowspan="1">obsoleted</td><td class="text-left" colspan="1" rowspan="1"><a href="#RFC3230"><cite title="Instance Digests in HTTP">[RFC3230]</cite></a>, <a href="#obsolete-3230" title="Obsoleting RFC 3230">Section 1.3</a> of RFC 9530</td></tr></tbody></table></div></section><section id="establish-hash-algorithm-registry"><h3 id="rfc.section.7.2"><a href="#rfc.section.7.2">7.2.</a>&nbsp;<a href="#establish-hash-algorithm-registry">Creation of the Hash Algorithms for HTTP Digest Fields Registry</a></h3><div id="rfc.section.7.2.p.1"><p>IANA has created the new "Hash Algorithms for HTTP Digest Fields" registry at &lt;<a href="https://www.iana.org/assignments/http-digest-hash-alg/">https://www.iana.org/assignments/http-digest-hash-alg/</a>&gt; and populated it with the entries in <a href="#iana-hash-algorithm-table" title="Initial Hash Algorithms">Table 2</a>. The procedure for new registrations is provided in <a href="#algorithms" title="Hash Algorithm Considerations and Registration">Section 5</a>.</p></div><div class="table table-condensed table-striped" id="iana-hash-algorithm-table"><table class="v3 text-center"><caption>Table 2: Initial Hash Algorithms</caption><thead><tr><th class="text-left" colspan="1" rowspan="1">Algorithm Key</th><th class="text-left" colspan="1" rowspan="1">Status</th><th class="text-left" colspan="1" rowspan="1">Description</th><th class="text-left" colspan="1" rowspan="1">Reference</th></tr></thead><tbody><tr><td class="text-left" colspan="1" rowspan="1">sha-512</td><td class="text-left" colspan="1" rowspan="1">Active</td><td class="text-left" colspan="1" rowspan="1">The SHA-512 algorithm.</td><td class="text-left" colspan="1" rowspan="1"><a href="#RFC6234"><cite title="US Secure Hash Algorithms (SHA and SHA-based HMAC and HKDF)">[RFC6234]</cite></a>, <a href="#RFC4648"><cite title="The Base16, Base32, and Base64 Data Encodings">[RFC4648]</cite></a>, RFC 9530</td></tr><tr><td class="text-left" colspan="1" rowspan="1">sha-256</td><td class="text-left" colspan="1" rowspan="1">Active</td><td class="text-left" colspan="1" rowspan="1">The SHA-256 algorithm.</td><td class="text-left" colspan="1" rowspan="1"><a href="#RFC6234"><cite title="US Secure Hash Algorithms (SHA and SHA-based HMAC and HKDF)">[RFC6234]</cite></a>, <a href="#RFC4648"><cite title="The Base16, Base32, and Base64 Data Encodings">[RFC4648]</cite></a>, RFC 9530</td></tr><tr><td class="text-left" colspan="1" rowspan="1">md5</td><td class="text-left" colspan="1" rowspan="1">Deprecated</td><td class="text-left" colspan="1" rowspan="1">The MD5 algorithm. It is vulnerable to collision attacks; see <a href="#RFC6151"><cite title="Updated Security Considerations for the MD5 Message-Digest and the HMAC-MD5 Algorithms">[NO-MD5]</cite></a> and <a href="#CMU-836068"><cite title="MD5 vulnerable to collision attacks">[CMU-836068]</cite></a></td><td class="text-left" colspan="1" rowspan="1"><a href="#RFC1321"><cite title="The MD5 Message-Digest Algorithm">[RFC1321]</cite></a>, <a href="#RFC4648"><cite title="The Base16, Base32, and Base64 Data Encodings">[RFC4648]</cite></a>, RFC 9530</td></tr><tr><td class="text-left" colspan="1" rowspan="1">sha</td><td class="text-left" colspan="1" rowspan="1">Deprecated</td><td class="text-left" colspan="1" rowspan="1">The SHA-1 algorithm. It is vulnerable to collision attacks; see <a href="#RFC6194"><cite title="Security Considerations for the SHA-0 and SHA-1 Message-Digest Algorithms">[NO-SHA]</cite></a> and <a href="#IACR-2020-014"><cite title="SHA-1 is a Shambles">[IACR-2020-014]</cite></a></td><td class="text-left" colspan="1" rowspan="1"><a href="#RFC3174"><cite title="US Secure Hash Algorithm 1 (SHA1)">[RFC3174]</cite></a>, <a href="#RFC4648"><cite title="The Base16, Base32, and Base64 Data Encodings">[RFC4648]</cite></a>, <a href="#RFC6234"><cite title="US Secure Hash Algorithms (SHA and SHA-based HMAC and HKDF)">[RFC6234]</cite></a>, RFC 9530</td></tr><tr><td class="text-left" colspan="1" rowspan="1">unixsum</td><td class="text-left" colspan="1" rowspan="1">Deprecated</td><td class="text-left" colspan="1" rowspan="1">The algorithm used by the UNIX "sum" command.</td><td class="text-left" colspan="1" rowspan="1"><a href="#RFC4648"><cite title="The Base16, Base32, and Base64 Data Encodings">[RFC4648]</cite></a>, <a href="#RFC6234"><cite title="US Secure Hash Algorithms (SHA and SHA-based HMAC and HKDF)">[RFC6234]</cite></a>, <a href="#UNIX"><cite title="The Single UNIX Specification, Version 2 - 6 Vol Set for UNIX 98">[UNIX]</cite></a>, <span class="nobr">RFC 9530</span></td></tr><tr><td class="text-left" colspan="1" rowspan="1">unixcksum</td><td class="text-left" colspan="1" rowspan="1">Deprecated</td><td class="text-left" colspan="1" rowspan="1">The algorithm used by the UNIX "cksum" command.</td><td class="text-left" colspan="1" rowspan="1"><a href="#RFC4648"><cite title="The Base16, Base32, and Base64 Data Encodings">[RFC4648]</cite></a>, <a href="#RFC6234"><cite title="US Secure Hash Algorithms (SHA and SHA-based HMAC and HKDF)">[RFC6234]</cite></a>, <a href="#UNIX"><cite title="The Single UNIX Specification, Version 2 - 6 Vol Set for UNIX 98">[UNIX]</cite></a>, <span class="nobr">RFC 9530</span></td></tr><tr><td class="text-left" colspan="1" rowspan="1">adler</td><td class="text-left" colspan="1" rowspan="1">Deprecated</td><td class="text-left" colspan="1" rowspan="1">The ADLER32 algorithm.</td><td class="text-left" colspan="1" rowspan="1"><a href="#RFC1950"><cite title="ZLIB Compressed Data Format Specification version 3.3">[RFC1950]</cite></a>, RFC 9530</td></tr><tr><td class="text-left" colspan="1" rowspan="1">crc32c</td><td class="text-left" colspan="1" rowspan="1">Deprecated</td><td class="text-left" colspan="1" rowspan="1">The CRC32c algorithm.</td><td class="text-left" colspan="1" rowspan="1"><a href="https://www.rfc-editor.org/rfc/rfc9260.html#appendix-A">Appendix A</a> of <a href="#RFC9260"><cite title="Stream Control Transmission Protocol">[RFC9260]</cite></a>, RFC 9530</td></tr></tbody></table></div></section><section id="deprecate-the-hypertext-transfer-protocol-http-digest-algorithm-values-registry"><h3 id="rfc.section.7.3"><a href="#rfc.section.7.3">7.3.</a>&nbsp;<a href="#deprecate-the-hypertext-transfer-protocol-http-digest-algorithm-values-registry">Deprecate the Hypertext Transfer Protocol (HTTP) Digest Algorithm Values Registry</a></h3><div id="rfc.section.7.3.p.1" class="avoidbreakafter"><p>IANA has deprecated the "Hypertext Transfer Protocol (HTTP) Digest Algorithm Values" registry at &lt;<a href="https://www.iana.org/assignments/http-dig-alg/">https://www.iana.org/assignments/http-dig-alg/</a>&gt; and replaced the note on that registry with the following text:</p></div><div id="rfc.section.7.3.p.2"><blockquote><p>This registry is deprecated since it lists the algorithms that can be used with the <span class="tt">Digest</span> and <span class="tt">Want-Digest</span> fields defined in <a href="#RFC3230"><cite title="Instance Digests in HTTP">[RFC3230]</cite></a>, which has been obsoleted by RFC 9530. While registration is not closed, new registrations are encouraged to use the <a href="https://www.iana.org/assignments/http-digest-hash-alg/">Hash Algorithms for HTTP Digest Fields</a> registry instead.</p></blockquote></div></section></section><section class="np"><div id="rfc.references"><h2 id="rfc.section.8"><a href="#rfc.section.8">8.</a> References</h2><section><div id="rfc.references.2"><h3 id="rfc.section.8.1"><a href="#rfc.section.8.1">8.1.</a> Normative References</h3><dl class="dl-horizontal"><dt id="RFC8792">[<a href="#RFC8792" class="smpl">FOLDING</a>]</dt><dd>Watsen, K., Auerswald, E., Farrel, A., and Q. Wu, “<a href="https://www.rfc-editor.org/rfc/rfc8792.html">Handling Long Lines in Content of Internet-Drafts and RFCs</a>”, RFC 8792, <a href="https://dx.doi.org/10.17487/RFC8792">DOI 10.17487/RFC8792</a>, June 2020, &lt;<a href="https://www.rfc-editor.org/info/rfc8792">https://www.rfc-editor.org/info/rfc8792</a>&gt;.</dd><dt id="RFC9110">[<a href="#RFC9110" class="smpl">HTTP</a>]</dt><dd>Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, Ed., “<a href="https://www.rfc-editor.org/rfc/rfc9110.html">HTTP Semantics</a>”, <a href="https://www.rfc-editor.org/info/std97">STD 97</a>, RFC 9110, <a href="https://dx.doi.org/10.17487/RFC9110">DOI 10.17487/RFC9110</a>, June 2022, &lt;<a href="https://www.rfc-editor.org/info/rfc9110">https://www.rfc-editor.org/info/rfc9110</a>&gt;.</dd><dt id="RFC1321">[<a href="#RFC1321" class="smpl">RFC1321</a>]</dt><dd>Rivest, R., “<a href="https://www.rfc-editor.org/rfc/rfc1321.html">The MD5 Message-Digest Algorithm</a>”, RFC 1321, <a href="https://dx.doi.org/10.17487/RFC1321">DOI 10.17487/RFC1321</a>, April 1992, &lt;<a href="https://www.rfc-editor.org/info/rfc1321">https://www.rfc-editor.org/info/rfc1321</a>&gt;.</dd><dt id="RFC1950">[<a href="#RFC1950" class="smpl">RFC1950</a>]</dt><dd>Deutsch, P. and J-L. Gailly, “<a href="https://www.rfc-editor.org/rfc/rfc1950.html">ZLIB Compressed Data Format Specification version 3.3</a>”, RFC 1950, <a href="https://dx.doi.org/10.17487/RFC1950">DOI 10.17487/RFC1950</a>, May 1996, &lt;<a href="https://www.rfc-editor.org/info/rfc1950">https://www.rfc-editor.org/info/rfc1950</a>&gt;.</dd><dt id="RFC2119">[<a href="#RFC2119" class="smpl">RFC2119</a>]</dt><dd>Bradner, S., “<a href="https://www.rfc-editor.org/rfc/rfc2119.html">Key words for use in RFCs to Indicate Requirement Levels</a>”, <a href="https://www.rfc-editor.org/info/bcp14">BCP 14</a>, RFC 2119, <a href="https://dx.doi.org/10.17487/RFC2119">DOI 10.17487/RFC2119</a>, March 1997, &lt;<a href="https://www.rfc-editor.org/info/rfc2119">https://www.rfc-editor.org/info/rfc2119</a>&gt;.</dd><dt id="RFC3174">[<a href="#RFC3174" class="smpl">RFC3174</a>]</dt><dd>Eastlake 3rd, D. and P. Jones, “<a href="https://www.rfc-editor.org/rfc/rfc3174.html">US Secure Hash Algorithm 1 (SHA1)</a>”, RFC 3174, <a href="https://dx.doi.org/10.17487/RFC3174">DOI 10.17487/RFC3174</a>, September 2001, &lt;<a href="https://www.rfc-editor.org/info/rfc3174">https://www.rfc-editor.org/info/rfc3174</a>&gt;.</dd><dt id="RFC4648">[<a href="#RFC4648" class="smpl">RFC4648</a>]</dt><dd>Josefsson, S., “<a href="https://www.rfc-editor.org/rfc/rfc4648.html">The Base16, Base32, and Base64 Data Encodings</a>”, RFC 4648, <a href="https://dx.doi.org/10.17487/RFC4648">DOI 10.17487/RFC4648</a>, October 2006, &lt;<a href="https://www.rfc-editor.org/info/rfc4648">https://www.rfc-editor.org/info/rfc4648</a>&gt;.</dd><dt id="RFC5234">[<a href="#RFC5234" class="smpl">RFC5234</a>]</dt><dd>Crocker, D., Ed. and P. Overell, “<a href="https://www.rfc-editor.org/rfc/rfc5234.html">Augmented BNF for Syntax Specifications: ABNF</a>”, <a href="https://www.rfc-editor.org/info/std68">STD 68</a>, RFC 5234, <a href="https://dx.doi.org/10.17487/RFC5234">DOI 10.17487/RFC5234</a>, January 2008, &lt;<a href="https://www.rfc-editor.org/info/rfc5234">https://www.rfc-editor.org/info/rfc5234</a>&gt;.</dd><dt id="RFC6234">[<a href="#RFC6234" class="smpl">RFC6234</a>]</dt><dd>Eastlake 3rd, D. and T. Hansen, “<a href="https://www.rfc-editor.org/rfc/rfc6234.html">US Secure Hash Algorithms (SHA and SHA-based HMAC and HKDF)</a>”, RFC 6234, <a href="https://dx.doi.org/10.17487/RFC6234">DOI 10.17487/RFC6234</a>, May 2011, &lt;<a href="https://www.rfc-editor.org/info/rfc6234">https://www.rfc-editor.org/info/rfc6234</a>&gt;.</dd><dt id="RFC7405">[<a href="#RFC7405" class="smpl">RFC7405</a>]</dt><dd>Kyzivat, P., “<a href="https://www.rfc-editor.org/rfc/rfc7405.html">Case-Sensitive String Support in ABNF</a>”, RFC 7405, <a href="https://dx.doi.org/10.17487/RFC7405">DOI 10.17487/RFC7405</a>, December 2014, &lt;<a href="https://www.rfc-editor.org/info/rfc7405">https://www.rfc-editor.org/info/rfc7405</a>&gt;.</dd><dt id="RFC8126">[<a href="#RFC8126" class="smpl">RFC8126</a>]</dt><dd>Cotton, M., Leiba, B., and T. Narten, “<a href="https://www.rfc-editor.org/rfc/rfc8126.html">Guidelines for Writing an IANA Considerations Section in RFCs</a>”, <a href="https://www.rfc-editor.org/info/bcp26">BCP 26</a>, RFC 8126, <a href="https://dx.doi.org/10.17487/RFC8126">DOI 10.17487/RFC8126</a>, June 2017, &lt;<a href="https://www.rfc-editor.org/info/rfc8126">https://www.rfc-editor.org/info/rfc8126</a>&gt;.</dd><dt id="RFC8174">[<a href="#RFC8174" class="smpl">RFC8174</a>]</dt><dd>Leiba, B., “<a href="https://www.rfc-editor.org/rfc/rfc8174.html">Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</a>”, <a href="https://www.rfc-editor.org/info/bcp14">BCP 14</a>, RFC 8174, <a href="https://dx.doi.org/10.17487/RFC8174">DOI 10.17487/RFC8174</a>, May 2017, &lt;<a href="https://www.rfc-editor.org/info/rfc8174">https://www.rfc-editor.org/info/rfc8174</a>&gt;.</dd><dt id="RFC8941">[<a href="#RFC8941" class="smpl">STRUCTURED-FIELDS</a>]</dt><dd>Nottingham, M. and P-H. Kamp, “<a href="https://www.rfc-editor.org/rfc/rfc8941.html">Structured Field Values for HTTP</a>”, RFC 8941, <a href="https://dx.doi.org/10.17487/RFC8941">DOI 10.17487/RFC8941</a>, February 2021, &lt;<a href="https://www.rfc-editor.org/info/rfc8941">https://www.rfc-editor.org/info/rfc8941</a>&gt;.</dd></dl></div></section><section><div id="rfc.references.3"><h3 id="rfc.section.8.2"><a href="#rfc.section.8.2">8.2.</a> Informative References</h3><dl class="dl-horizontal"><dt id="CMU-836068">[<a href="#CMU-836068" class="smpl">CMU-836068</a>]</dt><dd>Carnegie Mellon University, Software Engineering Institute, “<a href="https://www.kb.cert.org/vuls/id/836068/">MD5 vulnerable to collision attacks</a>”, December 2008, &lt;<a href="https://www.kb.cert.org/vuls/id/836068/">https://www.kb.cert.org/vuls/id/836068/</a>&gt;.</dd><dt id="FIPS186-5">[<a href="#FIPS186-5" class="smpl">FIPS186-5</a>]</dt><dd>National Institute of Standards and Technology (NIST), “<a href="https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf">Digital Signature Standard (DSS)</a>”, FIPS PUB 186-5, <a href="https://dx.doi.org/10.6028/NIST.FIPS.186-5">DOI 10.6028/NIST.FIPS.186-5</a>, February 2023, &lt;<a href="https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf">https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.186-5.pdf</a>&gt;.</dd><dt id="RFC9112">[<a href="#RFC9112" class="smpl">HTTP/1.1</a>]</dt><dd>Fielding, R., Ed., Nottingham, M., Ed., and J. Reschke, Ed., “<a href="https://www.rfc-editor.org/rfc/rfc9112.html">HTTP/1.1</a>”, <a href="https://www.rfc-editor.org/info/std99">STD 99</a>, RFC 9112, <a href="https://dx.doi.org/10.17487/RFC9112">DOI 10.17487/RFC9112</a>, June 2022, &lt;<a href="https://www.rfc-editor.org/info/rfc9112">https://www.rfc-editor.org/info/rfc9112</a>&gt;.</dd><dt id="IACR-2020-014">[<a href="#IACR-2020-014" class="smpl">IACR-2020-014</a>]</dt><dd>Leurent, G. and T. Peyrin, “<a href="https://eprint.iacr.org/2020/014.pdf">SHA-1 is a Shambles</a>”, January 2020, &lt;<a href="https://eprint.iacr.org/2020/014.pdf">https://eprint.iacr.org/2020/014.pdf</a>&gt;.</dd><dt id="I-D.thomson-http-mice">[<a href="#I-D.thomson-http-mice" class="smpl">MICE</a>]</dt><dd>Thomson, M. and J. Yasskin, “<a href="https://datatracker.ietf.org/doc/html/draft-thomson-http-mice-03">Merkle Integrity Content Encoding</a>”, <a href="https://datatracker.ietf.org/doc/draft-thomson-http-mice">Work in Progress</a>, draft-thomson-http-mice-03, Work in Progress, August 2018, &lt;<a href="https://datatracker.ietf.org/doc/html/draft-thomson-http-mice-03">https://datatracker.ietf.org/doc/html/draft-thomson-http-mice-03</a>&gt;.</dd><dt id="RFC6151">[<a href="#RFC6151" class="smpl">NO-MD5</a>]</dt><dd>Turner, S. and L. Chen, “<a href="https://www.rfc-editor.org/rfc/rfc6151.html">Updated Security Considerations for the MD5 Message-Digest and the HMAC-MD5 Algorithms</a>”, RFC 6151, <a href="https://dx.doi.org/10.17487/RFC6151">DOI 10.17487/RFC6151</a>, March 2011, &lt;<a href="https://www.rfc-editor.org/info/rfc6151">https://www.rfc-editor.org/info/rfc6151</a>&gt;.</dd><dt id="RFC6194">[<a href="#RFC6194" class="smpl">NO-SHA</a>]</dt><dd>Polk, T., Chen, L., Turner, S., and P. Hoffman, “<a href="https://www.rfc-editor.org/rfc/rfc6194.html">Security Considerations for the SHA-0 and SHA-1 Message-Digest Algorithms</a>”, RFC 6194, <a href="https://dx.doi.org/10.17487/RFC6194">DOI 10.17487/RFC6194</a>, March 2011, &lt;<a href="https://www.rfc-editor.org/info/rfc6194">https://www.rfc-editor.org/info/rfc6194</a>&gt;.</dd><dt id="RFC5789">[<a href="#RFC5789" class="smpl">PATCH</a>]</dt><dd>Dusseault, L. and J. Snell, “<a href="https://www.rfc-editor.org/rfc/rfc5789.html">PATCH Method for HTTP</a>”, RFC 5789, <a href="https://dx.doi.org/10.17487/RFC5789">DOI 10.17487/RFC5789</a>, March 2010, &lt;<a href="https://www.rfc-editor.org/info/rfc5789">https://www.rfc-editor.org/info/rfc5789</a>&gt;.</dd><dt id="RFC3230">[<a href="#RFC3230" class="smpl">RFC3230</a>]</dt><dd>Mogul, J. and A. Van Hoff, “<a href="https://www.rfc-editor.org/rfc/rfc3230.html">Instance Digests in HTTP</a>”, RFC 3230, <a href="https://dx.doi.org/10.17487/RFC3230">DOI 10.17487/RFC3230</a>, January 2002, &lt;<a href="https://www.rfc-editor.org/info/rfc3230">https://www.rfc-editor.org/info/rfc3230</a>&gt;.</dd><dt id="RFC6211">[<a href="#RFC6211" class="smpl">RFC6211</a>]</dt><dd>Schaad, J., “<a href="https://www.rfc-editor.org/rfc/rfc6211.html">Cryptographic Message Syntax (CMS) Algorithm Identifier Protection Attribute</a>”, RFC 6211, <a href="https://dx.doi.org/10.17487/RFC6211">DOI 10.17487/RFC6211</a>, April 2011, &lt;<a href="https://www.rfc-editor.org/info/rfc6211">https://www.rfc-editor.org/info/rfc6211</a>&gt;.</dd><dt id="RFC7396">[<a href="#RFC7396" class="smpl">RFC7396</a>]</dt><dd>Hoffman, P. and J. Snell, “<a href="https://www.rfc-editor.org/rfc/rfc7396.html">JSON Merge Patch</a>”, RFC 7396, <a href="https://dx.doi.org/10.17487/RFC7396">DOI 10.17487/RFC7396</a>, October 2014, &lt;<a href="https://www.rfc-editor.org/info/rfc7396">https://www.rfc-editor.org/info/rfc7396</a>&gt;.</dd><dt id="RFC7696">[<a href="#RFC7696" class="smpl">RFC7696</a>]</dt><dd>Housley, R., “<a href="https://www.rfc-editor.org/rfc/rfc7696.html">Guidelines for Cryptographic Algorithm Agility and Selecting Mandatory-to-Implement Algorithms</a>”, <a href="https://www.rfc-editor.org/info/bcp201">BCP 201</a>, RFC 7696, <a href="https://dx.doi.org/10.17487/RFC7696">DOI 10.17487/RFC7696</a>, November 2015, &lt;<a href="https://www.rfc-editor.org/info/rfc7696">https://www.rfc-editor.org/info/rfc7696</a>&gt;.</dd><dt id="RFC8188">[<a href="#RFC8188" class="smpl">RFC8188</a>]</dt><dd>Thomson, M., “<a href="https://www.rfc-editor.org/rfc/rfc8188.html">Encrypted Content-Encoding for HTTP</a>”, RFC 8188, <a href="https://dx.doi.org/10.17487/RFC8188">DOI 10.17487/RFC8188</a>, June 2017, &lt;<a href="https://www.rfc-editor.org/info/rfc8188">https://www.rfc-editor.org/info/rfc8188</a>&gt;.</dd><dt id="RFC9260">[<a href="#RFC9260" class="smpl">RFC9260</a>]</dt><dd>Stewart, R., Tüxen, M., and K. Nielsen, “<a href="https://www.rfc-editor.org/rfc/rfc9260.html">Stream Control Transmission Protocol</a>”, RFC 9260, <a href="https://dx.doi.org/10.17487/RFC9260">DOI 10.17487/RFC9260</a>, June 2022, &lt;<a href="https://www.rfc-editor.org/info/rfc9260">https://www.rfc-editor.org/info/rfc9260</a>&gt;.</dd><dt id="RFC9457">[<a href="#RFC9457" class="smpl">RFC9457</a>]</dt><dd>Nottingham, M., Wilde, E., and S. Dalal, “<a href="https://www.rfc-editor.org/rfc/rfc9457.html">Problem Details for HTTP APIs</a>”, RFC 9457, <a href="https://dx.doi.org/10.17487/RFC9457">DOI 10.17487/RFC9457</a>, July 2023, &lt;<a href="https://www.rfc-editor.org/info/rfc9457">https://www.rfc-editor.org/info/rfc9457</a>&gt;.</dd><dt id="RFC9421">[<a href="#RFC9421" class="smpl">SIGNATURES</a>]</dt><dd>Backman, A., Ed., Richer, J., Ed., and M. Sporny, “<a href="https://www.rfc-editor.org/rfc/rfc9421.html">HTTP Message Signatures</a>”, RFC 9421, <a href="https://dx.doi.org/10.17487/RFC9421">DOI 10.17487/RFC9421</a>, February 2024, &lt;<a href="https://www.rfc-editor.org/info/rfc9421">https://www.rfc-editor.org/info/rfc9421</a>&gt;.</dd><dt id="RFC8446">[<a href="#RFC8446" class="smpl">TLS</a>]</dt><dd>Rescorla, E., “<a href="https://www.rfc-editor.org/rfc/rfc8446.html">The Transport Layer Security (TLS) Protocol Version 1.3</a>”, RFC 8446, <a href="https://dx.doi.org/10.17487/RFC8446">DOI 10.17487/RFC8446</a>, August 2018, &lt;<a href="https://www.rfc-editor.org/info/rfc8446">https://www.rfc-editor.org/info/rfc8446</a>&gt;.</dd><dt id="UNIX">[<a href="#UNIX" class="smpl">UNIX</a>]</dt><dd>The Open Group, “The Single UNIX Specification, Version 2 - 6 Vol Set for UNIX 98”, January 1998.</dd></dl></div></section></div></section><hr class="hidden-print"><section id="resource-representation"><h2 id="rfc.section.A" class="np"><a href="#rfc.section.A">Appendix A.</a>&nbsp;<a href="#resource-representation">Resource Representation and Representation Data</a></h2><div id="rfc.section.A.p.1"><p>The following examples show how representation metadata, content transformations, and methods impact the message and content. These examples a not exhaustive.</p></div><div id="rfc.section.A.p.2"><p>Unless otherwise indicated, the examples are based on the JSON object <span class="tt">{"hello": "world"}</span> followed by an LF. When the content contains non-printable characters (e.g., when it is encoded), it is shown as a sequence of hex-encoded bytes.</p></div><div id="rfc.section.A.p.3"><p>Consider a client that wishes to upload a JSON object using the PUT method. It could do this using the application/json <span class="tt">Content-Type</span> without any content coding.</p></div><div id="rfc.figure.1"><div><pre class="text"> PUT /entries/1234 HTTP/1.1 Host: foo.example Content-Type: application/json Content-Length: 19 {"hello": "world"} </pre></div></div><p class="figure">Figure 1: Request Containing a JSON Object without Any Content Coding</p><div id="rfc.section.A.p.4"><p>However, the use of content coding is quite common. The client could also upload the same data with a GZIP coding (<a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-8.4.1.3">Section 8.4.1.3</a> of <a href="#RFC9110"><cite title="HTTP Semantics">[HTTP]</cite></a>). Note that in this case, the <span class="tt">Content-Length</span> contains a larger value due to the coding overheads.</p></div><div id="ex-put-gz"></div><div id="rfc.figure.2"><div><pre class="text"> PUT /entries/1234 HTTP/1.1 Host: foo.example Content-Type: application/json Content-Encoding: gzip Content-Length: 39 1F 8B 08 00 88 41 37 64 00 FF AB 56 CA 48 CD C9 C9 57 B2 52 50 2A CF 2F CA 49 51 AA E5 02 00 D9 E4 31 E7 13 00 00 00 </pre></div></div><p class="figure">Figure 2: Request Containing a GZIP-Encoded JSON Object</p><div id="rfc.section.A.p.5"><p>Sending the GZIP-coded data without indicating it via <span class="tt">Content-Encoding</span> means that the content is malformed. In this case, the server can reply with an error.</p></div><div id="rfc.figure.3"><div><pre class="text"> PUT /entries/1234 HTTP/1.1 Host: foo.example Content-Type: application/json Content-Length: 39 1F 8B 08 00 88 41 37 64 00 FF AB 56 CA 48 CD C9 C9 57 B2 52 50 2A CF 2F CA 49 51 AA E5 02 00 D9 E4 31 E7 13 00 00 00 </pre></div></div><p class="figure">Figure 3: Request Containing Malformed JSON</p><div id="rfc.figure.4"><div><pre class="text"> HTTP/1.1 400 Bad Request </pre></div></div><p class="figure">Figure 4: An Error Response for Malformed Content</p><div id="rfc.section.A.p.6"><p>A Range-Request affects the transferred message content. In this example, the client is accessing the resource at <span class="tt">/entries/1234</span>, which is the JSON object <span class="tt">{"hello": "world"}</span> followed by an LF. However, the client has indicated a preferred content coding and a specific byte range.</p></div><div id="rfc.figure.5"><div><pre class="text"> GET /entries/1234 HTTP/1.1 Host: foo.example Accept-Encoding: gzip Range: bytes=1-7 </pre></div></div><p class="figure">Figure 5: Request for Partial Content</p><div id="rfc.section.A.p.7"><p>The server satisfies the client request by responding with a partial representation (equivalent to the first 10 bytes of the JSON object displayed in whole in <a href="#ex-put-gz" title="Request Containing a GZIP-Encoded JSON Object">Figure 2</a>).</p></div><div id="rfc.figure.6"><div><pre class="text"> HTTP/1.1 206 Partial Content Content-Encoding: gzip Content-Type: application/json Content-Range: bytes 0-9/39 1F 8B 08 00 A5 B4 BD 62 02 FF </pre></div></div><p class="figure">Figure 6: Partial Response from a GZIP-Encoded Representation</p><div id="rfc.section.A.p.8"><p>Aside from content coding or range requests, the method can also affect the transferred message content. For example, the response to a HEAD request does not carry content, but this example case includes <span class="tt">Content-Length</span>; see <a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-8.6">Section 8.6</a> of <a href="#RFC9110"><cite title="HTTP Semantics">[HTTP]</cite></a>.</p></div><div id="rfc.figure.7"><div><pre class="text"> HEAD /entries/1234 HTTP/1.1 Host: foo.example Accept: application/json Accept-Encoding: gzip </pre></div></div><p class="figure">Figure 7: HEAD Request</p><div id="rfc.figure.8"><div><pre class="text"> HTTP/1.1 200 OK Content-Type: application/json Content-Encoding: gzip Content-Length: 39 </pre></div></div><p class="figure">Figure 8: Response to HEAD Request (Empty Content)</p><div id="rfc.section.A.p.9"><p>Finally, the semantics of a response might decouple the target URI from the enclosed representation. In the example below, the client issues a POST request directed to <span class="tt">/authors/</span>, but the response includes a <span class="tt">Content-Location</span> header field indicating that the enclosed representation refers to the resource available at <span class="tt">/authors/123</span>. Note that <span class="tt">Content-Length</span> is not sent in this example.</p></div><div id="rfc.figure.9"><div><pre class="text"> POST /authors/ HTTP/1.1 Host: foo.example Accept: application/json Content-Type: application/json {"author": "Camilleri"} </pre></div></div><p class="figure">Figure 9: POST Request</p><div id="rfc.figure.10"><div><pre class="text"> HTTP/1.1 201 Created Content-Type: application/json Content-Location: /authors/123 Location: /authors/123 {"id": "123", "author": "Camilleri"} </pre></div></div><p class="figure">Figure 10: Response with Content-Location Header</p></section><hr class="hidden-print"><section id="examples-unsolicited"><h2 id="rfc.section.B" class="np"><a href="#rfc.section.B">Appendix B.</a>&nbsp;<a href="#examples-unsolicited">Examples of Unsolicited <span class="tt">Digest</span></a></h2><div id="rfc.section.B.p.1"><p>The following examples demonstrate interactions where a server responds with a <span class="tt">Content-Digest</span> or <span class="tt">Repr-Digest</span> field, even though the client did not solicit one using <span class="tt">Want-Content-Digest</span> or <span class="tt">Want-Repr-Digest</span>.</p></div><div id="rfc.section.B.p.2"><p>Some examples include JSON objects in the content. For presentation purposes, objects that fit completely within the line-length limits are presented on a single line using compact notation with no leading space. Objects that would exceed line-length limits are presented across multiple lines (one line per key-value pair) with two spaces of leading indentation.</p></div><div id="rfc.section.B.p.3"><p>Checksum mechanisms defined in this document are media-type agnostic and do not provide canonicalization algorithms for specific formats. Examples are calculated inclusive of any space. While examples can include both fields, <span class="tt">Content-Digest</span> and <span class="tt">Repr-Digest</span> can be returned independently.</p></div><section id="example-full-representation"><h3 id="rfc.section.B.1"><a href="#rfc.section.B.1">B.1.</a>&nbsp;<a href="#example-full-representation">Server Returns Full Representation Data</a></h3><div id="rfc.section.B.1.p.1"><p>In this example, the message content conveys complete representation data. This means that in the response, <span class="tt">Content-Digest</span> and <span class="tt">Repr-Digest</span> are both computed over the JSON object <span class="tt">{"hello": "world"}</span> followed by an LF; thus, they have the same value.</p></div><div id="rfc.figure.11"><div><pre class="text"> GET /items/123 HTTP/1.1 Host: foo.example </pre></div></div><p class="figure">Figure 11: GET Request for an Item</p><div id="rfc.figure.12"><div><pre class="text"> NOTE: '\' line wrapping per RFC 8792 HTTP/1.1 200 OK Content-Type: application/json Content-Length: 19 Content-Digest: \ sha-256=:RK/0qy18MlBSVnWgjwz6lZEWjP/lF5HF9bvEF8FabDg=: Repr-Digest: \ sha-256=:RK/0qy18MlBSVnWgjwz6lZEWjP/lF5HF9bvEF8FabDg=: {"hello": "world"} </pre></div></div><p class="figure">Figure 12: Response with Identical <span class="tt">Repr-Digest</span> and <span class="tt">Content-Digest</span></p></section><section id="server-returns-no-representation-data"><h3 id="rfc.section.B.2"><a href="#rfc.section.B.2">B.2.</a>&nbsp;<a href="#server-returns-no-representation-data">Server Returns No Representation Data</a></h3><div id="rfc.section.B.2.p.1"><p>In this example, a HEAD request is used to retrieve the checksum of a resource.</p></div><div id="rfc.section.B.2.p.2"><p>The response <span class="tt">Content-Digest</span> field-value is computed on empty content. <span class="tt">Repr-Digest</span> is calculated over the JSON object <span class="tt">{"hello": "world"}</span> followed by an LF, which is not shown because there is no content.</p></div><div id="rfc.figure.13"><div><pre class="text"> HEAD /items/123 HTTP/1.1 Host: foo.example </pre></div></div><p class="figure">Figure 13: HEAD Request for an Item</p><div id="rfc.figure.14"><div><pre class="text"> NOTE: '\' line wrapping per RFC 8792 HTTP/1.1 200 OK Content-Type: application/json Content-Digest: \ sha-256=:47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=: Repr-Digest: \ sha-256=:RK/0qy18MlBSVnWgjwz6lZEWjP/lF5HF9bvEF8FabDg=: </pre></div></div><p class="figure">Figure 14: Response with Both <span class="tt">Content-Digest</span> and <span class="tt">Digest</span> (Empty Content)</p></section><section id="server-returns-partial-representation-data"><h3 id="rfc.section.B.3"><a href="#rfc.section.B.3">B.3.</a>&nbsp;<a href="#server-returns-partial-representation-data">Server Returns Partial Representation Data</a></h3><div id="rfc.section.B.3.p.1"><p>In this example, the client makes a range request and the server responds with partial content.</p></div><div id="rfc.figure.15"><div><pre class="text"> GET /items/123 HTTP/1.1 Host: foo.example Range: bytes=10-18 </pre></div></div><p class="figure">Figure 15: Request for Partial Content</p><div id="rfc.figure.16"><div><pre class="text"> NOTE: '\' line wrapping per RFC 8792 HTTP/1.1 206 Partial Content Content-Type: application/json Content-Range: bytes 10-18/19 Content-Digest: \ sha-256=:jjcgBDWNAtbYUXI37CVG3gRuGOAjaaDRGpIUFsdyepQ=: Repr-Digest: \ sha-256=:RK/0qy18MlBSVnWgjwz6lZEWjP/lF5HF9bvEF8FabDg=: "world"} </pre></div></div><p class="figure">Figure 16: Partial Response with Both <span class="tt">Content-Digest</span> and <span class="tt">Repr-Digest</span></p><div id="rfc.section.B.3.p.2" class="avoidbreakafter"><p>In the response message above, note that the <span class="tt">Repr-Digest</span> and <span class="tt">Content-Digests</span> are different. The <span class="tt">Repr-Digest</span> field-value is calculated across the entire JSON object <span class="tt">{"hello": "world"}</span> followed by an LF, and the field appears as follows:</p></div><div id="rfc.section.B.3.p.3"><pre class="text"> NOTE: '\' line wrapping per RFC 8792 Repr-Digest: \ sha-256=:RK/0qy18MlBSVnWgjwz6lZEWjP/lF5HF9bvEF8FabDg=: </pre></div><div id="rfc.section.B.3.p.4" class="avoidbreakafter"><p>However, since the message content is constrained to bytes 10-18, the <span class="tt">Content-Digest</span> field-value is calculated over the sequence <span class="tt">"world"}</span> followed by an LF, thus resulting in the following:</p></div><div id="rfc.section.B.3.p.5"><pre class="text"> NOTE: '\' line wrapping per RFC 8792 Content-Digest: \ sha-256=:jjcgBDWNAtbYUXI37CVG3gRuGOAjaaDRGpIUFsdyepQ=: </pre></div></section><section id="client-and-server-provide-full-representation-data"><h3 id="rfc.section.B.4"><a href="#rfc.section.B.4">B.4.</a>&nbsp;<a href="#client-and-server-provide-full-representation-data">Client and Server Provide Full Representation Data</a></h3><div id="rfc.section.B.4.p.1"><p>The request contains a <span class="tt">Repr-Digest</span> field-value calculated on the enclosed representation. It also includes an <span class="tt">Accept-Encoding: br</span> header field that advertises that the client supports Brotli encoding.</p></div><div id="rfc.section.B.4.p.2"><p>The response includes a <span class="tt">Content-Encoding: br</span> that indicates the selected representation is Brotli-encoded. The <span class="tt">Repr-Digest</span> field-value is therefore different compared to the request.</p></div><div id="rfc.section.B.4.p.3"><p>For presentation purposes, the response body is displayed as a sequence of hex-encoded bytes because it contains non-printable characters.</p></div><div id="rfc.figure.17"><div><pre class="text"> NOTE: '\' line wrapping per RFC 8792 PUT /items/123 HTTP/1.1 Host: foo.example Content-Type: application/json Accept-Encoding: br Repr-Digest: \ sha-256=:RK/0qy18MlBSVnWgjwz6lZEWjP/lF5HF9bvEF8FabDg=: {"hello": "world"} </pre></div></div><p class="figure">Figure 17: PUT Request with <span class="tt">Digest</span></p><div id="rfc.figure.18"><div><pre class="text"> NOTE: '\' line wrapping per RFC 8792 HTTP/1.1 200 OK Content-Type: application/json Content-Location: /items/123 Content-Encoding: br Content-Length: 23 Repr-Digest: \ sha-256=:d435Qo+nKZ+gLcUHn7GQtQ72hiBVAgqoLsZnZPiTGPk=: 8B 08 80 7B 22 68 65 6C 6C 6F 22 3A 20 22 77 6F 72 6C 64 22 7D 0A 03 </pre></div></div><p class="figure">Figure 18: Response with <span class="tt">Digest</span> of Encoded Response</p></section><section id="client-provides-full-representation-data-server-provides-no-representation-data"><h3 id="rfc.section.B.5"><a href="#rfc.section.B.5">B.5.</a>&nbsp;<a href="#client-provides-full-representation-data-server-provides-no-representation-data">Client Provides Full Representation Data and Server Provides No Representation Data</a></h3><div id="rfc.section.B.5.p.1"><p>The request <span class="tt">Repr-Digest</span> field-value is calculated on the enclosed content, which is the JSON object <span class="tt">{"hello": "world"}</span> followed by an LF.</p></div><div id="rfc.section.B.5.p.2"><p>The response <span class="tt">Repr-Digest</span> field-value depends on the representation metadata header fields, including <span class="tt">Content-Encoding: br</span>, even when the response does not contain content.</p></div><div id="rfc.section.B.5.p.3"><pre class="text"> NOTE: '\' line wrapping per RFC 8792 PUT /items/123 HTTP/1.1 Host: foo.example Content-Type: application/json Content-Length: 19 Accept-Encoding: br Repr-Digest: \ sha-256=:RK/0qy18MlBSVnWgjwz6lZEWjP/lF5HF9bvEF8FabDg==: {"hello": "world"} </pre></div><div id="rfc.figure.19"><div><pre class="text"> HTTP/1.1 204 No Content Content-Type: application/json Content-Encoding: br Repr-Digest: sha-256=:d435Qo+nKZ+gLcUHn7GQtQ72hiBVAgqoLsZnZPiTGPk=: </pre></div></div><p class="figure">Figure 19: Empty Response with <span class="tt">Digest</span></p></section><section id="client-and-server-provide-full-representation-data-1"><h3 id="rfc.section.B.6"><a href="#rfc.section.B.6">B.6.</a>&nbsp;<a href="#client-and-server-provide-full-representation-data-1">Client and Server Provide Full Representation Data</a></h3><div id="rfc.section.B.6.p.1"><p>The response contains two digest values using different algorithms.</p></div><div id="rfc.section.B.6.p.2"><p>For presentation purposes, the response body is displayed as a sequence of hex-encoded bytes because it contains non-printable characters.</p></div><div id="rfc.figure.20"><div><pre class="text"> NOTE: '\' line wrapping per RFC 8792 PUT /items/123 HTTP/1.1 Host: foo.example Content-Type: application/json Accept-Encoding: br Repr-Digest: \ sha-256=:RK/0qy18MlBSVnWgjwz6lZEWjP/lF5HF9bvEF8FabDg==: {"hello": "world"} </pre></div></div><p class="figure">Figure 20: PUT Request with <span class="tt">Digest</span></p><div id="rfc.figure.21"><div><pre class="text"> NOTE: '\' line wrapping per RFC 8792 HTTP/1.1 200 OK Content-Type: application/json Content-Encoding: br Content-Location: /items/123 Repr-Digest: \ sha-256=:d435Qo+nKZ+gLcUHn7GQtQ72hiBVAgqoLsZnZPiTGPk=:,\ sha-512=:db7fdBbgZMgX1Wb2MjA8zZj+rSNgfmDCEEXM8qLWfpfoNY0sCpHAzZbj\ 09X1/7HAb7Od5Qfto4QpuBsFbUO3dQ==: 8B 08 80 7B 22 68 65 6C 6C 6F 22 3A 20 22 77 6F 72 6C 64 22 7D 0A 03 </pre></div></div><p class="figure">Figure 21: Response with <span class="tt">Digest</span> of Encoded Content</p></section><section id="post-not-request-uri"><h3 id="rfc.section.B.7"><a href="#rfc.section.B.7">B.7.</a>&nbsp;<a href="#post-not-request-uri">POST Response Does Not Reference the Request URI</a></h3><div id="rfc.section.B.7.p.1"><p>The request <span class="tt">Repr-Digest</span> field-value is computed on the enclosed representation (see <a href="#state-changing-requests" title="Using Repr-Digest in State-Changing Requests">Section 3.1</a>), which is the JSON object <span class="tt">{"title": "New Title"}</span> followed by an LF.</p></div><div id="rfc.section.B.7.p.2"><p>The representation enclosed in the response is a multiline JSON object followed by an LF. It refers to the resource identified by <span class="tt">Content-Location</span> (see <a href="https://www.rfc-editor.org/rfc/rfc9110.html#section-6.4.2">Section 6.4.2</a> of <a href="#RFC9110"><cite title="HTTP Semantics">[HTTP]</cite></a>); thus, an application can use <span class="tt">Repr-Digest</span> in association with the resource referenced by <span class="tt">Content-Location</span>.</p></div><div id="rfc.figure.22"><div><pre class="text"> POST /books HTTP/1.1 Host: foo.example Content-Type: application/json Accept: application/json Accept-Encoding: identity Repr-Digest: sha-256=:mEkdbO7Srd9LIOegftO0aBX+VPTVz7/CSHes2Z27gc4=: {"title": "New Title"} </pre></div></div><p class="figure">Figure 22: POST Request with <span class="tt">Digest</span></p><div id="rfc.figure.23"><div><pre class="text"> HTTP/1.1 201 Created Content-Type: application/json Content-Location: /books/123 Location: /books/123 Repr-Digest: sha-256=:uVSlinTTdQUwm2On4k8TJUikGN1bf/Ds8WPX4oe0h9I=: { "id": "123", "title": "New Title" } </pre></div></div><p class="figure">Figure 23: Response with <span class="tt">Digest</span> of Resource</p></section><section id="post-referencing-status"><h3 id="rfc.section.B.8"><a href="#rfc.section.B.8">B.8.</a>&nbsp;<a href="#post-referencing-status">POST Response Describes the Request Status</a></h3><div id="rfc.section.B.8.p.1"><p>The request <span class="tt">Repr-Digest</span> field-value is computed on the enclosed representation (see <a href="#state-changing-requests" title="Using Repr-Digest in State-Changing Requests">Section 3.1</a>), which is the JSON object <span class="tt">{"title": "New Title"}</span> followed by an LF.</p></div><div id="rfc.section.B.8.p.2"><p>The representation enclosed in the response describes the status of the request, so <span class="tt">Repr-Digest</span> is computed on that enclosed representation. It is a multiline JSON object followed by an LF.</p></div><div id="rfc.section.B.8.p.3"><p>Response <span class="tt">Repr-Digest</span> has no explicit relation with the resource referenced by <span class="tt">Location</span>.</p></div><div id="rfc.figure.24"><div><pre class="text"> POST /books HTTP/1.1 Host: foo.example Content-Type: application/json Accept: application/json Accept-Encoding: identity Repr-Digest: sha-256=:mEkdbO7Srd9LIOegftO0aBX+VPTVz7/CSHes2Z27gc4=: {"title": "New Title"} </pre></div></div><p class="figure">Figure 24: POST Request with <span class="tt">Digest</span></p><div id="rfc.figure.25"><div><pre class="text"> HTTP/1.1 201 Created Content-Type: application/json Repr-Digest: sha-256=:yXIGDTN5VrfoyisKlXgRKUHHMs35SNtyC3szSz1dbO8=: Location: /books/123 { "status": "created", "id": "123", "ts": 1569327729, "instance": "/books/123" } </pre></div></div><p class="figure">Figure 25: Response with <span class="tt">Digest</span> of Representation</p></section><section id="digest-with-patch"><h3 id="rfc.section.B.9"><a href="#rfc.section.B.9">B.9.</a>&nbsp;<a href="#digest-with-patch"><span class="tt">Digest</span> with PATCH</a></h3><div id="rfc.section.B.9.p.1"><p>This case is analogous to a POST request where the target resource reflects the target URI.</p></div><div id="rfc.section.B.9.p.2"><p>The PATCH request uses the <span class="tt">application/merge-patch+json</span> media type defined in <a href="#RFC7396"><cite title="JSON Merge Patch">[RFC7396]</cite></a>. <span class="tt">Repr-Digest</span> is calculated on the content that corresponds to the patch document and is the JSON object <span class="tt">{"title": "New Title"}</span> followed by an LF.</p></div><div id="rfc.section.B.9.p.3"><p>The response <span class="tt">Repr-Digest</span> field-value is computed on the complete representation of the patched resource. It is a multiline JSON object followed by an LF.</p></div><div id="fig-patch"></div><div id="rfc.figure.26"><div><pre class="text"> PATCH /books/123 HTTP/1.1 Host: foo.example Content-Type: application/merge-patch+json Accept: application/json Accept-Encoding: identity Repr-Digest: sha-256=:mEkdbO7Srd9LIOegftO0aBX+VPTVz7/CSHes2Z27gc4=: {"title": "New Title"} </pre></div></div><p class="figure">Figure 26: PATCH Request with <span class="tt">Digest</span></p><div id="rfc.figure.27"><div><pre class="text"> HTTP/1.1 200 OK Content-Type: application/json Repr-Digest: sha-256=:uVSlinTTdQUwm2On4k8TJUikGN1bf/Ds8WPX4oe0h9I=: { "id": "123", "title": "New Title" } </pre></div></div><p class="figure">Figure 27: Response with <span class="tt">Digest</span> of Representation</p><div id="rfc.section.B.9.p.4"><p>Note that a <span class="tt">204 No Content</span> response without content, but with the same <span class="tt">Repr-Digest</span> field-value, would have been legitimate too. In that case, <span class="tt">Content-Digest</span> would have been computed on an empty content.</p></div></section><section id="error-responses"><h3 id="rfc.section.B.10"><a href="#rfc.section.B.10">B.10.</a>&nbsp;<a href="#error-responses">Error Responses</a></h3><div id="rfc.section.B.10.p.1"><p>In error responses, the representation data does not necessarily refer to the target resource. Instead, it refers to the representation of the error.</p></div><div id="rfc.section.B.10.p.2"><p>In the following example, a client sends the same request from <a href="#fig-patch" title="PATCH Request with Digest">Figure 26</a> to patch the resource located at /books/123. However, the resource does not exist and the server generates a 404 response with a body that describes the error in accordance with <a href="#RFC9457"><cite title="Problem Details for HTTP APIs">[RFC9457]</cite></a>.</p></div><div id="rfc.section.B.10.p.3"><p>The response <span class="tt">Repr-Digest</span> field-value is computed on this enclosed representation. It is a multiline JSON object followed by an LF.</p></div><div id="rfc.figure.28"><div><pre class="text"> HTTP/1.1 404 Not Found Content-Type: application/problem+json Repr-Digest: sha-256=:EXB0S2VF2H7ijkAVJkH1Sm0pBho0iDZcvVUHHXTTZSA=: { "title": "Not Found", "detail": "Cannot PATCH a non-existent resource", "status": 404 } </pre></div></div><p class="figure">Figure 28: Response with <span class="tt">Digest</span> of Error Representation</p></section><section id="use-with-trailer-fields-and-transfer-coding"><h3 id="rfc.section.B.11"><a href="#rfc.section.B.11">B.11.</a>&nbsp;<a href="#use-with-trailer-fields-and-transfer-coding">Use with Trailer Fields and Transfer Coding</a></h3><div id="rfc.section.B.11.p.1"><p>An origin server sends <span class="tt">Repr-Digest</span> as trailer field, so it can calculate digest-value while streaming content and thus mitigate resource consumption. The <span class="tt">Repr-Digest</span> field-value is the same as in <a href="#example-full-representation" title="Server Returns Full Representation Data">Appendix B.1</a> because <span class="tt">Repr-Digest</span> is designed to be independent of the use of one or more transfer codings (see <a href="#representation-digest" title="The Repr-Digest Field">Section 3</a>).</p></div><div id="rfc.section.B.11.p.2"><p>In the response content below, the string "\r\n" represents the CRLF bytes.</p></div><div id="rfc.figure.29"><div><pre class="text"> GET /items/123 HTTP/1.1 Host: foo.example </pre></div></div><p class="figure">Figure 29: GET Request</p><div id="rfc.figure.30"><div><pre class="text"> NOTE: '\' line wrapping per RFC 8792 HTTP/1.1 200 OK Content-Type: application/json Transfer-Encoding: chunked Trailer: Repr-Digest 8\r\n {"hello"\r\n 8\r\n : "world\r\n 3\r\n "}\n\r\n 0\r\n Repr-Digest: \ sha-256=:RK/0qy18MlBSVnWgjwz6lZEWjP/lF5HF9bvEF8FabDg==:\r\n </pre></div></div><p class="figure">Figure 30: Chunked Response with <span class="tt">Digest</span></p></section></section><hr class="hidden-print"><section id="examples-solicited"><h2 id="rfc.section.C" class="np"><a href="#rfc.section.C">Appendix C.</a>&nbsp;<a href="#examples-solicited">Examples of <span class="tt">Want-Repr-Digest</span> Solicited <span class="tt">Digest</span></a></h2><div id="rfc.section.C.p.1"><p>The following examples demonstrate interactions where a client solicits a <span class="tt">Repr-Digest</span> using <span class="tt">Want-Repr-Digest</span>. The behavior of <span class="tt">Content-Digest</span> and <span class="tt">Want-Content-Digest</span> is identical.</p></div><div id="rfc.section.C.p.2"><p>Some examples include JSON objects in the content. For presentation purposes, objects that fit completely within the line-length limits are presented on a single line using compact notation with no leading space. Objects that would exceed line-length limits are presented across multiple lines (one line per key-value pair) with two spaces of leading indentation.</p></div><div id="rfc.section.C.p.3"><p>Checksum mechanisms described in this document are media-type agnostic and do not provide canonicalization algorithms for specific formats. Examples are calculated inclusive of any space.</p></div><section id="server-selects-clients-least-preferred-algorithm"><h3 id="rfc.section.C.1"><a href="#rfc.section.C.1">C.1.</a>&nbsp;<a href="#server-selects-clients-least-preferred-algorithm">Server Selects Client's Least Preferred Algorithm</a></h3><div id="rfc.section.C.1.p.1"><p>The client requests a digest and prefers "sha". The server is free to reply with "sha-256" anyway.</p></div><div id="rfc.figure.31"><div><pre class="text"> GET /items/123 HTTP/1.1 Host: foo.example Want-Repr-Digest: sha-256=3, sha=10 </pre></div></div><p class="figure">Figure 31: GET Request with <span class="tt">Want-Repr-Digest</span></p><div id="rfc.figure.32"><div><pre class="text"> NOTE: '\' line wrapping per RFC 8792 HTTP/1.1 200 OK Content-Type: application/json Repr-Digest: \ sha-256=:RK/0qy18MlBSVnWgjwz6lZEWjP/lF5HF9bvEF8FabDg==: {"hello": "world"} </pre></div></div><p class="figure">Figure 32: Response with Different Algorithm</p></section><section id="ex-server-selects-unsupported-algorithm"><h3 id="rfc.section.C.2"><a href="#rfc.section.C.2">C.2.</a>&nbsp;<a href="#ex-server-selects-unsupported-algorithm">Server Selects Algorithm Unsupported by Client</a></h3><div id="rfc.section.C.2.p.1"><p>The client requests a "sha" digest because that is the only algorithm it supports. The server is not obliged to produce a response containing a "sha" digest; it instead uses a different algorithm.</p></div><div id="rfc.figure.33"><div><pre class="text"> GET /items/123 HTTP/1.1 Host: foo.example Want-Repr-Digest: sha=10 </pre></div></div><p class="figure">Figure 33: GET Request with <span class="tt">Want-Repr-Digest</span></p><div id="rfc.figure.34"><div><pre class="text"> NOTE: '\' line wrapping per RFC 8792 HTTP/1.1 200 OK Content-Type: application/json Repr-Digest: \ sha-512=:YMAam51Jz/jOATT6/zvHrLVgOYTGFy1d6GJiOHTohq4yP+pgk4vf2aCs\ yRZOtw8MjkM7iw7yZ/WkppmM44T3qg==: {"hello": "world"} </pre></div></div><p class="figure">Figure 34: Response with Unsupported Algorithm</p></section><section id="server-does-not-support-client-algorithm-and-returns-an-error"><h3 id="rfc.section.C.3"><a href="#rfc.section.C.3">C.3.</a>&nbsp;<a href="#server-does-not-support-client-algorithm-and-returns-an-error">Server Does Not Support Client Algorithm and Returns an Error</a></h3><div id="rfc.section.C.3.p.1"><p><a href="#ex-server-selects-unsupported-algorithm" title="Server Selects Algorithm Unsupported by Client">Appendix C.2</a> is an example where a server ignores the client's preferred digest algorithm. Alternatively, a server can also reject the request and return a response with an error status code such as 4xx or 5xx. This specification does not prescribe any requirement on status code selection; the following example illustrates one possible option.</p></div><div id="rfc.section.C.3.p.2"><p>In this example, the client requests a "sha" <span class="tt">Repr-Digest</span>, and the server returns an error with problem details <a href="#RFC9457"><cite title="Problem Details for HTTP APIs">[RFC9457]</cite></a> contained in the content. The problem details contain a list of the hashing algorithms that the server supports. This is purely an example; this specification does not define any format or requirements for such content.</p></div><div id="rfc.figure.35"><div><pre class="text"> GET /items/123 HTTP/1.1 Host: foo.example Want-Repr-Digest: sha=10 </pre></div></div><p class="figure">Figure 35: GET Request with <span class="tt">Want-Repr-Digest</span></p><div id="rfc.figure.36"><div><pre class="text"> HTTP/1.1 400 Bad Request Content-Type: application/problem+json { "title": "Bad Request", "detail": "Supported hashing algorithms: sha-256, sha-512", "status": 400 } </pre></div></div><p class="figure">Figure 36: Response Advertising the Supported Algorithms</p></section></section><hr class="hidden-print"><section id="sample-digest-values"><h2 id="rfc.section.D" class="np"><a href="#rfc.section.D">Appendix D.</a>&nbsp;<a href="#sample-digest-values">Sample <span class="tt">Digest</span> Values</a></h2><div id="rfc.section.D.p.1"><p>This section shows examples of digest values for different hashing algorithms. The input value is the JSON object <span class="tt">{"hello": "world"}</span>. The digest values are each produced by running the relevant hashing algorithm over the input and running the output bytes through Byte Sequence serialization; see <a href="https://www.rfc-editor.org/rfc/rfc8941.html#section-4.1.8">Section 4.1.8</a> of <a href="#RFC8941"><cite title="Structured Field Values for HTTP">[STRUCTURED-FIELDS]</cite></a>.</p></div><div id="rfc.section.D.p.2"><pre class="text"> NOTE: '\' line wrapping per RFC 8792 sha-512 - :WZDPaVn/7XgHaAy8pmojAkGWoRx2UFChF41A2svX+TaPm+\ AbwAgBWnrIiYllu7BNNyealdVLvRwEmTHWXvJwew==: sha-256 - :X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=: md5 - :Sd/dVLAcvNLSq16eXua5uQ==: sha - :07CavjDP4u3/TungoUHJO/Wzr4c=: unixsum - :GQU=: unixcksum - :7zsHAA==: adler - :OZkGFw==: crc32c - :Q3lHIA==: </pre></div></section><hr class="hidden-print"><section id="migrating"><h2 id="rfc.section.E" class="np"><a href="#rfc.section.E">Appendix E.</a>&nbsp;<a href="#migrating">Migrating from RFC 3230</a></h2><div id="rfc.section.E.p.1"><p>HTTP digests are computed by applying a hashing algorithm to input data. <a href="#RFC3230"><cite title="Instance Digests in HTTP">[RFC3230]</cite></a> defined the input data as an "instance", a term it also defined. The concept of an instance has since been superseded by the HTTP semantic term "representation". It is understood that some implementations of <a href="#RFC3230"><cite title="Instance Digests in HTTP">[RFC3230]</cite></a> mistook "instance" to mean HTTP content. Using content for the <span class="tt">Digest</span> field is an error that leads to interoperability problems between peers that implement <a href="#RFC3230"><cite title="Instance Digests in HTTP">[RFC3230]</cite></a>.</p></div><div id="rfc.section.E.p.2"><p><a href="#RFC3230"><cite title="Instance Digests in HTTP">[RFC3230]</cite></a> was only ever intended to use what HTTP now defines as selected representation data. The semantic concept of digest and representation are explained alongside the definition of the <span class="tt">Repr-Digest</span> field (<a href="#representation-digest" title="The Repr-Digest Field">Section 3</a>).</p></div><div id="rfc.section.E.p.3"><p>While the syntax of <span class="tt">Digest</span> and <span class="tt">Repr-Digest</span> are different, the considerations and examples this document gives for <span class="tt">Repr-Digest</span> apply equally to <span class="tt">Digest</span> because they operate on the same input data; see Sections <a href="#state-changing-requests" title="Using Repr-Digest in State-Changing Requests">3.1</a>, <a href="#security" title="Security Considerations">6</a> and <a href="#usage-in-signatures" title="Usage in Signatures">6.3</a>.</p></div><div id="rfc.section.E.p.4"><p><a href="#RFC3230"><cite title="Instance Digests in HTTP">[RFC3230]</cite></a> could never communicate the digest of HTTP message content in the <span class="tt">Digest</span> field; <span class="tt">Content-Digest</span> now provides that capability.</p></div><div id="rfc.section.E.p.5"><p><a href="#RFC3230"><cite title="Instance Digests in HTTP">[RFC3230]</cite></a> allowed algorithms to define their output encoding format for use with the <span class="tt">Digest</span> field. This resulted in a mix of formats such as base64, hex, or decimal. By virtue of using Structured Fields, <span class="tt">Content-Digest</span>, and <span class="tt">Repr-Digest</span> use only a single encoding format. Further explanation and examples are provided in <a href="#sample-digest-values" title="Sample Digest Values">Appendix D</a>.</p></div></section><hr class="hidden-print"><section id="acknowledgements"><h2 id="rfc.section.unnumbered-4" class="np"><a href="#acknowledgements">Acknowledgements</a></h2><div id="rfc.section.unnumbered-4.p.1"><p>This document is based on ideas from <a href="#RFC3230"><cite title="Instance Digests in HTTP">[RFC3230]</cite></a>, so thanks to Jeff Mogul and Arthur Van Hoff for their great work. The original idea of refreshing <a href="#RFC3230"><cite title="Instance Digests in HTTP">[RFC3230]</cite></a> arose from an interesting discussion with Mark Nottingham, Jeffrey Yasskin, and Martin Thomson when reviewing the MICE content coding.</p></div><div id="rfc.section.unnumbered-4.p.2"><p>Thanks to Julian Reschke for his valuable contributions to this document, and to the following contributors that have helped improve this specification by reporting bugs, asking smart questions, drafting or reviewing text, and evaluating open issues: Mike Bishop, Brian Campbell, Matthew Kerwin, James Manger, Tommy Pauly, Sean Turner, Justin Richer, and Erik Wilde.</p></div></section><hr class="hidden-print"><section id="rfc.authors" class="np"><h2><a href="#rfc.authors">Authors' Addresses</a></h2><address><b>Roberto Polli</b><br>Team Digitale, Italian Government<br>Italy<br>EMail: <a href="mailto:robipolli@gmail.com">robipolli@gmail.com</a></address><address><b>Lucas Pardue</b><br>Cloudflare<br>EMail: <a href="mailto:lucas@lucaspardue.com">lucas@lucaspardue.com</a></address></section></div></div></div><script src="/assets/node_modules/jquery/dist/jquery.min.js"></script><script src="/assets/node_modules/bootstrap/dist/js/bootstrap.min.js"></script></body></html>

Pages: 1 2 3 4 5 6 7 8 9 10