<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc2629 version 1.5.6 -->
<?rfc toc="yes"?>
<?rfc tocindent="yes"?>
<?rfc sortrefs="yes"?>
<?rfc symrefs="yes"?>
<?rfc strict="yes"?>
<?rfc compact="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc docmapping="yes"?>
<?rfc-ext html-pretty-print="prettyprint https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"?>
<rfc xmlns:x="http://purl.org/net/xml2rfc/ext"
     category="std"
     docName="draft-ietf-httpbis-message-signatures-06"
     ipr="trust200902"
     submissionType="IETF">
   <x:feedback template="mailto:quic@ietf.org?subject={docname},%20%22{section}%22\&amp;amp;body=%3c{ref}%3e:"/>
   <front>
      <title>HTTP Message Signatures</title>
      <author fullname="Annabelle Backman"
              initials="A."
              role="editor"
              surname="Backman">
         <organization>Amazon</organization>
         <address>
            <postal>
               <street>P.O. Box 81226</street>
               <city>Seattle</city>
               <region>WA</region>
               <code>98108-1226</code>
               <country>United States of America</country>
            </postal>
            <email>richanna@amazon.com</email>
            <uri>https://www.amazon.com/</uri>
         </address>
      </author>
      <author fullname="Justin Richer" initials="J." surname="Richer">
         <organization>Bespoke Engineering</organization>
         <address>
            <email>ietf@justin.richer.org</email>
            <uri>https://bspk.io/</uri>
         </address>
      </author>
      <author fullname="Manu Sporny" initials="M." surname="Sporny">
         <organization>Digital Bazaar</organization>
         <address>
            <postal>
               <street>203 Roanoke Street W.</street>
               <city>Blacksburg</city>
               <region>VA</region>
               <code>24060</code>
               <country>United States of America</country>
            </postal>
            <email>msporny@digitalbazaar.com</email>
            <uri>https://manu.sporny.org/</uri>
         </address>
      </author>
      <date day="13" month="August" year="2021"/>
      <area>Applications and Real-Time</area>
      <workgroup>HTTP</workgroup>
      <keyword>PKI</keyword>
      <abstract>
         <t>This document describes a mechanism for creating, encoding, and verifying digital signatures or message authentication codes over components of an HTTP message. This mechanism supports use cases where the full HTTP message may not be known to the signer, and where the message may be transformed (e.g., by intermediaries) before reaching the verifier. This document also describes a means for requesting that a signature be applied to a subsequent HTTP message in an ongoing HTTP exchange.</t>
      </abstract>
      <note title="Note to Readers">
         <t>
            <em>RFC EDITOR: please remove this section before publication</em>
         </t>
         <t>Discussion of this draft takes place on the HTTP working group mailing list (ietf-http-wg@w3.org), which is archived at <eref target="https://lists.w3.org/Archives/Public/ietf-http-wg/">https://lists.w3.org/Archives/Public/ietf-http-wg/</eref>.</t>
         <t>Working Group information can be found at <eref target="https://httpwg.org/">https://httpwg.org/</eref>; source code and issues list for this draft can be found at <eref target="https://github.com/httpwg/http-extensions/labels/signatures">https://github.com/httpwg/http-extensions/labels/signatures</eref>.</t>
      </note>
   </front>
   <middle>
      <section anchor="intro">
         <name>Introduction</name>
         <t>Message integrity and authenticity are important security properties that are critical to the secure operation of many HTTP applications. Application developers typically rely on the transport layer to provide these properties, by operating their application over <xref target="TLS"/>. However, TLS only guarantees these properties over a single TLS connection, and the path between client and application may be composed of multiple independent TLS connections (for example, if the application is hosted behind a TLS-terminating gateway or if the client is behind a TLS Inspection appliance). In such cases, TLS cannot guarantee end-to-end message integrity or authenticity between the client and application. Additionally, some operating environments present obstacles that make it impractical to use TLS, or to use features necessary to provide message authenticity. Furthermore, some applications require the binding of an application-level key to the HTTP message, separate from any TLS certificates in use. Consequently, while TLS can meet message integrity and authenticity needs for many HTTP-based applications, it is not a universal solution.</t>
         <t>This document defines a mechanism for providing end-to-end integrity and authenticity for components of an HTTP message. The mechanism allows applications to create digital signatures or message authentication codes (MACs) over only the components of the message that are meaningful and appropriate for the application. Strict canonicalization rules ensure that the verifier can verify the signature even if the message has been transformed in any of the many ways permitted by HTTP.</t>
         <t>The signing mechanism described in this document consists of three parts:</t>
         <t>
            <list style="symbols">
               <t>A common nomenclature and canonicalization rule set for the different protocol elements and other components of HTTP messages.</t>
               <t>Algorithms for generating and verifying signatures over HTTP message components using this nomenclature and rule set.</t>
               <t>A mechanism for attaching a signature and related metadata to an HTTP message.</t>
            </list>
         </t>
         <t>This document also provides a mechanism for one party to signal to another party that a signature is desired in one or more subsequent messages. This optional negotiation mechanism can be used along with opportunistic or application-driven message signatures by either party.</t>
         <section anchor="requirements-discussion">
            <name>Requirements Discussion</name>
            <t>HTTP permits and sometimes requires intermediaries to transform messages in a variety of ways. This may result in a recipient receiving a message that is not bitwise equivalent to the message that was originally sent. In such a case, the recipient will be unable to verify a signature over the raw bytes of the sender's HTTP message, as verifying digital signatures or MACs requires both signer and verifier to have the exact same signature input. Since the exact raw bytes of the message cannot be relied upon as a reliable source of signature input, the signer and verifier must derive the signature input from their respective versions of the message, via a mechanism that is resilient to safe changes that do not alter the meaning of the message.</t>
            <t>For a variety of reasons, it is impractical to strictly define what constitutes a safe change versus an unsafe one. Applications use HTTP in a wide variety of ways, and may disagree on whether a particular piece of information in a message (e.g., the body, or the <spanx style="verb">Date</spanx> header field) is relevant. Thus a general purpose solution must provide signers with some degree of control over which message components are signed.</t>
            <t>HTTP applications may be running in environments that do not provide complete access to or control over HTTP messages (such as a web browser's JavaScript environment), or may be using libraries that abstract away the details of the protocol (such as <eref target="https://openjdk.java.net/groups/net/httpclient/intro.html">the Java HTTPClient library</eref>). These applications need to be able to generate and verify signatures despite incomplete knowledge of the HTTP message.</t>
         </section>
         <section anchor="transforms">
            <name>HTTP Message Transformations</name>
            <t>As mentioned earlier, HTTP explicitly permits and in some cases requires implementations to transform messages in a variety of ways. Implementations are required to tolerate many of these transformations. What follows is a non-normative and non-exhaustive list of transformations that may occur under HTTP, provided as context:</t>
            <t>
               <list style="symbols">
                  <t>Re-ordering of header fields with different header field names (<xref target="MESSAGING" x:fmt="," x:sec="3.2.2"/>).</t>
                  <t>Combination of header fields with the same field name (<xref target="MESSAGING" x:fmt="," x:sec="3.2.2"/>).</t>
                  <t>Removal of header fields listed in the <spanx style="verb">Connection</spanx> header field (<xref target="MESSAGING" x:fmt="," x:sec="6.1"/>).</t>
                  <t>Addition of header fields that indicate control options (<xref target="MESSAGING" x:fmt="," x:sec="6.1"/>).</t>
                  <t>Addition or removal of a transfer coding (<xref target="MESSAGING" x:fmt="," x:sec="5.7.2"/>).</t>
                  <t>Addition of header fields such as <spanx style="verb">Via</spanx> (<xref target="MESSAGING" x:fmt="," x:sec="5.7.1"/>) and <spanx style="verb">Forwarded</spanx> (<xref target="RFC7239" x:fmt="," x:sec="4"/>).</t>
               </list>
            </t>
         </section>
         <section anchor="safe-transformations">
            <name>Safe Transformations</name>
            <t>Based on the definition of HTTP and the requirements described above, we can identify certain types of transformations that should not prevent signature verification, even when performed on message components covered by the signature. The following list describes those transformations:</t>
            <t>
               <list style="symbols">
                  <t>Combination of header fields with the same field name.</t>
                  <t>Reordering of header fields with different names.</t>
                  <t>Conversion between different versions of the HTTP protocol (e.g., HTTP/1.x to HTTP/2, or vice-versa).</t>
                  <t>Changes in casing (e.g., "Origin" to "origin") of any case-insensitive components such as header field names, request URI scheme, or host.</t>
                  <t>Addition or removal of leading or trailing whitespace to a header field value.</t>
                  <t>Addition or removal of <spanx style="verb">obs-folds</spanx>.</t>
                  <t>Changes to the <spanx style="verb">request-target</spanx> and <spanx style="verb">Host</spanx> header field that when applied together do not result in a change to the message's effective request URI, as defined in <xref target="MESSAGING" x:fmt="of" x:sec="5.5"/>.</t>
               </list>
            </t>
            <t>Additionally, all changes to components not covered by the signature are considered safe.</t>
         </section>
         <section anchor="definitions">
            <name>Conventions and Terminology</name>
            <t>The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 <xref target="RFC2119"/>
               <xref target="RFC8174"/> when, and only when, they appear in all capitals, as shown here.</t>
            <t>The terms "HTTP message", "HTTP request", "HTTP response", <spanx style="verb">absolute-form</spanx>, <spanx style="verb">absolute-path</spanx>, "effective request URI", "gateway", "header field", "intermediary", <spanx style="verb">request-target</spanx>, "sender", and "recipient" are used as defined in <xref target="MESSAGING"/>.</t>
            <t>The term "method" is to be interpreted as defined in <xref target="SEMANTICS" x:fmt="of" x:sec="4"/>.</t>
            <t>For brevity, the term "signature" on its own is used in this document to refer to both digital signatures and keyed MACs. Similarly, the verb "sign" refers to the generation of either a digital signature or keyed MAC over a given input string. The qualified term "digital signature" refers specifically to the output of an asymmetric cryptographic signing operation.</t>
            <t>In addition to those listed above, this document uses the following terms:</t>
            <dl newline="true">
               <dt>HTTP Message Signature:</dt>
               <dd>
                  <t>A digital signature or keyed MAC that covers one or more portions of an HTTP message. Note that a given HTTP Message can contain multiple HTTP Message Signatures.</t>
               </dd>
               <dt>Signer:</dt>
               <dd>
                  <t>The entity that is generating or has generated an HTTP Message Signature. Note that multiple entities can act as signers and apply separate HTTP Message Signatures to a given HTTP Message.</t>
               </dd>
               <dt>Verifier:</dt>
               <dd>
                  <t>An entity that is verifying or has verified an HTTP Message Signature against an HTTP Message. Note that an HTTP Message Signature may be verified multiple times, potentially by different entities.</t>
               </dd>
               <dt>HTTP Message Component:</dt>
               <dd>
                  <t>A portion of an HTTP message that is capable of being covered by an HTTP Message Signature.</t>
               </dd>
               <dt>HTTP Message Component Identifier:</dt>
               <dd>
                  <t>A value that uniquely identifies a specific HTTP Message Component in respect to a particular HTTP Message Signature and the HTTP Message it applies to.</t>
               </dd>
               <dt>HTTP Message Component Value:</dt>
               <dd>
                  <t>The value associated with a given component identifier within the context of a particular HTTP Message. Component values are derived from the HTTP Message and are usually subject to a canonicalization process.</t>
               </dd>
               <dt>Covered Components:</dt>
               <dd>
                  <t>An ordered set of HTTP message component identifiers for fields (<xref target="http-header"/>) and specialty components (<xref target="specialty-content"/>) that indicates the set of message components covered by the signature, not including the <spanx style="verb">@signature-params</spanx> specialty identifier itself. The order of this set is preserved and communicated between the signer and verifier to facilitate reconstruction of the signature input.</t>
               </dd>
               <dt>Signature Input:</dt>
               <dd>
                  <t>The sequence of bytes processed by the HTTP Message Signature algorithm to produce the HTTP Message Signature. The signature input is generated by the signer and verifier using the covered components set and the HTTP Message.</t>
               </dd>
               <dt>HTTP Message Signature Algorithm:</dt>
               <dd>
                  <t>A cryptographic algorithm that describes the signing and verification process for the signature. When expressed explicitly, the value maps to a string defined in the HTTP Signature Algorithms Registry defined in this document.</t>
               </dd>
               <dt>Key Material:</dt>
               <dd>
                  <t>The key material required to create or verify the signature. The key material is often identified with an explicit key identifier, allowing the signer to indicate to the verifier which key was used.</t>
               </dd>
               <dt>Creation Time:</dt>
               <dd>
                  <t>A timestamp representing the point in time that the signature was generated, as asserted by the signer.</t>
               </dd>
               <dt>Expiration Time:</dt>
               <dd>
                  <t>A timestamp representing the point in time at which the signature expires, as asserted by the signer. A signature's expiration time could be undefined, indicating that the signature does not expire from the perspective of the signer.</t>
               </dd>
            </dl>
            <t>The term "Unix time" is defined by <xref target="POSIX.1"/>, <eref target="http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16">Section 4.16</eref>.</t>
            <t>This document contains non-normative examples of partial and complete HTTP messages. Some examples use a single trailing backslash '' to indicate line wrapping for long values, as per <xref target="RFC8792"/>. The <spanx style="verb">\</spanx> character and leading spaces on wrapped lines are not part of the value.</t>
         </section>
         <section anchor="application">
            <name>Application of HTTP Message Signatures</name>
            <t>HTTP Message Signatures are designed to be a general-purpose security mechanism applicable in a wide variety of circumstances and applications. In order to properly and safely apply HTTP Message Signatures, an application or profile of this specification MUST specify all of the following items:</t>
            <t>
               <list style="symbols">
                  <t>The set of <xref target="covered-content">component identifiers</xref> that are expected and required. For example, an authorization protocol could mandate that the <spanx style="verb">Authorization</spanx> header be covered to protect the authorization credentials and mandate the signature parameters contain a <spanx style="verb">created</spanx> parameter, while an API expecting HTTP message bodies could require the <spanx style="verb">Digest</spanx> header to be present and covered.</t>
                  <t>A means of retrieving the key material used to verify the signature. An application will usually use the <spanx style="verb">keyid</spanx> parameter of the signature parameters (<xref target="signature-params"/>) and define rules for resolving a key from there, though the appropriate key could be known from other means.</t>
                  <t>A means of determining the signature algorithm used to verify the signature is appropriate for the key material. For example, the process could use the <spanx style="verb">alg</spanx> parameter of the signature parameters (<xref target="signature-params"/>) to state the algorithm explicitly, derive the algorithm from the key material, or use some pre-configured algorithm agreed upon by the signer and verifier.</t>
                  <t>A means of determining that a given key and algorithm presented in the request are appropriate for the request being made. For example, a server expecting only ECDSA signatures should know to reject any RSA signatures, or a server expecting asymmetric cryptography should know to reject any symmetric cryptography.</t>
               </list>
            </t>
            <t>An application using signatures also has to ensure that the verifier will have access to all required information to re-create the signature input string. For example, a server behind a reverse proxy would need to know the original request URI to make use of identifiers like <spanx style="verb">@target-uri</spanx>. Additionally, an application using signatures in responses would need to ensure that clients receiving signed responses have access to all the signed portions, including any portions of the request that were signed by the server.</t>
            <t>The details of this kind of profiling are the purview of the application and outside the scope of this specification.</t>
         </section>
      </section>
      <section anchor="covered-content">
         <name>HTTP Message Components</name>
         <t>In order to allow signers and verifiers to establish which components are covered by a signature, this document defines component identifiers for components covered by an HTTP Message Signature, a set of rules for deriving and canonicalizing the values associated with these component identifiers from the HTTP Message, and the means for combining these canonicalized values into a signature input string. The values for these items MUST be accessible to both the signer and the verifier of the message, which means these are usually derived from aspects of the HTTP message or signature itself.</t>
         <t>Some HTTP message components can undergo transformations that change the bitwise value without altering meaning of the component's value (for example, the merging together of header fields with the same name). Message component values must therefore be canonicalized before it is signed, to ensure that a signature can be verified despite such intermediary transformations. This document defines rules for each component identifier that transform the identifier's associated component value into such a canonical form.</t>
         <t>Component identifiers are serialized using the production grammar defined by <xref target="RFC8941">RFC8941, Section 4</xref>. The component identifier itself is an <spanx style="verb">sf-string</spanx> value and MAY define parameters which are included using the <spanx style="verb">parameters</spanx> rule.</t>
         <figure>
            <sourcecode type="abnf">
component-identifier = sf-string parameters
</sourcecode>
         </figure>
         <t>Note that this means the value of the component identifier itself is encased in double quotes, with parameters following as a semicolon-separated list, such as <spanx style="verb">"cache-control"</spanx>, <spanx style="verb">"date"</spanx>, or <spanx style="verb">"@signature-params"</spanx>.</t>
         <t>The following sections define component identifier types, their parameters, their associated values, and the canonicalization rules for their values. The method for combining component identifiers into the signature input is defined in <xref target="create-sig-input"/>.</t>
         <section anchor="http-header">
            <name>HTTP Fields</name>
            <t>The component identifier for an HTTP field is the lowercased form of its field name. While HTTP field names are case-insensitive, implementations MUST use lowercased field names (e.g., <spanx style="verb">content-type</spanx>, <spanx style="verb">date</spanx>, <spanx style="verb">etag</spanx>) when using them as component identifiers.</t>
            <t>Unless overridden by additional parameters and rules, the HTTP field value MUST be canonicalized with the following steps:</t>
            <t>
               <list style="numbers">
                  <t>Create an ordered list of the field values of each instance of the field in the message, in the order that they occur (or will occur) in the message.</t>
                  <t>Strip leading and trailing whitespace from each item in the list.</t>
                  <t>Concatenate the list items together, with a comma "," and space " " between each item.</t>
               </list>
            </t>
            <t>The resulting string is the canonicalized component value.</t>
            <section anchor="http-header-structured">
               <name>Canonicalized Structured HTTP Fields</name>
               <t>If value of the the HTTP field in question is a structured field (<xref target="RFC8941"/>), the component identifier MAY include the <spanx style="verb">sf</spanx> parameter. If this parameter is included, the HTTP field value MUST be canonicalized using the rules specified in <xref target="RFC8941">Section 4 of RFC8941</xref>. For example, this process will replace any optional internal whitespace with a single space character.</t>
               <t>The resulting string is used as the component value in <xref target="http-header"/>.</t>
            </section>
            <section anchor="canonicalization-examples">
               <name>Canonicalization Examples</name>
               <t>This section contains non-normative examples of canonicalized values for header fields, given the following example HTTP message:</t>
               <figure>
                  <sourcecode type="http-message">
Host: www.example.com
Date: Tue, 07 Jun 2014 20:51:35 GMT
X-OWS-Header:   Leading and trailing whitespace.
X-Obs-Fold-Header: Obsolete
    line folding.
X-Empty-Header:
Cache-Control: max-age=60
Cache-Control:    must-revalidate
X-Dictionary:  a=1,    b=2;x=1;y=2,   c=(a   b   c)
</sourcecode>
               </figure>
               <t>The following table shows example canonicalized values for header fields, given that message:</t>
               <texttable title="Non-normative examples of header field canonicalization.">
                  <ttcol align="left">Header Field</ttcol>
                  <ttcol align="left">Canonicalized Value</ttcol>
                  <c>
                     <spanx style="verb">"cache-control"</spanx>
                  </c>
                  <c>max-age=60, must-revalidate</c>
                  <c>
                     <spanx style="verb">"date"</spanx>
                  </c>
                  <c>Tue, 07 Jun 2014 20:51:35 GMT</c>
                  <c>
                     <spanx style="verb">"host"</spanx>
                  </c>
                  <c>www.example.com</c>
                  <c>
                     <spanx style="verb">"x-empty-header"</spanx>
                  </c>
                  <c> </c>
                  <c>
                     <spanx style="verb">"x-obs-fold-header"</spanx>
                  </c>
                  <c>Obsolete line folding.</c>
                  <c>
                     <spanx style="verb">"x-ows-header"</spanx>
                  </c>
                  <c>Leading and trailing whitespace.</c>
                  <c>
                     <spanx style="verb">"x-dictionary"</spanx>
                  </c>
                  <c>a=1, b=2;x=1;y=2, c=(a b c)</c>
                  <c>
                     <spanx style="verb">"x-dictionary";sf</spanx>
                  </c>
                  <c>a=1, b=2;x=1;y=2, c=(a b c)</c>
               </texttable>
            </section>
         </section>
         <section anchor="dictionary-structured-field-members">
            <name>Dictionary Structured Field Members</name>
            <t>An individual member in the value of a Dictionary Structured Field is identified by using the parameter <spanx style="verb">key</spanx> on the component identifier for the field. The value of this parameter is a the key being identified, without any parameters present on that key in the original dictionary.</t>
            <t>An individual member in the value of a Dictionary Structured Field is canonicalized by applying the serialization algorithm described in <xref target="RFC8941">Section 4.1.2 of RFC8941</xref> on a Dictionary containing only that item.</t>
            <section anchor="canonicalization-examples-1">
               <name>Canonicalization Examples</name>
               <t>This section contains non-normative examples of canonicalized values for Dictionary Structured Field Members given the following example header field, whose value is known to be a Dictionary:</t>
               <figure>
                  <sourcecode type="http-message">
X-Dictionary:  a=1, b=2;x=1;y=2, c=(a b c)
</sourcecode>
               </figure>
               <t>The following table shows example canonicalized values for different component identifiers, given that field:</t>
               <texttable title="Non-normative examples of Dictionary member canonicalization.">
                  <ttcol align="left">Component Identifier</ttcol>
                  <ttcol align="left">Component Value</ttcol>
                  <c>
                     <spanx style="verb">"x-dictionary";key=a</spanx>
                  </c>
                  <c>1</c>
                  <c>
                     <spanx style="verb">"x-dictionary";key=b</spanx>
                  </c>
                  <c>2;x=1;y=2</c>
                  <c>
                     <spanx style="verb">"x-dictionary";key=c</spanx>
                  </c>
                  <c>(a, b, c)</c>
               </texttable>
            </section>
         </section>
         <section anchor="specialty-content">
            <name>Specialty Components</name>
            <t>Message components not found in an HTTP field can be included in the signature input by defining a component identifier and the canonicalization method for its component value.</t>
            <t>To differentiate specialty component identifiers from HTTP fields, specialty component identifiers MUST start with the "at" <spanx style="verb">@</spanx> character. This specification defines the following specialty component identifiers:</t>
            <dl>
               <dt>@signature-params</dt>
               <dd>
                  <t>The signature metadata parameters for this signature. (<xref target="signature-params"/>)</t>
               </dd>
               <dt>@method</dt>
               <dd>
                  <t>The method used for a request. (<xref target="content-request-method"/>)</t>
               </dd>
               <dt>@target-uri</dt>
               <dd>
                  <t>The full target URI for a request. (<xref target="content-target-uri"/>)</t>
               </dd>
               <dt>@authority</dt>
               <dd>
                  <t>The authority of the target URI for a request. (<xref target="content-request-authority"/>)</t>
               </dd>
               <dt>@scheme</dt>
               <dd>
                  <t>The scheme of the target URI for a request. (<xref target="content-request-scheme"/>)</t>
               </dd>
               <dt>@request-target</dt>
               <dd>
                  <t>The request target. (<xref target="content-request-target"/>)</t>
               </dd>
               <dt>@path</dt>
               <dd>
                  <t>The absolute path portion of the target URI for a request. (<xref target="content-request-path"/>)</t>
               </dd>
               <dt>@query</dt>
               <dd>
                  <t>The query portion of the target URI for a request. (<xref target="content-request-query"/>)</t>
               </dd>
               <dt>@query-params</dt>
               <dd>
                  <t>The parsed query parameters of the target URI for a request. (<xref target="content-request-query-params"/>)</t>
               </dd>
               <dt>@status</dt>
               <dd>
                  <t>The status code for a response. (<xref target="content-status-code"/>).</t>
               </dd>
               <dt>@request-response</dt>
               <dd>
                  <t>A signature from a request message that resulted in this response message. (<xref target="content-request-response"/>)</t>
               </dd>
            </dl>
            <t>Additional specialty component identifiers MAY be defined and registered in the HTTP Signatures Specialty Component Identifier Registry. (<xref target="content-registry"/>)</t>
            <section anchor="signature-params">
               <name>Signature Parameters</name>
               <t>HTTP Message Signatures have metadata properties that provide information regarding the signature's generation and verification, such as the set of covered components, a timestamp, identifiers for verification key material, and other utilities.</t>
               <t>The signature parameters component identifier is <spanx style="verb">@signature-params</spanx>.</t>
               <t>The signature parameters component value is the serialization of the signature parameters for this signature, including the covered components set with all associated parameters. These parameters include any of the following:</t>
               <t>
                  <list style="symbols">
                     <t>
                        <spanx style="verb">created</spanx>: Creation time as an <spanx style="verb">sf-integer</spanx> UNIX timestamp value. Sub-second precision is not supported. Inclusion of this parameter is RECOMMENDED.</t>
                     <t>
                        <spanx style="verb">expires</spanx>: Expiration time as an <spanx style="verb">sf-integer</spanx> UNIX timestamp value. Sub-second precision is not supported.</t>
                     <t>
                        <spanx style="verb">nonce</spanx>: A random unique value generated for this signature.</t>
                     <t>
                        <spanx style="verb">alg</spanx>: The HTTP message signature algorithm from the HTTP Message Signature Algorithm Registry, as an <spanx style="verb">sf-string</spanx> value.</t>
                     <t>
                        <spanx style="verb">keyid</spanx>: The identifier for the key material as an <spanx style="verb">sf-string</spanx> value.</t>
                  </list>
               </t>
               <t>Additional parameters can be defined in the <xref target="iana-param-contents">HTTP Signature Parameters Registry</xref>.</t>
               <t>The signature parameters component value is serialized as a parameterized inner list using the rules in <xref target="RFC8941">Section 4 of RFC8941</xref> as follows:</t>
               <t>
                  <list style="numbers">
                     <t>Let the output be an empty string.</t>
                     <t>Determine an order for the component identifiers of the covered components. Once this order is chosen, it cannot be changed. This order MUST be the same order as used in creating the signature input (<xref target="create-sig-input"/>).</t>
                     <t>Serialize the component identifiers of the covered components, including all parameters, as an ordered <spanx style="verb">inner-list</spanx> according to <xref target="RFC8941">Section 4.1.1.1 of RFC8941</xref> and append this to the output.</t>
                     <t>Determine an order for any signature parameters. Once this order is chosen, it cannot be changed.</t>
                     <t>Append the parameters to the <spanx style="verb">inner-list</spanx> in the chosen order according to <xref target="RFC8941">Section 4.1.1.2 of RFC8941</xref>, skipping parameters that are not available or not used for this message signature.</t>
                     <t>The output contains the signature parameters component value.</t>
                  </list>
               </t>
               <t>Note that the <spanx style="verb">inner-list</spanx> serialization is used for the covered component value instead of the <spanx style="verb">sf-list</spanx> serialization in order to facilitate this value's inclusion in message fields such as the <spanx style="verb">Signature-Input</spanx> field's dictionary, as discussed in <xref target="signature-input-header"/>.</t>
               <t>This example shows a canonicalized value for the parameters of a given signature:</t>
               <figure>
                  <artwork>
NOTE: '\' line wrapping per RFC 8792

("@target-uri" "@authority" "date" "cache-control" "x-empty-header" \
  "x-example");keyid="test-key-rsa-pss";alg="rsa-pss-sha512";\
  created=1618884475;expires=1618884775
</artwork>
               </figure>
               <t>Note that an HTTP message could contain multiple signatures, but only the signature parameters used for the current signature are included in the entry.</t>
            </section>
            <section anchor="content-request-method">
               <name>Method</name>
               <t>The <spanx style="verb">@method</spanx> component identifier refers to the HTTP method of a request message. The component value of is canonicalized by taking the value of the method as a string. Note that the method name is case-sensitive as per <xref target="SEMANTICS"/>
                  <xref target="SEMANTICS" x:fmt="sec" x:sec="9.1"/>, and conventionally standardized method names are uppercase US-ASCII. If used, the <spanx style="verb">@method</spanx> component identifier MUST occur only once in the covered components.</t>
               <t>For example, the following request message:</t>
               <figure>
                  <sourcecode type="http-message">
POST /path?param=value HTTP/1.1
Host: www.example.com
</sourcecode>
               </figure>
               <t>Would result in the following <spanx style="verb">@method</spanx> value:</t>
               <figure>
                  <artwork>
"@method": POST
</artwork>
               </figure>
               <t>If used in a response message, the <spanx style="verb">@method</spanx> component identifier refers to the associated component value of the request that triggered the response message being signed.</t>
            </section>
            <section anchor="content-target-uri">
               <name>Target URI</name>
               <t>The <spanx style="verb">@target-uri</spanx> component identifier refers to the target URI of a request message. The component value is the full absolute target URI of the request, potentially assembled from all available parts including the authority and request target as described in <xref target="SEMANTICS"/>
                  <xref target="SEMANTICS" x:fmt="sec" x:sec="7.1"/>. If used, the <spanx style="verb">@target-uri</spanx> component identifier MUST occur only once in the covered components.</t>
               <t>For example, the following message sent over HTTPS:</t>
               <figure>
                  <sourcecode type="http-message">
POST /path?param=value HTTP/1.1
Host: www.example.com
</sourcecode>
               </figure>
               <t>Would result in the following <spanx style="verb">@target-uri</spanx> value:</t>
               <figure>
                  <artwork>
"@target-uri": https://www.example.com/path?param=value
</artwork>
               </figure>
               <t>If used in a response message, the <spanx style="verb">@target-uri</spanx> component identifier refers to the associated component value of the request that triggered the response message being signed.</t>
            </section>
            <section anchor="content-request-authority">
               <name>Authority</name>
               <t>The <spanx style="verb">@authority</spanx> component identifier refers to the authority component of the target URI of the HTTP request message, as defined in <xref target="SEMANTICS"/>
                  <xref target="SEMANTICS" x:fmt="sec" x:sec="7.2"/>. In HTTP 1.1, this is usually conveyed using the <spanx style="verb">Host</spanx> header, while in HTTP 2 and HTTP 3 it is conveyed using the <spanx style="verb">:authority</spanx> pseudo-header. The value is the fully-qualified authority component of the request, comprised of the host and, optionally, port of the request target, as a string. The component value MUST be normalized according to the rules in <xref target="SEMANTICS"/>
                  <xref target="SEMANTICS" x:fmt="sec" x:sec="4.2.3"/>. Namely, the host name is normalized to lowercase and the default port is omitted. If used, the <spanx style="verb">@authority</spanx> component identifier MUST occur only once in the covered components.</t>
               <t>For example, the following request message:</t>
               <figure>
                  <sourcecode type="http-message">
POST /path?param=value HTTP/1.1
Host: www.example.com
</sourcecode>
               </figure>
               <t>Would result in the following <spanx style="verb">@authority</spanx> component value:</t>
               <figure>
                  <artwork>
"@authority": www.example.com
</artwork>
               </figure>
               <t>If used in a response message, the <spanx style="verb">@authority</spanx> component identifier refers to the associated component value of the request that triggered the response message being signed.</t>
            </section>
            <section anchor="content-request-scheme">
               <name>Scheme</name>
               <t>The <spanx style="verb">@scheme</spanx> component identifier refers to the scheme of the target URL of the HTTP request message. The component value is the scheme as a string as defined in <xref target="SEMANTICS"/>
                  <xref target="SEMANTICS" x:fmt="sec" x:sec="4.2"/>. While the scheme itself is case-insensitive, it MUST be normalized to lowercase for inclusion in the signature input string. If used, the <spanx style="verb">@scheme</spanx> component identifier MUST occur only once in the covered components.</t>
               <t>For example, the following request message requested over plain HTTP:</t>
               <figure>
                  <sourcecode type="http-message">
POST /path?param=value HTTP/1.1
Host: www.example.com
</sourcecode>
               </figure>
               <t>Would result in the following <spanx style="verb">@scheme</spanx> value:</t>
               <figure>
                  <artwork>
"@scheme": http
</artwork>
               </figure>
               <t>If used in a response message, the <spanx style="verb">@scheme</spanx> component identifier refers to the associated component value of the request that triggered the response message being signed.</t>
            </section>
            <section anchor="content-request-target">
               <name>Request Target</name>
               <t>The <spanx style="verb">@request-target</spanx> component identifier refers to the full request target of the HTTP request message, as defined in <xref target="SEMANTICS"/>
                  <xref target="SEMANTICS" x:fmt="sec" x:sec="7.1"/>. The component value of the request target can take different forms, depending on the type of request, as described below. If used, the <spanx style="verb">@request-target</spanx> component identifier MUST occur only once in the covered components.</t>
               <t>For HTTP 1.1, the component value is equivalent to the request target portion of the request line. However, this value is more difficult to reliably construct in other versions of HTTP. Therefore, it is NOT RECOMMENDED that this identifier be used when versions of HTTP other than 1.1 might be in use.</t>
               <t>The origin form value is combination of the absolute path and query components of the request URL. For example, the following request message:</t>
               <figure>
                  <sourcecode type="http-message">
POST /path?param=value HTTP/1.1
Host: www.example.com
</sourcecode>
               </figure>
               <t>Would result in the following <spanx style="verb">@request-target</spanx> component value:</t>
               <figure>
                  <artwork>
"@request-target": /path?param=value
</artwork>
               </figure>
               <t>The following request to an HTTP proxy with the absolute-form value, containing the fully qualified target URI:</t>
               <figure>
                  <sourcecode type="http-message">
GET https://www.example.com/path?param=value HTTP/1.1
</sourcecode>
               </figure>
               <t>Would result in the following <spanx style="verb">@request-target</spanx> component value:</t>
               <figure>
                  <artwork>
"@request-target": https://www.example.com/path?param=value
</artwork>
               </figure>
               <t>The following CONNECT request with an authority-form value, containing the host and port of the target:</t>
               <figure>
                  <sourcecode type="http-message">
CONNECT www.example.com:80 HTTP/1.1
Host: www.example.com
</sourcecode>
               </figure>
               <t>Would result in the following <spanx style="verb">@request-target</spanx> component value:</t>
               <figure>
                  <artwork>
"@request-target": www.example.com:80
</artwork>
               </figure>
               <t>The following OPTIONS request message with the asterisk-form value, containing a single asterisk <spanx style="verb">*</spanx> character:</t>
               <figure>
                  <sourcecode type="http-message">
OPTIONS * HTTP/1.1
Host: www.example.com
</sourcecode>
               </figure>
               <t>Would result in the following <spanx style="verb">@request-target</spanx> component value:</t>
               <figure>
                  <artwork>
"@request-target": *
</artwork>
               </figure>
               <t>If used in a response message, the <spanx style="verb">@request-target</spanx> component identifier refers to the associated component value of the request that triggered the response message being signed.</t>
            </section>
            <section anchor="content-request-path">
               <name>Path</name>
               <t>The <spanx style="verb">@path</spanx> component identifier refers to the target path of the HTTP request message. The component value is the absolute path of the request target defined by <xref target="RFC3986"/>, with no query component and no trailing <spanx style="verb">?</spanx> character. The value is normalized according to the rules in <xref target="SEMANTICS"/>
                  <xref target="SEMANTICS" x:fmt="sec" x:sec="4.2.3"/>. Namely, an empty path string is normalized as a single slash <spanx style="verb">/</spanx> character, and path components are represented by their values after decoding any percent-encoded octets. If used, the <spanx style="verb">@path</spanx> component identifier MUST occur only once in the covered components.</t>
               <t>For example, the following request message:</t>
               <figure>
                  <sourcecode type="http-message">
POST /path?param=value HTTP/1.1
Host: www.example.com
</sourcecode>
               </figure>
               <t>Would result in the following <spanx style="verb">@path</spanx> value:</t>
               <figure>
                  <artwork>
"@path": /path
</artwork>
               </figure>
               <t>If used in a response message, the <spanx style="verb">@path</spanx> identifier refers to the associated component value of the request that triggered the response message being signed.</t>
            </section>
            <section anchor="content-request-query">
               <name>Query</name>
               <t>The <spanx style="verb">@query</spanx> component identifier refers to the query component of the HTTP request message. The component value is the entire normalized query string defined by <xref target="RFC3986"/>, including the leading <spanx style="verb">?</spanx> character. The value is normalized according to the rules in <xref target="SEMANTICS"/>
                  <xref target="SEMANTICS" x:fmt="sec" x:sec="4.2.3"/>. Namely, percent-encoded octets are decoded. If used, the <spanx style="verb">@query</spanx> component identifier MUST occur only once in the covered components.</t>
               <t>For example, the following request message:</t>
               <figure>
                  <sourcecode type="http-message">
POST /path?param=value&amp;foo=bar&amp;baz=batman HTTP/1.1
Host: www.example.com
</sourcecode>
               </figure>
               <t>Would result in the following <spanx style="verb">@query</spanx> value:</t>
               <figure>
                  <artwork>
"@query": ?param=value&amp;foo=bar&amp;baz=batman
</artwork>
               </figure>
               <t>The following request message:</t>
               <figure>
                  <sourcecode type="http-message">
POST /path?queryString HTTP/1.1
Host: www.example.com
</sourcecode>
               </figure>
               <t>Would result in the following <spanx style="verb">@query</spanx> value:</t>
               <figure>
                  <artwork>
"@query": ?queryString
</artwork>
               </figure>
               <t>If used in a response message, the <spanx style="verb">@query</spanx> component identifier refers to the associated component value of the request that triggered the response message being signed.</t>
            </section>
            <section anchor="content-request-query-params">
               <name>Query Parameters</name>
               <t>If a request target URI uses HTML form parameters in the query string as defined in <xref target="HTMLURL"/> Section 5, the <spanx style="verb">@query-params</spanx> component identifier allows addressing of individual query parameters. The query parameters MUST be parsed according to <xref target="HTMLURL"/> Section 5.1, resulting in a list of (<spanx style="verb">nameString</spanx>, <spanx style="verb">valueString</spanx>) tuples. The REQUIRED <spanx style="verb">name</spanx> parameter of each input identifier contains the <spanx style="verb">nameString</spanx> of a single query parameter. Several different named query parameters MAY be included in the covered components. Single named parameters MAY occur in any order in the covered components.</t>
               <t>The component value of a single named parameter is the the <spanx style="verb">valueString</spanx> of the named query parameter defined by <xref target="HTMLURL"/> Section 5.1, which is the value after percent-encoded octets are decoded. Note that this value does not include any leading <spanx style="verb">?</spanx> characters, equals sign <spanx style="verb">=</spanx>, or separating <spanx style="verb">&amp;</spanx> characters. Named query parameters with an empty <spanx style="verb">valueString</spanx> are included with an empty string as the component value.</t>
               <t>If a parameter name occurs multiple times in a request, all parameter values of that name MUST be included in separate signature input lines in the order in which the parameters occur in the target URI.</t>
               <t>For example for the following request:</t>
               <figure>
                  <sourcecode type="http-message">
POST /path?param=value&amp;foo=bar&amp;baz=batman&amp;qux= HTTP/1.1
Host: www.example.com
</sourcecode>
               </figure>
               <t>Indicating the <spanx style="verb">baz</spanx>, <spanx style="verb">qux</spanx> and <spanx style="verb">param</spanx> named query parameters in would result in the following <spanx style="verb">@query-param</spanx> value:</t>
               <figure>
                  <artwork>
"@query-params";name="baz": batman
"@query-params";name="qux":
"@query-params";name="param": value
</artwork>
               </figure>
               <t>If used in a response message, the <spanx style="verb">@query-params</spanx> component identifier refers to the associated component value of the request that triggered the response message being signed.</t>
            </section>
            <section anchor="content-status-code">
               <name>Status Code</name>
               <t>The <spanx style="verb">@status</spanx> component identifier refers to the three-digit numeric HTTP status code of a response message as defined in <xref target="SEMANTICS"/>
                  <xref target="SEMANTICS" x:fmt="sec" x:sec="15"/>. The component value is the serialized three-digit integer of the HTTP response code, with no descriptive text. If used, the <spanx style="verb">@status</spanx> component identifier MUST occur only once in the covered components.</t>
               <t>For example, the following response message:</t>
               <figure>
                  <sourcecode type="http-message">
HTTP/1.1 200 OK
Date: Fri, 26 Mar 2010 00:05:00 GMT
</sourcecode>
               </figure>
               <t>Would result in the following <spanx style="verb">@status</spanx> value:</t>
               <figure>
                  <artwork>
"@status": 200
</artwork>
               </figure>
               <t>The <spanx style="verb">@status</spanx> component identifier MUST NOT be used in a request message.</t>
            </section>
            <section anchor="content-request-response">
               <name>Request-Response Signature Binding</name>
               <t>When a signed request message results in a signed response message, the <spanx style="verb">@request-response</spanx> component identifier can be used to cryptographically link the request and the response to each other by including the identified request signature value in the response's signature input without copying the value of the request's signature to the response directly. This component identifier has a single REQUIRED parameter:</t>
               <dl>
                  <dt>
                     <spanx style="verb">key</spanx>
                  </dt>
                  <dd>
                     <t>Identifies which signature from the response to sign.</t>
                  </dd>
               </dl>
               <t>The component value is the <spanx style="verb">sf-binary</spanx> representation of the signature value of the referenced request identified by the <spanx style="verb">key</spanx> parameter.</t>
               <t>For example, when serving this signed request:</t>
               <figure>
                  <sourcecode type="http-message">
NOTE: '\' line wrapping per RFC 8792

POST /foo?param=value&amp;pet=dog HTTP/1.1
Host: example.com
Date: Tue, 20 Apr 2021 02:07:55 GMT
Content-Type: application/json
Content-Length: 18
Signature-Input: sig1=("@authority" "content-type")\
  ;created=1618884475;keyid="test-key-rsa-pss"
Signature: sig1=:KuhJjsOKCiISnKHh2rln5ZNIrkRvue0DSu5rif3g7ckTbbX7C4\
  Jp3bcGmi8zZsFRURSQTcjbHdJtN8ZXlRptLOPGHkUa/3Qov79gBeqvHNUO4bhI27p\
  4WzD1bJDG9+6ml3gkrs7rOvMtROObPuc78A95fa4+skS/t2T7OjkfsHAm/enxf1fA\
  wkk15xj0n6kmriwZfgUlOqyff0XLwuH4XFvZ+ZTyxYNoo2+EfFg4NVfqtSJch2WDY\
  7n/qmhZOzMfyHlggWYFnDpyP27VrzQCQg8rM1Crp6MrwGLa94v6qP8pq0sQVq2DLt\
  4NJSoRRqXTvqlWIRnexmcKXjQFVz6YSA==:

{"hello": "world"}
</sourcecode>
               </figure>
               <t>This would result in the following unsigned response message:</t>
               <figure>
                  <sourcecode type="http-message">
HTTP/1.1 200 OK
Date: Tue, 20 Apr 2021 02:07:56 GMT
Content-Type: application/json
Content-Length: 62

{"busy": true, "message": "Your call is very important to us"}
</sourcecode>
               </figure>
               <t>The server signs the response with its own key and includes the signature of <spanx style="verb">sig1</spanx> from the request in the covered components of the response. The signature input string for this example is:</t>
               <figure>
                  <artwork>
NOTE: '\' line wrapping per RFC 8792

"content-type": application/json
"content-length": 62
"@status": 200
"@request-response";key="sig1": :KuhJjsOKCiISnKHh2rln5ZNIrkRvue0DSu\
  5rif3g7ckTbbX7C4Jp3bcGmi8zZsFRURSQTcjbHdJtN8ZXlRptLOPGHkUa/3Qov79\
  gBeqvHNUO4bhI27p4WzD1bJDG9+6ml3gkrs7rOvMtROObPuc78A95fa4+skS/t2T7\
  OjkfsHAm/enxf1fAwkk15xj0n6kmriwZfgUlOqyff0XLwuH4XFvZ+ZTyxYNoo2+Ef\
  Fg4NVfqtSJch2WDY7n/qmhZOzMfyHlggWYFnDpyP27VrzQCQg8rM1Crp6MrwGLa94\
  v6qP8pq0sQVq2DLt4NJSoRRqXTvqlWIRnexmcKXjQFVz6YSA==:
"@signature-params": ("content-type" "content-length" "@status" \
  "@request-response";key="sig1");created=1618884475\
  ;keyid="test-key-ecc-p256"
</artwork>
               </figure>
               <t>The signed response message is:</t>
               <figure>
                  <sourcecode type="http-message">
NOTE: '\' line wrapping per RFC 8792

HTTP/1.1 200 OK
Date: Tue, 20 Apr 2021 02:07:56 GMT
Content-Type: application/json
Content-Length: 62
Signature-Input: sig1=("content-type" "content-length" "@status" \
  "@request-response";key="sig1");created=1618884475\
  ;keyid="test-key-ecc-p256"
Signature: sig1=:crVqK54rxvdx0j7qnt2RL1oQSf+o21S/6Uk2hyFpoIfOT0q+Hv\
  msYAXUXzo0Wn8NFWh/OjWQOXHAQdVnTk87Pw==:

{"busy": true, "message": "Your call is very important to us"}
</sourcecode>
               </figure>
               <t>Since the request's signature value itself is not repeated in the response, the requester MUST keep the original signature value around long enough to validate the signature of the response.</t>
               <t>The <spanx style="verb">@request-response</spanx> component identifier MUST NOT be used in a request message.</t>
            </section>
         </section>
         <section anchor="create-sig-input">
            <name>Creating the Signature Input String</name>
            <t>The signature input is a US-ASCII string containing the canonicalized HTTP message components covered by the signature. To create the signature input string, the signer or verifier concatenates together entries for each identifier in the signature's covered components (including their parameters) using the following algorithm:</t>
            <t>
               <list style="numbers">
                  <t>Let the output be an empty string.</t>
                  <t>For each message component item in the covered components set (in order): <list style="numbers">
                        <t>Append the component identifier for the covered component serialized according to the <spanx style="verb">component-identifier</spanx> rule.</t>
                        <t>Append a single colon <spanx style="verb">":"</spanx>
                        </t>
                        <t>Append a single space <spanx style="verb">" "</spanx>
                        </t>
                        <t>Append the covered component's canonicalized component value, as defined by the HTTP message component type. (<xref target="http-header"/> and <xref target="specialty-content"/>)</t>
                        <t>Append a single newline <spanx style="verb">"\\n"</spanx>
                        </t>
                     </list>
                  </t>
                  <t>Append the signature parameters component (<xref target="signature-params"/>) as follows: <list style="numbers">
                        <t>Append the component identifier for the signature parameters serialized according to the <spanx style="verb">component-identifier</spanx> rule, i.e. <spanx style="verb">"@signature-params"</spanx>
                        </t>
                        <t>Append a single colon <spanx style="verb">":"</spanx>
                        </t>
                        <t>Append a single space <spanx style="verb">" "</spanx>
                        </t>
                        <t>Append the signature parameters' canonicalized component value as defined in <xref target="signature-params"/>
                        </t>
                     </list>
                  </t>
                  <t>Return the output string.</t>
               </list>
            </t>
            <t>If covered components reference a component identifier that cannot be resolved to a component value in the message, the implementation MUST produce an error. Such situations are included but not limited to:</t>
            <t>
               <list style="symbols">
                  <t>The signer or verifier does not understand the component identifier.</t>
                  <t>The component identifier identifies a field that is not present in the message or whose value is malformed.</t>
                  <t>The component identifier is a Dictionary member identifier that references a field that is not present in the message, is not a Dictionary Structured Field, or whose value is malformed.</t>
                  <t>The component identifier is a Dictionary member identifier that references a member that is not present in the field value, or whose value is malformed. E.g., the identifier is <spanx style="verb">"x-dictionary";key="c"</spanx> and the value of the <spanx style="verb">x-dictionary</spanx> header field is <spanx style="verb">a=1, b=2</spanx>
                  </t>
               </list>
            </t>
            <t>In the following non-normative example, the HTTP message being signed is the following request:</t>
            <figure>
               <sourcecode type="http-message">
GET /foo HTTP/1.1
Host: example.org
Date: Tue, 20 Apr 2021 02:07:55 GMT
X-Example: Example header
        with some whitespace.
X-Empty-Header:
Cache-Control: max-age=60
Cache-Control: must-revalidate
</sourcecode>
            </figure>
            <t>The covered components consist of the <spanx style="verb">@method</spanx>, <spanx style="verb">@path</spanx>, and <spanx style="verb">@authority</spanx> specialty component identifiers followed by the <spanx style="verb">Cache-Control</spanx>, <spanx style="verb">X-Empty-Header</spanx>, <spanx style="verb">X-Example</spanx> HTTP headers, in order. The signature parameters consist of a creation timestamp is <spanx style="verb">1618884475</spanx> and the key identifier is <spanx style="verb">test-key-rsa-pss</spanx>. The signature input string for this message with these parameters is:</t>
            <figure anchor="example-sig-input"
                    title="Non-normative example Signature Input">
               <artwork name="example-sig-input">
NOTE: '\' line wrapping per RFC 8792

"@method": GET
"@path": /foo
"@authority": example.org
"cache-control": max-age=60, must-revalidate
"x-empty-header":
"x-example": Example header with some whitespace.
"@signature-params": ("@method" "@path" "@authority" \
  "cache-control" "x-empty-header" "x-example");created=1618884475\
  ;keyid="test-key-rsa-pss"
</artwork>
            </figure>
         </section>
      </section>
      <section anchor="message-signatures">
         <name>HTTP Message Signatures</name>
         <t>An HTTP Message Signature is a signature over a string generated from a subset of the components of an HTTP message in addition to metadata about the signature itself. When successfully verified against an HTTP message, an HTTP Message Signature provides cryptographic proof that the message is semantically equivalent to the message for which the signature was generated, with respect to the subset of message components that was signed.</t>
         <section anchor="sign">
            <name>Creating a Signature</name>
            <t>In order to create a signature, a signer MUST follow the following algorithm:</t>
            <t>
               <list style="numbers">
                  <t>The signer chooses an HTTP signature algorithm and key material for signing. The signer MUST choose key material that is appropriate for the signature's algorithm, and that conforms to any requirements defined by the algorithm, such as key size or format. The mechanism by which the signer chooses the algorithm and key material is out of scope for this document.</t>
                  <t>The signer sets the signature's creation time to the current time.</t>
                  <t>If applicable, the signer sets the signature's expiration time property to the time at which the signature is to expire.</t>
                  <t>The signer creates an ordered set of component identifiers representing the message components to be covered by the signature, and attaches signature metadata parameters to this set. The serialized value of this is later used as the value of the <spanx style="verb">Signature-Input</spanx> field as described in <xref target="signature-input-header"/>. <list style="symbols">
                        <t>Once an order of covered components is chosen, the order MUST NOT change for the life of the signature.</t>
                        <t>Each covered component identifier MUST be either an HTTP field in the message <xref target="http-header"/> or a specialty component identifier listed in <xref target="specialty-content"/> or its associated registry.</t>
                        <t>Signers of a request SHOULD include some or all of the message control data in the covered components, such as the <spanx style="verb">@method</spanx>, <spanx style="verb">@authority</spanx>, <spanx style="verb">@target-uri</spanx>, or some combination thereof.</t>
                        <t>Signers SHOULD include the <spanx style="verb">created</spanx> signature metadata parameter to indicate when the signature was created.</t>
                        <t>The <spanx style="verb">@signature-params</spanx> specialty component identifier is not explicitly listed in the list of covered component identifiers, because it is required to always be present as the last line in the signature input. This ensures that a signature always covers its own metadata.</t>
                        <t>Further guidance on what to include in this set and in what order is out of scope for this document.</t>
                     </list>
                  </t>
                  <t>The signer creates the signature input string based on these signature parameters. (<xref target="create-sig-input"/>)</t>
                  <t>The signer signs the signature input with the chosen signing algorithm using the key material chosen by the signer. Several signing algorithms are defined in in <xref target="signature-methods"/>.</t>
                  <t>The byte array output of the signature function is the HTTP message signature output value to be included in the <spanx style="verb">Signature</spanx> field as defined in <xref target="signature-header"/>.</t>
               </list>
            </t>
            <t>For example, given the HTTP message and signature parameters in the example in <xref target="create-sig-input"/>, the example signature input string when signed with the <spanx style="verb">test-key-rsa-pss</spanx> key in <xref target="example-key-rsa-pss-test"/> gives the following message signature output value, encoded in Base64:</t>
            <figure anchor="example-sig-value"
                    title="Non-normative example signature value">
               <artwork>
NOTE: '\' line wrapping per RFC 8792

P0wLUszWQjoi54udOtydf9IWTfNhy+r53jGFj9XZuP4uKwxyJo1RSHi+oEF1FuX6O29\
d+lbxwwBao1BAgadijW+7O/PyezlTnqAOVPWx9GlyntiCiHzC87qmSQjvu1CFyFuWSj\
dGa3qLYYlNm7pVaJFalQiKWnUaqfT4LyttaXyoyZW84jS8gyarxAiWI97mPXU+OVM64\
+HVBHmnEsS+lTeIsEQo36T3NFf2CujWARPQg53r58RmpZ+J9eKR2CD6IJQvacn5A4Ix\
5BUAVGqlyp8JYm+S/CWJi31PNUjRRCusCVRj05NrxABNFv3r5S9IXf2fYJK+eyW4AiG\
VMvMcOg==
</artwork>
            </figure>
         </section>
         <section anchor="verify">
            <name>Verifying a Signature</name>
            <t>A verifier processes a signature and its associated signature input parameters in concert with each other.</t>
            <t>In order to verify a signature, a verifier MUST follow the following algorithm:</t>
            <t>
               <list style="numbers">
                  <t>Parse the <spanx style="verb">Signature</spanx> and <spanx style="verb">Signature-Input</spanx> fields and extract the signatures to be verified. <list style="numbers">
                        <t>If there is more than one signature value present, determine which signature should be processed for this message. If an applicable signature is not found, produce an error.</t>
                        <t>If the chosen <spanx style="verb">Signature</spanx> value does not have a corresponding <spanx style="verb">Signature-Input</spanx> value, produce an error.</t>
                     </list>
                  </t>
                  <t>Parse the values of the chosen <spanx style="verb">Signature-Input</spanx> field to get the parameters for the signature to be verified.</t>
                  <t>Parse the value of the corresponding <spanx style="verb">Signature</spanx> field to get the byte array value of the signature to be verified.</t>
                  <t>Examine the signature parameters to confirm that the signature meets the requirements described in this document, as well as any additional requirements defined by the application such as which message components are required to be covered by the signature. (<xref target="verify-requirements"/>)</t>
                  <t>Determine the verification key material for this signature. If the key material is known through external means such as static configuration or external protocol negotiation, the verifier will use that. If the key is identified in the signature parameters, the verifier will dereference this to appropriate key material to use with the signature. The verifier has to determine the trustworthiness of the key material for the context in which the signature is presented. If a key is identified that the verifier does not know, does not trust for this request, or does not match something preconfigured, the verification MUST fail.</t>
                  <t>Determine the algorithm to apply for verification: <list style="numbers">
                        <t>If the algorithm is known through external means such as static configuration or external protocol negotiation, the verifier will use this algorithm.</t>
                        <t>If the algorithm is explicitly stated in the signature parameters using a value from the HTTP Message Signatures registry, the verifier will use the referenced algorithm.</t>
                        <t>If the algorithm can be determined from the keying material, such as through an algorithm field on the key value itself, the verifier will use this algorithm.</t>
                        <t>If the algorithm is specified in more that one location, such as through static configuration and the algorithm signature parameter, or the algorithm signature parameter and from the key material itself, the resolved algorithms MUST be the same. If the algorithms are not the same, the verifier MUST vail the verification.</t>
                     </list>
                  </t>
                  <t>Use the received HTTP message and the signature's metadata to recreate the signature input, using the process described in <xref target="create-sig-input"/>. The value of the <spanx style="verb">@signature-params</spanx> input is the value of the <spanx style="verb">SignatureInput</spanx> field for this signature serialized according to the rules described in <xref target="signature-params"/>, not including the signature's label from the <spanx style="verb">Signature-Input</spanx> field.</t>
                  <t>If the key material is appropriate for the algorithm, apply the verification algorithm to the signature, recalculated signature input, signature parameters, key material, and algorithm. Several algorithms are defined in <xref target="signature-methods"/>.</t>
                  <t>The results of the verification algorithm function are the final results of the signature verification.</t>
               </list>
            </t>
            <t>If any of the above steps fail or produce an error, the signature validation fails.</t>
            <section anchor="verify-requirements">
               <name>Enforcing Application Requirements</name>
               <t>The verification requirements specified in this document are intended as a baseline set of restrictions that are generally applicable to all use cases. Applications using HTTP Message Signatures MAY impose requirements above and beyond those specified by this document, as appropriate for their use case.</t>
               <t>Some non-normative examples of additional requirements an application might define are:</t>
               <t>
                  <list style="symbols">
                     <t>Requiring a specific set of header fields to be signed (e.g., <spanx style="verb">Authorization</spanx>, <spanx style="verb">Digest</spanx>).</t>
                     <t>Enforcing a maximum signature age.</t>
                     <t>Prohibition of signature metadata parameters, such as runtime algorithm signaling with the <spanx style="verb">alg</spanx> parameter.</t>
                     <t>Prohibiting the use of certain algorithms, or mandating the use of a specific algorithm.</t>
                     <t>Requiring keys to be of a certain size (e.g., 2048 bits vs. 1024 bits).</t>
                     <t>Enforcing uniqueness of a <spanx style="verb">nonce</spanx> value.</t>
                  </list>
               </t>
               <t>Application-specific requirements are expected and encouraged. When an application defines additional requirements, it MUST enforce them during the signature verification process, and signature verification MUST fail if the signature does not conform to the application's requirements.</t>
               <t>Applications MUST enforce the requirements defined in this document. Regardless of use case, applications MUST NOT accept signatures that do not conform to these requirements.</t>
            </section>
         </section>
         <section anchor="signature-methods">
            <name>Signature Algorithm Methods</name>
            <t>HTTP Message signatures MAY use any cryptographic digital signature or MAC method that is appropriate for the key material, environment, and needs of the signer and verifier. All signatures are generated from and verified against the byte values of the signature input string defined in <xref target="create-sig-input"/>.</t>
            <t>Each signature algorithm method takes as its input the signature input string as a set of byte values (<spanx style="verb">I</spanx>), the signing key material (<spanx style="verb">Ks</spanx>), and outputs the signature output as a set of byte values (<spanx style="verb">S</spanx>):</t>
            <figure>
               <artwork>
HTTP_SIGN (I, Ks)  -&gt;  S
</artwork>
            </figure>
            <t>Each verification algorithm method takes as its input the recalculated signature input string as a set of byte values (<spanx style="verb">I</spanx>), the verification key material (<spanx style="verb">Kv</spanx>), and the presented signature to be verified as a set of byte values (<spanx style="verb">S</spanx>) and outputs the verification result (<spanx style="verb">V</spanx>) as a boolean:</t>
            <figure>
               <artwork>
HTTP_VERIFY (I, Kv, S) -&gt; V
</artwork>
            </figure>
            <t>This section contains several common algorithm methods. The method to use can be communicated through the algorithm signature parameter defined in <xref target="signature-params"/>, by reference to the key material, or through mutual agreement between the signer and verifier.</t>
            <section anchor="method-rsa-pss-sha512">
               <name>RSASSA-PSS using SHA-512</name>
               <t>To sign using this algorithm, the signer applies the <spanx style="verb">RSASSA-PSS-SIGN (K, M)</spanx> function <xref target="RFC8017"/> with the signer's private signing key (<spanx style="verb">K</spanx>) and the signature input string (<spanx style="verb">M</spanx>) (<xref target="create-sig-input"/>). The mask generation function is <spanx style="verb">MGF1</spanx> as specified in <xref target="RFC8017"/> with a hash function of SHA-512 <xref target="RFC6234"/>. The salt length (<spanx style="verb">sLen</spanx>) is 64 bytes. The hash function (<spanx style="verb">Hash</spanx>) SHA-512 <xref target="RFC6234"/> is applied to the signature input string to create the digest content to which the digital signature is applied. The resulting signed content byte array (<spanx style="verb">S</spanx>) is the HTTP message signature output used in <xref target="sign"/>.</t>
               <t>To verify using this algorithm, the verifier applies the <spanx style="verb">RSASSA-PSS-VERIFY ((n, e), M, S)</spanx> function <xref target="RFC8017"/> using the public key portion of the verification key material (<spanx style="verb">(n, e)</spanx>) and the signature input string (<spanx style="verb">M</spanx>) re-created as described in <xref target="verify"/>. The mask generation function is <spanx style="verb">MGF1</spanx> as specified in <xref target="RFC8017"/> with a hash function of SHA-512 <xref target="RFC6234"/>. The salt length (<spanx style="verb">sLen</spanx>) is 64 bytes. The hash function (<spanx style="verb">Hash</spanx>) SHA-512 <xref target="RFC6234"/> is applied to the signature input string to create the digest content to which the verification function is applied. The verifier extracts the HTTP message signature to be verified (<spanx style="verb">S</spanx>) as described in <xref target="verify"/>. The results of the verification function are compared to the http message signature to determine if the signature presented is valid.</t>
            </section>
            <section anchor="method-rsa-v1_5-sha256">
               <name>RSASSA-PKCS1-v1_5 using SHA-256</name>
               <t>To sign using this algorithm, the signer applies the <spanx style="verb">RSASSA-PKCS1-V1_5-SIGN (K, M)</spanx> function <xref target="RFC8017"/> with the signer's private signing key (<spanx style="verb">K</spanx>) and the signature input string (<spanx style="verb">M</spanx>) (<xref target="create-sig-input"/>). The hash SHA-256 <xref target="RFC6234"/> is applied to the signature input string to create the digest content to which the digital signature is applied. The resulting signed content byte array (<spanx style="verb">S</spanx>) is the HTTP message signature output used in <xref target="sign"/>.</t>
               <t>To verify using this algorithm, the verifier applies the <spanx style="verb">RSASSA-PKCS1-V1_5-VERIFY ((n, e), M, S)</spanx> function <xref target="RFC8017"/> using the public key portion of the verification key material (<spanx style="verb">(n, e)</spanx>) and the signature input string (<spanx style="verb">M</spanx>) re-created as described in <xref target="verify"/>. The hash function SHA-256 <xref target="RFC6234"/> is applied to the signature input string to create the digest content to which the verification function is applied. The verifier extracts the HTTP message signature to be verified (<spanx style="verb">S</spanx>) as described in <xref target="verify"/>. The results of the verification function are compared to the http message signature to determine if the signature presented is valid.</t>
            </section>
            <section anchor="method-hmac-sha256">
               <name>HMAC using SHA-256</name>
               <t>To sign and verify using this algorithm, the signer applies the <spanx style="verb">HMAC</spanx> function <xref target="RFC2104"/> with the shared signing key (<spanx style="verb">K</spanx>) and the signature input string (<spanx style="verb">text</spanx>) (<xref target="create-sig-input"/>). The hash function SHA-256 <xref target="RFC6234"/> is applied to the signature input string to create the digest content to which the HMAC is applied, giving the signature result.</t>
               <t>For signing, the resulting value is the HTTP message signature output used in <xref target="sign"/>.</t>
               <t>For verification, the verifier extracts the HTTP message signature to be verified (<spanx style="verb">S</spanx>) as described in <xref target="verify"/>. The output of the HMAC function is compared to the value of the HTTP message signature, and the results of the comparison determine the validity of the signature presented.</t>
            </section>
            <section anchor="method-ecdsa-p256-sha256">
               <name>ECDSA using curve P-256 DSS and SHA-256</name>
               <t>To sign using this algorithm, the signer applies the <spanx style="verb">ECDSA</spanx> algorithm <xref target="FIPS186-4"/> using curve P-256 with the signer's private signing key and the signature input string (<xref target="create-sig-input"/>). The hash SHA-256 <xref target="RFC6234"/> is applied to the signature input string to create the digest content to which the digital signature is applied. The resulting signed content byte array is the HTTP message signature output used in <xref target="sign"/>.</t>
               <t>To verify using this algorithm, the verifier applies the <spanx style="verb">ECDSA</spanx> algorithm <xref target="FIPS186-4"/> using the public key portion of the verification key material and the signature input string re-created as described in <xref target="verify"/>. The hash function SHA-256 <xref target="RFC6234"/> is applied to the signature input string to create the digest content to which the verification function is applied. The verifier extracts the HTTP message signature to be verified (<spanx style="verb">S</spanx>) as described in <xref target="verify"/>. The results of the verification function are compared to the http message signature to determine if the signature presented is valid.</t>
            </section>
            <section anchor="method-jose">
               <name>JSON Web Signature (JWS) algorithms</name>
               <t>If the signing algorithm is a JOSE signing algorithm from the JSON Web Signature and Encryption Algorithms Registry established by <xref target="RFC7518"/>, the JWS algorithm definition determines the signature and hashing algorithms to apply for both signing and verification. There is no use of the explicit <spanx style="verb">alg</spanx> signature parameter when using JOSE signing algorithms.</t>
               <t>For both signing and verification, the HTTP messages signature input string (<xref target="create-sig-input"/>) is used as the entire "JWS Signing Input". The JOSE Header defined in <xref target="RFC7517"/> is not used, and the signature input string is not first encoded in Base64 before applying the algorithm. The output of the JWS signature is taken as a byte array prior to the Base64url encoding used in JOSE.</t>
               <t>The JWS algorithm MUST NOT be <spanx style="verb">none</spanx> and MUST NOT be any algorithm with a JOSE Implementation Requirement of <spanx style="verb">Prohibited</spanx>.</t>
            </section>
         </section>
      </section>
      <section anchor="including-a-message-signature-in-a-message">
         <name>Including a Message Signature in a Message</name>
         <t>Message signatures can be included within an HTTP message via the <spanx style="verb">Signature-Input</spanx> and <spanx style="verb">Signature</spanx> HTTP fields, both defined within this specification. When attached to a message, an HTTP message signature is identified by a label. This label MUST be unique within a given HTTP message and MUST be used in both the <spanx style="verb">Signature-Input</spanx> and <spanx style="verb">Signature</spanx>. The label is chosen by the signer, except where a specific label is dictated by protocol negotiations.</t>
         <t>An HTTP message signature MUST use both fields containing the same labels: the <spanx style="verb">Signature</spanx> HTTP field contains the signature value, while the <spanx style="verb">Signature-Input</spanx> HTTP field identifies the covered components and parameters that describe how the signature was generated. Each field contains labeled values and MAY contain multiple labeled values, where the labels determine the correlation between the <spanx style="verb">Signature</spanx> and <spanx style="verb">Signature-Input</spanx> fields.</t>
         <section anchor="signature-input-header">
            <name>The 'Signature-Input' HTTP Field</name>
            <t>The <spanx style="verb">Signature-Input</spanx> HTTP field is a Dictionary Structured Field <xref target="RFC8941"/> containing the metadata for one or more message signatures generated from components within the HTTP message. Each member describes a single message signature. The member's name is an identifier that uniquely identifies the message signature within the context of the HTTP message. The member's value is the serialization of the covered components including all signature metadata parameters, using the serialization process defined in <xref target="signature-params"/>.</t>
            <figure>
               <sourcecode type="http-message">
NOTE: '\' line wrapping per RFC 8792

Signature-Input: sig1=("@method" "@target-uri" "host" "date" \
  "cache-control" "x-empty-header" "x-example");created=1618884475\
  ;keyid="test-key-rsa-pss"
</sourcecode>
            </figure>
            <t>To facilitate signature validation, the <spanx style="verb">Signature-Input</spanx> field value MUST contain the same serialized value used in generating the signature input string's <spanx style="verb">@signature-params</spanx> value.</t>
            <t>The signer MAY include the <spanx style="verb">Signature-Input</spanx> field as a trailer to facilitate signing a message after its content has been processed by the signer. However, since intermediaries are allowed to drop trailers as per <xref target="SEMANTICS"/>, it is RECOMMENDED that the <spanx style="verb">Signature-Input</spanx> HTTP field be included only as a header to avoid signatures being inadvertently stripped from a message.</t>
            <t>Multiple <spanx style="verb">Signature-Input</spanx> fields MAY be included in a single HTTP message. The signature labels MUST be unique across all field values.</t>
         </section>
         <section anchor="signature-header">
            <name>The 'Signature' HTTP Field</name>
            <t>The <spanx style="verb">Signature</spanx> HTTP field is a Dictionary Structured field <xref target="RFC8941"/> containing one or more message signatures generated from components within the HTTP message. Each member's name is a signature identifier that is present as a member name in the <spanx style="verb">Signature-Input</spanx> Structured field within the HTTP message. Each member's value is a Byte Sequence containing the signature value for the message signature identified by the member name. Any member in the <spanx style="verb">Signature</spanx> HTTP field that does not have a corresponding member in the HTTP message's <spanx style="verb">Signature-Input</spanx> HTTP field MUST be ignored.</t>
            <figure>
               <sourcecode type="http-message">
NOTE: '\' line wrapping per RFC 8792

Signature: sig1=:P0wLUszWQjoi54udOtydf9IWTfNhy+r53jGFj9XZuP4uKwxyJo\
  1RSHi+oEF1FuX6O29d+lbxwwBao1BAgadijW+7O/PyezlTnqAOVPWx9GlyntiCiHz\
  C87qmSQjvu1CFyFuWSjdGa3qLYYlNm7pVaJFalQiKWnUaqfT4LyttaXyoyZW84jS8\
  gyarxAiWI97mPXU+OVM64+HVBHmnEsS+lTeIsEQo36T3NFf2CujWARPQg53r58Rmp\
  Z+J9eKR2CD6IJQvacn5A4Ix5BUAVGqlyp8JYm+S/CWJi31PNUjRRCusCVRj05NrxA\
  BNFv3r5S9IXf2fYJK+eyW4AiGVMvMcOg==:
</sourcecode>
            </figure>
            <t>The signer MAY include the <spanx style="verb">Signature</spanx> field as a trailer to facilitate signing a message after its content has been processed by the signer. However, since intermediaries are allowed to drop trailers as per <xref target="SEMANTICS"/>, it is RECOMMENDED that the <spanx style="verb">Signature-Input</spanx> HTTP field be included only as a header to avoid signatures being inadvertently stripped from a message.</t>
            <t>Multiple <spanx style="verb">Signature</spanx> fields MAY be included in a single HTTP message. The signature labels MUST be unique across all field values.</t>
         </section>
         <section anchor="multiple-signatures">
            <name>Multiple Signatures</name>
            <t>Multiple distinct signatures MAY be included in a single message. Since <spanx style="verb">Signature-Input</spanx> and <spanx style="verb">Signature</spanx> are both defined as Dictionary Structured fields, they can be used to include multiple signatures within the same HTTP message by using distinct signature labels. For example, a signer may include multiple signatures signing the same message components with different keys or algorithms to support verifiers with different capabilities, or a reverse proxy may include information about the client in fields when forwarding the request to a service host, including a signature over the client's original signature values.</t>
            <t>The following is a non-normative example of header fields a reverse proxy sets in addition to the examples in the previous sections.</t>
            <figure>
               <sourcecode type="http-message">
NOTE: '\' line wrapping per RFC 8792

Forwarded: for=192.0.2.123
Signature-Input: sig1=("@method" "@path" "@authority" \
    "cache-control" "x-empty-header" "x-example")\
    ;created=1618884475;keyid="test-key-rsa-pss"
Signature: sig1=:P0wLUszWQjoi54udOtydf9IWTfNhy+r53jGFj9XZuP4uKwxyJo\
    1RSHi+oEF1FuX6O29d+lbxwwBao1BAgadijW+7O/PyezlTnqAOVPWx9GlyntiCi\
    HzC87qmSQjvu1CFyFuWSjdGa3qLYYlNm7pVaJFalQiKWnUaqfT4LyttaXyoyZW8\
    4jS8gyarxAiWI97mPXU+OVM64+HVBHmnEsS+lTeIsEQo36T3NFf2CujWARPQg53\
    r58RmpZ+J9eKR2CD6IJQvacn5A4Ix5BUAVGqlyp8JYm+S/CWJi31PNUjRRCusCV\
    Rj05NrxABNFv3r5S9IXf2fYJK+eyW4AiGVMvMcOg==:
</sourcecode>
            </figure>
            <t>The client's request includes a signature value under the label <spanx style="verb">sig1</spanx>, which the proxy signs in addition to the <spanx style="verb">Forwarded</spanx> header defined in <xref target="RFC7239"/>. Note that since the client's signature already covers the client's <spanx style="verb">Signature-Input</spanx> value for <spanx style="verb">sig1</spanx>, this value is transitively covered by the proxy's signature and need not be added explicitly. This results in a signature input string of:</t>
            <figure>
               <artwork>
NOTE: '\' line wrapping per RFC 8792

"signature";key="sig1": :P0wLUszWQjoi54udOtydf9IWTfNhy+r53jGFj9XZuP\
  4uKwxyJo1RSHi+oEF1FuX6O29d+lbxwwBao1BAgadijW+7O/PyezlTnqAOVPWx9Gl\
  yntiCiHzC87qmSQjvu1CFyFuWSjdGa3qLYYlNm7pVaJFalQiKWnUaqfT4LyttaXyo\
  yZW84jS8gyarxAiWI97mPXU+OVM64+HVBHmnEsS+lTeIsEQo36T3NFf2CujWARPQg\
  53r58RmpZ+J9eKR2CD6IJQvacn5A4Ix5BUAVGqlyp8JYm+S/CWJi31PNUjRRCusCV\
  Rj05NrxABNFv3r5S9IXf2fYJK+eyW4AiGVMvMcOg==:
"forwarded": for=192.0.2.123
"@signature-params": ("signature";key="sig1" "forwarded")\
  ;created=1618884480;keyid="test-key-rsa";alg="rsa-v1_5-sha256"
</artwork>
            </figure>
            <t>And a signature output value of:</t>
            <figure>
               <artwork>
NOTE: '\' line wrapping per RFC 8792

cjGvZwbsq9JwexP9TIvdLiivxqLINwp/ybAc19KOSQuLvtmMt3EnZxNiE+797dXK2cj\
PPUFqoZxO8WWx1SnKhAU9SiXBr99NTXRmA1qGBjqus/1Yxwr8keB8xzFt4inv3J3zP0\
k6TlLkRJstkVnNjuhRIUA/ZQCo8jDYAl4zWJJjppy6Gd1XSg03iUa0sju1yj6rcKbMA\
BBuzhUz4G0u1hZkIGbQprCnk/FOsqZHpwaWvY8P3hmcDHkNaavcokmq+3EBDCQTzgwL\
qfDmV0vLCXtDda6CNO2Zyum/pMGboCnQn/VkQ+j8kSydKoFg6EbVuGbrQijth6I0dDX\
2/HYcJg==
</artwork>
            </figure>
            <t>These values are added to the HTTP request message by the proxy. The original signature is included under the identifier <spanx style="verb">sig1</spanx>, and the reverse proxy's signature is included under the label <spanx style="verb">proxy_sig</spanx>. The proxy uses the key <spanx style="verb">test-key-rsa</spanx> to create its signature using the <spanx style="verb">rsa-v1_5-sha256</spanx> signature algorithm, while the client's original signature was made using the key id of <spanx style="verb">test-key-rsa-pss</spanx> and an RSA PSS signature algorithm.</t>
            <figure>
               <sourcecode type="http-message">
NOTE: '\' line wrapping per RFC 8792

Forwarded: for=192.0.2.123
Signature-Input: sig1=("@method" "@path" "@authority" \
    "cache-control" "x-empty-header" "x-example")\
    ;created=1618884475;keyid="test-key-rsa-pss", \
  proxy_sig=("signature";key="sig1" "forwarded")\
    ;created=1618884480;keyid="test-key-rsa";alg="rsa-v1_5-sha256"
Signature: sig1=:P0wLUszWQjoi54udOtydf9IWTfNhy+r53jGFj9XZuP4uKwxyJo\
    1RSHi+oEF1FuX6O29d+lbxwwBao1BAgadijW+7O/PyezlTnqAOVPWx9GlyntiCi\
    HzC87qmSQjvu1CFyFuWSjdGa3qLYYlNm7pVaJFalQiKWnUaqfT4LyttaXyoyZW8\
    4jS8gyarxAiWI97mPXU+OVM64+HVBHmnEsS+lTeIsEQo36T3NFf2CujWARPQg53\
    r58RmpZ+J9eKR2CD6IJQvacn5A4Ix5BUAVGqlyp8JYm+S/CWJi31PNUjRRCusCV\
    Rj05NrxABNFv3r5S9IXf2fYJK+eyW4AiGVMvMcOg==:, \
  proxy_sig=:cjGvZwbsq9JwexP9TIvdLiivxqLINwp/ybAc19KOSQuLvtmMt3EnZx\
    NiE+797dXK2cjPPUFqoZxO8WWx1SnKhAU9SiXBr99NTXRmA1qGBjqus/1Yxwr8k\
    eB8xzFt4inv3J3zP0k6TlLkRJstkVnNjuhRIUA/ZQCo8jDYAl4zWJJjppy6Gd1X\
    Sg03iUa0sju1yj6rcKbMABBuzhUz4G0u1hZkIGbQprCnk/FOsqZHpwaWvY8P3hm\
    cDHkNaavcokmq+3EBDCQTzgwLqfDmV0vLCXtDda6CNO2Zyum/pMGboCnQn/VkQ+\
    j8kSydKoFg6EbVuGbrQijth6I0dDX2/HYcJg==:
</sourcecode>
            </figure>
            <t>The proxy's signature and the client's original signature can be verified independently for the same message, based on the needs of the application. Since the proxy's signature covers the client signature, the backend service fronted by the proxy can trust that the proxy has validated the incoming signature.</t>
         </section>
      </section>
      <section anchor="requesting-signatures">
         <name>Requesting Signatures</name>
         <t>While a signer is free to attach a signature to a request or response without prompting, it is often desirable for a potential verifier to signal that it expects a signature from a potential signer using the <spanx style="verb">Accept-Signature</spanx> field.</t>
         <t>The message to which the requested signature is applied is known as the "target message". When the <spanx style="verb">Accept-Signature</spanx> field is sent in an HTTP Request message, the field indicates that the client desires the server to sign the response using the identified parameters and the target message is the response to this request. All responses from resources that support such signature negotiation SHOULD either be uncacheable or contain a <spanx style="verb">Vary</spanx> header field that lists <spanx style="verb">Accept-Signature</spanx>, in order to prevent a cache from returning a response with a signature intended for a different request.</t>
         <t>When the <spanx style="verb">Accept-Signature</spanx> field is used in an HTTP Response message, the field indicates that the server desires the client to sign its next request to the server with the identified parameters, and the target message is the client's next request. The client can choose to also continue signing future requests to the same server in the same way.</t>
         <t>The target message of an <spanx style="verb">Accept-Signature</spanx> field MUST include all labeled signatures indicated in the <spanx style="verb">Accept-Header</spanx> signature, each covering the same identified components of the <spanx style="verb">Accept-Signature</spanx> field.</t>
         <t>The sender of an <spanx style="verb">Accept-Signature</spanx> field MUST include identifiers that are appropriate for the type of the target message. For example, if the target message is a response, the identifiers can not include the <spanx style="verb">@status</spanx> identifier.</t>
         <section anchor="accept-signature-header">
            <name>The Accept-Signature Field</name>
            <t>The <spanx style="verb">Accept-Signature</spanx> HTTP header field is a Dictionary Structured field <xref target="RFC8941"/> containing the metadata for one or more requested message signatures to be generated from message components of the target HTTP message. Each member describes a single message signature. The member's name is an identifier that uniquely identifies the requested message signature within the context of the target HTTP message. The member's value is the serialization of the desired covered components of the target message, including any allowed signature metadata parameters, using the serialization process defined in <xref target="signature-params"/>.</t>
            <figure>
               <sourcecode type="http-message">
NOTE: '\' line wrapping per RFC 8792

Accept-Signature: sig1=("@method" "@target-uri" "host" "date" \
  "cache-control" "x-empty-header" "x-example")\
  ;keyid="test-key-rsa-pss"
</sourcecode>
            </figure>
            <t>The requested signature MAY include parameters, such as a desired algorithm or key identifier. These parameters MUST NOT include parameters that the signer is expected to generate, including the <spanx style="verb">created</spanx> and <spanx style="verb">nonce</spanx> parameters.</t>
         </section>
         <section anchor="processing-an-accept-signature">
            <name>Processing an Accept-Signature</name>
            <t>The receiver of an <spanx style="verb">Accept-Signature</spanx> field fulfills that header as follows:</t>
            <t>
               <list style="numbers">
                  <t>Parse the field value as a Dictionary</t>
                  <t>For each member of the dictionary: <list style="numbers">
                        <t>The name of the member is the label of the output signature as specified in <xref target="signature-input-header"/>
                        </t>
                        <t>Parse the value of the member to obtain the set of covered component identifiers</t>
                        <t>Process the requested parameters, such as the signing algorithm and key material. If any requested parameters cannot be fulfilled, or if the requested parameters conflict with those deemed appropriate to the target message, the process fails and returns an error.</t>
                        <t>Select any additional parameters necessary for completing the signature</t>
                        <t>Create the <spanx style="verb">Signature-Input</spanx> and <spanx style="verb">Signature</spanx> header values and associate them with the label</t>
                     </list>
                  </t>
                  <t>Optionally create any additional <spanx style="verb">Signature-Input</spanx> and <spanx style="verb">Signature</spanx> values, with unique labels not found in the <spanx style="verb">Accept-Signature</spanx> field</t>
                  <t>Combine all labeled <spanx style="verb">Signature-Input</spanx> and <spanx style="verb">Signature</spanx> values and attach both headers to the target message</t>
               </list>
            </t>
            <t>Note that by this process, a signature applied to a target message MUST have the same label, MUST have the same set of covered component, and MAY have additional parameters. Also note that the target message MAY include additional signatures not specified by the <spanx style="verb">Accept-Signature</spanx> field.</t>
         </section>
      </section>
      <section anchor="iana">
         <name>IANA Considerations</name>
         <section anchor="hsa-registry">
            <name>HTTP Signature Algorithms Registry</name>
            <t>This document defines HTTP Signature Algorithms, for which IANA is asked to create and maintain a new registry titled "HTTP Signature Algorithms". Initial values for this registry are given in <xref target="iana-hsa-contents"/>. Future assignments and modifications to existing assignment are to be made through the Expert Review registration policy <xref target="RFC8126"/> and shall follow the template presented in <xref target="iana-hsa-template"/>.</t>
            <t>Algorithms referenced by algorithm identifiers have to be fully defined with all parameters fixed. Algorithm identifiers in this registry are to be interpreted as whole string values and not as a combination of parts. That is to say, it is expected that implementors understand <spanx style="verb">rsa-pss-sha512</spanx> as referring to one specific algorithm with its hash, mask, and salt values set as defined here. Implementors do not parse out the <spanx style="verb">rsa</spanx>, <spanx style="verb">pss</spanx>, and <spanx style="verb">sha512</spanx> portions of the identifier to determine parameters of the signing algorithm from the string.</t>
            <section anchor="iana-hsa-template">
               <name>Registration Template</name>
               <dl newline="true">
                  <dt>Algorithm Name:</dt>
                  <dd>
                     <t>An identifier for the HTTP Signature Algorithm. The name MUST be an ASCII string consisting only of lower-case characters (<spanx style="verb">"a"</spanx> - <spanx style="verb">"z"</spanx>), digits (<spanx style="verb">"0"</spanx> - <spanx style="verb">"9"</spanx>), and hyphens (<spanx style="verb">"-"</spanx>), and SHOULD NOT exceed 20 characters in length. The identifier MUST be unique within the context of the registry.</t>
                  </dd>
                  <dt>Status:</dt>
                  <dd>
                     <t>A brief text description of the status of the algorithm. The description MUST begin with one of "Active" or "Deprecated", and MAY provide further context or explanation as to the reason for the status.</t>
                  </dd>
                  <dt>Description:</dt>
                  <dd>
                     <t>A brief description of the algorithm used to sign the signature input string.</t>
                  </dd>
                  <dt>Specification document(s):</dt>
                  <dd>
                     <t>Reference to the document(s) that specify the token endpoint authorization method, preferably including a URI that can be used to retrieve a copy of the document(s). An indication of the relevant sections may also be included but is not required.</t>
                  </dd>
               </dl>
            </section>
            <section anchor="iana-hsa-contents">
               <name>Initial Contents</name>
               <section anchor="rsa-pss-sha512">
                  <name>rsa-pss-sha512</name>
                  <dl newline="true">
                     <dt>Algorithm Name:</dt>
                     <dd>
                        <t>
                           <spanx style="verb">rsa-pss-sha512</spanx>
                        </t>
                     </dd>
                     <dt>Status:</dt>
                     <dd>
                        <t>Active</t>
                     </dd>
                     <dt>Definition:</dt>
                     <dd>
                        <t>RSASSA-PSS using SHA-256</t>
                     </dd>
                     <dt>Specification document(s):</dt>
                     <dd>
                        <t>[[This document]], <xref target="method-rsa-pss-sha512"/>
                        </t>
                     </dd>
                  </dl>
               </section>
               <section anchor="rsa-v15-sha256">
                  <name>rsa-v1_5-sha256</name>
                  <dl newline="true">
                     <dt>Algorithm Name:</dt>
                     <dd>
                        <t>
                           <spanx style="verb">rsa-v1_5-sha256</spanx>
                        </t>
                     </dd>
                     <dt>Status:</dt>
                     <dd>
                        <t>Active</t>
                     </dd>
                     <dt>Description:</dt>
                     <dd>
                        <t>RSASSA-PKCS1-v1_5 using SHA-256</t>
                     </dd>
                     <dt>Specification document(s):</dt>
                     <dd>
                        <t>[[This document]], <xref target="method-rsa-v1_5-sha256"/>
                        </t>
                     </dd>
                  </dl>
               </section>
               <section anchor="hmac-sha256">
                  <name>hmac-sha256</name>
                  <dl newline="true">
                     <dt>Algorithm Name:</dt>
                     <dd>
                        <t>
                           <spanx style="verb">hmac-sha256</spanx>
                        </t>
                     </dd>
                     <dt>Status:</dt>
                     <dd>
                        <t>Active</t>
                     </dd>
                     <dt>Description:</dt>
                     <dd>
                        <t>HMAC using SHA-256</t>
                     </dd>
                     <dt>Specification document(s):</dt>
                     <dd>
                        <t>[[This document]], <xref target="method-hmac-sha256"/>
                        </t>
                     </dd>
                  </dl>
               </section>
               <section anchor="ecdsa-p256-sha256">
                  <name>ecdsa-p256-sha256</name>
                  <dl newline="true">
                     <dt>Algorithm Name:</dt>
                     <dd>
                        <t>
                           <spanx style="verb">ecdsa-p256-sha256</spanx>
                        </t>
                     </dd>
                     <dt>Status:</dt>
                     <dd>
                        <t>Active</t>
                     </dd>
                     <dt>Description:</dt>
                     <dd>
                        <t>ECDSA using curve P-256 DSS and SHA-256</t>
                     </dd>
                     <dt>Specification document(s):</dt>
                     <dd>
                        <t>[[This document]], <xref target="method-ecdsa-p256-sha256"/>
                        </t>
                     </dd>
                  </dl>
               </section>
            </section>
         </section>
         <section anchor="param-registry">
            <name>HTTP Signature Metadata Parameters Registry</name>
            <t>This document defines the signature parameters structure, the values of which may have parameters containing metadata about a message signature. IANA is asked to create and maintain a new registry titled "HTTP Signature Metadata Parameters" to record and maintain the set of parameters defined for use with member values in the signature parameters structure. Initial values for this registry are given in <xref target="iana-param-contents"/>. Future assignments and modifications to existing assignments are to be made through the Expert Review registration policy <xref target="RFC8126"/> and shall follow the template presented in <xref target="iana-param-template"/>.</t>
            <section anchor="iana-param-template">
               <name>Registration Template</name>
            </section>
            <section anchor="iana-param-contents">
               <name>Initial Contents</name>
               <t>The table below contains the initial contents of the HTTP Signature Metadata Parameters Registry. Each row in the table represents a distinct entry in the registry.</t>
               <texttable title="Initial contents of the HTTP Signature Metadata Parameters Registry.">
                  <ttcol align="left">Name</ttcol>
                  <ttcol align="left">Status</ttcol>
                  <ttcol align="left">Reference(s)</ttcol>
                  <c>
                     <spanx style="verb">alg</spanx>
                  </c>
                  <c>Active</c>
                  <c>
                     <xref target="signature-params"/> of this document</c>
                  <c>
                     <spanx style="verb">created</spanx>
                  </c>
                  <c>Active</c>
                  <c>
                     <xref target="signature-params"/> of this document</c>
                  <c>
                     <spanx style="verb">expires</spanx>
                  </c>
                  <c>Active</c>
                  <c>
                     <xref target="signature-params"/> of this document</c>
                  <c>
                     <spanx style="verb">keyid</spanx>
                  </c>
                  <c>Active</c>
                  <c>
                     <xref target="signature-params"/> of this document</c>
                  <c>
                     <spanx style="verb">nonce</spanx>
                  </c>
                  <c>Active</c>
                  <c>
                     <xref target="signature-params"/> of this document</c>
               </texttable>
            </section>
         </section>
         <section anchor="content-registry">
            <name>HTTP Signature Specialty Component Identifiers Registry</name>
            <t>This document defines a method for canonicalizing HTTP message components, including components that can be generated from the context of the HTTP message outside of the HTTP fields. These components are identified by a unique string, known as the component identifier. IANA is asked to create and maintain a new registry typed "HTTP Signature Specialty Component Identifiers" to record and maintain the set of non-field component identifiers and the methods to produce their associated component values. Initial values for this registry are given in <xref target="iana-content-contents"/>. Future assignments and modifications to existing assignments are to be made through the Expert Review registration policy <xref target="RFC8126"/> and shall follow the template presented in <xref target="iana-content-template"/>.</t>
            <section anchor="iana-content-template">
               <name>Registration Template</name>
            </section>
            <section anchor="iana-content-contents">
               <name>Initial Contents</name>
               <t>The table below contains the initial contents of the HTTP Signature Specialty Component Identifiers Registry.</t>
               <texttable title="Initial contents of the HTTP Signature Specialty Component Identifiers Registry.">
                  <ttcol align="left">Name</ttcol>
                  <ttcol align="left">Status</ttcol>
                  <ttcol align="left">Target</ttcol>
                  <ttcol align="left">Reference</ttcol>
                  <c>
                     <spanx style="verb">@signature-params</spanx>
                  </c>
                  <c>Active</c>
                  <c>Request, Response</c>
                  <c>
                     <xref target="signature-params"/> of this document</c>
                  <c>
                     <spanx style="verb">@method</spanx>
                  </c>
                  <c>Active</c>
                  <c>Request, Related-Response</c>
                  <c>
                     <xref target="content-request-method"/> of this document</c>
                  <c>
                     <spanx style="verb">@authority</spanx>
                  </c>
                  <c>Active</c>
                  <c>Request, Related-Response</c>
                  <c>
                     <xref target="content-request-authority"/> of this document</c>
                  <c>
                     <spanx style="verb">@scheme</spanx>
                  </c>
                  <c>Active</c>
                  <c>Request, Related-Response</c>
                  <c>
                     <xref target="content-request-scheme"/> of this document</c>
                  <c>
                     <spanx style="verb">@target-uri</spanx>
                  </c>
                  <c>Active</c>
                  <c>Request, Related-Response</c>
                  <c>
                     <xref target="content-target-uri"/> of this document</c>
                  <c>
                     <spanx style="verb">@request-target</spanx>
                  </c>
                  <c>Active</c>
                  <c>Request, Related-Response</c>
                  <c>
                     <xref target="content-request-target"/> of this document</c>
                  <c>
                     <spanx style="verb">@path</spanx>
                  </c>
                  <c>Active</c>
                  <c>Request, Related-Response</c>
                  <c>
                     <xref target="content-request-path"/> of this document</c>
                  <c>
                     <spanx style="verb">@query</spanx>
                  </c>
                  <c>Active</c>
                  <c>Request, Related-Response</c>
                  <c>
                     <xref target="content-request-query"/> of this document</c>
                  <c>
                     <spanx style="verb">@query-params</spanx>
                  </c>
                  <c>Active</c>
                  <c>Request, Related-Response</c>
                  <c>
                     <xref target="content-request-query-params"/> of this document</c>
                  <c>
                     <spanx style="verb">@status</spanx>
                  </c>
                  <c>Active</c>
                  <c>Response</c>
                  <c>
                     <xref target="content-status-code"/> of this document</c>
                  <c>
                     <spanx style="verb">@request-response</spanx>
                  </c>
                  <c>Active</c>
                  <c>
                     <xref target="content-request-response"/> of this document</c>
                  <c> </c>
               </texttable>
            </section>
         </section>
      </section>
      <section anchor="security">
         <name>Security Considerations</name>
         <t>(( TODO: need to dive deeper on this section; not sure how much of what's referenced below is actually applicable, or if it covers everything we need to worry about. ))</t>
         <t>(( TODO: Should provide some recommendations on how to determine what components need to be signed for a given use case. ))</t>
         <t>There are a number of security considerations to take into account when implementing or utilizing this specification. A thorough security analysis of this protocol, including its strengths and weaknesses, can be found in <xref target="WP-HTTP-Sig-Audit"/>.</t>
      </section>
   </middle>
   <back>
      <references title="Normative References">
         <reference anchor="RFC2104">
            <front>
               <title>HMAC: Keyed-Hashing for Message Authentication</title>
               <author fullname="H. Krawczyk" initials="H." surname="Krawczyk"/>
               <author fullname="M. Bellare" initials="M." surname="Bellare"/>
               <author fullname="R. Canetti" initials="R." surname="Canetti"/>
               <date month="February" year="1997"/>
            </front>
            <seriesInfo name="RFC" value="2104"/>
            <seriesInfo name="DOI" value="10.17487/RFC2104"/>
         </reference>
         <reference anchor="RFC3986">
            <front>
               <title>Uniform Resource Identifier (URI): Generic Syntax</title>
               <author fullname="T. Berners-Lee" initials="T." surname="Berners-Lee"/>
               <author fullname="R. Fielding" initials="R." surname="Fielding"/>
               <author fullname="L. Masinter" initials="L." surname="Masinter"/>
               <date month="January" year="2005"/>
            </front>
            <seriesInfo name="STD" value="66"/>
            <seriesInfo name="RFC" value="3986"/>
            <seriesInfo name="DOI" value="10.17487/RFC3986"/>
         </reference>
         <reference anchor="FIPS186-4"
                    target="https://csrc.nist.gov/publications/detail/fips/186/4/final">
            <front>
               <title>Digital Signature Standard (DSS)</title>
               <author/>
               <date year="2013"/>
            </front>
         </reference>
         <reference anchor="POSIX.1"
                    target="https://pubs.opengroup.org/onlinepubs/9699919799/">
            <front>
               <title>The Open Group Base Specifications Issue 7, 2018 edition</title>
               <author/>
               <date year="2018"/>
            </front>
         </reference>
         <reference anchor="SEMANTICS">
            <front>
               <title>HTTP Semantics</title>
               <author fullname="Roy T. Fielding">
                  <organization>Adobe</organization>
               </author>
               <author fullname="Mark Nottingham">
                  <organization>Fastly</organization>
               </author>
               <author fullname="Julian Reschke">
                  <organization>greenbytes GmbH</organization>
               </author>
               <date day="25" month="July" year="2021"/>
            </front>
            <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-semantics-17"/>
         </reference>
         <reference anchor="MESSAGING">
            <front>
               <title>HTTP/1.1</title>
               <author fullname="Roy T. Fielding">
                  <organization>Adobe</organization>
               </author>
               <author fullname="Mark Nottingham">
                  <organization>Fastly</organization>
               </author>
               <author fullname="Julian Reschke">
                  <organization>greenbytes GmbH</organization>
               </author>
               <date day="25" month="July" year="2021"/>
            </front>
            <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-messaging-17"/>
         </reference>
         <reference anchor="HTMLURL" target="https://url.spec.whatwg.org/">
            <front>
               <title>URL (Living Standard)</title>
               <author/>
               <date year="2021"/>
            </front>
         </reference>
         <reference anchor="RFC2119">
            <front>
               <title>Key words for use in RFCs to Indicate Requirement Levels</title>
               <author fullname="S. Bradner" initials="S." surname="Bradner"/>
               <date month="March" year="1997"/>
            </front>
            <seriesInfo name="BCP" value="14"/>
            <seriesInfo name="RFC" value="2119"/>
            <seriesInfo name="DOI" value="10.17487/RFC2119"/>
         </reference>
         <reference anchor="RFC8174">
            <front>
               <title>Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words</title>
               <author fullname="B. Leiba" initials="B." surname="Leiba"/>
               <date month="May" year="2017"/>
            </front>
            <seriesInfo name="BCP" value="14"/>
            <seriesInfo name="RFC" value="8174"/>
            <seriesInfo name="DOI" value="10.17487/RFC8174"/>
         </reference>
         <reference anchor="RFC8792">
            <front>
               <title>Handling Long Lines in Content of Internet-Drafts and RFCs</title>
               <author fullname="K. Watsen" initials="K." surname="Watsen"/>
               <author fullname="E. Auerswald" initials="E." surname="Auerswald"/>
               <author fullname="A. Farrel" initials="A." surname="Farrel"/>
               <author fullname="Q. Wu" initials="Q." surname="Wu"/>
               <date month="June" year="2020"/>
            </front>
            <seriesInfo name="RFC" value="8792"/>
            <seriesInfo name="DOI" value="10.17487/RFC8792"/>
         </reference>
         <reference anchor="RFC8941">
            <front>
               <title>Structured Field Values for HTTP</title>
               <author fullname="M. Nottingham" initials="M." surname="Nottingham"/>
               <author fullname="P-H. Kamp" initials="P-H." surname="Kamp"/>
               <date month="February" year="2021"/>
            </front>
            <seriesInfo name="RFC" value="8941"/>
            <seriesInfo name="DOI" value="10.17487/RFC8941"/>
         </reference>
      </references>
      <references title="Informative References">
         <reference anchor="RFC6234">
            <front>
               <title>US Secure Hash Algorithms (SHA and SHA-based HMAC and HKDF)</title>
               <author fullname="D. Eastlake 3rd" initials="D." surname="Eastlake 3rd"/>
               <author fullname="T. Hansen" initials="T." surname="Hansen"/>
               <date month="May" year="2011"/>
            </front>
            <seriesInfo name="RFC" value="6234"/>
            <seriesInfo name="DOI" value="10.17487/RFC6234"/>
         </reference>
         <reference anchor="RFC7517">
            <front>
               <title>JSON Web Key (JWK)</title>
               <author fullname="M. Jones" initials="M." surname="Jones"/>
               <date month="May" year="2015"/>
            </front>
            <seriesInfo name="RFC" value="7517"/>
            <seriesInfo name="DOI" value="10.17487/RFC7517"/>
         </reference>
         <reference anchor="RFC7518">
            <front>
               <title>JSON Web Algorithms (JWA)</title>
               <author fullname="M. Jones" initials="M." surname="Jones"/>
               <date month="May" year="2015"/>
            </front>
            <seriesInfo name="RFC" value="7518"/>
            <seriesInfo name="DOI" value="10.17487/RFC7518"/>
         </reference>
         <reference anchor="RFC7239">
            <front>
               <title>Forwarded HTTP Extension</title>
               <author fullname="A. Petersson" initials="A." surname="Petersson"/>
               <author fullname="M. Nilsson" initials="M." surname="Nilsson"/>
               <date month="June" year="2014"/>
            </front>
            <seriesInfo name="RFC" value="7239"/>
            <seriesInfo name="DOI" value="10.17487/RFC7239"/>
         </reference>
         <reference anchor="RFC8017">
            <front>
               <title>PKCS #1: RSA Cryptography Specifications Version 2.2</title>
               <author fullname="K. Moriarty"
                       initials="K."
                       role="editor"
                       surname="Moriarty"/>
               <author fullname="B. Kaliski" initials="B." surname="Kaliski"/>
               <author fullname="J. Jonsson" initials="J." surname="Jonsson"/>
               <author fullname="A. Rusch" initials="A." surname="Rusch"/>
               <date month="November" year="2016"/>
            </front>
            <seriesInfo name="RFC" value="8017"/>
            <seriesInfo name="DOI" value="10.17487/RFC8017"/>
         </reference>
         <reference anchor="I-D.ietf-httpbis-client-cert-field">
            <front>
               <title>Client-Cert HTTP Header Field: Conveying Client Certificate Information from TLS Terminating Reverse Proxies to Origin Server Applications</title>
               <author fullname="Brian Campbell">
                  <organization>Ping Identity</organization>
               </author>
               <author fullname="Mike Bishop">
                  <organization>Akamai</organization>
               </author>
               <date day="8" month="June" year="2021"/>
            </front>
            <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-client-cert-field-00"/>
         </reference>
         <reference anchor="WP-HTTP-Sig-Audit"
                    target="https://web-payments.org/specs/source/http-signatures-audit/">
            <front>
               <title>Security Considerations for HTTP Signatures</title>
               <author/>
               <date year="2013"/>
            </front>
         </reference>
         <reference anchor="TLS">
            <front>
               <title>The Transport Layer Security (TLS) Protocol Version 1.3</title>
               <author fullname="E. Rescorla" initials="E." surname="Rescorla"/>
               <date month="August" year="2018"/>
            </front>
            <seriesInfo name="RFC" value="8446"/>
            <seriesInfo name="DOI" value="10.17487/RFC8446"/>
         </reference>
         <reference anchor="RFC8126">
            <front>
               <title>Guidelines for Writing an IANA Considerations Section in RFCs</title>
               <author fullname="M. Cotton" initials="M." surname="Cotton"/>
               <author fullname="B. Leiba" initials="B." surname="Leiba"/>
               <author fullname="T. Narten" initials="T." surname="Narten"/>
               <date month="June" year="2017"/>
            </front>
            <seriesInfo name="BCP" value="26"/>
            <seriesInfo name="RFC" value="8126"/>
            <seriesInfo name="DOI" value="10.17487/RFC8126"/>
         </reference>
      </references>
      <section anchor="detection">
         <name>Detecting HTTP Message Signatures</name>
         <t>There have been many attempts to create signed HTTP messages in the past, including other non-standard definitions of the <spanx style="verb">Signature</spanx> field used within this specification. It is recommended that developers wishing to support both this specification and other historical drafts do so carefully and deliberately, as incompatibilities between this specification and various versions of other drafts could lead to unexpected problems.</t>
         <t>It is recommended that implementers first detect and validate the <spanx style="verb">Signature-Input</spanx> field defined in this specification to detect that this standard is in use and not an alternative. If the <spanx style="verb">Signature-Input</spanx> field is present, all <spanx style="verb">Signature</spanx> fields can be parsed and interpreted in the context of this draft.</t>
      </section>
      <section anchor="examples">
         <name>Examples</name>
         <section anchor="example-keys">
            <name>Example Keys</name>
            <t>This section provides cryptographic keys that are referenced in example signatures throughout this document. These keys MUST NOT be used for any purpose other than testing.</t>
            <t>The key identifiers for each key are used throughout the examples in this specification. It is assumed for these examples that the signer and verifier can unambiguously dereference all key identifiers used here, and that the keys and algorithms used are appropriate for the context in which the signature is presented.</t>
            <section anchor="example-key-rsa-test">
               <name>Example Key RSA test</name>
               <t>The following key is a 2048-bit RSA public and private key pair, referred to in this document as <spanx style="verb">test-key-rsa</spanx>:</t>
               <figure>
                  <artwork>
-----BEGIN RSA PUBLIC KEY-----
MIIBCgKCAQEAhAKYdtoeoy8zcAcR874L8cnZxKzAGwd7v36APp7Pv6Q2jdsPBRrw
WEBnez6d0UDKDwGbc6nxfEXAy5mbhgajzrw3MOEt8uA5txSKobBpKDeBLOsdJKFq
MGmXCQvEG7YemcxDTRPxAleIAgYYRjTSd/QBwVW9OwNFhekro3RtlinV0a75jfZg
kne/YiktSvLG34lw2zqXBDTC5NHROUqGTlML4PlNZS5Ri2U4aCNx2rUPRcKIlE0P
uKxI4T+HIaFpv8+rdV6eUgOrB2xeI1dSFFn/nnv5OoZJEIB+VmuKn3DCUcCZSFlQ
PSXSfBDiUGhwOw76WuSSsf1D4b/vLoJ10wIDAQAB
-----END RSA PUBLIC KEY-----

-----BEGIN RSA PRIVATE KEY-----
MIIEqAIBAAKCAQEAhAKYdtoeoy8zcAcR874L8cnZxKzAGwd7v36APp7Pv6Q2jdsP
BRrwWEBnez6d0UDKDwGbc6nxfEXAy5mbhgajzrw3MOEt8uA5txSKobBpKDeBLOsd
JKFqMGmXCQvEG7YemcxDTRPxAleIAgYYRjTSd/QBwVW9OwNFhekro3RtlinV0a75
jfZgkne/YiktSvLG34lw2zqXBDTC5NHROUqGTlML4PlNZS5Ri2U4aCNx2rUPRcKI
lE0PuKxI4T+HIaFpv8+rdV6eUgOrB2xeI1dSFFn/nnv5OoZJEIB+VmuKn3DCUcCZ
SFlQPSXSfBDiUGhwOw76WuSSsf1D4b/vLoJ10wIDAQABAoIBAG/JZuSWdoVHbi56
vjgCgkjg3lkO1KrO3nrdm6nrgA9P9qaPjxuKoWaKO1cBQlE1pSWp/cKncYgD5WxE
CpAnRUXG2pG4zdkzCYzAh1i+c34L6oZoHsirK6oNcEnHveydfzJL5934egm6p8DW
+m1RQ70yUt4uRc0YSor+q1LGJvGQHReF0WmJBZHrhz5e63Pq7lE0gIwuBqL8SMaA
yRXtK+JGxZpImTq+NHvEWWCu09SCq0r838ceQI55SvzmTkwqtC+8AT2zFviMZkKR
Qo6SPsrqItxZWRty2izawTF0Bf5S2VAx7O+6t3wBsQ1sLptoSgX3QblELY5asI0J
YFz7LJECgYkAsqeUJmqXE3LP8tYoIjMIAKiTm9o6psPlc8CrLI9CH0UbuaA2JCOM
cCNq8SyYbTqgnWlB9ZfcAm/cFpA8tYci9m5vYK8HNxQr+8FS3Qo8N9RJ8d0U5Csw
DzMYfRghAfUGwmlWj5hp1pQzAuhwbOXFtxKHVsMPhz1IBtF9Y8jvgqgYHLbmyiu1
mwJ5AL0pYF0G7x81prlARURwHo0Yf52kEw1dxpx+JXER7hQRWQki5/NsUEtv+8RT
qn2m6qte5DXLyn83b1qRscSdnCCwKtKWUug5q2ZbwVOCJCtmRwmnP131lWRYfj67
B/xJ1ZA6X3GEf4sNReNAtaucPEelgR2nsN0gKQKBiGoqHWbK1qYvBxX2X3kbPDkv
9C+celgZd2PW7aGYLCHq7nPbmfDV0yHcWjOhXZ8jRMjmANVR/eLQ2EfsRLdW69bn
f3ZD7JS1fwGnO3exGmHO3HZG+6AvberKYVYNHahNFEw5TsAcQWDLRpkGybBcxqZo
81YCqlqidwfeO5YtlO7etx1xLyqa2NsCeG9A86UjG+aeNnXEIDk1PDK+EuiThIUa
/2IxKzJKWl1BKr2d4xAfR0ZnEYuRrbeDQYgTImOlfW6/GuYIxKYgEKCFHFqJATAG
IxHrq1PDOiSwXd2GmVVYyEmhZnbcp8CxaEMQoevxAta0ssMK3w6UsDtvUvYvF22m
qQKBiD5GwESzsFPy3Ga0MvZpn3D6EJQLgsnrtUPZx+z2Ep2x0xc5orneB5fGyF1P
WtP+fG5Q6Dpdz3LRfm+KwBCWFKQjg7uTxcjerhBWEYPmEMKYwTJF5PBG9/ddvHLQ
EQeNC8fHGg4UXU8mhHnSBt3EA10qQJfRDs15M38eG2cYwB1PZpDHScDnDA0=
-----END RSA PRIVATE KEY-----
</artwork>
               </figure>
            </section>
            <section anchor="example-key-rsa-pss-test">
               <name>Example RSA PSS Key</name>
               <t>The following key is a 2048-bit RSA public and private key pair, referred to in this document as <spanx style="verb">test-key-rsa-pss</spanx>:</t>
               <figure>
                  <artwork>
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr4tmm3r20Wd/PbqvP1s2
+QEtvpuRaV8Yq40gjUR8y2Rjxa6dpG2GXHbPfvMs8ct+Lh1GH45x28Rw3Ry53mm+
oAXjyQ86OnDkZ5N8lYbggD4O3w6M6pAvLkhk95AndTrifbIFPNU8PPMO7OyrFAHq
gDsznjPFmTOtCEcN2Z1FpWgchwuYLPL+Wokqltd11nqqzi+bJ9cvSKADYdUAAN5W
Utzdpiy6LbTgSxP7ociU4Tn0g5I6aDZJ7A8Lzo0KSyZYoA485mqcO0GVAdVw9lq4
aOT9v6d+nb4bnNkQVklLQ3fVAvJm+xdDOp9LCNCN48V2pnDOkFV6+U9nV5oyc6XI
2wIDAQAB
-----END PUBLIC KEY-----

-----BEGIN PRIVATE KEY-----
MIIEvgIBADALBgkqhkiG9w0BAQoEggSqMIIEpgIBAAKCAQEAr4tmm3r20Wd/Pbqv
P1s2+QEtvpuRaV8Yq40gjUR8y2Rjxa6dpG2GXHbPfvMs8ct+Lh1GH45x28Rw3Ry5
3mm+oAXjyQ86OnDkZ5N8lYbggD4O3w6M6pAvLkhk95AndTrifbIFPNU8PPMO7Oyr
FAHqgDsznjPFmTOtCEcN2Z1FpWgchwuYLPL+Wokqltd11nqqzi+bJ9cvSKADYdUA
AN5WUtzdpiy6LbTgSxP7ociU4Tn0g5I6aDZJ7A8Lzo0KSyZYoA485mqcO0GVAdVw
9lq4aOT9v6d+nb4bnNkQVklLQ3fVAvJm+xdDOp9LCNCN48V2pnDOkFV6+U9nV5oy
c6XI2wIDAQABAoIBAQCUB8ip+kJiiZVKF8AqfB/aUP0jTAqOQewK1kKJ/iQCXBCq
pbo360gvdt05H5VZ/RDVkEgO2k73VSsbulqezKs8RFs2tEmU+JgTI9MeQJPWcP6X
aKy6LIYs0E2cWgp8GADgoBs8llBq0UhX0KffglIeek3n7Z6Gt4YFge2TAcW2WbN4
XfK7lupFyo6HHyWRiYHMMARQXLJeOSdTn5aMBP0PO4bQyk5ORxTUSeOciPJUFktQ
HkvGbym7KryEfwH8Tks0L7WhzyP60PL3xS9FNOJi9m+zztwYIXGDQuKM2GDsITeD
2mI2oHoPMyAD0wdI7BwSVW18p1h+jgfc4dlexKYRAoGBAOVfuiEiOchGghV5vn5N
RDNscAFnpHj1QgMr6/UG05RTgmcLfVsI1I4bSkbrIuVKviGGf7atlkROALOG/xRx
DLadgBEeNyHL5lz6ihQaFJLVQ0u3U4SB67J0YtVO3R6lXcIjBDHuY8SjYJ7Ci6Z6
vuDcoaEujnlrtUhaMxvSfcUJAoGBAMPsCHXte1uWNAqYad2WdLjPDlKtQJK1diCm
rqmB2g8QE99hDOHItjDBEdpyFBKOIP+NpVtM2KLhRajjcL9Ph8jrID6XUqikQuVi
4J9FV2m42jXMuioTT13idAILanYg8D3idvy/3isDVkON0X3UAVKrgMEne0hJpkPL
FYqgetvDAoGBAKLQ6JZMbSe0pPIJkSamQhsehgL5Rs51iX4m1z7+sYFAJfhvN3Q/
OGIHDRp6HjMUcxHpHw7U+S1TETxePwKLnLKj6hw8jnX2/nZRgWHzgVcY+sPsReRx
NJVf+Cfh6yOtznfX00p+JWOXdSY8glSSHJwRAMog+hFGW1AYdt7w80XBAoGBAImR
NUugqapgaEA8TrFxkJmngXYaAqpA0iYRA7kv3S4QavPBUGtFJHBNULzitydkNtVZ
3w6hgce0h9YThTo/nKc+OZDZbgfN9s7cQ75x0PQCAO4fx2P91Q+mDzDUVTeG30mE
t2m3S0dGe47JiJxifV9P3wNBNrZGSIF3mrORBVNDAoGBAI0QKn2Iv7Sgo4T/XjND
dl2kZTXqGAk8dOhpUiw/HdM3OGWbhHj2NdCzBliOmPyQtAr770GITWvbAI+IRYyF
S7Fnk6ZVVVHsxjtaHy1uJGFlaZzKR4AGNaUTOJMs6NadzCmGPAxNQQOCqoUjn4XR
rOjr9w349JooGXhOxbu8nOxX
-----END PRIVATE KEY-----
</artwork>
               </figure>
            </section>
            <section anchor="example-key-ecc-p256">
               <name>Example ECC P-256 Test Key</name>
               <t>The following key is an elliptical curve key over the curve P-256, referred to in this document as <spanx style="verb">test-key-ecc-p256</spanx>.</t>
               <figure>
                  <artwork>
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIFKbhfNZfpDsW43+0+JjUr9K+bTeuxopu653+hBaXGA7oAoGCCqGSM49
AwEHoUQDQgAEqIVYZVLCrPZHGHjP17CTW0/+D9Lfw0EkjqF7xB4FivAxzic30tMM
4GF+hR6Dxh71Z50VGGdldkkDXZCnTNnoXQ==
-----END EC PRIVATE KEY-----
</artwork>
               </figure>
               <figure>
                  <artwork>
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEqIVYZVLCrPZHGHjP17CTW0/+D9Lf
w0EkjqF7xB4FivAxzic30tMM4GF+hR6Dxh71Z50VGGdldkkDXZCnTNnoXQ==
-----END PUBLIC KEY-----
</artwork>
               </figure>
            </section>
            <section anchor="example-shared-secret">
               <name>Example Shared Secret</name>
               <t>The following shared secret is 64 randomly-generated bytes encoded in Base64, referred to in this document as <spanx style="verb">test-shared-secret</spanx>.</t>
               <figure>
                  <artwork>
NOTE: '\' line wrapping per RFC 8792

uzvJfB4u3N0Jy4T7NZ75MDVcr8zSTInedJtkgcu46YW4XByzNJjxBdtjUkdJPBt\
  bmHhIDi6pcl8jsasjlTMtDQ==
</artwork>
               </figure>
            </section>
         </section>
         <section anchor="test-cases">
            <name>Test Cases</name>
            <t>This section provides non-normative examples that may be used as test cases to validate implementation correctness. These examples are based on the following HTTP messages:</t>
            <t>For requests, this <spanx style="verb">test-request</spanx> message is used:</t>
            <figure>
               <sourcecode type="http-message">
POST /foo?param=value&amp;pet=dog HTTP/1.1
Host: example.com
Date: Tue, 20 Apr 2021 02:07:55 GMT
Content-Type: application/json
Digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
Content-Length: 18

{"hello": "world"}
</sourcecode>
            </figure>
            <t>For responses, this <spanx style="verb">test-response</spanx> message is used:</t>
            <figure>
               <sourcecode type="http-message">
HTTP/1.1 200 OK
Date: Tue, 20 Apr 2021 02:07:56 GMT
Content-Type: application/json
Digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
Content-Length: 18

{"hello": "world"}
</sourcecode>
            </figure>
            <section anchor="minimal-signature-using-rsa-pss-sha512">
               <name>Minimal Signature Using rsa-pss-sha512</name>
               <t>This example presents a minimal <spanx style="verb">Signature-Input</spanx> and <spanx style="verb">Signature</spanx> header for a signature using the <spanx style="verb">rsa-pss-sha512</spanx> algorithm over <spanx style="verb">test-request</spanx>, covering none of the components of the HTTP message request but providing a timestamped signature proof of possession of the key.</t>
               <t>The corresponding signature input is:</t>
               <figure>
                  <artwork>
NOTE: '\' line wrapping per RFC 8792

"@signature-params": ();created=1618884475\
  ;keyid="test-key-rsa-pss";alg="rsa-pss-sha512"
</artwork>
               </figure>
               <t>This results in the following <spanx style="verb">Signature-Input</spanx> and <spanx style="verb">Signature</spanx> headers being added to the message:</t>
               <figure>
                  <sourcecode type="http-message">
NOTE: '\' line wrapping per RFC 8792

Signature-Input: sig1=();created=1618884475\
  ;keyid="test-key-rsa-pss";alg="rsa-pss-sha512"
Signature: sig1=:HWP69ZNiom9Obu1KIdqPPcu/C1a5ZUMBbqS/xwJECV8bhIQVmE\
  AAAzz8LQPvtP1iFSxxluDO1KE9b8L+O64LEOvhwYdDctV5+E39Jy1eJiD7nYREBgx\
  TpdUfzTO+Trath0vZdTylFlxK4H3l3s/cuFhnOCxmFYgEa+cw+StBRgY1JtafSFwN\
  cZgLxVwialuH5VnqJS4JN8PHD91XLfkjMscTo4jmVMpFd3iLVe0hqVFl7MDt6TMkw\
  IyVFnEZ7B/VIQofdShO+C/7MuupCSLVjQz5xA+Zs6Hw+W9ESD/6BuGs6LF1TcKLxW\
  +5K+2zvDY/Cia34HNpRW5io7Iv9/b7iQ==:
</sourcecode>
               </figure>
               <t>Note that since the covered components list is empty, this signature could be applied by an attacker to an unrelated HTTP message. Therefore, use of an empty covered components set is discouraged.</t>
            </section>
            <section anchor="selective-covered-components-using-rsa-pss-sha512">
               <name>Selective Covered Components using rsa-pss-sha512</name>
               <t>This example covers additional components in <spanx style="verb">test-request</spanx> using the <spanx style="verb">rsa-pss-sha512</spanx> algorithm.</t>
               <t>The corresponding signature input is:</t>
               <figure>
                  <artwork>
NOTE: '\' line wrapping per RFC 8792

"@authority": example.com
"content-type": application/json
"@signature-params": ("@authority" "content-type")\
  ;created=1618884475;keyid="test-key-rsa-pss"
</artwork>
               </figure>
               <t>This results in the following <spanx style="verb">Signature-Input</spanx> and <spanx style="verb">Signature</spanx> headers being added to the message:</t>
               <figure>
                  <sourcecode type="http-message">
NOTE: '\' line wrapping per RFC 8792

Signature-Input: sig1=("@authority" "content-type")\
  ;created=1618884475;keyid="test-key-rsa-pss"
Signature: sig1=:ik+OtGmM/kFqENDf9Plm8AmPtqtC7C9a+zYSaxr58b/E6h81gh\
  JS3PcH+m1asiMp8yvccnO/RfaexnqanVB3C72WRNZN7skPTJmUVmoIeqZncdP2mlf\
  xlLP6UbkrgYsk91NS6nwkKC6RRgLhBFqzP42oq8D2336OiQPDAo/04SxZt4Wx9nDG\
  uy2SfZJUhsJqZyEWRk4204x7YEB3VxDAAlVgGt8ewilWbIKKTOKp3ymUeQIwptqYw\
  v0l8mN404PPzRBTpB7+HpClyK4CNp+SVv46+6sHMfJU4taz10s/NoYRmYCGXyadzY\
  YDj0BYnFdERB6NblI/AOWFGl5Axhhmjg==:
</sourcecode>
               </figure>
            </section>
            <section anchor="full-coverage-using-rsa-pss-sha512">
               <name>Full Coverage using rsa-pss-sha512</name>
               <t>This example covers all headers in <spanx style="verb">test-request</spanx> (including the message body <spanx style="verb">Digest</spanx>) plus various elements of the control data, using the <spanx style="verb">rsa-pss-sha512</spanx> algorithm.</t>
               <t>The corresponding signature input is:</t>
               <figure>
                  <artwork>
NOTE: '\' line wrapping per RFC 8792

"date": Tue, 20 Apr 2021 02:07:56 GMT
"@method": POST
"@path": /foo
"@query": ?param=value&amp;pet=dog
"@authority": example.com
"content-type": application/json
"digest": SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
"content-length": 18
"@signature-params": ("date" "@method" "@path" "@query" \
  "@authority" "content-type" "digest" "content-length")\
  ;created=1618884475;keyid="test-key-rsa-pss"
</artwork>
               </figure>
               <t>This results in the following <spanx style="verb">Signature-Input</spanx> and <spanx style="verb">Signature</spanx> headers being added to the message:</t>
               <figure>
                  <sourcecode type="http-message">
NOTE: '\' line wrapping per RFC 8792

Signature-Input: sig1=("date" "@method" "@path" "@query" \
  "@authority" "content-type" "digest" "content-length")\
  ;created=1618884475;keyid="test-key-rsa-pss"
Signature: sig1=:JuJnJMFGD4HMysAGsfOY6N5ZTZUknsQUdClNG51VezDgPUOW03\
  QMe74vbIdndKwW1BBrHOHR3NzKGYZJ7X3ur23FMCdANe4VmKb3Rc1Q/5YxOO8p7Ko\
  yfVa4uUcMk5jB9KAn1M1MbgBnqwZkRWsbv8ocCqrnD85Kavr73lx51k1/gU8w673W\
  T/oBtxPtAn1eFjUyIKyA+XD7kYph82I+ahvm0pSgDPagu917SlqUjeaQaNnlZzO03\
  Iy1RZ5XpgbNeDLCqSLuZFVID80EohC2CQ1cL5svjslrlCNstd2JCLmhjL7xV3NYXe\
  rLim4bqUQGRgDwNJRnqobpS6C1NBns/Q==:
</sourcecode>
               </figure>
               <t>Note in this example that the value of the <spanx style="verb">Date</spanx> header and the value of the <spanx style="verb">created</spanx> signature parameter need not be the same. This is due to the fact that the <spanx style="verb">Date</spanx> header is added when creating the HTTP Message and the <spanx style="verb">created</spanx> parameter is populated when creating the signature over that message, and these two times could vary. If the <spanx style="verb">Date</spanx> header is covered by the signature, it is up to the verifier to determine whether its value has to match that of the <spanx style="verb">created</spanx> parameter or not.</t>
            </section>
            <section anchor="signing-a-response-using-ecdsa-p256-sha256">
               <name>Signing a Response using ecdsa-p256-sha256</name>
               <t>This example covers portions of the <spanx style="verb">test-response</spanx> response message using the <spanx style="verb">ecdsa-p256-sha256</spanx> algorithm and the key <spanx style="verb">test-key-ecc-p256</spanx>.</t>
               <t>The corresponding signature input is:</t>
               <figure>
                  <artwork>
NOTE: '\' line wrapping per RFC 8792

"content-type": application/json
"digest": SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
"content-length": 18
"@signature-params": ("content-type" "digest" "content-length")\
  ;created=1618884475;keyid="test-key-ecc-p256"
</artwork>
               </figure>
               <t>This results in the following <spanx style="verb">Signature-Input</spanx> and <spanx style="verb">Signature</spanx> headers being added to the message:</t>
               <figure>
                  <sourcecode type="http-message">
NOTE: '\' line wrapping per RFC 8792

Signature-Input: sig1=("content-type" "digest" "content-length")\
  ;created=1618884475;keyid="test-key-ecc-p256"
Signature: sig1=:n8RKXkj0iseWDmC6PNSQ1GX2R9650v+lhbb6rTGoSrSSx18zmn\
  6fPOtBx48/WffYLO0n1RHHf9scvNGAgGq52Q==:
</sourcecode>
               </figure>
            </section>
            <section anchor="signing-a-request-using-hmac-sha256">
               <name>Signing a Request using hmac-sha256</name>
               <t>This example covers portions of the <spanx style="verb">test-request</spanx> using the <spanx style="verb">hmac-sha256</spanx> algorithm and the secret <spanx style="verb">test-shared-secret</spanx>.</t>
               <t>The corresponding signature input is:</t>
               <figure>
                  <artwork>
NOTE: '\' line wrapping per RFC 8792

"@authority": example.com
"date": Tue, 20 Apr 2021 02:07:55 GMT
"content-type": application/json
"@signature-params": ("@authority" "date" "content-type")\
  ;created=1618884475;keyid="test-shared-secret"
</artwork>
               </figure>
               <t>This results in the following <spanx style="verb">Signature-Input</spanx> and <spanx style="verb">Signature</spanx> headers being added to the message:</t>
               <figure>
                  <sourcecode type="http-message">
NOTE: '\' line wrapping per RFC 8792

Signature-Input: sig1=("@authority" "date" "content-type")\
  ;created=1618884475;keyid="test-shared-secret"
Signature: sig1=:fN3AMNGbx0V/cIEKkZOvLOoC3InI+lM2+gTv22x3ia8=:
</sourcecode>
               </figure>
            </section>
         </section>
         <section anchor="tls-terminating-proxies">
            <name>TLS-Terminating Proxies</name>
            <t>In this example, there is a TLS-terminating reverse proxy sitting in front of the resource. The client does not sign the request but instead uses mutual TLS to make its call. The terminating proxy validates the TLS stream and injects a <spanx style="verb">Client-Cert</spanx> header according to <xref target="I-D.ietf-httpbis-client-cert-field"/>. By signing this header field, a reverse proxy can not only attest to its own validation of the initial request but also authenticate itself to the backend system independently of the client's actions. The client makes the following request to the TLS terminating proxy using mutual TLS:</t>
            <figure>
               <sourcecode type="http-message">
POST /foo?Param=value&amp;pet=Dog HTTP/1.1
Host: example.com
Date: Tue, 20 Apr 2021 02:07:55 GMT
Content-Type: application/json
Content-Length: 18

{"hello": "world"}
</sourcecode>
            </figure>
            <t>The proxy processes the TLS connection and extracts the client's TLS certificate to a <spanx style="verb">Client-Cert</spanx> header field and passes it along to the internal service hosted at <spanx style="verb">service.internal.example</spanx>. This results in the following unsigned request:</t>
            <figure>
               <sourcecode type="http-message">
NOTE: '\' line wrapping per RFC 8792

POST /foo?Param=value&amp;pet=Dog HTTP/1.1
Host: service.internal.example
Date: Tue, 20 Apr 2021 02:07:55 GMT
Content-Type: application/json
Content-Length: 18
Client-Cert: :MIIBqDCCAU6gAwIBAgIBBzAKBggqhkjOPQQDAjA6MRswGQYDVQQKD\
  BJMZXQncyBBdXRoZW50aWNhdGUxGzAZBgNVBAMMEkxBIEludGVybWVkaWF0ZSBDQT\
  AeFw0yMDAxMTQyMjU1MzNaFw0yMTAxMjMyMjU1MzNaMA0xCzAJBgNVBAMMAkJDMFk\
  wEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE8YnXXfaUgmnMtOXU/IncWalRhebrXmck\
  C8vdgJ1p5Be5F/3YC8OthxM4+k1M6aEAEFcGzkJiNy6J84y7uzo9M6NyMHAwCQYDV\
  R0TBAIwADAfBgNVHSMEGDAWgBRm3WjLa38lbEYCuiCPct0ZaSED2DAOBgNVHQ8BAf\
  8EBAMCBsAwEwYDVR0lBAwwCgYIKwYBBQUHAwIwHQYDVR0RAQH/BBMwEYEPYmRjQGV\
  4YW1wbGUuY29tMAoGCCqGSM49BAMCA0gAMEUCIBHda/r1vaL6G3VliL4/Di6YK0Q6\
  bMjeSkC3dFCOOB8TAiEAx/kHSB4urmiZ0NX5r5XarmPk0wmuydBVoU4hBVZ1yhk=:

{"hello": "world"}
</sourcecode>
            </figure>
            <t>Without a signature, the internal service would need to trust that the incoming connection has the right information. By signing the <spanx style="verb">Client-Cert</spanx> header and other portions of the internal request, the internal service can be assured that the correct party, the trusted proxy, has processed the request and presented it to the correct service. The proxy's signature input consists of the following:</t>
            <figure>
               <artwork>
NOTE: '\' line wrapping per RFC 8792

"@path": /foo
"@query": Param=value&amp;pet=Dog
"@method": POST
"@authority": service.internal.example
"client-cert": :MIIBqDCCAU6gAwIBAgIBBzAKBggqhkjOPQQDAjA6MRswGQYDVQQ\
  KDBJMZXQncyBBdXRoZW50aWNhdGUxGzAZBgNVBAMMEkxBIEludGVybWVkaWF0ZSBD\
  QTAeFw0yMDAxMTQyMjU1MzNaFw0yMTAxMjMyMjU1MzNaMA0xCzAJBgNVBAMMAkJDM\
  FkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE8YnXXfaUgmnMtOXU/IncWalRhebrXm\
  ckC8vdgJ1p5Be5F/3YC8OthxM4+k1M6aEAEFcGzkJiNy6J84y7uzo9M6NyMHAwCQY\
  DVR0TBAIwADAfBgNVHSMEGDAWgBRm3WjLa38lbEYCuiCPct0ZaSED2DAOBgNVHQ8B\
  Af8EBAMCBsAwEwYDVR0lBAwwCgYIKwYBBQUHAwIwHQYDVR0RAQH/BBMwEYEPYmRjQ\
  GV4YW1wbGUuY29tMAoGCCqGSM49BAMCA0gAMEUCIBHda/r1vaL6G3VliL4/Di6YK0\
  Q6bMjeSkC3dFCOOB8TAiEAx/kHSB4urmiZ0NX5r5XarmPk0wmuydBVoU4hBVZ1yhk=:
"@signature-params": ("@path" "@query" "@method" "@authority" \
  "client-cert");created=1618884475;keyid="test-key-ecc-p256"
</artwork>
            </figure>
            <t>This results in the following signature:</t>
            <figure>
               <artwork>
NOTE: '\' line wrapping per RFC 8792

5gudRjXaHrAYbEaQUOoY9TuvqWOdPcspkp7YyKCB0XhyAG9cB715hucPPanEK0OVyiN\
LJqcoq2Yn1DPWQcnbog==
</artwork>
            </figure>
            <t>Which results in the following signed request sent from the proxy to the internal service:</t>
            <figure>
               <artwork>
NOTE: '\' line wrapping per RFC 8792

POST /foo?Param=value&amp;pet=Dog HTTP/1.1
Host: service.internal.example
Date: Tue, 20 Apr 2021 02:07:55 GMT
Content-Type: application/json
Content-Length: 18
Client-Cert: :MIIBqDCCAU6gAwIBAgIBBzAKBggqhkjOPQQDAjA6MRswGQYDVQQKD\
  BJMZXQncyBBdXRoZW50aWNhdGUxGzAZBgNVBAMMEkxBIEludGVybWVkaWF0ZSBDQT\
  AeFw0yMDAxMTQyMjU1MzNaFw0yMTAxMjMyMjU1MzNaMA0xCzAJBgNVBAMMAkJDMFk\
  wEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAE8YnXXfaUgmnMtOXU/IncWalRhebrXmck\
  C8vdgJ1p5Be5F/3YC8OthxM4+k1M6aEAEFcGzkJiNy6J84y7uzo9M6NyMHAwCQYDV\
  R0TBAIwADAfBgNVHSMEGDAWgBRm3WjLa38lbEYCuiCPct0ZaSED2DAOBgNVHQ8BAf\
  8EBAMCBsAwEwYDVR0lBAwwCgYIKwYBBQUHAwIwHQYDVR0RAQH/BBMwEYEPYmRjQGV\
  4YW1wbGUuY29tMAoGCCqGSM49BAMCA0gAMEUCIBHda/r1vaL6G3VliL4/Di6YK0Q6\
  bMjeSkC3dFCOOB8TAiEAx/kHSB4urmiZ0NX5r5XarmPk0wmuydBVoU4hBVZ1yhk=:
Signature-Input: ttrp=("@path" "@query" "@method" "@authority" \
  "client-cert");created=1618884475;keyid="test-key-ecc-p256"
Signature: ttrp=:5gudRjXaHrAYbEaQUOoY9TuvqWOdPcspkp7YyKCB0XhyAG9cB7\
  15hucPPanEK0OVyiNLJqcoq2Yn1DPWQcnbog==:

{"hello": "world"}
</artwork>
            </figure>
            <t>The internal service can validate the proxy's signature and therefore be able to trust that the client's certificate has been appropriately processed.</t>
         </section>
      </section>
      <section anchor="acknowledgements" numbered="false">
         <name>Acknowledgements</name>
         <t>This specification was initially based on the draft-cavage-http-signatures internet draft. The editors would like to thank the authors of that draft, Mark Cavage and Manu Sporny, for their work on that draft and their continuing contributions.</t>
         <t>The editors would also like to thank the following individuals for feedback, insight, and implementation of this draft and its predecessors (in alphabetical order): Mark Adamcin, Mark Allen, Paul Annesley, Karl Böhlmark, Stéphane Bortzmeyer, Sarven Capadisli, Liam Dennehy, ductm54, Stephen Farrell, Phillip Hallam-Baker, Eric Holmes, Andrey Kislyuk, Adam Knight, Dave Lehn, Dave Longley, Ilari Liusvaara, James H. Manger, Kathleen Moriarty, Mark Nottingham, Yoav Nir, Adrian Palmer, Lucas Pardue, Roberto Polli, Julian Reschke, Michael Richardson, Wojciech Rygielski, Adam Scarr, Cory J. Slep, Dirk Stein, Henry Story, Lukasz Szewc, Chris Webber, and Jeffrey Yasskin.</t>
      </section>
      <section anchor="document-history" numbered="false">
         <name>Document History</name>
         <t>
            <em>RFC EDITOR: please remove this section before publication</em>
         </t>
         <t>
            <list style="symbols">
               <t>draft-ietf-httpbis-message-signatures <list style="symbols">
                     <t>-06 <list style="symbols">
                           <t>Updated language for message components, including identifiers and values.</t>
                           <t>Clarified that Signature-Input and Signature are fields which can be used as headers or trailers.</t>
                           <t>Add "Accept-Signature" field and semantics for signature negotiation.</t>
                           <t>Define new specialty content identifiers, re-defined request-target identifier.</t>
                           <t>Added request-response binding.</t>
                        </list>
                     </t>
                     <t>-05 <list style="symbols">
                           <t>Remove list prefixes.</t>
                           <t>Clarify signature algorithm parameters.</t>
                           <t>Update and fix examples.</t>
                           <t>Add examples for ECC and HMAC.</t>
                        </list>
                     </t>
                     <t>-04 <list style="symbols">
                           <t>Moved signature component definitions up to intro.</t>
                           <t>Created formal function definitions for algorithms to fulfill.</t>
                           <t>Updated all examples.</t>
                           <t>Added nonce parameter field.</t>
                        </list>
                     </t>
                     <t>-03 <list style="symbols">
                           <t>Clarified signing and verification processes.</t>
                           <t>Updated algorithm and key selection method.</t>
                           <t>Clearly defined core algorithm set.</t>
                           <t>Defined JOSE signature mapping process.</t>
                           <t>Removed legacy signature methods.</t>
                           <t>Define signature parameters separately from "signature" object model.</t>
                           <t>Define serialization values for signature-input header based on signature input.</t>
                        </list>
                     </t>
                     <t>-02 <list style="symbols">
                           <t>Removed editorial comments on document sources.</t>
                           <t>Removed in-document issues list in favor of tracked issues.</t>
                           <t>Replaced unstructured <spanx style="verb">Signature</spanx> header with <spanx style="verb">Signature-Input</spanx> and <spanx style="verb">Signature</spanx> Dictionary Structured Header Fields.</t>
                           <t>Defined content identifiers for individual Dictionary members, e.g., <spanx style="verb">"x-dictionary-field";key=member-name</spanx>.</t>
                           <t>Defined content identifiers for first N members of a List, e.g., <spanx style="verb">"x-list-field":prefix=4</spanx>.</t>
                           <t>Fixed up examples.</t>
                           <t>Updated introduction now that it's adopted.</t>
                           <t>Defined specialty content identifiers and a means to extend them.</t>
                           <t>Required signature parameters to be included in signature.</t>
                           <t>Added guidance on backwards compatibility, detection, and use of signature methods.</t>
                        </list>
                     </t>
                     <t>-01 <list style="symbols">
                           <t>Strengthened requirement for content identifiers for header fields to be lower-case (changed from SHOULD to MUST).</t>
                           <t>Added real example values for Creation Time and Expiration Time.</t>
                           <t>Minor editorial corrections and readability improvements.</t>
                        </list>
                     </t>
                     <t>-00 <list style="symbols">
                           <t>Initialized from draft-richanna-http-message-signatures-00, following adoption by the working group.</t>
                        </list>
                     </t>
                  </list>
               </t>
               <t>draft-richanna-http-message-signatures <list style="symbols">
                     <t>-00 <list style="symbols">
                           <t>Converted to xml2rfc v3 and reformatted to comply with RFC style guides.</t>
                           <t>Removed Signature auth-scheme definition and related content.</t>
                           <t>Removed conflicting normative requirements for use of algorithm parameter. Now MUST NOT be relied upon.</t>
                           <t>Removed Extensions appendix.</t>
                           <t>Rewrote abstract and introduction to explain context and need, and challenges inherent in signing HTTP messages.</t>
                           <t>Rewrote and heavily expanded algorithm definition, retaining normative requirements.</t>
                           <t>Added definitions for key terms, referenced RFC 7230 for HTTP terms.</t>
                           <t>Added examples for canonicalization and signature generation steps.</t>
                           <t>Rewrote Signature header definition, retaining normative requirements.</t>
                           <t>Added default values for algorithm and expires parameters.</t>
                           <t>Rewrote HTTP Signature Algorithms registry definition. Added change control policy and registry template. Removed suggested URI.</t>
                           <t>Added IANA HTTP Signature Parameter registry.</t>
                           <t>Added additional normative and informative references.</t>
                           <t>Added Topics for Working Group Discussion section, to be removed prior to publication as an RFC.</t>
                        </list>
                     </t>
                  </list>
               </t>
            </list>
         </t>
      </section>
   </back>
</rfc>
