<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="rfc2629.xslt" ?>
<!-- generated by https://github.com/cabo/kramdown-rfc version 1.6.17 (Ruby 2.6.4) -->
<?rfc tocindent="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"
      consensus="true"
      docName="draft-ietf-httpbis-message-signatures-13"
      ipr="trust200902"
      sortRefs="true"
      symRefs="true"
      tocInclude="true">
   <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."
               role="editor"
               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="26" month="September" year="2022"/>
      <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 removeInRFC="true" title="About This Document">
         <t>Status information for this document may be found at <eref target="https://datatracker.ietf.org/doc/draft-ietf-httpbis-message-signatures/"/>.</t>
         <t>Discussion of this document takes place on the HTTP Working Group mailing list (<eref target="mailto:ietf-http-wg@w3.org"/>), which is archived at <eref target="https://lists.w3.org/Archives/Public/ietf-http-wg/"/>. Working Group information can be found at <eref target="https://httpwg.org/"/>.</t>
         <t>Source for this draft and an issue tracker can be found at <eref target="https://github.com/httpwg/http-extensions/labels/signatures"/>.</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, used to create the signature base.</t>
               <t>Algorithms for generating and verifying signatures over HTTP message components using this signature base through application of cryptographic primitives.</t>
               <t>A mechanism for attaching a signature and related metadata to an HTTP message, and for parsing attached signatures and metadata from HTTP messages. To facilitate this, this document defines the "Signature-Input" and "Signature" fields.</t>
            </list>
         </t>
         <t>This document also provides a mechanism for a potential verifier to signal to a potential signer that a signature is desired in one or more subsequent messages. To facilitate this, this document defines the "Accept-Signature" field. This optional negotiation mechanism can be used along with opportunistic or application-driven message signatures by either party.</t>
         <section anchor="definitions">
            <name>Conventions and Terminology</name>
            <t>The key words "<bcp14>MUST</bcp14>", "<bcp14>MUST NOT</bcp14>", "<bcp14>REQUIRED</bcp14>", "<bcp14>SHALL</bcp14>", "<bcp14>SHALL NOT</bcp14>", "<bcp14>SHOULD</bcp14>", "<bcp14>SHOULD NOT</bcp14>", "<bcp14>RECOMMENDED</bcp14>", "<bcp14>NOT RECOMMENDED</bcp14>", "<bcp14>MAY</bcp14>", and "<bcp14>OPTIONAL</bcp14>" 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", "target URI", "gateway", "header field", "intermediary", "request target", "sender", "method", and "recipient" are used as defined in <xref target="HTTP"/>.</t>
            <t>For brevity, the term "signature" on its own is used in this document to refer to both digital signatures (which use asymmetric cryptography) and keyed MACs (which use symmetric cryptography). Similarly, the verb "sign" refers to the generation of either a digital signature or keyed MAC over a given signature base. The qualified term "digital signature" refers specifically to the output of an asymmetric cryptographic signing operation.</t>
            <t>This document uses the following terminology from <xref section="3" sectionFormat="of" target="STRUCTURED-FIELDS"/> to specify data types: List, Inner List, Dictionary, Item, String, Integer, Byte Sequence, and Boolean.</t>
            <t>This document defines several string constructions using <xref target="ABNF"/> and uses the following ABNF rules: <spanx style="verb">VCHAR</spanx>, <spanx style="verb">SP</spanx>, <spanx style="verb">DQUOTE</spanx>, <spanx style="verb">LF</spanx>. This document uses the following ABNF rules from <xref target="STRUCTURED-FIELDS"/>: <spanx style="verb">sf-string</spanx>, <spanx style="verb">inner-list</spanx>, <spanx style="verb">parameters</spanx>. This document uses the following ABNF rules from <xref target="HTTP"/>: <spanx style="verb">field-content</spanx>.</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>Derived Component:</dt>
               <dd>
                  <t>An HTTP Message Component derived from the HTTP message through the use of a specified algorithm or process. See <xref target="derived-components"/>.</t>
               </dd>
               <dt>HTTP Message Component Name:</dt>
               <dd>
                  <t>A string that identifies an HTTP Message Component's source, such as a field name or derived component name.</t>
               </dd>
               <dt>HTTP Message Component Identifier:</dt>
               <dd>
                  <t>The combination of an HTTP Message Component Name and any parameters 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 derived components (<xref target="derived-components"/>) that indicates the set of message components covered by the signature, never including the <spanx style="verb">@signature-params</spanx> identifier itself. The order of this set is preserved and communicated between the signer and verifier to facilitate reconstruction of the signature base.</t>
               </dd>
               <dt>Signature Base:</dt>
               <dd>
                  <t>The sequence of bytes generated by the signer and verifier using the covered components set and the HTTP Message. The signature base is processed by the cryptographic algorithm to produce or verify the HTTP Message Signature.</t>
               </dd>
               <dt>HTTP Message Signature Algorithm:</dt>
               <dd>
                  <t>A cryptographic algorithm that describes the signing and verification process for the signature, defined in terms of the <spanx style="verb">HTTP_SIGN</spanx> and <spanx style="verb">HTTP_VERIFY</spanx> primitives described in <xref target="signature-methods"/>.</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 after which the signature should no longer be accepted by the verifier, as asserted by the signer.</t>
               </dd>
               <dt>Target Message:</dt>
               <dd>
                  <t>The HTTP message to which an HTTP Message Signature is applied.</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 <spanx style="verb">\</spanx> 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="requirements">
            <name>Requirements</name>
            <t>HTTP permits and sometimes requires intermediaries to transform messages in a variety of ways. This can 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 integrity protections 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 base. Since the exact raw bytes of the message cannot be relied upon as a reliable source for a signature base, the signer and verifier have to independently create the signature base 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 message content, the method, or a particular header field) is relevant. Thus, a general purpose solution needs to 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 could occur under HTTP, provided as context:</t>
            <t>
               <list style="symbols">
                  <t>Re-ordering of header fields with different header field names (<xref section="5.3" sectionFormat="of" target="HTTP"/>).</t>
                  <t>Combination of header fields with the same field name (<xref section="5.2" sectionFormat="of" target="HTTP"/>).</t>
                  <t>Removal of header fields listed in the Connection header field (<xref section="7.6.1" sectionFormat="of" target="HTTP"/>).</t>
                  <t>Addition of header fields that indicate control options (<xref section="7.6.1" sectionFormat="of" target="HTTP"/>).</t>
                  <t>Addition or removal of a transfer coding (<xref section="7.7" sectionFormat="of" target="HTTP"/>).</t>
                  <t>Addition of header fields such as <spanx style="verb">Via</spanx> (<xref section="7.6.3" sectionFormat="of" target="HTTP"/>) and <spanx style="verb">Forwarded</spanx> (<xref section="4" sectionFormat="of" target="RFC7239"/>).</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 field names, request URI scheme, or host.</t>
                  <t>Addition or removal of leading or trailing whitespace to a field value.</t>
                  <t>Addition or removal of <spanx style="verb">obs-folds</spanx> from field values.</t>
                  <t>Changes to the request target and authority that when applied together do not result in a change to the message's target URI, as defined in <xref section="7.1" sectionFormat="of" target="HTTP"/>.</t>
               </list>
            </t>
            <t>We can identify these types of transformations as ones that should not prevent signature verification, even when performed on message components covered by the signature. Additionally, all changes to components not covered by the signature should not prevent signature verification.</t>
            <t>Some examples of these kinds of transformations, and the effect they have on the message signature, are found in <xref target="example-transform"/>.</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 <bcp14>MUST</bcp14> specify all of the following items:</t>
            <t>
               <list style="symbols">
                  <t>The set of <xref target="covered-content">component identifiers</xref> and <xref target="signature-params">signature parameters</xref> that are expected and required to be included in the covered components list. For example, an authorization protocol could mandate that the Authorization field be covered to protect the authorization credentials and mandate the signature parameters contain a <spanx style="verb">created</spanx> parameter, while an API expecting semantically relevant HTTP message content could require the Content-Digest header to be present and covered as well as mandate a value for <spanx style="verb">tag</spanx> that is specific to the API being protected.</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 such as pre-registration of a signer's key.</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>
                  <t>A means of determining the context for derivation of message components from an HTTP message and its application context. While this is normally the target HTTP message itself, the context could include additional information known to the application, such as an external host name.</t>
               </list>
            </t>
            <t>When choosing these parameters, an application of HTTP message signatures has to ensure that the verifier will have access to all required information needed to re-create the signature base. For example, a server behind a reverse proxy would need to know the original request URI to make use of the derived component <spanx style="verb">@target-uri</spanx>, even though the apparent target URI would be changed by the reverse proxy (see also <xref target="security-message-component-context"/>). Additionally, an application using signatures in responses would need to ensure that clients receiving signed responses have access to all the signed portions of the message, including any portions of the request that were signed by the server using the related-response parameter.</t>
            <t>The details of this kind of profiling are the purview of the application and outside the scope of this specification, however some additional considerations are discussed in <xref target="security"/>.</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 base.</t>
         <t>The context for deriving these values <bcp14>MUST</bcp14> be accessible to both the signer and the verifier of the message. The context <bcp14>MUST</bcp14> be consistent across all components. For more considerations of the message component context, see <xref target="security-message-component-context"/>.</t>
         <t>A component identifier is composed of a component name and any parameters associated with that name. Each component name is either an HTTP field name <xref target="http-header"/> or a registered derived component name <xref target="derived-components"/>. The possible parameters for a component identifier are dependent on the component identifier, and a registry cataloging all possible parameters is defined in <xref target="param-registry"/>.</t>
         <t>Within a single list of covered components, each component identifier <bcp14>MUST</bcp14> occur only once. One component identifier is distinct from another if either the component name or its parameters differ. Multiple component identifiers having the same component name <bcp14>MAY</bcp14> be included if they have parameters that make them distinct. The order of parameters <bcp14>MUST</bcp14> be preserved when processing a component identifier (such as when parsing during verification), but the order of parameters is not significant when comparing two component identifiers for equality. That is to say, <spanx style="verb">"foo";bar;baz</spanx> cannot be in the same message as <spanx style="verb">"foo";baz;bar</spanx>, since these two component identifiers are equivalent, but a system processing one form is not allowed to transform it into the other form.</t>
         <t>The component value associated with a component identifier is defined by the identifier itself. Component values <bcp14>MUST NOT</bcp14> contain newline (<spanx style="verb">\n</spanx>) characters. 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 they are 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>The following sections define component identifier names, their parameters, their associated values, and the canonicalization rules for their values. The method for combining message components into the signature base is defined in <xref target="create-sig-input"/>.</t>
         <section anchor="http-header">
            <name>HTTP Fields</name>
            <t>The component name for an HTTP field is the lowercased form of its field name. While HTTP field names are case-insensitive, implementations <bcp14>MUST</bcp14> 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 names.</t>
            <t>Unless overridden by additional parameters and rules, the HTTP field value <bcp14>MUST</bcp14> be canonicalized as a single combined value as defined in <xref section="5.2" sectionFormat="of" target="HTTP"/>. Note that some HTTP fields, such as Set-Cookie <xref target="COOKIE"/>, do not follow a syntax that allows for combination of field values in this manner such that the combined output is unambiguous from multiple inputs. However, the canonicalized component value is never parsed by the message signature process, merely used as part of the signature base in <xref target="create-sig-input"/>. Even so, caution needs to be taken when including such fields in signatures, and the <spanx style="verb">bs</spanx> parameter defined in <xref target="http-header-byte-sequence"/> provides a method for wrapping such problematic fields. See <xref target="security-non-list"/> for more discussion of this issue.</t>
            <t>If the combined value is not available for a given field by an implementation, the following algorithm will produce canonicalized results for an implementation:</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. Note that since HTTP field values are not allowed to contain leading and trailing whitespace, this will be a no-op in a compliant implementation.</t>
                  <t>Remove any obsolete line-folding within the line and replace it with a single space (" "), as discussed in <xref section="5.2" sectionFormat="of" target="HTTP1"/>. Note that this behavior is specific to <xref target="HTTP1"/> and does not apply to other versions of the HTTP specification which do not allow internal line folding.</t>
                  <t>Concatenate the list of values together with a single comma (",") and a single space (" ") between each item.</t>
               </list>
            </t>
            <t>The resulting string is the canonicalized component value for the field.</t>
            <t>Note that some HTTP fields have values with multiple valid serializations that have equivalent semantics. Applications signing and processing such fields <bcp14>MUST</bcp14> consider how to handle the values of such fields to ensure that the signer and verifier can derive the same value, as discussed in <xref target="security-field-values"/>.</t>
            <t>Following are non-normative examples of canonicalized values for header fields, given the following example HTTP message fragment:</t>
            <figure>
               <sourcecode type="http-message">
Host: www.example.com
Date: Tue, 20 Apr 2021 02:07:56 GMT
X-OWS-Header:   Leading and trailing whitespace.
X-Obs-Fold-Header: Obsolete
    line folding.
Cache-Control: max-age=60
Cache-Control:    must-revalidate
Example-Dict:  a=1,    b=2;x=1;y=2,   c=(a   b   c)
</sourcecode>
            </figure>
            <t>The following example shows canonicalized values for these example header fields, presented using the signature base format discussed in <xref target="create-sig-input"/>:</t>
            <figure>
               <artwork>
"host": www.example.com
"date": Tue, 20 Apr 2021 02:07:56 GMT
"x-ows-header": Leading and trailing whitespace.
"x-obs-fold-header": Obsolete line folding.
"cache-control": max-age=60, must-revalidate
"example-dict": a=1,    b=2;x=1;y=2,   c=(a   b   c)
</artwork>
            </figure>
            <t>Since empty HTTP header fields are allowed, they are also able to be signed when present in a message. The canonicalized value is the empty string. This means that the following empty header:</t>
            <figure>
               <sourcecode type="http-message" x:line-folding="\">
X-Empty-Header: \

</sourcecode>
            </figure>
            <t>Is serialized by the <xref target="create-sig-input">signature base generation algorithm</xref> with an empty string value following the colon and space added after the content identifier.</t>
            <figure>
               <artwork>
NOTE: '\' line wrapping per RFC 8792

"x-empty-header": \

</artwork>
            </figure>
            <t>Note: these are shown here using the line wrapping algorithm in <xref target="RFC8792"/> due to limitations in the document format that strips trailing spaces from diagrams.</t>
            <t>Any HTTP field component identifiers <bcp14>MAY</bcp14> have the following parameters in specific circumstances, each described in detail in their own sections:</t>
            <dl>
               <dt>
                  <spanx style="verb">sf</spanx>
               </dt>
               <dd>
                  <t>A boolean flag indicating that the component value is serialized using strict encoding of the structured field value. <xref target="http-header-structured"/>
                  </t>
               </dd>
               <dt>
                  <spanx style="verb">key</spanx>
               </dt>
               <dd>
                  <t>A string parameter used to select a single member value from a Dictionary structured field. <xref target="http-header-dictionary"/>
                  </t>
               </dd>
               <dt>
                  <spanx style="verb">bs</spanx>
               </dt>
               <dd>
                  <t>A boolean flag indicating that individual field values are encoded using Byte Sequence data structures before being combined into the component value. <xref target="http-header-byte-sequence"/>
                  </t>
               </dd>
               <dt>
                  <spanx style="verb">req</spanx>
               </dt>
               <dd>
                  <t>A boolean flag for signed responses indicating that the component value is derived from the request that triggered this response message and not from the response message directly. Note that this parameter can also be applied to any derived component identifiers that target the request. <xref target="content-request-response"/>
                  </t>
               </dd>
            </dl>
            <t>Multiple parameters <bcp14>MAY</bcp14> be specified together, though some combinations are redundant or incompatible. For example, the <spanx style="verb">sf</spanx> parameter's functionality is already covered when the <spanx style="verb">key</spanx> parameter is used on a dictionary item, since <spanx style="verb">key</spanx> requires strict serialization of the value. The <spanx style="verb">bs</spanx> parameter, which requires the raw field values from the message, is not compatible with use of the <spanx style="verb">sf</spanx> or <spanx style="verb">key</spanx> parameters, which require the parsed data structures of the field values after combination.</t>
            <t>Additional parameters are be defined in a registry established in <xref target="param-registry"/>.</t>
            <section anchor="http-header-structured">
               <name>Strict Serialization of HTTP Structured Fields</name>
               <t>If the value of the the HTTP field in question is known by the application to be a structured field (<xref target="STRUCTURED-FIELDS"/>), and the expected type of the structured field is known, the signer <bcp14>MAY</bcp14> include the <spanx style="verb">sf</spanx> parameter in the component identifier. If this parameter is included with a component identifier, the HTTP field value <bcp14>MUST</bcp14> be serialized using the rules specified in <xref section="4" sectionFormat="of" target="STRUCTURED-FIELDS"/> applicable to the type of the HTTP field. Note that this process will replace any optional internal whitespace with a single space character, among other potential transformations of the value.</t>
               <t>If multiple field values occur within a message, these values <bcp14>MUST</bcp14> be combined into a single List or Dictionary structure before serialization.</t>
               <t>For example, the following dictionary field is a valid serialization:</t>
               <figure>
                  <sourcecode type="http-message">
Example-Dict:  a=1,    b=2;x=1;y=2,   c=(a   b   c)
</sourcecode>
               </figure>
               <t>If included in the signature base without parameters, its value would be:</t>
               <figure>
                  <artwork>
"example-dict": a=1,    b=2;x=1;y=2,   c=(a   b   c)
</artwork>
               </figure>
               <t>However, if the <spanx style="verb">sf</spanx> parameter is added, the value is re-serialized as follows:</t>
               <figure>
                  <artwork>
"example-dict";sf: a=1, b=2;x=1;y=2, c=(a b c)
</artwork>
               </figure>
               <t>The resulting string is used as the component value in <xref target="http-header"/>.</t>
            </section>
            <section anchor="http-header-dictionary">
               <name>Dictionary Structured Field Members</name>
               <t>If a given field is known by the application to be a Dictionary structured field, an individual member in the value of that Dictionary is identified by using the parameter <spanx style="verb">key</spanx> and the Dictionary member key as a String value.</t>
               <t>If multiple field values occur within a message, these values <bcp14>MUST</bcp14> be combined into a single Dictionary structure before serialization.</t>
               <t>An individual member value of a Dictionary Structured Field is canonicalized by applying the serialization algorithm described in <xref section="4.1.2" sectionFormat="of" target="STRUCTURED-FIELDS"/> on the <spanx style="verb">member_value</spanx> and its parameters, not including the dictionary key itself. Specifically, the value is serialized as an Item or Inner List (the two possible values of a Dictionary member).</t>
               <t>Each parameterized key for a given field <bcp14>MUST NOT</bcp14> appear more than once in the signature base. Parameterized keys <bcp14>MAY</bcp14> appear in any order in the signature base, regardless of the order they occur in the source Dictionary.</t>
               <t>If a Dictionary key is named as a covered component but it does not occur in the Dictionary, this <bcp14>MUST</bcp14> cause an error in the signature base generation.</t>
               <t>Following are non-normative examples of canonicalized values for Dictionary structured field members given the following example header field, whose value is known by the application to be a Dictionary:</t>
               <figure>
                  <sourcecode type="http-message">
Example-Dict:  a=1, b=2;x=1;y=2, c=(a   b    c), d
</sourcecode>
               </figure>
               <t>The following example shows canonicalized values for different component identifiers of this field, presented using the signature base format discussed in <xref target="create-sig-input"/>:</t>
               <figure>
                  <artwork>
"example-dict";key="a": 1
"example-dict";key="d": ?1
"example-dict";key="b": 2;x=1;y=2
"example-dict";key="c": (a b c)
</artwork>
               </figure>
               <t>Note that the value for <spanx style="verb">key="c"</spanx> has been re-serialized according to the strict <spanx style="verb">member_value</spanx> algorithm, and the value for <spanx style="verb">key="d"</spanx> has been serialized as a Boolean value.</t>
            </section>
            <section anchor="http-header-byte-sequence">
               <name>Binary-wrapped HTTP Fields</name>
               <t>If the value of the the HTTP field in question is known by the application to cause problems with serialization, particularly with the combination of multiple values into a single line as discussed in <xref target="security-non-list"/>, the signer <bcp14>SHOULD</bcp14> include the <spanx style="verb">bs</spanx> parameter in a component identifier to indicate the values of the fields need to be wrapped as binary structures before being combined.</t>
               <t>If this parameter is included with a component identifier, the component value <bcp14>MUST</bcp14> be calculated using the following algorithm:</t>
               <t>
                  <list style="numbers">
                     <t>Let the input be the ordered set of values for a field, in the order they appear in the message.</t>
                     <t>Create an empty List for accumulating processed field values.</t>
                     <t>For each field value in the set: <list style="numbers">
                           <t>Strip leading and trailing whitespace from the field value. Note that since HTTP field values are not allowed to contain leading and trailing whitespace, this will be a no-op in a compliant implementation.</t>
                           <t>Remove any obsolete line-folding within the line and replace it with a single space (" "), as discussed in <xref section="5.2" sectionFormat="of" target="HTTP1"/>. Note that this behavior is specific to <xref target="HTTP1"/> and does not apply to other versions of the HTTP specification.</t>
                           <t>Encode the bytes of the resulting field value's ASCII representation as a Byte Sequence.</t>
                           <t>Add the Byte Sequence to the List accumulator.</t>
                        </list>
                     </t>
                     <t>The intermediate result is a List of Byte Sequence values.</t>
                     <t>Follow the strict serialization of a List as described in <xref section="4.1.1" sectionFormat="of" target="STRUCTURED-FIELDS"/> and return this output.</t>
                  </list>
               </t>
               <t>For example, the following field with internal commas prevents the distinct field values from being safely combined:</t>
               <figure>
                  <sourcecode type="http-message">
Example-Header: value, with, lots
Example-Header: of, commas
</sourcecode>
               </figure>
               <t>In our example, the same field can be sent with a semantically different single value:</t>
               <figure>
                  <sourcecode type="http-message">
Example-Header: value, with, lots, of, commas
</sourcecode>
               </figure>
               <t>Both of these versions are treated differently by the application. however, if included in the signature base without parameters, the component value would be the same in both cases:</t>
               <figure>
                  <artwork>
"example-header": value, with, lots, of, commas
</artwork>
               </figure>
               <t>However, if the <spanx style="verb">bs</spanx> parameter is added, the two separate instances are encoded and serialized as follows:</t>
               <figure>
                  <artwork>
"example-header";bs: :dmFsdWUsIHdpdGgsIGxvdHM=:, :b2YsIGNvbW1hcw==:
</artwork>
               </figure>
               <t>For the single-instance field above, the encoding with the <spanx style="verb">bs</spanx> parameter is:</t>
               <figure>
                  <artwork>
"example-header";bs: :dmFsdWUsIHdpdGgsIGxvdHMsIG9mLCBjb21tYXM=:
</artwork>
               </figure>
               <t>This component value is distinct from the multiple-instance field above, preventing a collision which could potentially be exploited.</t>
            </section>
         </section>
         <section anchor="derived-components">
            <name>Derived Components</name>
            <t>In addition to HTTP fields, there are a number of different components that can be derived from the control data, processing context, or other aspects of the HTTP message being signed. Such derived components can be included in the signature base by defining a component name, possible parameters, message target, and the derivation method for its component value.</t>
            <t>Derived component names <bcp14>MUST</bcp14> start with the "at" <spanx style="verb">@</spanx> character. This differentiates derived component names from HTTP field names, which cannot contain the <spanx style="verb">@</spanx> character as per <xref section="5.1" sectionFormat="of" target="HTTP"/>. Processors of HTTP Message Signatures <bcp14>MUST</bcp14> treat derived component names separately from field names, as discussed in <xref target="security-lazy-header-parser"/>.</t>
            <t>This specification defines the following derived components:</t>
            <dl>
               <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-param</dt>
               <dd>
                  <t>A parsed query parameter of the target URI for a request. (<xref target="content-request-query-param"/>)</t>
               </dd>
               <dt>@status</dt>
               <dd>
                  <t>The status code for a response. (<xref target="content-status-code"/>).</t>
               </dd>
            </dl>
            <t>Additional derived component names are defined in the HTTP Signatures Derived Component Name Registry. (<xref target="content-registry"/>)</t>
            <t>Derived component values are taken from the context of the target message for the signature. This context includes information about the message itself, such as its control data, as well as any additional state and context held by the signer. In particular, when signing a response, the signer can include any derived components from the originating request by using the <xref target="content-request-response">request-response signature binding parameter</xref>.</t>
            <dl>
               <dt>request:</dt>
               <dd>
                  <t>Values derived from and results applied to an HTTP request message as described in <xref section="3.4" sectionFormat="of" target="HTTP"/>. If the target message of the signature is a response, using the <spanx style="verb">req</spanx> parameter allows a request-targeted derived component to be included in the signature (see <xref target="content-request-response"/>).</t>
               </dd>
               <dt>response:</dt>
               <dd>
                  <t>Values derived from and results applied to an HTTP response message as described in <xref section="3.4" sectionFormat="of" target="HTTP"/>.</t>
               </dd>
            </dl>
            <t>A derived component definition <bcp14>MUST</bcp14> define all target message types to which it can be applied.</t>
            <t>Derived component values <bcp14>MUST</bcp14> be limited to printable characters and spaces and <bcp14>MUST NOT</bcp14> contain any newline characters. Derived component values <bcp14>MUST NOT</bcp14> start or end with whitespace characters.</t>
            <section anchor="content-request-method">
               <name>Method</name>
               <t>The <spanx style="verb">@method</spanx> derived component refers to the HTTP method of a request message. The component value is canonicalized by taking the value of the method as a string. Note that the method name is case-sensitive as per <xref section="9.1" sectionFormat="comma" target="HTTP"/>, and conventionally standardized method names are uppercase US-ASCII.</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> component value:</t>
               <figure>
                  <artwork>
POST
</artwork>
               </figure>
               <t>And the following signature base line:</t>
               <figure>
                  <artwork>
"@method": POST
</artwork>
               </figure>
            </section>
            <section anchor="content-target-uri">
               <name>Target URI</name>
               <t>The <spanx style="verb">@target-uri</spanx> derived component 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 section="7.1" sectionFormat="comma" target="HTTP"/>.</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> component value:</t>
               <figure>
                  <artwork>
https://www.example.com/path?param=value
</artwork>
               </figure>
               <t>And the following signature base line:</t>
               <figure>
                  <artwork>
"@target-uri": https://www.example.com/path?param=value
</artwork>
               </figure>
            </section>
            <section anchor="content-request-authority">
               <name>Authority</name>
               <t>The <spanx style="verb">@authority</spanx> derived component refers to the authority component of the target URI of the HTTP request message, as defined in <xref section="7.2" sectionFormat="comma" target="HTTP"/>. In HTTP 1.1, this is usually conveyed using the Host header, while in HTTP 2 and HTTP 3 it is conveyed using the :authority 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 <bcp14>MUST</bcp14> be normalized according to the rules in <xref section="4.2.3" sectionFormat="comma" target="HTTP"/>. Namely, the host name is normalized to lowercase and the default port is omitted.</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>
www.example.com
</artwork>
               </figure>
               <t>And the following signature base line:</t>
               <figure>
                  <artwork>
"@authority": www.example.com
</artwork>
               </figure>
               <t>The <spanx style="verb">@authority</spanx> derived component <bcp14>SHOULD</bcp14> be used instead of signing the Host header directly, see <xref target="security-not-fields"/>.</t>
            </section>
            <section anchor="content-request-scheme">
               <name>Scheme</name>
               <t>The <spanx style="verb">@scheme</spanx> derived component refers to the scheme of the target URL of the HTTP request message. The component value is the scheme as a lowercase string as defined in <xref section="4.2" sectionFormat="comma" target="HTTP"/>. While the scheme itself is case-insensitive, it <bcp14>MUST</bcp14> be normalized to lowercase for inclusion in the signature base.</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> component value:</t>
               <figure>
                  <artwork>
http
</artwork>
               </figure>
               <t>And the following signature base line:</t>
               <figure>
                  <artwork>
"@scheme": http
</artwork>
               </figure>
            </section>
            <section anchor="content-request-target">
               <name>Request Target</name>
               <t>The <spanx style="verb">@request-target</spanx> derived component refers to the full request target of the HTTP request message, as defined in <xref section="7.1" sectionFormat="comma" target="HTTP"/>. The component value of the request target can take different forms, depending on the type of request, as described below.</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 <bcp14>NOT RECOMMENDED</bcp14> that this component 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>
/path?param=value
</artwork>
               </figure>
               <t>And the following signature base line:</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>
https://www.example.com/path?param=value
</artwork>
               </figure>
               <t>And the following signature base line:</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>
www.example.com:80
</artwork>
               </figure>
               <t>And the following signature base line:</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>
*
</artwork>
               </figure>
               <t>And the following signature base line:</t>
               <figure>
                  <artwork>
"@request-target": *
</artwork>
               </figure>
            </section>
            <section anchor="content-request-path">
               <name>Path</name>
               <t>The <spanx style="verb">@path</spanx> derived component 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 section="4.2.3" sectionFormat="comma" target="HTTP"/>. 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.</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> component value:</t>
               <figure>
                  <artwork>
/path
</artwork>
               </figure>
               <t>And the following signature base line:</t>
               <figure>
                  <artwork>
"@path": /path
</artwork>
               </figure>
            </section>
            <section anchor="content-request-query">
               <name>Query</name>
               <t>The <spanx style="verb">@query</spanx> derived component 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 section="4.2.3" sectionFormat="comma" target="HTTP"/>. Namely, percent-encoded octets are decoded.</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> component value:</t>
               <figure>
                  <artwork>
?param=value&amp;foo=bar&amp;baz=batman
</artwork>
               </figure>
               <t>And the following signature base line:</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> component value:</t>
               <figure>
                  <artwork>
?queryString
</artwork>
               </figure>
               <t>And the following signature base line:</t>
               <figure>
                  <artwork>
"@query": ?queryString
</artwork>
               </figure>
               <t>If the query string is absent from the request message, the value is the leading <spanx style="verb">?</spanx> character alone:</t>
               <figure>
                  <artwork>
?
</artwork>
               </figure>
               <t>Resulting in the following signature base line:</t>
               <figure>
                  <artwork>
"@query": ?
</artwork>
               </figure>
            </section>
            <section anchor="content-request-query-param">
               <name>Query Parameters</name>
               <t>If a request target URI uses HTML form parameters in the query string as defined in <xref target="HTMLURL">HTMLURL, Section 5</xref>, the <spanx style="verb">@query-param</spanx> derived component allows addressing of individual query parameters. The query parameters <bcp14>MUST</bcp14> be parsed according to <xref target="HTMLURL">HTMLURL, Section 5.1</xref>, resulting in a list of (<spanx style="verb">nameString</spanx>, <spanx style="verb">valueString</spanx>) tuples. The <bcp14>REQUIRED</bcp14>
                  <spanx style="verb">name</spanx> parameter of each component identifier contains the <spanx style="verb">nameString</spanx> of a single query parameter as a String value. Several different named query parameters <bcp14>MAY</bcp14> be included in the covered components. Single named parameters <bcp14>MAY</bcp14> 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">HTMLURL, Section 5.1</xref>, 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 query parameter is named as a covered component but it does not occur in the query parameters, this <bcp14>MUST</bcp14> cause an error in the signature base generation.</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> component values:</t>
               <t>
                  <em>baz</em>: <spanx style="verb">batman</spanx>
               </t>
               <t>
                  <em>qux</em>: an empty string</t>
               <t>
                  <em>param</em>: <spanx style="verb">value</spanx>
               </t>
               <t>And the following signature base lines:</t>
               <figure>
                  <artwork>
NOTE: '\' line wrapping per RFC 8792

"@query-param";name="baz": batman
"@query-param";name="qux": \

"@query-param";name="param": value
</artwork>
               </figure>
               <t>If a parameter name occurs multiple times in a request, all parameter values of that name <bcp14>MUST</bcp14> be included in separate signature base lines in the order in which the parameters occur in the target URI. Note that in some implementations, the order of parsed query parameters is not stable, and this situation could lead to unexpected results. If multiple parameters are common within an application, it is <bcp14>RECOMMENDED</bcp14> to sign the entire query string using the <spanx style="verb">@query</spanx> component identifier defined in <xref target="content-request-query"/>.</t>
            </section>
            <section anchor="content-status-code">
               <name>Status Code</name>
               <t>The <spanx style="verb">@status</spanx> derived component refers to the three-digit numeric HTTP status code of a response message as defined in <xref section="15" sectionFormat="comma" target="HTTP"/>. The component value is the serialized three-digit integer of the HTTP status code, with no descriptive text.</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> component value:</t>
               <figure>
                  <artwork>
200
</artwork>
               </figure>
               <t>And the following signature base line:</t>
               <figure>
                  <artwork>
"@status": 200
</artwork>
               </figure>
               <t>The <spanx style="verb">@status</spanx> component identifier <bcp14>MUST NOT</bcp14> be used in a request message.</t>
            </section>
         </section>
         <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, consisting of the ordered set of covered components and the ordered set of parameters including a timestamp of signature creation, identifiers for verification key material, and other utilities. This metadata is represented by a special derived component for signature parameters, and it is treated slightly differently from other derived components. Specifically, the signature parameters message component is <bcp14>REQUIRED</bcp14> as the last line of the <xref target="create-sig-input">signature base</xref>, and the component identifier <bcp14>MUST NOT</bcp14> be enumerated within the set of covered components for any signature, including itself.</t>
            <t>The signature parameters component name 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 ordered 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 Integer UNIX timestamp value. Sub-second precision is not supported. Inclusion of this parameter is <bcp14>RECOMMENDED</bcp14>.</t>
                  <t>
                     <spanx style="verb">expires</spanx>: Expiration time as an Integer UNIX timestamp value. Sub-second precision is not supported.</t>
                  <t>
                     <spanx style="verb">nonce</spanx>: A random unique value generated for this signature as a String value.</t>
                  <t>
                     <spanx style="verb">alg</spanx>: The HTTP message signature algorithm from the HTTP Message Signature Algorithm Registry, as a String value.</t>
                  <t>
                     <spanx style="verb">keyid</spanx>: The identifier for the key material as a String value.</t>
                  <t>
                     <spanx style="verb">tag</spanx>: An application-specific tag for the signature as a String value. This value is used by applications to help identify signatures relevant for specific applications or protocols.</t>
               </list>
            </t>
            <t>Additional parameters can be defined in the <xref target="iana-param-contents">HTTP Signature Parameters Registry</xref>. Note that there is no general ordering to the parameters, but once an ordering is chosen for a given set of parameters, it cannot be changed without altering the signature parameters value.</t>
            <t>The signature parameters component value is serialized as a parameterized Inner List using the rules in <xref section="4" sectionFormat="of" target="STRUCTURED-FIELDS"/> 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, not including the <spanx style="verb">@signature-params</spanx> component identifier itself. Once this order is chosen, it cannot be changed. This order <bcp14>MUST</bcp14> be the same order as used in creating the signature base (<xref target="create-sig-input"/>).</t>
                  <t>Serialize the component identifiers of the covered components, including all parameters, as an ordered Inner List of String values according to <xref section="4.1.1.1" sectionFormat="of" target="STRUCTURED-FIELDS"/> and append this to the output. Note that the component identifiers can include their own parameters, and these parameters are ordered sets. Once an order is chosen for a component's parameters, the order cannot be changed.</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 Inner List in order according to <xref section="4.1.1.2" sectionFormat="of" target="STRUCTURED-FIELDS"/>, 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 Inner List serialization from <xref section="4.1.1.1" sectionFormat="of" target="STRUCTURED-FIELDS"/> is used for the covered component value instead of the List serialization from <xref section="4.1.1" sectionFormat="of" target="STRUCTURED-FIELDS"/> in order to facilitate parallelism with this value's inclusion in the Signature-Input field, as discussed in <xref target="signature-input-header"/>.</t>
            <t>This example shows the serialized component value for the parameters of an example message signature:</t>
            <figure>
               <artwork>
NOTE: '\' line wrapping per RFC 8792

("@target-uri" "@authority" "date" "cache-control")\
  ;keyid="test-key-rsa-pss";alg="rsa-pss-sha512";\
  created=1618884475;expires=1618884775
</artwork>
            </figure>
            <t>Note that an HTTP message could contain <xref target="signature-multiple">multiple signatures</xref>, but only the signature parameters used for a single signature are included in a given signature parameters entry.</t>
         </section>
         <section anchor="content-request-response">
            <name>Request-Response Signature Binding</name>
            <t>When a request message results in a signed response message, the signer can include portions of the request message in the signature base by adding the <spanx style="verb">req</spanx> parameter to the component identifier.</t>
            <dl>
               <dt>
                  <spanx style="verb">req</spanx>
               </dt>
               <dd>
                  <t>A boolean flag indicating that the component value is derived from the request that triggered this response message and not from the response message directly.</t>
               </dd>
            </dl>
            <t>This parameter can be applied to both HTTP fields and derived components that target the request, with the same semantics. The component value for a message component using this parameter is calculated in the same manner as it is normally, but data is pulled from the request message instead of the target response message to which the signature is applied.</t>
            <t>Note that the same component name <bcp14>MAY</bcp14> be included with and without the <spanx style="verb">req</spanx> parameter in a single signature base, indicating the same named component from both the request and response message.</t>
            <t>The <spanx style="verb">req</spanx> parameter <bcp14>MAY</bcp14> be combined with other parameters as appropriate for the component identifier, such as the <spanx style="verb">key</spanx> parameter for a dictionary field.</t>
            <t>For example, when serving a response for this signed request:</t>
            <figure>
               <sourcecode type="http-message" x:line-folding="\">
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-Digest: sha-512=:WZDPaVn/7XgHaAy8pmojAkGWoRx2UFChF41A2svX+T\
  aPm+AbwAgBWnrIiYllu7BNNyealdVLvRwEmTHWXvJwew==:
Content-Length: 18
Signature-Input: sig1=("@method" "@authority" "@path" \
  "content-digest" "content-length" "content-type")\
  ;created=1618884475;keyid="test-key-rsa-pss"
Signature:  sig1=:LAH8BjcfcOcLojiuOBFWn0P5keD3xAOuJRGziCLuD8r5MW9S0\
  RoXXLzLSRfGY/3SF8kVIkHjE13SEFdTo4Af/fJ/Pu9wheqoLVdwXyY/UkBIS1M8Br\
  c8IODsn5DFIrG0IrburbLi0uCc+E2ZIIb6HbUJ+o+jP58JelMTe0QE3IpWINTEzpx\
  jqDf5/Df+InHCAkQCTuKsamjWXUpyOT1Wkxi7YPVNOjW4MfNuTZ9HdbD2Tr65+BXe\
  TG9ZS/9SWuXAc+BZ8WyPz0QRz//ec3uWXd7bYYODSjRAxHqX+S1ag3LZElYyUKaAI\
  jZ8MGOt4gXEwCSLDv/zqxZeWLj/PDkn6w==:

{"hello": "world"}
</sourcecode>
            </figure>
            <t>This would result in the following unsigned response message:</t>
            <figure>
               <sourcecode type="http-message">
HTTP/1.1 503 Service Unavailable
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>To cryptographically link the response to the request, the server signs the response with its own key and includes the method, authority, and the signature value <spanx style="verb">sig1</spanx> from the request in the covered components of the response. The signature base for this example is:</t>
            <figure>
               <artwork>
NOTE: '\' line wrapping per RFC 8792

"@status": 503
"content-length": 62
"content-type": application/json
"signature";req;key="sig1": :LAH8BjcfcOcLojiuOBFWn0P5keD3xAOuJRGziC\
  LuD8r5MW9S0RoXXLzLSRfGY/3SF8kVIkHjE13SEFdTo4Af/fJ/Pu9wheqoLVdwXyY\
  /UkBIS1M8Brc8IODsn5DFIrG0IrburbLi0uCc+E2ZIIb6HbUJ+o+jP58JelMTe0QE\
  3IpWINTEzpxjqDf5/Df+InHCAkQCTuKsamjWXUpyOT1Wkxi7YPVNOjW4MfNuTZ9Hd\
  bD2Tr65+BXeTG9ZS/9SWuXAc+BZ8WyPz0QRz//ec3uWXd7bYYODSjRAxHqX+S1ag3\
  LZElYyUKaAIjZ8MGOt4gXEwCSLDv/zqxZeWLj/PDkn6w==:
"@authority";req: example.com
"@method";req: POST
"@signature-params": ("@status" "content-length" "content-type" \
  "signature";req;key="sig1" "@authority";req "@method";req)\
  ;created=1618884479;keyid="test-key-ecc-p256"
</artwork>
            </figure>
            <t>The signed response message is:</t>
            <figure>
               <sourcecode type="http-message" x:line-folding="\">
HTTP/1.1 503 Service Unavailable
Date: Tue, 20 Apr 2021 02:07:56 GMT
Content-Type: application/json
Content-Length: 62
Signature-Input: reqres=("@status" "content-length" "content-type" \
  "signature";req;key="sig1" "@authority";req "@method";req)\
  ;created=1618884479;keyid="test-key-ecc-p256"
Signature: reqres=:mh17P4TbYYBmBwsXPT4nsyVzW4Rp9Fb8WcvnfqKCQLoMvzOB\
  LD/n32tL/GPW6XE5GAS5bdsg1khK6lBzV1Cx/Q==:

{"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 <bcp14>MUST</bcp14> keep the original signature value around long enough to validate the signature of the response that uses this component identifier.</t>
            <t>Note that the ECDSA algorithm in use here is non-deterministic, meaning a different signature value will be created every time the algorithm is run. The signature value provided here can be validated against the given keys, but newly-generated signature values are not expected to match the example. See <xref target="security-nondeterministic"/>.</t>
            <t>The <spanx style="verb">req</spanx> parameter <bcp14>MUST NOT</bcp14> be used in a signature that targets a request message.</t>
         </section>
         <section anchor="create-sig-input">
            <name>Creating the Signature Base</name>
            <t>The signature base is a US-ASCII string containing the canonicalized HTTP message components covered by the signature. The input to the signature base creation algorithm is the ordered set of covered component identifiers and their associated values, along with any additional signature parameters discussed in <xref target="signature-params"/>.</t>
            <t>Component identifiers are serialized using the production grammar defined by <xref section="4" sectionFormat="comma" target="STRUCTURED-FIELDS"/>. The component identifier has a component name, which is a String Item value serialized using the <spanx style="verb">sf-string</spanx> ABNF rule. The component identifier <bcp14>MAY</bcp14> also include defined parameters which are serialized using the <spanx style="verb">parameters</spanx> ABNF rule. The signature parameters line defined in <xref target="signature-params"/> follows this same pattern, but the component identifier is a String Item with a fixed value and no parameters, and the component value is always an Inner List with optional parameters.</t>
            <t>Note that this means the serialization of the component name 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">"@authority"</spanx>, <spanx style="verb">"@signature-params"</spanx>, or <spanx style="verb">"example-dictionary";key="foo"</spanx>.</t>
            <t>The output is the ordered set of bytes that form the signature base, which conforms to the following ABNF:</t>
            <figure>
               <sourcecode type="abnf">
signature-base = *( signature-base-line LF ) signature-params-line
signature-base-line = component-identifier ":" SP
    ( derived-component-value / field-content ) ; no obs-fold
component-identifier = component-name parameters
component-name = sf-string
derived-component-value = *( VCHAR / SP )
signature-params-line = DQUOTE "@signature-params" DQUOTE
     ":" SP inner-list
</sourcecode>
            </figure>
            <t>To create the signature base, the signer or verifier concatenates together entries for each component identifier in the signature's covered components (including their parameters) using the following algorithm. All errors produced as described immediately <bcp14>MUST</bcp14> fail the algorithm with no signature output base output.</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> ABNF rule. Note that this serialization places the component name in double quotes and appends any parameters outside of the quotes.</t>
                        <t>Append a single colon <spanx style="verb">:</spanx>
                        </t>
                        <t>Append a single space " "</t>
                        <t>Determine the component value for the component identifier. <list style="symbols">
                              <t>If the component identifier has a parameter that is not understood, produce an error.</t>
                              <t>If the component identifier has several incompatible parameters, such as <spanx style="verb">bs</spanx> and <spanx style="verb">sf</spanx>, produce an error.</t>
                              <t>If the component identifier contains the <spanx style="verb">req</spanx> parameter and the target message is a request, produce an error.</t>
                              <t>If the component identifier contains the <spanx style="verb">req</spanx> parameter and the target message is a response, the context for the component value is the related request message of the target response message. Otherwise, the context for the component value is the target message.</t>
                              <t>If the component name starts with an "at" character (<spanx style="verb">@</spanx>), derive the component's value from the message according to the specific rules defined for the derived component, as in <xref target="derived-components"/>, including processing of any known valid parameters. If the derived component name is unknown or the value cannot be derived, produce an error.</t>
                              <t>If the component name does not start with an "at" character (<spanx style="verb">@</spanx>), canonicalize the HTTP field value as described in <xref target="http-header"/>, including processing of any known valid parameters. If the field cannot be found in the message, or the value cannot be obtained in the context, produce an error.</t>
                           </list>
                        </t>
                        <t>Append the covered component's canonicalized component value.</t>
                        <t>Append a single newline <spanx style="verb">\n</spanx>
                        </t>
                     </list>
                  </t>
                  <t>Append the signature parameters component (<xref target="signature-params"/>) according to the <spanx style="verb">signature-params-line</spanx> rule 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. the exact value <spanx style="verb">"@signature-params"</spanx> (including double quotes)</t>
                        <t>Append a single colon <spanx style="verb">:</spanx>
                        </t>
                        <t>Append a single space " "</t>
                        <t>Append the signature parameters' canonicalized component value as defined in <xref target="signature-params"/>, i.e. an Inner List structured field value with parameters</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 <bcp14>MUST</bcp14> produce an error and not create a signature base. Such situations are included but not limited to:</t>
            <t>
               <list style="symbols">
                  <t>The signer or verifier does not understand the derived component name.</t>
                  <t>The component name identifies a field that is not present in the message or whose value is malformed.</t>
                  <t>The component identifier includes a parameter that is unknown or does not apply to the component identifier to which it is attached.</t>
                  <t>The component identifier indicates that a structured field serialization is used (via the <spanx style="verb">sf</spanx> parameter), but the field in question is known to not be a structured field or the type of structured field is not known to the implementation.</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 or a named query parameter identifier that references a member that is not present in the component value, or whose value is malformed. E.g., the identifier is <spanx style="verb">"example-dict";key="c"</spanx> and the value of the Example-Dict header field is <spanx style="verb">a=1, b=2</spanx>, which does not have the <spanx style="verb">c</spanx> value.</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" x:line-folding="\">
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-Digest: sha-512=:WZDPaVn/7XgHaAy8pmojAkGWoRx2UFChF41A2svX+T\
  aPm+AbwAgBWnrIiYllu7BNNyealdVLvRwEmTHWXvJwew==:
Content-Length: 18

{"hello": "world"}
</sourcecode>
            </figure>
            <t>The covered components consist of the <spanx style="verb">@method</spanx>, <spanx style="verb">@authority</spanx>, and <spanx style="verb">@path</spanx> derived components followed by the <spanx style="verb">Content-Digest</spanx>, <spanx style="verb">Content-Length</spanx>, and <spanx style="verb">Content-Type</spanx> HTTP header fields, in order. The signature parameters consist of a creation timestamp of <spanx style="verb">1618884473</spanx> and a key identifier of <spanx style="verb">test-key-rsa-pss</spanx>. Note that no explicit <spanx style="verb">alg</spanx> parameter is given here since the verifier is known by the application to use the RSA PSS algorithm based on the identified key. The signature base for this message with these parameters is:</t>
            <figure anchor="example-sig-input" title="Non-normative example Signature Base">
               <sourcecode name="example-sig-input" type="http-message" x:line-folding="\">
"@method": POST
"@authority": example.com
"@path": /foo
"content-digest": sha-512=:WZDPaVn/7XgHaAy8pmojAkGWoRx2UFChF41A2svX\
  +TaPm+AbwAgBWnrIiYllu7BNNyealdVLvRwEmTHWXvJwew==:
"content-length": 18
"content-type": application/json
"@signature-params": ("@method" "@authority" "@path" \
  "content-digest" "content-length" "content-type")\
  ;created=1618884473;keyid="test-key-rsa-pss"
</sourcecode>
            </figure>
            <t>Note that the example signature base here, or anywhere else within this specification, does not include the final newline that ends the displayed example.</t>
         </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>Creation of an HTTP message signature is a process that takes as its input the message context and the requirements for the application. The output is a signature value and set of signature parameters that can be communicated to the verifier by adding them to the message.</t>
            <t>In order to create a signature, a signer <bcp14>MUST</bcp14> follow the following algorithm:</t>
            <t>
               <list style="numbers">
                  <t>The signer chooses an HTTP signature algorithm and key material for signing. The signer <bcp14>MUST</bcp14> 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. The expiration is a hint to the verifier, expressing the time at which the signer is no longer willing to vouch for the safety of the signature.</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 Signature-Input field as described in <xref target="signature-input-header"/>. <list style="symbols">
                        <t>Once an order of covered components is chosen, the order <bcp14>MUST NOT</bcp14> change for the life of the signature.</t>
                        <t>Each covered component identifier <bcp14>MUST</bcp14> be either an HTTP field in the message context <xref target="http-header"/> or a derived component listed in <xref target="derived-components"/> or its associated registry.</t>
                        <t>Signers of a request <bcp14>SHOULD</bcp14> 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 <bcp14>SHOULD</bcp14> 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> derived component identifier <bcp14>MUST NOT</bcp14> be listed in the list of covered component identifiers. The derived component is required to always be the last line in the signature base, ensuring that a signature always covers its own metadata and the metadata cannot be substituted.</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 base using these parameters and the signature base creation algorithm. (<xref target="create-sig-input"/>)</t>
                  <t>The signer uses the <spanx style="verb">HTTP_SIGN</spanx> primitive function to sign the signature base with the chosen signing algorithm using the key material chosen by the signer. The <spanx style="verb">HTTP_SIGN</spanx> primitive and several concrete applications of 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 Signature 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 base is signed with the <spanx style="verb">test-key-rsa-pss</spanx> key in <xref target="example-key-rsa-pss-test"/> and the RSA PSS algorithm described in <xref target="method-rsa-pss-sha512"/>, giving 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

HIbjHC5rS0BYaa9v4QfD4193TORw7u9edguPh0AW3dMq9WImrlFrCGUDih47vAxi4L2\
YRZ3XMJc1uOKk/J0ZmZ+wcta4nKIgBkKq0rM9hs3CQyxXGxHLMCy8uqK488o+9jrptQ\
+xFPHK7a9sRL1IXNaagCNN3ZxJsYapFj+JXbmaI5rtAdSfSvzPuBCh+ARHBmWuNo1Uz\
VVdHXrl8ePL4cccqlazIJdC4QEjrF+Sn4IxBQzTZsL9y9TP5FsZYzHvDqbInkTNigBc\
E9cKOYNFCn4D/WM7F6TNuZO9EgtzepLWcjTymlHzK7aXq6Am6sfOrpIC49yXjj3ae6H\
RalVc/g==
</artwork>
            </figure>
            <t>Note that the RSA PSS algorithm in use here is non-deterministic, meaning a different signature value will be created every time the algorithm is run. The signature value provided here can be validated against the given keys, but newly-generated signature values are not expected to match the example. See <xref target="security-nondeterministic"/>.</t>
         </section>
         <section anchor="verify">
            <name>Verifying a Signature</name>
            <t>Verification of an HTTP message signature is a process that takes as its input the message context (including Signature and Signature-Input fields) and the requirements for the application. The output of the verification is either a positive verification or an error.</t>
            <t>In order to verify a signature, a verifier <bcp14>MUST</bcp14> follow the following algorithm:</t>
            <t>
               <list style="numbers">
                  <t>Parse the Signature and Signature-Input fields as described in <xref target="signature-input-header"/> and <xref target="signature-header"/>, 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 based on the policy and configuration of the verifier. If an applicable signature is not found, produce an error.</t>
                        <t>If the chosen Signature value does not have a corresponding Signature-Input value, produce an error.</t>
                     </list>
                  </t>
                  <t>Parse the values of the chosen Signature-Input field as a parameterized Inner List to get the ordered list of covered components and the signature parameters for the signature to be verified.</t>
                  <t>Parse the value of the corresponding Signature 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 <bcp14>MUST</bcp14> 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 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 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 is specified in more than 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 <bcp14>MUST</bcp14> be the same. If the algorithms are not the same, the verifier <bcp14>MUST</bcp14> fail the verification.</t>
                     </list>
                  </t>
                  <t>Use the received HTTP message and the parsed signature parameters to re-create the signature base, using the algorithm defined in <xref target="create-sig-input"/>. The value of the <spanx style="verb">@signature-params</spanx> input is the value of the Signature-Input field for this signature serialized according to the rules described in <xref target="signature-params"/>. Note that this does not include the signature's label from the Signature-Input field.</t>
                  <t>If the key material is appropriate for the algorithm, apply the appropriate <spanx style="verb">HTTP_VERIFY</spanx> cryptographic verification algorithm to the signature, recalculated signature base, key material, signature value. The <spanx style="verb">HTTP_VERIFY</spanx> primitive and several concrete algorithms are defined in <xref target="signature-methods"/>.</t>
                  <t>The results of the verification algorithm function are the final results of the cryptographic verification function.</t>
               </list>
            </t>
            <t>If any of the above steps fail or produce an error, the signature validation fails.</t>
            <t>For example, verifying the signature with the key <spanx style="verb">sig1</spanx> of the following message with the <spanx style="verb">test-key-rsa-pss</spanx> key in <xref target="example-key-rsa-pss-test"/> and the RSA PSS algorithm described in <xref target="method-rsa-pss-sha512"/>:</t>
            <figure>
               <sourcecode type="http-message" x:line-folding="\">
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-Digest: sha-512=:WZDPaVn/7XgHaAy8pmojAkGWoRx2UFChF41A2svX+T\
  aPm+AbwAgBWnrIiYllu7BNNyealdVLvRwEmTHWXvJwew==:
Content-Length: 18
Signature-Input: sig1=("@method" "@authority" "@path" \
  "content-digest" "content-length" "content-type")\
  ;created=1618884473;keyid="test-key-rsa-pss"
Signature: sig1=:HIbjHC5rS0BYaa9v4QfD4193TORw7u9edguPh0AW3dMq9WImrl\
  FrCGUDih47vAxi4L2YRZ3XMJc1uOKk/J0ZmZ+wcta4nKIgBkKq0rM9hs3CQyxXGxH\
  LMCy8uqK488o+9jrptQ+xFPHK7a9sRL1IXNaagCNN3ZxJsYapFj+JXbmaI5rtAdSf\
  SvzPuBCh+ARHBmWuNo1UzVVdHXrl8ePL4cccqlazIJdC4QEjrF+Sn4IxBQzTZsL9y\
  9TP5FsZYzHvDqbInkTNigBcE9cKOYNFCn4D/WM7F6TNuZO9EgtzepLWcjTymlHzK7\
  aXq6Am6sfOrpIC49yXjj3ae6HRalVc/g==:

{"hello": "world"}
</sourcecode>
            </figure>
            <t>With the additional requirements that at least the method, authority, path, content-digest, content-length, and content-type be signed, and that the signature creation timestamp is recent enough at the time of verification, the verification passes.</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 <bcp14>MAY</bcp14> 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., Authorization, Digest).</t>
                     <t>Enforcing a maximum signature age from the time of the <spanx style="verb">created</spanx> time stamp.</t>
                     <t>Rejection of signatures past the expiration time in the <spanx style="verb">expires</spanx> time stamp. Note that the expiration time is a hint from the signer and that a verifier can always reject a signature ahead of its expiration time.</t>
                     <t>Prohibition of certain signature metadata parameters, such as runtime algorithm signaling with the <spanx style="verb">alg</spanx> parameter when the algorithm is determined from the key information.</t>
                     <t>Ensuring successful dereferencing of the <spanx style="verb">keyid</spanx> parameter to valid and appropriate key material.</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 the <spanx style="verb">nonce</spanx> parameter.</t>
                     <t>Requiring an application-specific value for the <spanx style="verb">tag</spanx> parameter.</t>
                  </list>
               </t>
               <t>Application-specific requirements are expected and encouraged. When an application defines additional requirements, it <bcp14>MUST</bcp14> enforce them during the signature verification process, and signature verification <bcp14>MUST</bcp14> fail if the signature does not conform to the application's requirements.</t>
               <t>Applications <bcp14>MUST</bcp14> enforce the requirements defined in this document. Regardless of use case, applications <bcp14>MUST NOT</bcp14> accept signatures that do not conform to these requirements.</t>
            </section>
         </section>
         <section anchor="signature-methods">
            <name>Signature Algorithms</name>
            <t>An HTTP Message signature <bcp14>MUST</bcp14> use a cryptographic digital signature or MAC method that is appropriate for the key material, environment, and needs of the signer and verifier. This specification does not strictly limit the available signature algorithms, and any signature algorithm that meets these basic requirements <bcp14>MAY</bcp14> be used by an application of HTTP message signatures.</t>
            <t>Each signing method <spanx style="verb">HTTP_SIGN</spanx> takes as its input the signature base defined in <xref target="create-sig-input"/> as a byte array (<spanx style="verb">M</spanx>), the signing key material (<spanx style="verb">Ks</spanx>), and outputs the signature output as a byte array (<spanx style="verb">S</spanx>):</t>
            <figure>
               <artwork>
HTTP_SIGN (M, Ks)  -&gt;  S
</artwork>
            </figure>
            <t>Each verification method <spanx style="verb">HTTP_VERIFY</spanx> takes as its input the re-generated signature base defined in <xref target="create-sig-input"/> as a byte array (<spanx style="verb">M</spanx>), the verification key material (<spanx style="verb">Kv</spanx>), and the presented signature to be verified as a byte array (<spanx style="verb">S</spanx>) and outputs the verification result (<spanx style="verb">V</spanx>) as a boolean:</t>
            <figure>
               <artwork>
HTTP_VERIFY (M, Kv, S) -&gt; V
</artwork>
            </figure>
            <t>The following sections contain several common signature algorithms and demonstrates how these cryptographic primitives map to the <spanx style="verb">HTTP_SIGN</spanx> and <spanx style="verb">HTTP_VERIFY</spanx> definitions here. Which method to use can be communicated through the explicit algorithm signature parameter <spanx style="verb">alg</spanx> defined in <xref target="signature-params"/>, by reference to the key material, or through mutual agreement between the signer and verifier. Signature algorithms selected using the <spanx style="verb">alg</spanx> parameter <bcp14>MUST</bcp14> use values from the <xref target="hsa-registry">HTTP Message Signature Algorithms Registry</xref>.</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 defined in <xref target="RFC8017"/> with the signer's private signing key (<spanx style="verb">K</spanx>) and the signature base (<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 base 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 base (<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 base 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 indicate if the signature presented is valid.</t>
               <t>Note that the output of RSA PSS algorithms are non-deterministic, and therefore it is not correct to re-calculate a new signature on the signature base and compare the results to an existing signature. Instead, the verification algorithm defined here needs to be used. See <xref target="security-nondeterministic"/>.</t>
               <t>Use of this algorithm can be indicated at runtime using the <spanx style="verb">rsa-pss-sha512</spanx> value for the <spanx style="verb">alg</spanx> signature parameter.</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 defined in <xref target="RFC8017"/> with the signer's private signing key (<spanx style="verb">K</spanx>) and the signature base (<spanx style="verb">M</spanx>) (<xref target="create-sig-input"/>). The hash SHA-256 <xref target="RFC6234"/> is applied to the signature base 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 base (<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 base 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 indicate if the signature presented is valid.</t>
               <t>Use of this algorithm can be indicated at runtime using the <spanx style="verb">rsa-v1_5-sha256</spanx> value for the <spanx style="verb">alg</spanx> signature parameter.</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 base (<spanx style="verb">text</spanx>) (<xref target="create-sig-input"/>). The hash function SHA-256 <xref target="RFC6234"/> is applied to the signature base 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 bytewise to the value of the HTTP message signature, and the results of the comparison determine the validity of the signature presented.</t>
               <t>Use of this algorithm can be indicated at runtime using the <spanx style="verb">hmac-sha256</spanx> value for the <spanx style="verb">alg</spanx> signature parameter.</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 defined in <xref target="FIPS186-4"/> using curve P-256 with the signer's private signing key and the signature base (<xref target="create-sig-input"/>). The hash SHA-256 <xref target="RFC6234"/> is applied to the signature base to create the digest content to which the digital signature is applied, (<spanx style="verb">M</spanx>). The signature algorithm returns two integer values, <spanx style="verb">r</spanx> and <spanx style="verb">s</spanx>. These are both encoded as big-endian unsigned integers, zero-padded to 32-octets each. These encoded values are concatenated into a single 64-octet array consisting of the encoded value of <spanx style="verb">r</spanx> followed by the encoded value of <spanx style="verb">s</spanx>. The resulting concatenation of <spanx style="verb">(r, s)</spanx> is byte array of 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 defined in <xref target="FIPS186-4"/> using the public key portion of the verification key material and the signature base re-created as described in <xref target="verify"/>. The hash function SHA-256 <xref target="RFC6234"/> is applied to the signature base to create the digest content to which the signature verification function is applied, (<spanx style="verb">M</spanx>). The verifier extracts the HTTP message signature to be verified (<spanx style="verb">S</spanx>) as described in <xref target="verify"/>. This value is a 64-octet array consisting of the encoded values of <spanx style="verb">r</spanx> and <spanx style="verb">s</spanx> concatenated in order. These are both encoded in big-endian unsigned integers, zero-padded to 32-octets each. The resulting signature value <spanx style="verb">(r, s)</spanx> is used as input to the signature verification function. The results of the verification function indicate if the signature presented is valid.</t>
               <t>Note that the output of ECDSA algorithms are non-deterministic, and therefore it is not correct to re-calculate a new signature on the signature base and compare the results to an existing signature. Instead, the verification algorithm defined here needs to be used. See <xref target="security-nondeterministic"/>.</t>
               <t>Use of this algorithm can be indicated at runtime using the <spanx style="verb">ecdsa-p256-sha256</spanx> value for the <spanx style="verb">alg</spanx> signature parameter.</t>
            </section>
            <section anchor="method-ecdsa-p384-sha384">
               <name>ECDSA using curve P-384 DSS and SHA-384</name>
               <t>To sign using this algorithm, the signer applies the <spanx style="verb">ECDSA</spanx> algorithm defined in <xref target="FIPS186-4"/> using curve P-384 with the signer's private signing key and the signature base (<xref target="create-sig-input"/>). The hash SHA-384 <xref target="RFC6234"/> is applied to the signature base to create the digest content to which the digital signature is applied, (<spanx style="verb">M</spanx>). The signature algorithm returns two integer values, <spanx style="verb">r</spanx> and <spanx style="verb">s</spanx>. These are both encoded as big-endian unsigned integers, zero-padded to 48-octets each. These encoded values are concatenated into a single 96-octet array consisting of the encoded value of <spanx style="verb">r</spanx> followed by the encoded value of <spanx style="verb">s</spanx>. The resulting concatenation of <spanx style="verb">(r, s)</spanx> is byte array of 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 defined in <xref target="FIPS186-4"/> using the public key portion of the verification key material and the signature base re-created as described in <xref target="verify"/>. The hash function SHA-384 <xref target="RFC6234"/> is applied to the signature base to create the digest content to which the signature verification function is applied, (<spanx style="verb">M</spanx>). The verifier extracts the HTTP message signature to be verified (<spanx style="verb">S</spanx>) as described in <xref target="verify"/>. This value is a 96-octet array consisting of the encoded values of <spanx style="verb">r</spanx> and <spanx style="verb">s</spanx> concatenated in order. These are both encoded in big-endian unsigned integers, zero-padded to 48-octets each. The resulting signature value <spanx style="verb">(r, s)</spanx> is used as input to the signature verification function. The results of the verification function indicate if the signature presented is valid.</t>
               <t>Note that the output of ECDSA algorithms are non-deterministic, and therefore it is not correct to re-calculate a new signature on the signature base and compare the results to an existing signature. Instead, the verification algorithm defined here needs to be used. See <xref target="security-nondeterministic"/>.</t>
               <t>Use of this algorithm can be indicated at runtime using the <spanx style="verb">ecdsa-p384-sha384</spanx> value for the <spanx style="verb">alg</spanx> signature parameter.</t>
            </section>
            <section anchor="method-ed25519">
               <name>EdDSA using curve edwards25519</name>
               <t>To sign using this algorithm, the signer applies the <spanx style="verb">Ed25519</spanx> algorithm defined in <xref section="5.1.6" sectionFormat="of" target="RFC8032"/> with the signer's private signing key and the signature base (<xref target="create-sig-input"/>). The signature base is taken as the input message (<spanx style="verb">M</spanx>) with no pre-hash function. The signature is a 64-octet concatenation of <spanx style="verb">R</spanx> and <spanx style="verb">S</spanx> as specified in <xref section="5.1.6" sectionFormat="of" target="RFC8032"/>, and this is taken as a byte array for the HTTP message signature output used in <xref target="sign"/>.</t>
               <t>To verify using this algorithm, the signer applies the <spanx style="verb">Ed25519</spanx> algorithm defined in <xref section="5.1.7" sectionFormat="of" target="RFC8032"/> using the public key portion of the verification key material (<spanx style="verb">A</spanx>) and the signature base re-created as described in <xref target="verify"/>. The signature base is taken as the input message (<spanx style="verb">M</spanx>) with no pre-hash function. The signature to be verified is processed as the 64-octet concatenation of <spanx style="verb">R</spanx> and <spanx style="verb">S</spanx> as specified in <xref section="5.1.7" sectionFormat="of" target="RFC8032"/>. The results of the verification function indicate if the signature presented is valid.</t>
               <t>Use of this algorithm can be indicated at runtime using the <spanx style="verb">ed25519</spanx> value for the <spanx style="verb">alg</spanx> signature parameter.</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.</t>
               <t>For both signing and verification, the HTTP messages signature base (<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 base 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 <bcp14>MUST NOT</bcp14> be <spanx style="verb">none</spanx> and <bcp14>MUST NOT</bcp14> be any algorithm with a JOSE Implementation Requirement of <spanx style="verb">Prohibited</spanx>.</t>
               <t>JWA algorithm values from the JSON Web Signature and Encryption Algorithms Registry are not included as signature parameters. Typically, the JWS algorithm can be signaled using JSON Web Keys or other mechanisms common to JOSE implementations. In fact, and JWA algorithm values are not registered in the <xref target="hsa-registry">HTTP Message Signature Algorithms Registry</xref>, and so the explicit <spanx style="verb">alg</spanx> signature parameter is not used at all when using JOSE signing algorithms.</t>
            </section>
         </section>
      </section>
      <section anchor="including-a-message-signature-in-a-message">
         <name>Including a Message Signature in a Message</name>
         <t>HTTP message signatures can be included within an HTTP message via the Signature-Input and Signature fields, both defined within this specification.</t>
         <t>The Signature-Input field identifies the covered components and parameters that describe how the signature was generated, while the Signature field contains the signature value. Each field <bcp14>MAY</bcp14> contain multiple labeled values.</t>
         <t>An HTTP message signature is identified by a label within an HTTP message. This label <bcp14>MUST</bcp14> be unique within a given HTTP message and <bcp14>MUST</bcp14> be used in both the Signature-Input and Signature fields. The label is chosen by the signer, except where a specific label is dictated by protocol negotiations such as described in <xref target="request-signature"/>.</t>
         <t>An HTTP message signature <bcp14>MUST</bcp14> use both Signature-Input and Signature fields and each field <bcp14>MUST</bcp14> contain the same labels. The presence of a label in one field but not in the other is an error.</t>
         <section anchor="signature-input-header">
            <name>The Signature-Input HTTP Field</name>
            <t>The Signature-Input field is a Dictionary structured field defined in <xref section="3.2" sectionFormat="of" target="STRUCTURED-FIELDS"/> 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 key is the label that uniquely identifies the message signature within the context of the HTTP message. The member's value is the serialization of the covered components Inner List plus all signature metadata parameters identified by the label.</t>
            <figure>
               <sourcecode type="http-message" x:line-folding="\">
Signature-Input: sig1=("@method" "@target-uri" "@authority" \
  "content-digest" "cache-control");\
  created=1618884475;keyid="test-key-rsa-pss"
</sourcecode>
            </figure>
            <t>To facilitate signature validation, the Signature-Input field value <bcp14>MUST</bcp14> contain the same serialized value used in generating the signature base's <spanx style="verb">@signature-params</spanx> value defined in <xref target="signature-params"/>. Note that in a structured field value, list order and parameter order have to be preserved.</t>
            <t>The signer <bcp14>MAY</bcp14> include the Signature-Input 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="HTTP"/>, it is <bcp14>RECOMMENDED</bcp14> that the Signature-Input field be included only as a header to avoid signatures being inadvertently stripped from a message.</t>
            <t>Multiple Signature-Input fields <bcp14>MAY</bcp14> be included in a single HTTP message. The signature labels <bcp14>MUST</bcp14> be unique across all field values.</t>
         </section>
         <section anchor="signature-header">
            <name>The Signature HTTP Field</name>
            <t>The Signature field is a Dictionary structured field defined in <xref section="3.2" sectionFormat="of" target="STRUCTURED-FIELDS"/> containing one or more message signatures generated from components and context of the HTTP message. The member's key is the label that uniquely identifies the message signature within the context of the HTTP message. The member's value is a Byte Sequence containing the signature value for the message signature identified by the label.</t>
            <figure>
               <sourcecode type="http-message" x:line-folding="\">
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 <bcp14>MAY</bcp14> include the Signature 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="HTTP"/>, it is <bcp14>RECOMMENDED</bcp14> that the Signature field be included only as a header to avoid signatures being inadvertently stripped from a message.</t>
            <t>Multiple Signature fields <bcp14>MAY</bcp14> be included in a single HTTP message. The signature labels <bcp14>MUST</bcp14> be unique across all field values.</t>
         </section>
         <section anchor="signature-multiple">
            <name>Multiple Signatures</name>
            <t>Multiple distinct signatures <bcp14>MAY</bcp14> be included in a single message. Each distinct signature <bcp14>MUST</bcp14> have a unique label. These multiple signatures could be added all by the same signer or could come from several different signers. 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 non-normative example starts with a signed request from the client. A reverse proxy takes this request validates the client's signature.</t>
            <figure>
               <sourcecode type="http-message" x:line-folding="\">
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-Digest: sha-512=:WZDPaVn/7XgHaAy8pmojAkGWoRx2UFChF41A2svX+T\
  aPm+AbwAgBWnrIiYllu7BNNyealdVLvRwEmTHWXvJwew==:
Content-Length: 18
Signature-Input: sig1=("@method" "@authority" "@path" \
  "content-digest" "content-length" "content-type")\
  ;created=1618884475;keyid="test-key-rsa-pss"
Signature:  sig1=:LAH8BjcfcOcLojiuOBFWn0P5keD3xAOuJRGziCLuD8r5MW9S0\
  RoXXLzLSRfGY/3SF8kVIkHjE13SEFdTo4Af/fJ/Pu9wheqoLVdwXyY/UkBIS1M8Br\
  c8IODsn5DFIrG0IrburbLi0uCc+E2ZIIb6HbUJ+o+jP58JelMTe0QE3IpWINTEzpx\
  jqDf5/Df+InHCAkQCTuKsamjWXUpyOT1Wkxi7YPVNOjW4MfNuTZ9HdbD2Tr65+BXe\
  TG9ZS/9SWuXAc+BZ8WyPz0QRz//ec3uWXd7bYYODSjRAxHqX+S1ag3LZElYyUKaAI\
  jZ8MGOt4gXEwCSLDv/zqxZeWLj/PDkn6w==:

{"hello": "world"}
</sourcecode>
            </figure>
            <t>The proxy then alters the message before forwarding it on to the origin server, changing the target host and adding the Forwarded header field defined in <xref target="RFC7239"/>.</t>
            <figure>
               <sourcecode type="http-message" x:line-folding="\">
POST /foo?param=Value&amp;Pet=dog HTTP/1.1
Host: origin.host.internal.example
Date: Tue, 20 Apr 2021 02:07:56 GMT
Content-Type: application/json
Content-Digest: sha-512=:WZDPaVn/7XgHaAy8pmojAkGWoRx2UFChF41A2svX+T\
  aPm+AbwAgBWnrIiYllu7BNNyealdVLvRwEmTHWXvJwew==:
Content-Length: 18
Forwarded: for=192.0.2.123
Signature-Input: sig1=("@method" "@authority" "@path" \
  "content-digest" "content-length" "content-type")\
  ;created=1618884475;keyid="test-key-rsa-pss"
Signature:  sig1=:LAH8BjcfcOcLojiuOBFWn0P5keD3xAOuJRGziCLuD8r5MW9S0\
  RoXXLzLSRfGY/3SF8kVIkHjE13SEFdTo4Af/fJ/Pu9wheqoLVdwXyY/UkBIS1M8Br\
  c8IODsn5DFIrG0IrburbLi0uCc+E2ZIIb6HbUJ+o+jP58JelMTe0QE3IpWINTEzpx\
  jqDf5/Df+InHCAkQCTuKsamjWXUpyOT1Wkxi7YPVNOjW4MfNuTZ9HdbD2Tr65+BXe\
  TG9ZS/9SWuXAc+BZ8WyPz0QRz//ec3uWXd7bYYODSjRAxHqX+S1ag3LZElYyUKaAI\
  jZ8MGOt4gXEwCSLDv/zqxZeWLj/PDkn6w==:

{"hello": "world"}
</sourcecode>
            </figure>
            <t>The proxy includes the client's signature value under the label <spanx style="verb">sig1</spanx>, which the proxy signs in addition to the Forwarded field. Note that since the client's signature already covers the client's Signature-Input value for <spanx style="verb">sig1</spanx>, this value is transitively covered by the proxy's signature and need not be added explicitly. The proxy identifies its own key and algorithm and, in this example, includes an expiration for the signature to indicate to downstream systems that the proxy will not vouch for this signed message past this short time window. This results in a signature base of:</t>
            <figure>
               <artwork>
NOTE: '\' line wrapping per RFC 8792

"signature";key="sig1": :LAH8BjcfcOcLojiuOBFWn0P5keD3xAOuJRGziCLuD8\
  r5MW9S0RoXXLzLSRfGY/3SF8kVIkHjE13SEFdTo4Af/fJ/Pu9wheqoLVdwXyY/UkB\
  IS1M8Brc8IODsn5DFIrG0IrburbLi0uCc+E2ZIIb6HbUJ+o+jP58JelMTe0QE3IpW\
  INTEzpxjqDf5/Df+InHCAkQCTuKsamjWXUpyOT1Wkxi7YPVNOjW4MfNuTZ9HdbD2T\
  r65+BXeTG9ZS/9SWuXAc+BZ8WyPz0QRz//ec3uWXd7bYYODSjRAxHqX+S1ag3LZEl\
  YyUKaAIjZ8MGOt4gXEwCSLDv/zqxZeWLj/PDkn6w==:
"forwarded": for=192.0.2.123
"@signature-params": ("signature";key="sig1" "forwarded")\
  ;created=1618884480;expires=1618884540;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

G1WLTL4/9PGSKEQbSAMypZNk+I2dpLJ6qvl2JISahlP31OO/QEUd8/HdO2O7vYLi5k3\
JIiAK3UPK4U+kvJZyIUidsiXlzRI+Y2se3SGo0D8dLfhG95bKr6ukYXl60QHpsGRTfS\
iwdtvYKXGpKNrMlISJYd+oGrGRyI9gbCy0aFhc6I/okIMLeK4g9PgzpC3YTwhUQ98KI\
BNLWHgREfBgJxjPbxFlsgJ9ykPviLj8GKJ81HwsK3XM9P7WaS7fMGOt8h1kSqgkZQB9\
YqiIo+WhHvJa7iPy8QrYFKzx9BBEY6AwfStZAsXXz3LobZseyxsYcLJLs8rY0wVA9NP\
sxKrHGA==
</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" x:line-folding="\">
POST /foo?param=Value&amp;Pet=dog HTTP/1.1
Host: origin.host.internal.example
Date: Tue, 20 Apr 2021 02:07:56 GMT
Content-Type: application/json
Content-Digest: sha-512=:WZDPaVn/7XgHaAy8pmojAkGWoRx2UFChF41A2svX+T\
  aPm+AbwAgBWnrIiYllu7BNNyealdVLvRwEmTHWXvJwew==:
Content-Length: 18
Forwarded: for=192.0.2.123
Signature-Input: sig1=("@method" "@authority" "@path" \
    "content-digest" "content-length" "content-type")\
    ;created=1618884475;keyid="test-key-rsa-pss", \
  proxy_sig=("signature";key="sig1" "forwarded")\
    ;created=1618884480;expires=1618884540;keyid="test-key-rsa"\
    ;alg="rsa-v1_5-sha256"
Signature:  sig1=:LAH8BjcfcOcLojiuOBFWn0P5keD3xAOuJRGziCLuD8r5MW9S0\
    RoXXLzLSRfGY/3SF8kVIkHjE13SEFdTo4Af/fJ/Pu9wheqoLVdwXyY/UkBIS1M8\
    Brc8IODsn5DFIrG0IrburbLi0uCc+E2ZIIb6HbUJ+o+jP58JelMTe0QE3IpWINT\
    EzpxjqDf5/Df+InHCAkQCTuKsamjWXUpyOT1Wkxi7YPVNOjW4MfNuTZ9HdbD2Tr\
    65+BXeTG9ZS/9SWuXAc+BZ8WyPz0QRz//ec3uWXd7bYYODSjRAxHqX+S1ag3LZE\
    lYyUKaAIjZ8MGOt4gXEwCSLDv/zqxZeWLj/PDkn6w==:, \
  proxy_sig=:G1WLTL4/9PGSKEQbSAMypZNk+I2dpLJ6qvl2JISahlP31OO/QEUd8/\
    HdO2O7vYLi5k3JIiAK3UPK4U+kvJZyIUidsiXlzRI+Y2se3SGo0D8dLfhG95bKr\
    6ukYXl60QHpsGRTfSiwdtvYKXGpKNrMlISJYd+oGrGRyI9gbCy0aFhc6I/okIML\
    eK4g9PgzpC3YTwhUQ98KIBNLWHgREfBgJxjPbxFlsgJ9ykPviLj8GKJ81HwsK3X\
    M9P7WaS7fMGOt8h1kSqgkZQB9YqiIo+WhHvJa7iPy8QrYFKzx9BBEY6AwfStZAs\
    XXz3LobZseyxsYcLJLs8rY0wVA9NPsxKrHGA==:

{"hello": "world"}
</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="request-signature">
         <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 Accept-Signature field.</t>
         <t>When the Accept-Signature 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 <bcp14>SHOULD</bcp14> either be uncacheable or contain a Vary header field that lists Accept-Signature, in order to prevent a cache from returning a response with a signature intended for a different request.</t>
         <t>When the Accept-Signature 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 Accept-Signature field <bcp14>MUST</bcp14> include all labeled signatures indicated in the Accept-Header signature, each covering the same identified components of the Accept-Signature field.</t>
         <t>The sender of an Accept-Signature field <bcp14>MUST</bcp14> include only identifiers that are appropriate for the type of the target message. For example, if the target message is a request, the covered components can not include the <spanx style="verb">@status</spanx> component identifier.</t>
         <section anchor="accept-signature-header">
            <name>The Accept-Signature Field</name>
            <t>The Accept-Signature field is a Dictionary structured field defined in <xref section="3.2" sectionFormat="of" target="STRUCTURED-FIELDS"/> 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 label 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" x:line-folding="\">
Accept-Signature: sig1=("@method" "@target-uri" "@authority" \
  "content-digest" "cache-control");\
  keyid="test-key-rsa-pss"
</sourcecode>
            </figure>
            <t>The requested signature <bcp14>MAY</bcp14> include parameters, such as a desired algorithm or key identifier. These parameters <bcp14>MUST NOT</bcp14> include parameters that the signer is expected to generate, such as the <spanx style="verb">created</spanx> parameter.</t>
         </section>
         <section anchor="processing-an-accept-signature">
            <name>Processing an Accept-Signature</name>
            <t>The receiver of an Accept-Signature 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 key is taken as 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>Determine that the covered components are applicable to the target message. If not, the process fails and returns an error.</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 and generate any additional parameters necessary for completing the signature</t>
                        <t>Create the HTTP message signature over the target message</t>
                        <t>Create the Signature-Input and Signature values and associate them with the label</t>
                     </list>
                  </t>
                  <t>Optionally create any additional Signature-Input and Signature values, with unique labels not found in the Accept-Signature field</t>
                  <t>Combine all labeled Signature-Input and Signature values and attach both fields to the target message</t>
               </list>
            </t>
            <t>Note that by this process, a signature applied to a target message <bcp14>MUST</bcp14> have the same label, <bcp14>MUST</bcp14> have the same set of covered component, and <bcp14>MAY</bcp14> have additional parameters. Also note that the target message <bcp14>MAY</bcp14> include additional signatures not specified by the Accept-Signature field.</t>
         </section>
      </section>
      <section anchor="iana">
         <name>IANA Considerations</name>
         <t>IANA is requested to create three registries and to populate those registries with initial values as described in this section.</t>
         <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, and the registry of one combination of parameters does not imply the registration of other combinations.</t>
            <t>Algorithms added to this registry <bcp14>MUST NOT</bcp14> be aliases for other entries in the registry.</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 <bcp14>MUST</bcp14> 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 <bcp14>SHOULD NOT</bcp14> exceed 20 characters in length. The identifier <bcp14>MUST</bcp14> be unique within the context of the registry.</t>
                  </dd>
                  <dt>Description:</dt>
                  <dd>
                     <t>A brief description of the algorithm used to sign the signature base.</t>
                  </dd>
                  <dt>Status:</dt>
                  <dd>
                     <t>A brief text description of the status of the algorithm. The description <bcp14>MUST</bcp14> begin with one of "Active" or "Deprecated", and <bcp14>MAY</bcp14> provide further context or explanation as to the reason for the status.</t>
                  </dd>
                  <dt>Specification document(s):</dt>
                  <dd>
                     <t>Reference to the document(s) that specify the algorithm, 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>
               <texttable title="Initial contents of the HTTP Signature Algorithms Registry.">
                  <ttcol align="left">Algorithm Name</ttcol>
                  <ttcol align="left">Description</ttcol>
                  <ttcol align="left">Status</ttcol>
                  <ttcol align="left">Specification document(s)</ttcol>
                  <c>
                     <spanx style="verb">rsa-pss-sha512</spanx>
                  </c>
                  <c>RSASSA-PSS using SHA-512</c>
                  <c>Active</c>
                  <c>
                     <xref target="method-rsa-pss-sha512"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">rsa-v1_5-sha256</spanx>
                  </c>
                  <c>RSASSA-PKCS1-v1_5 using SHA-256</c>
                  <c>Active</c>
                  <c>
                     <xref target="method-rsa-v1_5-sha256"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">hmac-sha256</spanx>
                  </c>
                  <c>HMAC using SHA-256</c>
                  <c>Active</c>
                  <c>
                     <xref target="method-hmac-sha256"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">ecdsa-p256-sha256</spanx>
                  </c>
                  <c>ECDSA using curve P-256 DSS and SHA-256</c>
                  <c>Active</c>
                  <c>
                     <xref target="method-ecdsa-p256-sha256"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">ecdsa-p384-sha384</spanx>
                  </c>
                  <c>ECDSA using curve P-384 DSS and SHA-384</c>
                  <c>Active</c>
                  <c>
                     <xref target="method-ecdsa-p384-sha384"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">ed25519</spanx>
                  </c>
                  <c>Edwards Curve DSA using curve edwards25519</c>
                  <c>Active</c>
                  <c>
                     <xref target="method-ed25519"/> of RFC nnnn</c>
               </texttable>
            </section>
         </section>
         <section anchor="param-registry">
            <name>HTTP Signature Metadata Parameters Registry</name>
            <t>This document defines the signature parameters structure in <xref target="signature-params"/>, 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>
               <dl newline="true">
                  <dt>Name:</dt>
                  <dd>
                     <t>An identifier for the HTTP signature metadata parameter. The name <bcp14>MUST</bcp14> be an ASCII string that conforms to the <spanx style="verb">key</spanx> ABNF rule defined in <xref section="3.1.2" sectionFormat="of" target="STRUCTURED-FIELDS"/> and <bcp14>SHOULD NOT</bcp14> exceed 20 characters in length. The identifier <bcp14>MUST</bcp14> be unique within the context of the registry.</t>
                  </dd>
                  <dt>Description:</dt>
                  <dd>
                     <t>A brief description of the metadata parameter and what it represents.</t>
                  </dd>
                  <dt>Specification document(s):</dt>
                  <dd>
                     <t>Reference to the document(s) that specify the parameter, 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-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">Description</ttcol>
                  <ttcol align="left">Specification document(s)</ttcol>
                  <c>
                     <spanx style="verb">alg</spanx>
                  </c>
                  <c>Explicitly declared signature algorithm</c>
                  <c>
                     <xref target="signature-params"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">created</spanx>
                  </c>
                  <c>Timestamp of signature creation</c>
                  <c>
                     <xref target="signature-params"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">expires</spanx>
                  </c>
                  <c>Timestamp of proposed signature expiration</c>
                  <c>
                     <xref target="signature-params"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">keyid</spanx>
                  </c>
                  <c>Key identifier for the signing and verification keys used to create this signature</c>
                  <c>
                     <xref target="signature-params"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">nonce</spanx>
                  </c>
                  <c>A single-use nonce value</c>
                  <c>
                     <xref target="signature-params"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">tag</spanx>
                  </c>
                  <c>An application-specific tag for a signature</c>
                  <c>
                     <xref target="signature-params"/> of RFC nnnn</c>
               </texttable>
            </section>
         </section>
         <section anchor="content-registry">
            <name>HTTP Signature Derived Component Names Registry</name>
            <t>This document defines a method for canonicalizing HTTP message components, including components that can be derived from the context of the HTTP message outside of the HTTP fields. These derived components are identified by a unique string, known as the component name. Component names for derived components always start with the "@" (at) symbol to distinguish them from HTTP header fields. IANA is asked to create and maintain a new registry typed "HTTP Signature Derived Component Names" to record and maintain the set of non-field component names 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>
               <dl newline="true">
                  <dt>Name:</dt>
                  <dd>
                     <t>A name for the HTTP derived component. The name <bcp14>MUST</bcp14> begin with the <spanx style="verb">"@"</spanx> character followed by 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 <bcp14>SHOULD NOT</bcp14> exceed 20 characters in length. The name <bcp14>MUST</bcp14> be unique within the context of the registry.</t>
                  </dd>
                  <dt>Description:</dt>
                  <dd>
                     <t>A description of the derived component.</t>
                  </dd>
                  <dt>Status:</dt>
                  <dd>
                     <t>A brief text description of the status of the algorithm. The description <bcp14>MUST</bcp14> begin with one of "Active" or "Deprecated", and <bcp14>MAY</bcp14> provide further context or explanation as to the reason for the status.</t>
                  </dd>
                  <dt>Target:</dt>
                  <dd>
                     <t>The valid message targets for the derived parameter. <bcp14>MUST</bcp14> be one of the values "Request", "Response", or "Request, Response". The semantics of these are defined in <xref target="derived-components"/>.</t>
                  </dd>
                  <dt>Specification document(s):</dt>
                  <dd>
                     <t>Reference to the document(s) that specify the derived component, 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-content-contents">
               <name>Initial Contents</name>
               <t>The table below contains the initial contents of the HTTP Signature Derived Component Names Registry.</t>
               <texttable title="Initial contents of the HTTP Signature Derived Component Names Registry.">
                  <ttcol align="left">Name</ttcol>
                  <ttcol align="left">Description</ttcol>
                  <ttcol align="left">Status</ttcol>
                  <ttcol align="left">Target</ttcol>
                  <ttcol align="left">Specification document(s)</ttcol>
                  <c>
                     <spanx style="verb">@signature-params</spanx>
                  </c>
                  <c>Reserved for signature parameters line in signature base</c>
                  <c>Active</c>
                  <c>Request, Response</c>
                  <c>
                     <xref target="signature-params"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">@method</spanx>
                  </c>
                  <c>The HTTP request method</c>
                  <c>Active</c>
                  <c>Request</c>
                  <c>
                     <xref target="content-request-method"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">@authority</spanx>
                  </c>
                  <c>The HTTP authority, or target host</c>
                  <c>Active</c>
                  <c>Request</c>
                  <c>
                     <xref target="content-request-authority"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">@scheme</spanx>
                  </c>
                  <c>The URI scheme of the request URI</c>
                  <c>Active</c>
                  <c>Request</c>
                  <c>
                     <xref target="content-request-scheme"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">@target-uri</spanx>
                  </c>
                  <c>The full target URI of the request</c>
                  <c>Active</c>
                  <c>Request</c>
                  <c>
                     <xref target="content-target-uri"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">@request-target</spanx>
                  </c>
                  <c>The request target of the request</c>
                  <c>Active</c>
                  <c>Request</c>
                  <c>
                     <xref target="content-request-target"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">@path</spanx>
                  </c>
                  <c>The full path of the request URI</c>
                  <c>Active</c>
                  <c>Request</c>
                  <c>
                     <xref target="content-request-path"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">@query</spanx>
                  </c>
                  <c>The full query of the request URI</c>
                  <c>Active</c>
                  <c>Request</c>
                  <c>
                     <xref target="content-request-query"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">@query-param</spanx>
                  </c>
                  <c>A single named query parameter</c>
                  <c>Active</c>
                  <c>Request</c>
                  <c>
                     <xref target="content-request-query-param"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">@status</spanx>
                  </c>
                  <c>The status code of the response</c>
                  <c>Active</c>
                  <c>Response</c>
                  <c>
                     <xref target="content-status-code"/> of RFC nnnn</c>
               </texttable>
            </section>
         </section>
         <section anchor="component-param-registry">
            <name>HTTP Signature Component Parameters Registry</name>
            <t>This document defines several kinds of component identifiers, some of which can be parameterized in specific circumstances to provide unique modified behavior. IANA is asked to create and maintain a new registry typed "HTTP Signature Component Parameters" to record and maintain the set of parameters names, the component identifiers they are associated with, and the modifications these parameters make to the component value. Definitions of parameters <bcp14>MUST</bcp14> define the targets to which they apply (such as specific field types, derived components, or contexts) and any incompatibilities with other parameters known at the time of definition. Initial values for this registry are given in <xref target="iana-component-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-component-param-template"/>.</t>
            <section anchor="iana-component-param-template">
               <name>Registration Template</name>
               <dl newline="true">
                  <dt>Name:</dt>
                  <dd>
                     <t>A name for the parameter. The name <bcp14>MUST</bcp14> be an ASCII string that conforms to the <spanx style="verb">key</spanx> ABNF rule defined in <xref section="3.1.2" sectionFormat="of" target="STRUCTURED-FIELDS"/> and <bcp14>SHOULD NOT</bcp14> exceed 20 characters in length. The name <bcp14>MUST</bcp14> be unique within the context of the registry.</t>
                  </dd>
                  <dt>Description:</dt>
                  <dd>
                     <t>A description of the parameter's function.</t>
                  </dd>
                  <dt>Status:</dt>
                  <dd>
                     <t>A brief text description of the status of the parameter. The description <bcp14>MUST</bcp14> begin with one of "Active" or "Deprecated", and <bcp14>MAY</bcp14> provide further context or explanation as to the reason for the status.</t>
                  </dd>
                  <dt>Specification document(s):</dt>
                  <dd>
                     <t>Reference to the document(s) that specify the derived component, 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-component-param-contents">
               <name>Initial Contents</name>
               <t>The table below contains the initial contents of the HTTP Signature Derived Component Names Registry.</t>
               <texttable title="Initial contents of the HTTP Signature Component Parameters Registry.">
                  <ttcol align="left">Name</ttcol>
                  <ttcol align="left">Description</ttcol>
                  <ttcol align="left">Status</ttcol>
                  <ttcol align="left">Specification document(s)</ttcol>
                  <c>
                     <spanx style="verb">sf</spanx>
                  </c>
                  <c>Strict structured field serialization</c>
                  <c>Active</c>
                  <c>
                     <xref target="http-header-structured"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">key</spanx>
                  </c>
                  <c>Single key value of dictionary structured fields</c>
                  <c>Active</c>
                  <c>
                     <xref target="http-header-dictionary"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">bs</spanx>
                  </c>
                  <c>Byte Sequence wrapping indicator</c>
                  <c>Active</c>
                  <c>
                     <xref target="http-header-byte-sequence"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">req</spanx>
                  </c>
                  <c>Related request indicator</c>
                  <c>Active</c>
                  <c>
                     <xref target="content-request-scheme"/> of RFC nnnn</c>
                  <c>
                     <spanx style="verb">name</spanx>
                  </c>
                  <c>Single named query parameter</c>
                  <c>Active</c>
                  <c>
                     <xref target="content-request-query-param"/> of RFC nnnn</c>
               </texttable>
            </section>
         </section>
      </section>
      <section anchor="security">
         <name>Security Considerations</name>
         <t>In order for an HTTP message to be considered <em>covered</em> by a signature, all of the following conditions have to be true:</t>
         <t>
            <list style="symbols">
               <t>a signature is expected or allowed on the message by the verifier</t>
               <t>the signature exists on the message</t>
               <t>the signature is verified against the identified key material and algorithm</t>
               <t>the key material and algorithm are appropriate for the context of the message</t>
               <t>the signature is within expected time boundaries</t>
               <t>the signature covers the expected content, including any critical components</t>
               <t>the list of covered components is applicable to the context of the message</t>
            </list>
         </t>
         <t>In addition to the application requirement definitions listed in <xref target="application"/>, the following security considerations provide discussion and context to the requirements of creating and verifying signatures on HTTP messages.</t>
         <section anchor="general-considerations">
            <name>General Considerations</name>
            <section anchor="security-ignore">
               <name>Skipping Signature Verification</name>
               <t>HTTP Message Signatures only provide security if the signature is verified by the verifier. Since the message to which the signature is attached remains a valid HTTP message without the signature fields, it is possible for a verifier to ignore the output of the verification function and still process the message. Common reasons for this could be relaxed requirements in a development environment or a temporary suspension of enforcing verification during debugging an overall system. Such temporary suspensions are difficult to detect under positive-example testing since a good signature will always trigger a valid response whether or not it has been checked.</t>
               <t>To detect this, verifiers should be tested using both valid and invalid signatures, ensuring that the invalid signature fails as expected.</t>
            </section>
            <section anchor="security-tls">
               <name>Use of TLS</name>
               <t>The use of HTTP Message Signatures does not negate the need for TLS or its equivalent to protect information in transit. Message signatures provide message integrity over the covered message components but do not provide any confidentiality for the communication between parties.</t>
               <t>TLS provides such confidentiality between the TLS endpoints. As part of this, TLS also protects the signature data itself from being captured by an attacker, which is an important step in preventing <xref target="security-replay">signature replay</xref>.</t>
               <t>When TLS is used, it needs to be deployed according to the recommendations in <xref target="BCP195"/>.</t>
            </section>
         </section>
         <section anchor="message-processing-and-selection">
            <name>Message Processing and Selection</name>
            <section anchor="security-coverage">
               <name>Insufficient Coverage</name>
               <t>Any portions of the message not covered by the signature are susceptible to modification by an attacker without affecting the signature. An attacker can take advantage of this by introducing or modifying a header field or other message component that will change the processing of the message but will not be covered by the signature. Such an altered message would still pass signature verification, but when the verifier processes the message as a whole, the unsigned content injected by the attacker would subvert the trust conveyed by the valid signature and change the outcome of processing the message.</t>
               <t>To combat this, an application of this specification should require as much of the message as possible to be signed, within the limits of the application and deployment. The verifier should only trust message components that have been signed. Verifiers could also strip out any sensitive unsigned portions of the message before processing of the message continues.</t>
            </section>
            <section anchor="security-replay">
               <name>Signature Replay</name>
               <t>Since HTTP Message Signatures allows sub-portions of the HTTP message to be signed, it is possible for two different HTTP messages to validate against the same signature. The most extreme form of this would be a signature over no message components. If such a signature were intercepted, it could be replayed at will by an attacker, attached to any HTTP message. Even with sufficient component coverage, a given signature could be applied to two similar HTTP messages, allowing a message to be replayed by an attacker with the signature intact.</t>
               <t>To counteract these kinds of attacks, it's first important for the signer to cover sufficient portions of the message to differentiate it from other messages. In addition, the signature can use the <spanx style="verb">nonce</spanx> signature parameter to provide a per-message unique value to allow the verifier to detect replay of the signature itself if a nonce value is repeated. Furthermore, the signer can provide a timestamp for when the signature was created and a time at which the signer considers the signature to be expired, limiting the utility of a captured signature value.</t>
               <t>If a verifier wants to trigger a new signature from a signer, it can send the <spanx style="verb">Accept-Signature</spanx> header field with a new <spanx style="verb">nonce</spanx> parameter. An attacker that is simply replaying a signature would not be able to generate a new signature with the chosen nonce value.</t>
            </section>
            <section anchor="security-components">
               <name>Choosing Message Components</name>
               <t>Applications of HTTP Message Signatures need to decide which message components will be covered by the signature. Depending on the application, some components could be expected to be changed by intermediaries prior to the signature's verification. If these components are covered, such changes would, by design, break the signature.</t>
               <t>However, the HTTP Message Signature standard allows for flexibility in determining which components are signed precisely so that a given application can choose the appropriate portions of the message that need to be signed, avoiding problematic components. For example, a web application framework that relies on rewriting query parameters might avoid use of the <spanx style="verb">@query</spanx> derived component in favor of sub-indexing the query value using <spanx style="verb">@query-param</spanx> derived components instead.</t>
               <t>Some components are expected to be changed by intermediaries and ought not to be signed under most circumstance. The <spanx style="verb">Via</spanx> and <spanx style="verb">Forwarded</spanx> header fields, for example, are expected to be manipulated by proxies and other middle-boxes, including replacing or entirely dropping existing values. These fields should not be covered by the signature except in very limited and tightly-coupled scenarios.</t>
               <t>Additional considerations for choosing signature aspects are discussed in <xref target="application"/>.</t>
            </section>
            <section anchor="security-not-fields">
               <name>Choosing Signature Parameters and Derived Components over HTTP Fields</name>
               <t>Some HTTP fields have values and interpretations that are similar to HTTP signature parameters or derived components. In most cases, it is more desirable to sign the non-field alternative. In particular, the following fields should usually not be included in the signature unless the application specifically requires it:</t>
               <dl>
                  <dt>"date"</dt>
                  <dd>
                     <t>The "date" field value represents the timestamp of the HTTP message. However, the creation time of the signature itself is encoded in the <spanx style="verb">created</spanx> signature parameter. These two values can be different, depending on how the signature and the HTTP message are created and serialized. Applications processing signatures for valid time windows should use the <spanx style="verb">created</spanx> signature parameter for such calculations. An application could also put limits on how much skew there is between the "date" field and the <spanx style="verb">created</spanx> signature parameter, in order to limit the application of a generated signature to different HTTP messages. See also <xref target="security-replay"/> and <xref target="security-coverage"/>.</t>
                  </dd>
                  <dt>"host"</dt>
                  <dd>
                     <t>The "host" header field is specific to HTTP 1.1, and its functionality is subsumed by the "@authority" derived component, defined in <xref target="content-request-authority"/>. In order to preserve the value across different HTTP versions, applications should always use the "@authority" derived component. See also <xref target="security-versions"/>.</t>
                  </dd>
               </dl>
            </section>
            <section anchor="security-labels">
               <name>Signature Labels</name>
               <t>HTTP Message Signature values are identified in the Signature and Signature-Input field values by unique labels. These labels are chosen only when attaching the signature values to the message and are not accounted for in the signing process. An intermediary is allowed to re-label an existing signature when processing the message.</t>
               <t>Therefore, applications should not rely on specific labels being present, and applications should not put semantic meaning on the labels themselves. Instead, additional signature parameters can be used to convey whatever additional meaning is required to be attached to and covered by the signature. In particular, the <spanx style="verb">tag</spanx> parameter can be used to define an application-specific value as described in <xref target="security-signature-tag"/>.</t>
            </section>
            <section anchor="security-multiple">
               <name>Multiple Signature Confusion</name>
               <t>Since <xref target="signature-multiple">multiple signatures can be applied to one message</xref>, it is possible for an attacker to attach their own signature to a captured message without modifying existing signatures. This new signature could be completely valid based on the attacker's key, or it could be an invalid signature for any number of reasons. Each of these situations need to be accounted for.</t>
               <t>A verifier processing a set of valid signatures needs to account for all of the signers, identified by the signing keys. Only signatures from expected signers should be accepted, regardless of the cryptographic validity of the signature itself.</t>
               <t>A verifier processing a set of signatures on a message also needs to determine what to do when one or more of the signatures are not valid. If a message is accepted when at least one signature is valid, then a verifier could drop all invalid signatures from the request before processing the message further. Alternatively, if the verifier rejects a message for a single invalid signature, an attacker could use this to deny service to otherwise valid messages by injecting invalid signatures alongside the valid ones.</t>
            </section>
            <section anchor="security-signature-tag">
               <name>Collision of Application-Specific Signature Tag</name>
               <t>Multiple applications and protocols could apply HTTP signatures on the same message simultaneously. In fact, this is a desired feature in many circumstances as described in <xref target="signature-multiple"/>. A naive verifier could become confused in processing multiple signatures, either accepting or rejecting a message based on an unrelated or irrelevant signature. In order to help an application select which signatures apply to its own processing, the application can declare a specific value for the <spanx style="verb">tag</spanx> signature parameter as defined in <xref target="signature-params"/>. For example, a signature targeting an application gateway could require <spanx style="verb">tag="app-gateway"</spanx> as part of the signature parameters for that application.</t>
               <t>The use of the <spanx style="verb">tag</spanx> parameter does not prevent an attacker from also using the same value as a target application, since the parameter's value is public and otherwise unrestricted. As a consequence, a verifier should only use value of the <spanx style="verb">tag</spanx> parameter to limit which signatures to check. Each signature still needs to be examined by the verifier to ensure that sufficient coverage is provided, as discussed in <xref target="security-coverage"/>.</t>
            </section>
            <section anchor="security-message-content">
               <name>Message Content</name>
               <t>On its own, this specification does not provide coverage for the content of an HTTP message under the signature, either in request or response. However, <xref target="DIGEST"/> defines a set of fields that allow a cryptographic digest of the content to be represented in a field. Once this field is created, it can be included just like any other field as defined in <xref target="http-header"/>.</t>
               <t>For example, in the following response message:</t>
               <figure>
                  <sourcecode type="http-message">
HTTP/1.1 200 OK
Content-Type: application/json

{"hello": "world"}
</sourcecode>
               </figure>
               <t>The digest of the content can be added to the Content-Digest field as follows:</t>
               <figure>
                  <sourcecode type="http-message" x:line-folding="\">
HTTP/1.1 200 OK
Content-Type: application/json
Content-Digest: \
  sha-256=:X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=:

{"hello": "world"}
</sourcecode>
               </figure>
               <t>This field can be included in a signature base just like any other field along with the basic signature parameters:</t>
               <figure>
                  <artwork>
"@status": 200
"content-digest": \
  sha-256=:X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=:
"@signature-input": ("@status" "content-digest")
</artwork>
               </figure>
               <t>From here, the signing process proceeds as usual.</t>
               <t>Upon verification, it is important that the verifier validate not only the signature but also the value of the Content-Digest field itself against the actual received content. Unless the verifier performs this step, it would be possible for an attacker to substitute the message content but leave the Content-Digest field value untouched to pass the signature. Since only the field value is covered by the signature directly, checking only the signature is not sufficient protection against such a substitution attack.</t>
            </section>
         </section>
         <section anchor="cryptographic-considerations">
            <name>Cryptographic Considerations</name>
            <section anchor="security-collision">
               <name>Cryptography and Signature Collision</name>
               <t>The HTTP Message Signatures specification does not define any of its own cryptographic primitives, and instead relies on other specifications to define such elements. If the signature algorithm or key used to process the signature base is vulnerable to any attacks, the resulting signature will also be susceptible to these same attacks.</t>
               <t>A common attack against signature systems is to force a signature collision, where the same signature value successfully verifies against multiple different inputs. Since this specification relies on reconstruction of the signature base from an HTTP message, and the list of components signed is fixed in the signature, it is difficult but not impossible for an attacker to effect such a collision. An attacker would need to manipulate the HTTP message and its covered message components in order to make the collision effective.</t>
               <t>To counter this, only vetted keys and signature algorithms should be used to sign HTTP messages. The HTTP Message Signatures Algorithm Registry is one source of trusted signature algorithms for applications to apply to their messages.</t>
               <t>While it is possible for an attacker to substitute the signature parameters value or the signature value separately, the <xref target="create-sig-input">signature base generation algorithm</xref> always covers the signature parameters as the final value in the signature base using a deterministic serialization method. This step strongly binds the signature base with the signature value in a way that makes it much more difficult for an attacker to perform a partial substitution on the signature bases.</t>
            </section>
            <section anchor="security-keys">
               <name>Key Theft</name>
               <t>A foundational assumption of signature-based cryptographic systems is that the signing key is not compromised by an attacker. If the keys used to sign the message are exfiltrated or stolen, the attacker will be able to generate their own signatures using those keys. As a consequence, signers have to protect any signing key material from exfiltration, capture, and use by an attacker.</t>
               <t>To combat this, signers can rotate keys over time to limit the amount of time stolen keys are useful. Signers can also use key escrow and storage systems to limit the attack surface against keys. Furthermore, the use of asymmetric signing algorithms exposes key material less than the use of <xref target="security-symmetric">symmetric signing algorithms</xref>.</t>
            </section>
            <section anchor="security-symmetric">
               <name>Symmetric Cryptography</name>
               <t>The HTTP Message Signatures specification allows for both asymmetric and symmetric cryptography to be applied to HTTP messages. By its nature, symmetric cryptographic methods require the same key material to be known by both the signer and verifier. This effectively means that a verifier is capable of generating a valid signature, since they have access to the same key material. An attacker that is able to compromise a verifier would be able to then impersonate a signer.</t>
               <t>Where possible, asymmetric methods or secure key agreement mechanisms should be used in order to avoid this type of attack. When symmetric methods are used, distribution of the key material needs to be protected by the overall system. One technique for this is the use of separate cryptographic modules that separate the verification process (and therefore the key material) from other code, minimizing the vulnerable attack surface. Another technique is the use of key derivation functions that allow the signer and verifier to agree on unique keys for each message without having to share the key values directly.</t>
               <t>Additionally, if symmetric algorithms are allowed within a system, special care must be taken to avoid <xref target="security-keydowngrade">key downgrade attacks</xref>.</t>
            </section>
            <section anchor="security-keymixup">
               <name>Key Specification Mix-Up</name>
               <t>The existence of a valid signature on an HTTP message is not sufficient to prove that the message has been signed by the appropriate party. It is up to the verifier to ensure that a given key and algorithm are appropriate for the message in question. If the verifier does not perform such a step, an attacker could substitute their own signature using their own key on a message and force a verifier to accept and process it. To combat this, the verifier needs to ensure that not only does the signature validate for a message, but that the key and algorithm used are appropriate.</t>
            </section>
            <section anchor="security-nondeterministic">
               <name>Non-deterministic Signature Primitives</name>
               <t>Some cryptographic primitives such as RSA PSS and ECDSA have non-deterministic outputs, which include some amount of entropy within the algorithm. For such algorithms, multiple signatures generated in succession will not match. A lazy implementation of a verifier could ignore this distinction and simply check for the same value being created by re-signing the signature base. Such an implementation would work for deterministic algorithms such as HMAC and EdDSA but fail to verify valid signatures made using non-deterministic algorithms. It is therefore important that a verifier always use the correctly-defined verification function for the algorithm in question and not do a simple comparison.</t>
            </section>
            <section anchor="security-keydowngrade">
               <name>Key and Algorithm Specification Downgrades</name>
               <t>Applications of this specification need to protect against key specification downgrade attacks. For example, the same RSA key can be used for both RSA-PSS and RSA v1.5 signatures. If an application expects a key to only be used with RSA-PSS, it needs to reject signatures for that key using the weaker RSA 1.5 specification.</t>
               <t>Another example of a downgrade attack occurs when an asymmetric algorithm is expected, such as RSA-PSS, but an attacker substitutes a signature using symmetric algorithm, such as HMAC. A naive verifier implementation could use the value of the public RSA key as the input to the HMAC verification function. Since the public key is known to the attacker, this would allow the attacker to create a valid HMAC signature against this known key. To prevent this, the verifier needs to ensure that both the key material and the algorithm are appropriate for the usage in question. Additionally, while this specification does allow runtime specification of the algorithm using the <spanx style="verb">alg</spanx> signature parameter, applications are encouraged to use other mechanisms such as static configuration or higher protocol-level algorithm specification instead, preventing an attacker from substituting the algorithm specified.</t>
            </section>
         </section>
         <section anchor="matching-covered-components-to-message">
            <name>Matching Covered Components to Message</name>
            <section anchor="security-modify">
               <name>Modification of Required Message Parameters</name>
               <t>An attacker could effectively deny a service by modifying an otherwise benign signature parameter or signed message component. While rejecting a modified message is the desired behavior, consistently failing signatures could lead to the verifier turning off signature checking in order to make systems work again (see <xref target="security-ignore"/>), or to the application minimizing the signed component requirements.</t>
               <t>If such failures are common within an application, the signer and verifier should compare their generated signature bases with each other to determine which part of the message is being modified. If an expected modification is found, the signer and verifier can agree on an alternative set of requirements that will pass. However, the signer and verifier should not remove the requirement to sign the modified component when it is suspected an attacker is modifying the component.</t>
            </section>
            <section anchor="security-mismatch">
               <name>Mismatch of Signature Parameters from Message</name>
               <t>The verifier needs to make sure that the signed message components match those in the message itself. For example, the <spanx style="verb">@method</spanx> derived component requires that the value within the signature base be the same as the HTTP method used when presenting this message. This specification encourages this by requiring the verifier to derive the signature base from the message, but lazy cacheing or conveyance of a raw signature base to a processing subsystem could lead to downstream verifiers accepting a message that does not match the presented signature.</t>
               <t>To counter this, the component that generates the signature base needs to be trusted by both the signer and verifier within a system.</t>
            </section>
            <section anchor="security-message-component-context">
               <name>Message Component Source and Context</name>
               <t>The context for deriving message component values includes the HTTP Message itself, any associated messages (such as the request that triggered a response), and additional information that the signer or verifier has access to. Both signers and verifiers need to take carefully consider the source of all information when creating component values for the signature base and take care not to take information from untrusted sources. Otherwise, an attacker could leverage such a loosely-defined message context to inject their own values into the signature base string, overriding or corrupting the intended values.</t>
               <t>For example, in most situations, the target URI of the message is defined in <xref section="7.1" sectionFormat="comma" target="HTTP"/>. However, let's say that there is an application that requires signing of the <spanx style="verb">@authority</spanx> of the incoming request, but the application doing the processing is behind a reverse proxy. Such an application would expect a change in the <spanx style="verb">@authority</spanx> value, and it could be configured to know the external target URI as seen by the client on the other side of the proxy. This application would use this configured value as its target URI for the purposes of deriving message component values such as <spanx style="verb">@authority</spanx> instead of using the target URI of the incoming message.</t>
               <t>This approach is not without problems, as a misconfigured system could accept signed requests intended for different components in the system. For this scenario, an intermediary could instead add its own signature to be verified by the application directly, as demonstrated in <xref target="signature-multiple"/>. This alternative approach requires a more active intermediary but relies less on the target application knowing external configuration values.</t>
               <t>For another example, <xref target="content-request-response"/> defines a method for signing response messages but including portions of the request message that triggered the response. In this case, the context for component value calculation is the combination of the response and request message, not just the single message to which the signature is applied. For this feature, the <spanx style="verb">req</spanx> flag allows both signer to explicitly signal which part of the context is being sourced for a component identifier's value. Implementations need to ensure that only the intended message is being referred to for each component, otherwise an attacker could attempt to subvert a signature by manipulating one side or the other.</t>
            </section>
            <section anchor="security-context-multiple-signatures">
               <name>Multiple Message Component Contexts</name>
               <t>It is possible that the context for deriving message component values could be distinct for each signature present within a single message. This is particularly the case when proxies mutate messages and include signatures over the mutated values, in addition to any existing signatures. For example, a reverse proxy can replace a public hostname in a request to a service with the hostname for the individual service host that it is forwarding the request on to. If both the client and the reverse proxy add signatures covering <spanx style="verb">@authority</spanx>, the service host will see two signatures on the request, each signing different values for the <spanx style="verb">@authority</spanx> message component, reflecting the change to that component as the message made its way from the client to the service host.</t>
               <t>In such a case, it's common for the internal service to verify only one of the signatures or to use externally-configured information, as discussed in <xref target="security-message-component-context"/>. However, a verifier processing both signatures has to use a different message component context for each signature, since the component value for the <spanx style="verb">@authority</spanx> component will be different for each signature. Verifiers like this need to be aware of both the reverse proxy's context for incoming messages as well as the target service's context for the message coming from the reverse proxy. The verifier needs to take particular care to apply the correct context to the correct signature, otherwise an attacker could use knowledge of this complex setup to confuse the inputs to the verifier.</t>
               <t>Such verifiers also need to ensure that any differences in message component contexts between signatures are expected and permitted. For example, in the above scenario, the reverse proxy could include the original hostname in a <spanx style="verb">Forwarded</spanx> header field, and sign <spanx style="verb">@authority</spanx>, <spanx style="verb">forwarded</spanx>, and the client's entry in the <spanx style="verb">signature</spanx> field. The verifier can use the hostname from the <spanx style="verb">Forwarded</spanx> header field to confirm that the hostname was transformed as expected.</t>
            </section>
         </section>
         <section anchor="http-processing">
            <name>HTTP Processing</name>
            <section anchor="security-lazy-header-parser">
               <name>Confusing HTTP Field Names for Derived Component Names</name>
               <t>The definition of HTTP field names does not allow for the use of the <spanx style="verb">@</spanx> character anywhere in the name. As such, since all derived component names start with the <spanx style="verb">@</spanx> character, these namespaces should be completely separate. However, some HTTP implementations are not sufficiently strict about the characters accepted in HTTP headers. In such implementations, a sender (or attacker) could inject a header field starting with an <spanx style="verb">@</spanx> character and have it passed through to the application code. These invalid header fields could be used to override a portion of the derived message content and substitute an arbitrary value, providing a potential place for an attacker to mount a <xref target="security-collision">signature collision</xref> attack or other functional substitution attack (such as using the signature from a GET request on a crafted POST request).</t>
               <t>To combat this, when selecting values for a message component, if the component name starts with the <spanx style="verb">@</spanx> character, it needs to be processed as a derived component and never taken as a fields. Only if the component name does not start with the <spanx style="verb">@</spanx> character can it be taken from the fields of the message. The algorithm discussed in <xref target="create-sig-input"/> provides a safe order of operations.</t>
            </section>
            <section anchor="security-field-values">
               <name>Semantically Equivalent Field Values</name>
               <t>The <xref target="create-sig-input">signature base generation algorithm</xref> uses the value of an HTTP field as its component value. In the common case, this amounts to taking the actual bytes of the field value as the component value for both the signer and verifier. However, some field values allow for transformation of the values in semantically equivalent ways that alter the bytes used in the value itself. For example, a field definition can declare some or all of its value to be case-insensitive, or to have special handling of internal whitespace characters. Other fields have expected transformations from intermediaries, such as the removal of comments in the <spanx style="verb">Via</spanx> header field. In such cases, a verifier could be tripped up by using the equivalent transformed field value, which would differ from the byte value used by the signer. The verifier would have have a difficult time finding this class of errors since the value of the field is still acceptable for the application, but the actual bytes required by the signature base would not match.</t>
               <t>When processing such fields, the signer and verifier have to agree how to handle such transformations, if at all. One option is to not sign problematic fields, but care must be taken to ensure that there is still <xref target="security-coverage">sufficient signature coverage</xref> for the application. Another option is to define an application-specific canonicalization value for the field before it is added to the HTTP message, such as to always remove internal comments before signing, or to always transform values to lowercase. Since these transformations are applied prior to the field being used as input to the signature base generation algorithm, the signature base will still simply contain the byte value of the field as it appears within the message. If the transformations were to be applied after the value is extracted from the message but before it is added to the signature base, different attack surfaces such as value substitution attacks could be launched against the application. All application-specific additional rules are outside the scope of this specification, and by their very nature these transformations would harm interoperability of the implementation outside of this specific application. It is recommended that applications avoid the use of such additional rules wherever possible.</t>
            </section>
            <section anchor="security-structured">
               <name>Parsing Structured Field Values</name>
               <t>Several parts of this specification rely on the parsing of structured field values <xref target="STRUCTURED-FIELDS"/>. In particular, <xref target="http-header-structured">normalization of HTTP structured field values</xref>, <xref target="http-header-dictionary">referencing members of a dictionary structured field</xref>, and processing the <spanx style="verb">@signature-input</spanx> value when <xref target="verify">verifying a signature</xref>. While structured field values are designed to be relatively simple to parse, a naive or broken implementation of such a parser could lead to subtle attack surfaces being exposed in the implementation.</t>
               <t>For example, if a buggy parser of the <spanx style="verb">@signature-input</spanx> value does not enforce proper closing of quotes around string values within the list of component identifiers, an attacker could take advantage of this and inject additional content into the signature base through manipulating the Signature-Input field value on a message.</t>
               <t>To counteract this, implementations should use fully compliant and trusted parsers for all structured field processing, both on the signer and verifier side.</t>
            </section>
            <section anchor="security-versions">
               <name>HTTP Versions and Component Ambiguity</name>
               <t>Some message components are expressed in different ways across HTTP versions. For example, the authority of the request target is sent using the <spanx style="verb">Host</spanx> header field in HTTP 1.1 but with the <spanx style="verb">:authority</spanx> pseudo-header in HTTP 2. If a signer sends an HTTP 1.1 message and signs the <spanx style="verb">Host</spanx> field, but the message is translated to HTTP 2 before it reaches the verifier, the signature will not validate as the <spanx style="verb">Host</spanx> header field could be dropped.</t>
               <t>It is for this reason that HTTP Message Signatures defines a set of derived components that define a single way to get value in question, such as the <spanx style="verb">@authority</spanx> derived component (<xref target="content-request-authority"/>) in lieu of the <spanx style="verb">Host</spanx> header field. Applications should therefore prefer derived components for such options where possible.</t>
            </section>
            <section anchor="security-canonicalization">
               <name>Canonicalization Attacks</name>
               <t>Any ambiguity in the generation of the signature base could provide an attacker with leverage to substitute or break a signature on a message. Some message component values, particularly HTTP field values, are potentially susceptible to broken implementations that could lead to unexpected and insecure behavior. Naive implementations of this specification might implement HTTP field processing by taking the single value of a field and using it as the direct component value without processing it appropriately.</t>
               <t>For example, if the handling of <spanx style="verb">obs-fold</spanx> field values does not remove the internal line folding and whitespace, additional newlines could be introduced into the signature base by the signer, providing a potential place for an attacker to mount a <xref target="security-collision">signature collision</xref> attack. Alternatively, if header fields that appear multiple times are not joined into a single string value, as is required by this specification, similar attacks can be mounted as a signed component value would show up in the signature base more than once and could be substituted or otherwise attacked in this way.</t>
               <t>To counter this, the entire field value processing algorithm needs to be implemented by all implementations of signers and verifiers.</t>
            </section>
            <section anchor="security-non-list">
               <name>Non-List Field Values</name>
               <t>When an HTTP field occurs multiple times in a single message, these values need to be combined into a single one-line string value to be included in the HTTP signature base, as described in <xref target="create-sig-input"/>. Not all HTTP fields can be combined into a single value in this way and still be a valid value for the field. For the purposes of generating the signature base, the message component value is never meant to be read back out of the signature base string or used in the application. Therefore it is considered best practice to treat the signature base generation algorithm separately from processing the field values by the application, particularly for fields that are known to have this property. If the field values that are being signed do not validate, the signed message should also be rejected.</t>
               <t>If an HTTP field allows for unquoted commas within its values, combining multiple field values can lead to a situation where two semantically different messages produce the same line in a signature base. For example, take the following hypothetical header field with an internal comma in its syntax, here used to define two separate lists of values:</t>
               <figure>
                  <sourcecode type="http-message">
Example-Header: value, with, lots
Example-Header: of, commas
</sourcecode>
               </figure>
               <t>For this header field, sending all of these values as a single field value results in a single list of values:</t>
               <figure>
                  <sourcecode type="http-message">
Example-Header: value, with, lots, of, commas
</sourcecode>
               </figure>
               <t>Both of these messages would create the following line in the signature base:</t>
               <figure>
                  <artwork>
"example-header": value, with, lots, of, commas
</artwork>
               </figure>
               <t>Since two semantically distinct inputs can create the same output in the signature base, special care has to be taken when handling such values.</t>
               <t>Specifically, the Set-Cookie field <xref target="COOKIE"/> defines an internal syntax that does not conform to the List syntax in <xref target="STRUCTURED-FIELDS"/>. In particular some portions allow unquoted commas, and the field is typically sent as multiple separate field lines with distinct values when sending multiple cookies. When multiple Set-Cookie fields are sent in the same message, it is not generally possible to combine these into a single line and be able to parse and use the results, as discussed in <xref section="5.3" sectionFormat="comma" target="HTTP"/>. Therefore, all the cookies need to be processed from their separate header values, without being combined, while the signature base needs to be processed from the special combined value generated solely for this purpose. If the cookie value is invalid, the signed message ought to be rejected as this is a possible padding attack as described in <xref target="security-multiple-fields"/>.</t>
               <t>To deal with this, an application can choose to limit signing of problematic fields like Set-Cookie, such as including the field in a signature only when a single field value is present and the results would be unambiguous. Similar caution needs to be taken with all fields that could have non-deterministic mappings into the signature base. Signers can also make use of the <spanx style="verb">bs</spanx> parameter to armor such fields, as described in <xref target="http-header-byte-sequence"/>.</t>
            </section>
            <section anchor="security-multiple-fields">
               <name>Padding Attacks with Multiple Field Values</name>
               <t>Since HTTP field values need to be combined in a single string value to be included in the HTTP signature base, as described in <xref target="create-sig-input"/>, it is possible for an attacker to inject an additional value for a given field and add this to the signature base of the verifier.</t>
               <t>In most circumstances, this causes the signature validation to fail as expected, since the new signature base value will not match the one used by the signer to create the signature. However, it is theoretically possible for the attacker to inject both a garbage value to a field and a desired value to another field in order to force a particular input. This is a variation of the collision attack described in <xref target="security-collision"/>, where the attacker accomplishes their change in the message by adding to existing field values.</t>
               <t>To counter this, an application needs to validate the content of the fields covered in the signature in addition to ensuring that the signature itself validates. With such protections, the attacker's padding attack would be rejected by the field value processor, even in the case where the attacker could force a signature collision.</t>
            </section>
         </section>
      </section>
      <section anchor="privacy">
         <name>Privacy Considerations</name>
         <section anchor="privacy-identify-keys">
            <name>Identification through Keys</name>
            <t>If a signer uses the same key with multiple verifiers, or uses the same key over time with a single verifier, the ongoing use of that key can be used to track the signer throughout the set of verifiers that messages are sent to. Since cryptographic keys are meant to be functionally unique, the use of the same key over time is a strong indicator that it is the same party signing multiple messages.</t>
            <t>In many applications, this is a desirable trait, and it allows HTTP Message Signatures to be used as part of authenticating the signer to the verifier. However, it could be unintentional tracking that a signer might not be aware of. To counter this kind of tracking, a signer can use a different key for each verifier that it is in communication with. Sometimes, a signer could also rotate their key when sending messages to a given verifier. These approaches do not negate the need for other anti-tracking techniques to be applied as necessary.</t>
         </section>
         <section anchor="privacy-confidentiality">
            <name>Signatures do not provide confidentiality</name>
            <t>HTTP Message Signatures do not provide confidentiality of any of the information protected by the signature. The content of the HTTP message, including the value of all fields and the value of the signature itself, is presented in plaintext to any party with access to the message.</t>
            <t>To provide confidentiality at the transport level, TLS or its equivalent can be used as discussed in <xref target="security-tls"/>.</t>
         </section>
         <section anchor="privacy-oracle">
            <name>Oracles</name>
            <t>It is important to balance the need for providing useful feedback to developers on error conditions without providing additional information to an attacker. For example, a naive but helpful server implementation might try to indicate the required key identifier needed for requesting a resource. If someone knows who controls that key, a correlation can be made between the resource's existence and the party identified by the key. Access to such information could be used by an attacker as a means to target the legitimate owner of the resource for further attacks.</t>
         </section>
         <section anchor="privacy-required">
            <name>Required Content</name>
            <t>A core design tenet of this specification is that all message components covered by the signature need to be available to the verifier in order to recreate the signature base and verify the signature. As a consequence, if an application of this specification requires that a particular field be signed, the verifier will need access to the value of that field.</t>
            <t>For example, in some complex systems with intermediary processors this could cause the surprising behavior of an intermediary not being able to remove privacy-sensitive information from a message before forwarding it on for processing, for fear of breaking the signature. A possible mitigation for this specific situation would be for the intermediary to verify the signature itself, then modifying the message to remove the privacy-sensitive information. The intermediary can add its own signature at this point to signal to the next destination that the incoming signature was validated, as is shown in the example in <xref target="signature-multiple"/>.</t>
         </section>
      </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="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="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="RFC8032">
            <front>
               <title>Edwards-Curve Digital Signature Algorithm (EdDSA)</title>
               <author fullname="S. Josefsson" initials="S." surname="Josefsson"/>
               <author fullname="I. Liusvaara" initials="I." surname="Liusvaara"/>
               <date month="January" year="2017"/>
            </front>
            <seriesInfo name="RFC" value="8032"/>
            <seriesInfo name="DOI" value="10.17487/RFC8032"/>
         </reference>
         <reference anchor="STRUCTURED-FIELDS">
            <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>
         <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="HTTP">
            <front>
               <title>HTTP Semantics</title>
               <author fullname="R. Fielding"
                        initials="R."
                        role="editor"
                        surname="Fielding"/>
               <author fullname="M. Nottingham"
                        initials="M."
                        role="editor"
                        surname="Nottingham"/>
               <author fullname="J. Reschke"
                        initials="J."
                        role="editor"
                        surname="Reschke"/>
               <date month="June" year="2022"/>
            </front>
            <seriesInfo name="STD" value="97"/>
            <seriesInfo name="RFC" value="9110"/>
            <seriesInfo name="DOI" value="10.17487/RFC9110"/>
         </reference>
         <reference anchor="HTTP1">
            <front>
               <title>HTTP/1.1</title>
               <author fullname="R. Fielding"
                        initials="R."
                        role="editor"
                        surname="Fielding"/>
               <author fullname="M. Nottingham"
                        initials="M."
                        role="editor"
                        surname="Nottingham"/>
               <author fullname="J. Reschke"
                        initials="J."
                        role="editor"
                        surname="Reschke"/>
               <date month="June" year="2022"/>
            </front>
            <seriesInfo name="STD" value="99"/>
            <seriesInfo name="RFC" value="9112"/>
            <seriesInfo name="DOI" value="10.17487/RFC9112"/>
         </reference>
         <reference anchor="HTMLURL" target="https://url.spec.whatwg.org/">
            <front>
               <title>URL (Living Standard)</title>
               <author/>
               <date year="2021"/>
            </front>
         </reference>
         <reference anchor="ABNF">
            <front>
               <title>OSPF Database Exchange Summary List Optimization</title>
               <author fullname="R. Ogier" initials="R." surname="Ogier"/>
               <date month="May" year="2008"/>
            </front>
            <seriesInfo name="RFC" value="5243"/>
            <seriesInfo name="DOI" value="10.17487/RFC5243"/>
         </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>
      </references>
      <references title="Informative References">
         <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>
         <referencegroup anchor="BCP195" target="https://www.rfc-editor.org/info/bcp195">
            <reference anchor="RFC7525">
               <front>
                  <title>Recommendations for Secure Use of Transport Layer Security (TLS) and Datagram Transport Layer Security (DTLS)</title>
                  <author fullname="Y. Sheffer" initials="Y." surname="Sheffer"/>
                  <author fullname="R. Holz" initials="R." surname="Holz"/>
                  <author fullname="P. Saint-Andre" initials="P." surname="Saint-Andre"/>
                  <date month="May" year="2015"/>
               </front>
               <seriesInfo name="BCP" value="195"/>
               <seriesInfo name="RFC" value="7525"/>
               <seriesInfo name="DOI" value="10.17487/RFC7525"/>
            </reference>
            <reference anchor="RFC8996">
               <front>
                  <title>Deprecating TLS 1.0 and TLS 1.1</title>
                  <author fullname="K. Moriarty" initials="K." surname="Moriarty"/>
                  <author fullname="S. Farrell" initials="S." surname="Farrell"/>
                  <date month="March" year="2021"/>
               </front>
               <seriesInfo name="BCP" value="195"/>
               <seriesInfo name="RFC" value="8996"/>
               <seriesInfo name="DOI" value="10.17487/RFC8996"/>
            </reference>
         </referencegroup>
         <reference anchor="CLIENT-CERT">
            <front>
               <title>Client-Cert HTTP Header Field</title>
               <author fullname="Brian Campbell" initials="B." surname="Campbell">
                  <organization>Ping Identity</organization>
               </author>
               <author fullname="Mike Bishop" initials="M." surname="Bishop">
                  <organization>Akamai</organization>
               </author>
               <date day="25" month="May" year="2022"/>
            </front>
            <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-client-cert-field-02"/>
         </reference>
         <reference anchor="DIGEST">
            <front>
               <title>Digest Fields</title>
               <author fullname="Roberto Polli" initials="R." surname="Polli">
                  <organization>Team Digitale, Italian Government</organization>
               </author>
               <author fullname="Lucas Pardue" initials="L." surname="Pardue">
                  <organization>Cloudflare</organization>
               </author>
               <date day="19" month="June" year="2022"/>
            </front>
            <seriesInfo name="Internet-Draft" value="draft-ietf-httpbis-digest-headers-10"/>
         </reference>
         <reference anchor="COOKIE">
            <front>
               <title>HTTP State Management Mechanism</title>
               <author fullname="A. Barth" initials="A." surname="Barth"/>
               <date month="April" year="2011"/>
            </front>
            <seriesInfo name="RFC" value="6265"/>
            <seriesInfo name="DOI" value="10.17487/RFC6265"/>
         </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-standardized definitions of the Signature field, which is 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 Signature-Input field defined in this specification to detect that this standard is in use and not an alternative. If the Signature-Input field is present, all Signature fields can be parsed and interpreted in the context of this specification.</t>
      </section>
      <section anchor="examples">
         <name>Examples</name>
         <t>The following non-normative examples are provided as a means of testing implementations of HTTP Message Signatures. The signed messages given can be used to create the signature base with the stated parameters, creating signatures using the stated algorithms and keys.</t>
         <t>The private keys given can be used to generate signatures, though since several of the demonstrated algorithms are nondeterministic, the results of a signature are expected to be different from the exact bytes of the examples. The public keys given can be used to validate all signed examples.</t>
         <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 <bcp14>MUST NOT</bcp14> 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>
            <t>The components for each private key in PEM format can be displayed by executing the following OpenSSL command:</t>
            <figure>
               <artwork>
openssl pkey -text
</artwork>
            </figure>
            <t>This command was tested with all the example keys on OpenSSL version 1.1.1m. Note that some systems cannot produce or use all of these keys directly, and may require additional processing.</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>. This key is encoded in PEM Format, with no encryption.</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>. This key is PCKS#8 encoded in PEM format, with no encryption.</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 a public and private elliptical curve key pair over the curve P-256, referred to in this document as `test-key-ecc-p256. This key is encoded in PEM format, with no encryption.</t>
               <figure>
                  <artwork>
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEqIVYZVLCrPZHGHjP17CTW0/+D9Lf
w0EkjqF7xB4FivAxzic30tMM4GF+hR6Dxh71Z50VGGdldkkDXZCnTNnoXQ==
-----END PUBLIC KEY-----

-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIFKbhfNZfpDsW43+0+JjUr9K+bTeuxopu653+hBaXGA7oAoGCCqGSM49
AwEHoUQDQgAEqIVYZVLCrPZHGHjP17CTW0/+D9Lfw0EkjqF7xB4FivAxzic30tMM
4GF+hR6Dxh71Z50VGGdldkkDXZCnTNnoXQ==
-----END EC PRIVATE KEY-----
</artwork>
               </figure>
            </section>
            <section anchor="example-key-ed25519">
               <name>Example Ed25519 Test Key</name>
               <t>The following key is an elliptical curve key over the Edwards curve ed25519, referred to in this document as <spanx style="verb">test-key-ed25519</spanx>. This key is PCKS#8 encoded in PEM format, with no encryption.</t>
               <figure>
                  <artwork>
-----BEGIN PUBLIC KEY-----
MCowBQYDK2VwAyEAJrQLj5P/89iXES9+vFgrIy29clF9CC/oPPsw3c5D0bs=
-----END PUBLIC KEY-----

-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEIJ+DYvh6SEqVTm50DFtMDoQikTmiCqirVv9mWG9qfSnF
-----END PRIVATE 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" x:line-folding="\">
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-Digest: sha-512=:WZDPaVn/7XgHaAy8pmojAkGWoRx2UFChF41A2svX+T\
  aPm+AbwAgBWnrIiYllu7BNNyealdVLvRwEmTHWXvJwew==:
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" x:line-folding="\">
HTTP/1.1 200 OK
Date: Tue, 20 Apr 2021 02:07:56 GMT
Content-Type: application/json
Content-Digest: sha-512=:JlEy2bfUz7WrWIjc1qV6KVLpdr/7L5/L4h7Sxvh6sN\
  HpDQWDCL+GauFQWcZBvVDhiyOnAQsxzZFYwi0wDH+1pw==:
Content-Length: 23

{"message": "good dog"}
</sourcecode>
            </figure>
            <section anchor="minimal-signature-using-rsa-pss-sha512">
               <name>Minimal Signature Using rsa-pss-sha512</name>
               <t>This example presents a minimal 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, but providing a timestamped signature proof of possession of the key with a signer-provided nonce.</t>
               <t>The corresponding signature base is:</t>
               <figure>
                  <artwork>
NOTE: '\' line wrapping per RFC 8792

"@signature-params": ();created=1618884473;keyid="test-key-rsa-pss"\
  ;nonce="b3k2pp5k7z-50gnwp.yemd"
</artwork>
               </figure>
               <t>This results in the following Signature-Input and Signature headers being added to the message under the signature label <spanx style="verb">sig-b21</spanx>:</t>
               <figure>
                  <sourcecode type="http-message" x:line-folding="\">
Signature-Input: sig-b21=();created=1618884473\
  ;keyid="test-key-rsa-pss";nonce="b3k2pp5k7z-50gnwp.yemd"
Signature: sig-b21=:d2pmTvmbncD3xQm8E9ZV2828BjQWGgiwAaw5bAkgibUopem\
  LJcWDy/lkbbHAve4cRAtx31Iq786U7it++wgGxbtRxf8Udx7zFZsckzXaJMkA7ChG\
  52eSkFxykJeNqsrWH5S+oxNFlD4dzVuwe8DhTSja8xxbR/Z2cOGdCbzR72rgFWhzx\
  2VjBqJzsPLMIQKhO4DGezXehhWwE56YCE+O6c0mKZsfxVrogUvA4HELjVKWmAvtl6\
  UnCh8jYzuVG5WSb/QEVPnP5TmcAnLH1g+s++v6d4s8m0gCw1fV5/SITLq9mhho8K3\
  +7EPYTU8IU1bLhdxO5Nyt8C8ssinQ98Xw9Q==:
</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. In this example, the <spanx style="verb">nonce</spanx> parameter is included to prevent the same signature from being replayed more than once, but if an attacker intercepts the signature and prevents its delivery to the verifier, the attacker could apply this signature to another message. Therefore, use of an empty covered components set is discouraged. See <xref target="security-coverage"/> for more discussion.</t>
               <t>Note that the RSA PSS algorithm in use here is non-deterministic, meaning a different signature value will be created every time the algorithm is run. The signature value provided here can be validated against the given keys, but newly-generated signature values are not expected to match the example. See <xref target="security-nondeterministic"/>.</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 (the authority, the Content-Digest header field, and a single named query parameter) in <spanx style="verb">test-request</spanx> using the <spanx style="verb">rsa-pss-sha512</spanx> algorithm. This example also adds a <spanx style="verb">tag</spanx> parameter with the application-specific value of <spanx style="verb">header-example</spanx>.</t>
               <t>The corresponding signature base is:</t>
               <figure>
                  <artwork>
NOTE: '\' line wrapping per RFC 8792

"@authority": example.com
"content-digest": sha-512=:WZDPaVn/7XgHaAy8pmojAkGWoRx2UFChF41A2svX\
  +TaPm+AbwAgBWnrIiYllu7BNNyealdVLvRwEmTHWXvJwew==:
"@query-param";name="Pet": dog
"@signature-params": ("@authority" "content-digest" \
  "@query-param";name="Pet")\
  ;created=1618884473;keyid="test-key-rsa-pss"\
  ;tag="header-example"
</artwork>
               </figure>
               <t>This results in the following Signature-Input and Signature headers being added to the message under the label <spanx style="verb">sig-b22</spanx>:</t>
               <figure>
                  <sourcecode type="http-message" x:line-folding="\">
Signature-Input: sig-b22=("@authority" "content-digest" \
  "@query-param";name="Pet");created=1618884473\
  ;keyid="test-key-rsa-pss";tag="header-example"
Signature: sig-b22=:LjbtqUbfmvjj5C5kr1Ugj4PmLYvx9wVjZvD9GsTT4F7GrcQ\
  EdJzgI9qHxICagShLRiLMlAJjtq6N4CDfKtjvuJyE5qH7KT8UCMkSowOB4+ECxCmT\
  8rtAmj/0PIXxi0A0nxKyB09RNrCQibbUjsLS/2YyFYXEu4TRJQzRw1rLEuEfY17SA\
  RYhpTlaqwZVtR8NV7+4UKkjqpcAoFqWFQh62s7Cl+H2fjBSpqfZUJcsIk4N6wiKYd\
  4je2U/lankenQ99PZfB4jY3I5rSV2DSBVkSFsURIjYErOs0tFTQosMTAoxk//0RoK\
  UqiYY8Bh0aaUEb0rQl3/XaVe4bXTugEjHSw==:
</sourcecode>
               </figure>
               <t>Note that the RSA PSS algorithm in use here is non-deterministic, meaning a different signature value will be created every time the algorithm is run. The signature value provided here can be validated against the given keys, but newly-generated signature values are not expected to match the example. See <xref target="security-nondeterministic"/>.</t>
            </section>
            <section anchor="full-coverage-using-rsa-pss-sha512">
               <name>Full Coverage using rsa-pss-sha512</name>
               <t>This example covers all applicable message components in <spanx style="verb">test-request</spanx> (including the content type and length) plus many derived components, again using the <spanx style="verb">rsa-pss-sha512</spanx> algorithm. Note that the <spanx style="verb">Host</spanx> header field is not covered because the <spanx style="verb">@authority</spanx> derived component is included instead.</t>
               <t>The corresponding signature base is:</t>
               <figure>
                  <artwork>
NOTE: '\' line wrapping per RFC 8792

"date": Tue, 20 Apr 2021 02:07:55 GMT
"@method": POST
"@path": /foo
"@query": ?param=Value&amp;Pet=dog
"@authority": example.com
"content-type": application/json
"content-digest": sha-512=:WZDPaVn/7XgHaAy8pmojAkGWoRx2UFChF41A2svX\
  +TaPm+AbwAgBWnrIiYllu7BNNyealdVLvRwEmTHWXvJwew==:
"content-length": 18
"@signature-params": ("date" "@method" "@path" "@query" \
  "@authority" "content-type" "content-digest" "content-length")\
  ;created=1618884473;keyid="test-key-rsa-pss"
</artwork>
               </figure>
               <t>This results in the following Signature-Input and Signature headers being added to the message under the label <spanx style="verb">sig-b23</spanx>:</t>
               <figure>
                  <sourcecode type="http-message" x:line-folding="\">
Signature-Input: sig-b23=("date" "@method" "@path" "@query" \
  "@authority" "content-type" "content-digest" "content-length")\
  ;created=1618884473;keyid="test-key-rsa-pss"
Signature: sig-b23=:bbN8oArOxYoyylQQUU6QYwrTuaxLwjAC9fbY2F6SVWvh0yB\
  iMIRGOnMYwZ/5MR6fb0Kh1rIRASVxFkeGt683+qRpRRU5p2voTp768ZrCUb38K0fU\
  xN0O0iC59DzYx8DFll5GmydPxSmme9v6ULbMFkl+V5B1TP/yPViV7KsLNmvKiLJH1\
  pFkh/aYA2HXXZzNBXmIkoQoLd7YfW91kE9o/CCoC1xMy7JA1ipwvKvfrs65ldmlu9\
  bpG6A9BmzhuzF8Eim5f8ui9eH8LZH896+QIF61ka39VBrohr9iyMUJpvRX2Zbhl5Z\
  JzSRxpJyoEZAFL2FUo5fTIztsDZKEgM4cUA==:
</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. See <xref target="security-not-fields"/> for more discussion.</t>
               <t>Note that the RSA PSS algorithm in use here is non-deterministic, meaning a different signature value will be created every time the algorithm is run. The signature value provided here can be validated against the given keys, but newly-generated signature values are not expected to match the example. See <xref target="security-nondeterministic"/>.</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 base is:</t>
               <figure>
                  <artwork>
NOTE: '\' line wrapping per RFC 8792

"@status": 200
"content-type": application/json
"content-digest": sha-512=:mEWXIS7MaLRuGgxOBdODa3xqM1XdEvxoYhvlCFJ4\
  1QJgJc4GTsPp29l5oGX69wWdXymyU0rjJuahq4l5aGgfLQ==:
"content-length": 23
"@signature-params": ("@status" "content-type" "content-digest" \
  "content-length");created=1618884473;keyid="test-key-ecc-p256"
</artwork>
               </figure>
               <t>This results in the following Signature-Input and Signature headers being added to the message under the label <spanx style="verb">sig-b24</spanx>:</t>
               <figure>
                  <sourcecode type="http-message" x:line-folding="\">
Signature-Input: sig-b24=("@status" "content-type" \
  "content-digest" "content-length");created=1618884473\
  ;keyid="test-key-ecc-p256"
Signature: sig-b24=:wNmSUAhwb5LxtOtOpNa6W5xj067m5hFrj0XQ4fvpaCLx0NK\
  ocgPquLgyahnzDnDAUy5eCdlYUEkLIj+32oiasw==:
</sourcecode>
               </figure>
               <t>Note that the ECDSA algorithm in use here is non-deterministic, meaning a different signature value will be created every time the algorithm is run. The signature value provided here can be validated against the given keys, but newly-generated signature values are not expected to match the example. See <xref target="security-nondeterministic"/>.</t>
            </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 base is:</t>
               <figure>
                  <artwork>
NOTE: '\' line wrapping per RFC 8792

"date": Tue, 20 Apr 2021 02:07:55 GMT
"@authority": example.com
"content-type": application/json
"@signature-params": ("date" "@authority" "content-type")\
  ;created=1618884473;keyid="test-shared-secret"
</artwork>
               </figure>
               <t>This results in the following Signature-Input and Signature headers being added to the message under the label <spanx style="verb">sig-b25</spanx>:</t>
               <figure>
                  <sourcecode type="http-message" x:line-folding="\">
Signature-Input: sig-b25=("date" "@authority" "content-type")\
  ;created=1618884473;keyid="test-shared-secret"
Signature: sig-b25=:pxcQw6G3AjtMBQjwo8XzkZf/bws5LelbaMk5rGIGtE8=:
</sourcecode>
               </figure>
               <t>Before using symmetric signatures in practice, see the discussion of the security tradeoffs in <xref target="security-symmetric"/>.</t>
            </section>
            <section anchor="signing-a-request-using-ed25519">
               <name>Signing a Request using ed25519</name>
               <t>This example covers portions of the <spanx style="verb">test-request</spanx> using the <spanx style="verb">ed25519</spanx> algorithm and the key <spanx style="verb">test-key-ed25519</spanx>.</t>
               <t>The corresponding signature base is:</t>
               <figure>
                  <artwork>
NOTE: '\' line wrapping per RFC 8792

"date": Tue, 20 Apr 2021 02:07:55 GMT
"@method": POST
"@path": /foo
"@authority": example.com
"content-type": application/json
"content-length": 18
"@signature-params": ("date" "@method" "@path" "@authority" \
  "content-type" "content-length");created=1618884473\
  ;keyid="test-key-ed25519"
</artwork>
               </figure>
               <t>This results in the following Signature-Input and Signature headers being added to the message under the label <spanx style="verb">sig-b26</spanx>:</t>
               <figure>
                  <sourcecode type="http-message" x:line-folding="\">
Signature-Input: sig-b26=("date" "@method" "@path" "@authority" \
  "content-type" "content-length");created=1618884473\
  ;keyid="test-key-ed25519"
Signature: sig-b26=:wqcAqbmYJ2ji2glfAMaRy4gruYYnx2nEFN2HN6jrnDnQCK1\
  u02Gb04v9EDgwUPiu4A0w6vuQv5lIp5WPpBKRCw==:
</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="CLIENT-CERT"/>, and then applies a signature to this field. By signing this header field, a reverse proxy can not only attest to its own validation of the initial request's TLS parameters but also authenticate itself to the backend system independently of the client's actions.</t>
            <t>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" x:line-folding="\">
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 base 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=1618884473;keyid="test-key-ecc-p256"
</artwork>
            </figure>
            <t>This results in the following signature:</t>
            <figure>
               <artwork>
NOTE: '\' line wrapping per RFC 8792

xVMHVpawaAC/0SbHrKRs9i8I3eOs5RtTMGCWXm/9nvZzoHsIg6Mce9315T6xoklyy0y\
zhD9ah4JHRwMLOgmizw==
</artwork>
            </figure>
            <t>Which results in the following signed request sent from the proxy to the internal service with the proxy's signature under the label <spanx style="verb">ttrp</spanx>:</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=1618884473;keyid="test-key-ecc-p256"
Signature: ttrp=:xVMHVpawaAC/0SbHrKRs9i8I3eOs5RtTMGCWXm/9nvZzoHsIg6\
  Mce9315T6xoklyy0yzhD9ah4JHRwMLOgmizw==:

{"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 anchor="example-transform">
            <name>HTTP Message Transformations</name>
            <t>The HTTP protocol allows intermediaries and applications to transform an HTTP message without affecting the semantics of the message itself. HTTP message signatures are designed to be robust against many of these transformations in different circumstances.</t>
            <t>For example, the following HTTP request message has been signed using the <spanx style="verb">ed25519</spanx> algorithm and the key <spanx style="verb">test-key-ed25519</spanx>.</t>
            <figure>
               <sourcecode type="http-message" x:line-folding="\">
GET /demo?name1=Value1&amp;Name2=value2 HTTP/1.1
Host: example.org
Date: Fri, 15 Jul 2022 14:24:55 GMT
Accept: application/json
Accept: */*
Signature-Input: transform=("@method" "@path" "@authority" \
  "accept");created=1618884473;keyid="test-key-ed25519"
Signature: transform=:ZT1kooQsEHpZ0I1IjCqtQppOmIqlJPeo7DHR3SoMn0s5J\
  Z1eRGS0A+vyYP9t/LXlh5QMFFQ6cpLt2m0pmj3NDA==:
</sourcecode>
            </figure>
            <t>The signature base string for this message is:</t>
            <figure>
               <artwork>
"@method": GET
"@path": /demo
"@authority": example.org
"accept": application/json, */*
"@signature-params": ("@method" "@path" "@authority" "accept")\
  ;created=1618884473;keyid="test-key-ed25519"
</artwork>
            </figure>
            <t>The following message has been altered by adding the Accept-Language header as well as adding a query parameter. However, since neither the Accept-Language header nor the query are covered by the signature, the same signature is still valid:</t>
            <figure>
               <sourcecode type="http-message" x:line-folding="\">
GET /demo?name1=Value1&amp;Name2=value2&amp;param=added HTTP/1.1
Host: example.org
Date: Fri, 15 Jul 2022 14:24:55 GMT
Accept: application/json
Accept: */*
Accept-Language: en-US,en;q=0.5
Signature-Input: transform=("@method" "@path" "@authority" \
  "accept");created=1618884473;keyid="test-key-ed25519"
Signature: transform=:ZT1kooQsEHpZ0I1IjCqtQppOmIqlJPeo7DHR3SoMn0s5J\
  Z1eRGS0A+vyYP9t/LXlh5QMFFQ6cpLt2m0pmj3NDA==:
</sourcecode>
            </figure>
            <t>The following message has been altered by removing the Date header, adding a Referer header, and collapsing the Accept header into a single line. The Date and Referrer headers are not covered by the signature, and the collapsing of the Accept header is an allowed transformation that is already accounted for by the canonicalization algorithm for HTTP field values. The same signature is still valid:</t>
            <figure>
               <sourcecode type="http-message" x:line-folding="\">
GET /demo?name1=Value1&amp;Name2=value2 HTTP/1.1
Host: example.org
Referer: https://developer.example.org/demo
Accept: application/json, */*
Signature-Input: transform=("@method" "@path" "@authority" \
  "accept");created=1618884473;keyid="test-key-ed25519"
Signature: transform=:ZT1kooQsEHpZ0I1IjCqtQppOmIqlJPeo7DHR3SoMn0s5J\
  Z1eRGS0A+vyYP9t/LXlh5QMFFQ6cpLt2m0pmj3NDA==:
</sourcecode>
            </figure>
            <t>The following message has been altered by re-ordering the field values of the original message, but not re-ordering the individual Accept headers. The same signature is still valid:</t>
            <figure>
               <sourcecode type="http-message" x:line-folding="\">
GET /demo?name1=Value1&amp;Name2=value2 HTTP/1.1
Accept: application/json
Accept: */*
Date: Fri, 15 Jul 2022 14:24:55 GMT
Host: example.org
Signature-Input: transform=("@method" "@path" "@authority" \
  "accept");created=1618884473;keyid="test-key-ed25519"
Signature: transform=:ZT1kooQsEHpZ0I1IjCqtQppOmIqlJPeo7DHR3SoMn0s5J\
  Z1eRGS0A+vyYP9t/LXlh5QMFFQ6cpLt2m0pmj3NDA==:
</sourcecode>
            </figure>
            <t>The following message has been altered by changing the method to POST and the authority to "example.com" (inside the Host header). Since both the method and authority are covered by the signature, the same signature is NOT still valid:</t>
            <figure>
               <sourcecode type="http-message" x:line-folding="\">
POST /demo?name1=Value1&amp;Name2=value2 HTTP/1.1
Host: example.com
Date: Fri, 15 Jul 2022 14:24:55 GMT
Accept: application/json
Accept: */*
Signature-Input: transform=("@method" "@path" "@authority" \
  "accept");created=1618884473;keyid="test-key-ed25519"
Signature: transform=:ZT1kooQsEHpZ0I1IjCqtQppOmIqlJPeo7DHR3SoMn0s5J\
  Z1eRGS0A+vyYP9t/LXlh5QMFFQ6cpLt2m0pmj3NDA==:
</sourcecode>
            </figure>
            <t>The following message has been altered by changing the order of the two instances of the Accept header. Since the order of fields with the same name is semantically significant in HTTP, this changes the value used in the signature base, and the same signature is NOT still valid:</t>
            <figure>
               <sourcecode type="http-message" x:line-folding="\">
GET /demo?name1=Value1&amp;Name2=value2 HTTP/1.1
Host: example.org
Date: Fri, 15 Jul 2022 14:24:55 GMT
Accept: */*
Accept: application/json
Signature-Input: transform=("@method" "@path" "@authority" \
  "accept");created=1618884473;keyid="test-key-ed25519"
Signature: transform=:ZT1kooQsEHpZ0I1IjCqtQppOmIqlJPeo7DHR3SoMn0s5J\
  Z1eRGS0A+vyYP9t/LXlh5QMFFQ6cpLt2m0pmj3NDA==:
</sourcecode>
            </figure>
         </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. The specification also includes contributions from the draft-oauth-signed-http-request internet draft and other similar efforts.</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, <contact fullname="Karl Böhlmark"/>, <contact fullname="Stéphane Bortzmeyer"/>, Sarven Capadisli, Liam Dennehy, Stephen Farrell, Phillip Hallam-Baker, Tyler Ham, 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, Rich Salz, 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>-13 <list style="symbols">
                           <t>Renamed "context" parameter to "tag".</t>
                           <t>Added discussion on messages with multiple known contexts.</t>
                        </list>
                     </t>
                     <t>-12 <list style="symbols">
                           <t>Added "context" parameter.</t>
                           <t>Added set of safe transformation examples.</t>
                           <t>Added ECDSA over P-384.</t>
                           <t>Expanded definiton of message component source context.</t>
                           <t>Sorted security considerations into categories.</t>
                        </list>
                     </t>
                     <t>-11 <list style="symbols">
                           <t>Added ABNF references, coalesced ABNF rules.</t>
                           <t>Editorial and formatting fixes.</t>
                           <t>Update examples.</t>
                           <t>Added Byte Sequence field value wrapping.</t>
                        </list>
                     </t>
                     <t>-10 <list style="symbols">
                           <t>Removed "related response" and "@request-response" in favor of generic "req" parameter.</t>
                           <t>Editorial fixes to comply with HTTP extension style guidelines.</t>
                           <t>Add security consideration on message content.</t>
                        </list>
                     </t>
                     <t>-09 <list style="symbols">
                           <t>Explained key formats better.</t>
                           <t>Removed "host" and "date" from most examples.</t>
                           <t>Fixed query component generation.</t>
                           <t>Renamed "signature input" and "signature input string" to "signature base".</t>
                           <t>Added consideration for semantically equivalent field values.</t>
                        </list>
                     </t>
                     <t>-08 <list style="symbols">
                           <t>Editorial fixes.</t>
                           <t>Changed "specialty component" to "derived component".</t>
                           <t>Expanded signature input generation and ABNF rules.</t>
                           <t>Added Ed25519 algorithm.</t>
                           <t>Clarified encoding of ECDSA signature.</t>
                           <t>Clarified use of non-deterministic algorithms.</t>
                        </list>
                     </t>
                     <t>-07 <list style="symbols">
                           <t>Added security and privacy considerations.</t>
                           <t>Added pointers to algorithm values from definition sections.</t>
                           <t>Expanded IANA registry sections.</t>
                           <t>Clarified that the signing and verification algorithms take application requirements as inputs.</t>
                           <t>Defined "signature targets" of request, response, and related-response for specialty components.</t>
                        </list>
                     </t>
                     <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 <bcp14>SHOULD</bcp14> to <bcp14>MUST</bcp14>).</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 <bcp14>MUST NOT</bcp14> 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>
