draft-ietf-httpbis-message-signatures-04.txt   draft-ietf-httpbis-message-signatures-05.txt 
HTTP A. Backman, Ed. HTTP A. Backman, Ed.
Internet-Draft Amazon Internet-Draft Amazon
Intended status: Standards Track J. Richer Intended status: Standards Track J. Richer
Expires: 23 October 2021 Bespoke Engineering Expires: 10 December 2021 Bespoke Engineering
M. Sporny M. Sporny
Digital Bazaar Digital Bazaar
21 April 2021 8 June 2021
Signing HTTP Messages Signing HTTP Messages
draft-ietf-httpbis-message-signatures-04 draft-ietf-httpbis-message-signatures-05
Abstract Abstract
This document describes a mechanism for creating, encoding, and This document describes a mechanism for creating, encoding, and
verifying digital signatures or message authentication codes over verifying digital signatures or message authentication codes over
content within an HTTP message. This mechanism supports use cases content within an HTTP message. This mechanism supports use cases
where the full HTTP message may not be known to the signer, and where where the full HTTP message may not be known to the signer, and where
the message may be transformed (e.g., by intermediaries) before the message may be transformed (e.g., by intermediaries) before
reaching the verifier. reaching the verifier.
skipping to change at page 2, line 10 skipping to change at page 2, line 10
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on 23 October 2021. This Internet-Draft will expire on 10 December 2021.
Copyright Notice Copyright Notice
Copyright (c) 2021 IETF Trust and the persons identified as the Copyright (c) 2021 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents (https://trustee.ietf.org/ Provisions Relating to IETF Documents (https://trustee.ietf.org/
license-info) in effect on the date of publication of this document. license-info) in effect on the date of publication of this document.
Please review these documents carefully, as they describe your rights Please review these documents carefully, as they describe your rights
and restrictions with respect to this document. Code Components and restrictions with respect to this document. Code Components
extracted from this document must include Simplified BSD License text extracted from this document must include Simplified BSD License text
as described in Section 4.e of the Trust Legal Provisions and are as described in Section 4.e of the Trust Legal Provisions and are
provided without warranty as described in the Simplified BSD License. provided without warranty as described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
1.1. Requirements Discussion . . . . . . . . . . . . . . . . . 4 1.1. Requirements Discussion . . . . . . . . . . . . . . . . . 4
1.2. HTTP Message Transformations . . . . . . . . . . . . . . 5 1.2. HTTP Message Transformations . . . . . . . . . . . . . . 5
1.3. Safe Transformations . . . . . . . . . . . . . . . . . . 6 1.3. Safe Transformations . . . . . . . . . . . . . . . . . . 5
1.4. Conventions and Terminology . . . . . . . . . . . . . . . 6 1.4. Conventions and Terminology . . . . . . . . . . . . . . . 6
1.5. Application of HTTP Message Signatures . . . . . . . . . 8 1.5. Application of HTTP Message Signatures . . . . . . . . . 8
2. HTTP Message Signature Covered Content . . . . . . . . . . . 9 2. HTTP Message Signature Covered Content . . . . . . . . . . . 8
2.1. HTTP Headers . . . . . . . . . . . . . . . . . . . . . . 9 2.1. HTTP Headers . . . . . . . . . . . . . . . . . . . . . . 9
2.1.1. Canonicalized Structured HTTP Headers . . . . . . . . 10 2.1.1. Canonicalized Structured HTTP Headers . . . . . . . . 10
2.1.2. Canonicalization Examples . . . . . . . . . . . . . . 10 2.1.2. Canonicalization Examples . . . . . . . . . . . . . . 10
2.2. Dictionary Structured Field Members . . . . . . . . . . . 11 2.2. Dictionary Structured Field Members . . . . . . . . . . . 11
2.2.1. Canonicalization Examples . . . . . . . . . . . . . . 11 2.2.1. Canonicalization Examples . . . . . . . . . . . . . . 11
2.3. List Prefixes . . . . . . . . . . . . . . . . . . . . . . 12 2.3. Specialty Content Fields . . . . . . . . . . . . . . . . 11
2.3.1. Canonicalization Examples . . . . . . . . . . . . . . 12 2.3.1. Request Target . . . . . . . . . . . . . . . . . . . 12
2.4. Specialty Content Fields . . . . . . . . . . . . . . . . 13 2.3.2. Signature Parameters . . . . . . . . . . . . . . . . 13
2.4.1. Request Target . . . . . . . . . . . . . . . . . . . 13 2.4. Creating the Signature Input String . . . . . . . . . . . 14
2.4.2. Signature Parameters . . . . . . . . . . . . . . . . 14 3. HTTP Message Signatures . . . . . . . . . . . . . . . . . . . 16
2.5. Creating the Signature Input String . . . . . . . . . . . 16 3.1. Creating a Signature . . . . . . . . . . . . . . . . . . 17
3. HTTP Message Signatures . . . . . . . . . . . . . . . . . . . 18 3.2. Verifying a Signature . . . . . . . . . . . . . . . . . . 18
3.1. Creating a Signature . . . . . . . . . . . . . . . . . . 18 3.2.1. Enforcing Application Requirements . . . . . . . . . 20
3.2. Verifying a Signature . . . . . . . . . . . . . . . . . . 19 3.3. Signature Algorithm Methods . . . . . . . . . . . . . . . 21
3.2.1. Enforcing Application Requirements . . . . . . . . . 21 3.3.1. RSASSA-PSS using SHA-512 . . . . . . . . . . . . . . 21
3.3. Signature Algorithm Methods . . . . . . . . . . . . . . . 22 3.3.2. RSASSA-PKCS1-v1_5 using SHA-256 . . . . . . . . . . . 22
3.3.1. RSASSA-PSS using SHA-512 . . . . . . . . . . . . . . 22 3.3.3. HMAC using SHA-256 . . . . . . . . . . . . . . . . . 22
3.3.2. RSASSA-PKCS1-v1_5 using SHA-256 . . . . . . . . . . . 23 3.3.4. ECDSA using curve P-256 DSS and SHA-256 . . . . . . . 23
3.3.3. HMAC using SHA-256 . . . . . . . . . . . . . . . . . 23 3.3.5. JSON Web Signature (JWS) algorithms . . . . . . . . . 23
3.3.4. ECDSA using curve P-256 DSS and SHA-256 . . . . . . . 24 4. Including a Message Signature in a Message . . . . . . . . . 23
3.3.5. JSON Web Signature (JWS) algorithms . . . . . . . . . 24 4.1. The 'Signature-Input' HTTP Header . . . . . . . . . . . . 24
4. Including a Message Signature in a Message . . . . . . . . . 24 4.2. The 'Signature' HTTP Header . . . . . . . . . . . . . . . 24
4.1. The 'Signature-Input' HTTP Header . . . . . . . . . . . . 25 4.3. Multiple Signatures . . . . . . . . . . . . . . . . . . . 25
4.2. The 'Signature' HTTP Header . . . . . . . . . . . . . . . 25 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 26
4.3. Multiple Signatures . . . . . . . . . . . . . . . . . . . 26 5.1. HTTP Signature Algorithms Registry . . . . . . . . . . . 26
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 27 5.1.1. Registration Template . . . . . . . . . . . . . . . . 26
5.1. HTTP Signature Algorithms Registry . . . . . . . . . . . 27 5.1.2. Initial Contents . . . . . . . . . . . . . . . . . . 27
5.1.1. Registration Template . . . . . . . . . . . . . . . . 27 5.2. HTTP Signature Metadata Parameters Registry . . . . . . . 28
5.1.2. Initial Contents . . . . . . . . . . . . . . . . . . 28 5.2.1. Registration Template . . . . . . . . . . . . . . . . 28
5.2. HTTP Signature Metadata Parameters Registry . . . . . . . 29
5.2.1. Registration Template . . . . . . . . . . . . . . . . 29
5.2.2. Initial Contents . . . . . . . . . . . . . . . . . . 29 5.2.2. Initial Contents . . . . . . . . . . . . . . . . . . 29
5.3. HTTP Signature Specialty Content Identifiers Registry . . 30 5.3. HTTP Signature Specialty Content Identifiers Registry . . 29
5.3.1. Registration Template . . . . . . . . . . . . . . . . 30 5.3.1. Registration Template . . . . . . . . . . . . . . . . 29
5.3.2. Initial Contents . . . . . . . . . . . . . . . . . . 30 5.3.2. Initial Contents . . . . . . . . . . . . . . . . . . 29
6. Security Considerations . . . . . . . . . . . . . . . . . . . 31 6. Security Considerations . . . . . . . . . . . . . . . . . . . 30
7. References . . . . . . . . . . . . . . . . . . . . . . . . . 31 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 30
7.1. Normative References . . . . . . . . . . . . . . . . . . 31 7.1. Normative References . . . . . . . . . . . . . . . . . . 30
7.2. Informative References . . . . . . . . . . . . . . . . . 32 7.2. Informative References . . . . . . . . . . . . . . . . . 31
Appendix A. Detecting HTTP Message Signatures . . . . . . . . . 33 Appendix A. Detecting HTTP Message Signatures . . . . . . . . . 32
Appendix B. Examples . . . . . . . . . . . . . . . . . . . . . . 33 Appendix B. Examples . . . . . . . . . . . . . . . . . . . . . . 32
B.1. Example Keys . . . . . . . . . . . . . . . . . . . . . . 33 B.1. Example Keys . . . . . . . . . . . . . . . . . . . . . . 32
B.1.1. Example Key RSA test . . . . . . . . . . . . . . . . 33 B.1.1. Example Key RSA test . . . . . . . . . . . . . . . . 33
B.1.2. Example Key RSA PSS test . . . . . . . . . . . . . . 34 B.1.2. Example RSA PSS Key . . . . . . . . . . . . . . . . . 33
B.1.3. Example ECC P-256 Test Key . . . . . . . . . . . . . 34
B.1.4. Example Shared Secret . . . . . . . . . . . . . . . . 35
B.2. Test Cases . . . . . . . . . . . . . . . . . . . . . . . 35 B.2. Test Cases . . . . . . . . . . . . . . . . . . . . . . . 35
B.2.1. Minimal Signature Header using rsa-pss-sha512 . . . . 36 B.2.1. Minimal Signature Header using rsa-pss-sha512 . . . . 36
B.2.2. Header Coverage . . . . . . . . . . . . . . . . . . . 36 B.2.2. Header Coverage using rsa-pss-sha512 . . . . . . . . 36
B.2.3. Full Coverage . . . . . . . . . . . . . . . . . . . . 37 B.2.3. Full Coverage using rsa-pss-sha512 . . . . . . . . . 37
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 37 B.2.4. Signing a Response using ecdsa-p256-sha256 . . . . . 37
Document History . . . . . . . . . . . . . . . . . . . . . . . . 38 B.2.5. Signing a Request using hmac-sha256 . . . . . . . . . 38
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 40 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 38
Document History . . . . . . . . . . . . . . . . . . . . . . . . 39
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 41
1. Introduction 1. Introduction
Message integrity and authenticity are important security properties Message integrity and authenticity are important security properties
that are critical to the secure operation of many HTTP applications. that are critical to the secure operation of many HTTP applications.
Application developers typically rely on the transport layer to Application developers typically rely on the transport layer to
provide these properties, by operating their application over [TLS]. provide these properties, by operating their application over [TLS].
However, TLS only guarantees these properties over a single TLS However, TLS only guarantees these properties over a single TLS
connection, and the path between client and application may be connection, and the path between client and application may be
composed of multiple independent TLS connections (for example, if the composed of multiple independent TLS connections (for example, if the
skipping to change at page 7, line 27 skipping to change at page 7, line 16
Signature. Signature.
Verifier: Verifier:
An entity that is verifying or has verified an HTTP Message An entity that is verifying or has verified an HTTP Message
Signature against an HTTP Message. Note that an HTTP Message Signature against an HTTP Message. Note that an HTTP Message
Signature may be verified multiple times, potentially by different Signature may be verified multiple times, potentially by different
entities. entities.
Covered Content: Covered Content:
An ordered list of content identifiers for headers (Section 2.1) An ordered list of content identifiers for headers (Section 2.1)
and specialty content (Section 2.4) that indicates the metadata and specialty content (Section 2.3) that indicates the metadata
and message content that is covered by the signature, not and message content that is covered by the signature, not
including the "@signature-params" specialty field itself. including the "@signature-params" specialty field itself.
HTTP Signature Algorithm: HTTP Signature Algorithm:
A cryptographic algorithm that describes the signing and A cryptographic algorithm that describes the signing and
verification process for the signature. When expressed verification process for the signature. When expressed
explicitly, the value maps to a string defined in the HTTP explicitly, the value maps to a string defined in the HTTP
Signature Algorithms Registry defined in this document. Signature Algorithms Registry defined in this document.
Key Material: Key Material:
skipping to change at page 8, line 33 skipping to change at page 8, line 23
* The set of content identifiers (Section 2) that are expected and * The set of content identifiers (Section 2) that are expected and
required. For example, an authorization protocol could mandate required. For example, an authorization protocol could mandate
that the "Authorization" header be covered to protect the that the "Authorization" header be covered to protect the
authorization credentials and mandate the signature parameters authorization credentials and mandate the signature parameters
contain a "created" parameter, while an API expecting HTTP message contain a "created" parameter, while an API expecting HTTP message
bodies could require the "Digest" header to be present and bodies could require the "Digest" header to be present and
covered. covered.
* A means of retrieving the key material used to verify the * A means of retrieving the key material used to verify the
signature. An application will usually use the "keyid" parameter signature. An application will usually use the "keyid" parameter
of the signature parameters (Section 2.4.2) and define rules for of the signature parameters (Section 2.3.2) and define rules for
resolving a key from there, though the appropriate key could be resolving a key from there, though the appropriate key could be
known from other means. known from other means.
* A means of determining the signature algorithm used to verify the * A means of determining the signature algorithm used to verify the
signature content is appropriate for the key material. For signature content is appropriate for the key material. For
example, the process could use the "alg" parameter of the example, the process could use the "alg" parameter of the
signature parameters (Section 2.4.2) to state the algorithm signature parameters (Section 2.3.2) to state the algorithm
explicitly, derive the algorithm from the key material, or use explicitly, derive the algorithm from the key material, or use
some pre-configured algorithm agreed upon by the signer and some pre-configured algorithm agreed upon by the signer and
verifier. verifier.
* A means of determining that a given key and algorithm presented in * A means of determining that a given key and algorithm presented in
the request are appropriate for the request being made. For the request are appropriate for the request being made. For
example, a server expecting only ECDSA signatures should know to example, a server expecting only ECDSA signatures should know to
reject any RSA signatures, or a server expecting asymmetric reject any RSA signatures, or a server expecting asymmetric
cryptography should know to reject any symmetric cryptography. cryptography should know to reject any symmetric cryptography.
skipping to change at page 9, line 36 skipping to change at page 9, line 28
content-identifier = sf-string parameters content-identifier = sf-string parameters
Note that this means the value of the identifier itself is encased in Note that this means the value of the identifier itself is encased in
double quotes, with parameters following as a semicolon-separated double quotes, with parameters following as a semicolon-separated
list, such as ""cache-control"", ""date"", or ""@signature-params"". list, such as ""cache-control"", ""date"", or ""@signature-params"".
The following sections define content identifier types, their The following sections define content identifier types, their
parameters, their associated content, and their canonicalization parameters, their associated content, and their canonicalization
rules. The method for combining content identifiers into the rules. The method for combining content identifiers into the
signature input string is defined in Section 2.5. signature input string is defined in Section 2.4.
2.1. HTTP Headers 2.1. HTTP Headers
The content identifier for an HTTP header is the lowercased form of The content identifier for an HTTP header is the lowercased form of
its header field name. While HTTP header field names are case- its header field name. While HTTP header field names are case-
insensitive, implementations MUST use lowercased field names (e.g., insensitive, implementations MUST use lowercased field names (e.g.,
"content-type", "date", "etag") when using them as content "content-type", "date", "etag") when using them as content
identifiers. identifiers.
Unless overridden by additional parameters and rules, the HTTP header Unless overridden by additional parameters and rules, the HTTP header
skipping to change at page 12, line 18 skipping to change at page 11, line 42
| "x-dictionary";key=a | 1 | | "x-dictionary";key=a | 1 |
+----------------------+---------------------+ +----------------------+---------------------+
| "x-dictionary";key=b | 2;x=1;y=2 | | "x-dictionary";key=b | 2;x=1;y=2 |
+----------------------+---------------------+ +----------------------+---------------------+
| "x-dictionary";key=c | (a, b, c) | | "x-dictionary";key=c | (a, b, c) |
+----------------------+---------------------+ +----------------------+---------------------+
Table 2: Non-normative examples of Table 2: Non-normative examples of
Dictionary member canonicalization. Dictionary member canonicalization.
2.3. List Prefixes 2.3. Specialty Content Fields
A prefix of a List Structured Field consisting of the first N members
in the field's value (where N is an integer greater than 0 and less
than or equal to the number of members in the List) is identified by
the parameter "prefix" with the value of N as an integer.
A list prefix value is canonicalized by applying the serialization
algorithm described in Section 4.1.1 of RFC8941 [RFC8941] on a List
containing only the first N members as specified in the list prefix,
in the order they appear in the original List.
2.3.1. Canonicalization Examples
This section contains non-normative examples of canonicalized values
for list prefixes given the following example header fields, whose
values are assumed to be Dictionaries:
X-List-A: (a b c d e f)
X-List-B: ()
The following table shows example canonicalized values for different
content identifiers, given those fields:
+=====================+=====================+
| Content Identifier | Canonicalized Value |
+=====================+=====================+
| "x-list-a";prefix=0 | () |
+---------------------+---------------------+
| "x-list-a";prefix=1 | (a) |
+---------------------+---------------------+
| "x-list-a";prefix=3 | (a, b, c) |
+---------------------+---------------------+
| "x-list-a";prefix=6 | (a, b, c, d, e, f) |
+---------------------+---------------------+
| "x-list-b";prefix=0 | () |
+---------------------+---------------------+
Table 3: Non-normative examples of list
prefix canonicalization.
2.4. Specialty Content Fields
Content not found in an HTTP header can be included in the signature Content not found in an HTTP header can be included in the signature
base string by defining a content identifier and the canonicalization base string by defining a content identifier and the canonicalization
method for its content. method for its content.
To differentiate specialty content identifiers from HTTP headers, To differentiate specialty content identifiers from HTTP headers,
specialty content identifiers MUST start with the "at" "@" character. specialty content identifiers MUST start with the "at" "@" character.
This specification defines the following specialty content This specification defines the following specialty content
identifiers: identifiers:
@request-target The target request endpoint. (Section 2.4.1) @request-target The target request endpoint. (Section 2.3.1)
@signature-params The signature metadata parameters for this @signature-params The signature metadata parameters for this
signature. (Section 2.4.2) signature. (Section 2.3.2)
Additional specialty content identifiers MAY be defined and Additional specialty content identifiers MAY be defined and
registered in the HTTP Signatures Specialty Content Identifier registered in the HTTP Signatures Specialty Content Identifier
Registry. (Section 5.3) Registry. (Section 5.3)
2.4.1. Request Target 2.3.1. Request Target
The request target endpoint, consisting of the request method and the The request target endpoint, consisting of the request method and the
path and query of the effective request URI, is identified by the path and query of the effective request URI, is identified by the
"@request-target" identifier. "@request-target" identifier.
Its value is canonicalized as follows: Its value is canonicalized as follows:
1. Take the lowercased HTTP method of the message. 1. Take the lowercased HTTP method of the message.
2. Append a space " ". 2. Append a space " ".
3. Append the path and query of the request target of the message, 3. Append the path and query of the request target of the message,
formatted according to the rules defined for the :path pseudo- formatted according to the rules defined for the :path pseudo-
header in [HTTP2], Section 8.1.2.3. The resulting string is the header in [HTTP2], Section 8.1.2.3. The resulting string is the
canonicalized value. canonicalized value.
2.4.1.1. Canonicalization Examples 2.3.1.1. Canonicalization Examples
The following table contains non-normative example HTTP messages and The following table contains non-normative example HTTP messages and
their canonicalized "@request-target" values. their canonicalized "@request-target" values.
+=========================+=================+ +=========================+=================+
|HTTP Message | @request-target | |HTTP Message | @request-target |
+=========================+=================+ +=========================+=================+
| POST /?param=value HTTP/1.1| post | | POST /?param=value HTTP/1.1| post |
| Host: www.example.com | /?param=value | | Host: www.example.com | /?param=value |
+-------------------------+-----------------+ +-------------------------+-----------------+
skipping to change at page 14, line 35 skipping to change at page 13, line 25
+-------------------------+-----------------+ +-------------------------+-----------------+
| GET http://www.example.com HTTP/1.1| get / | | GET http://www.example.com HTTP/1.1| get / |
+-------------------------+-----------------+ +-------------------------+-----------------+
| CONNECT server.example.com:80 HTTP/1.1| connect / | | CONNECT server.example.com:80 HTTP/1.1| connect / |
| Host: server.example.com| | | Host: server.example.com| |
+-------------------------+-----------------+ +-------------------------+-----------------+
| OPTIONS * HTTP/1.1 | options * | | OPTIONS * HTTP/1.1 | options * |
| Host: server.example.com| | | Host: server.example.com| |
+-------------------------+-----------------+ +-------------------------+-----------------+
Table 4: Non-normative examples of "@request-target" Table 3: Non-normative examples of "@request-target"
canonicalization. canonicalization.
2.4.2. Signature Parameters 2.3.2. Signature Parameters
HTTP Message Signatures have metadata properties that provide HTTP Message Signatures have metadata properties that provide
information regarding the signature's generation and/or verification. information regarding the signature's generation and/or verification.
The signature parameters special content is identified by the The signature parameters specialty content is identified by the
"@signature-params" identifier. "@signature-params" identifier.
Its canonicalized value is the serialization of the signature Its canonicalized value is the serialization of the signature
parameters for this signature, including the covered content list parameters for this signature, including the covered content list
with all associated parameters. The following metadata properties with all associated parameters.
are defined:
The signature parameters are serialized using the rules in Section 4 * "alg": The HTTP message signature algorithm from the HTTP Message
of RFC8941 [RFC8941] as follows: Signature Algorithm Registry, as an "sf-string" value.
1. Let the output be an empty string. * "keyid": The identifier for the key material as an "sf-string"
value.
2. Determine an order for the content identifiers of the covered * "created": Creation time as an "sf-integer" UNIX timestamp value.
content. Once this order is chosen, it cannot be changed. Sub-second precision is not supported.
3. Serialize the content identifiers of the covered content as an * "expires": Expiration time as an "sf-integer" UNIX timestamp
ordered "inner-list" according to Section 4.1.1.1 of RFC8941 value. Sub-second precision is not supported.
[RFC8941] and append this to the output.
4. Determine an order for signature metadata parameters. Once this * "nonce": A random unique value generated for this signature.
order is chosen, it cannot be changed.
5. Append the signature metadata as parameters according to Additional parameters can be defined in the HTTP Signature Parameters
Section 4.1.1.2 of RFC8941 [RFC8941] in the chosen order, Registry (Section 5.2.2).
skipping fields that are not available or not used for this
signature:
* "alg": The HTTP message signature algorithm from the HTTP The signature parameters are serialized using the rules in Section 4
Message Signature Algorithm Registry, as an "sf-string" value. of RFC8941 [RFC8941] as follows:
* "keyid": The identifier for the key material as an "sf-string" 1. Let the output be an empty string.
value.
* "created": Creation time as an "sf-integer" UNIX timestamp 2. Determine an order for the content identifiers of the covered
value. Sub-second precision is not supported. content. Once this order is chosen, it cannot be changed.
* "expires": Expiration time as an "sf-integer" UNIX timestamp 3. Serialize the content identifiers of the covered content,
value. Sub-second precision is not supported. including all parameters, as an ordered "inner-list" according to
Section 4.1.1.1 of RFC8941 [RFC8941] and append this to the
output.
* "nonce": A random unique value generated for this signature. 4. Determine an order for any signature parameters. Once this order
is chosen, it cannot be changed.
5. Append the parameters to the "inner-list" in the chosen order
according to Section 4.1.1.2 of RFC8941 [RFC8941], skipping
parameters that are not available or not used for this signature.
6. The output contains the signature parameters value. 6. The output contains the signature parameters value.
Note that the "inner-list" serialization is used for the covered Note that the "inner-list" serialization is used for the covered
content value instead of the "sf-list" serialization in order to content value instead of the "sf-list" serialization in order to
facilitate this value's additional inclusion in the "Signature-Input" facilitate this value's additional inclusion in the "Signature-Input"
header's dictionary, as discussed in Section 4.1. header's dictionary, as discussed in Section 4.1.
This example shows a canonicalized value for the parameters of a This example shows a canonicalized value for the parameters of a
given signature: given signature:
("@request-target" "host" "date" "cache-control" "x-empty-header" \ ("@request-target" "host" "date" "cache-control" "x-empty-header" \
"x-example");keyid="test-key-rsa-pss";alg="rsa-pss-sha512";\ "x-example");keyid="test-key-rsa-pss";alg="rsa-pss-sha512";\
created=1618884475;expires=1618884775 created=1618884475;expires=1618884775
Note that an HTTP message could contain multiple signatures, but only Note that an HTTP message could contain multiple signatures, but only
the signature parameters used for the current signature are included the signature parameters used for the current signature are included
in this field. in this field.
2.5. Creating the Signature Input String 2.4. Creating the Signature Input String
The signature input is a US-ASCII string containing the content that The signature input is a US-ASCII string containing the content that
is covered by the signature. To create the signature input string, is covered by the signature. To create the signature input string,
the signer or verifier concatenates together entries for each the signer or verifier concatenates together entries for each
identifier in the signature's covered content and parameters using identifier in the signature's covered content and parameters using
the following algorithm: the following algorithm:
1. Let the output be an empty string. 1. Let the output be an empty string.
2. For each covered content item in the covered content list (in 2. For each covered content item in the covered content list (in
order): order):
1. Append the identifier for the covered content serialized 1. Append the identifier for the covered content serialized
according to the "content-identifier" rule. according to the "content-identifier" rule.
2. Append a single colon "":"" 2. Append a single colon "":""
3. Append a single space "" "" 3. Append a single space "" ""
4. Append the covered content's canonicalized value, as defined 4. Append the covered content's canonicalized value, as defined
by the covered content type. (Section 2.1 and Section 2.4) by the covered content type. (Section 2.1 and Section 2.3)
5. Append a single newline ""\\n"" 5. Append a single newline ""\\n""
3. Append the signature parameters (Section 2.4.2) as follows: 3. Append the signature parameters (Section 2.3.2) as follows:
1. Append the identifier for the signature parameters serialized 1. Append the identifier for the signature parameters serialized
according to the "content-identifier" rule, ""@signature- according to the "content-identifier" rule, ""@signature-
params"" params""
2. Append a single colon "":"" 2. Append a single colon "":""
3. Append a single space "" "" 3. Append a single space "" ""
4. Append the signature parameters' canonicalized value as 4. Append the signature parameters' canonicalized value as
defined in Section 2.4.2 defined in Section 2.3.2
4. Return the output string. 4. Return the output string.
If covered content references an identifier that cannot be resolved If covered content references an identifier that cannot be resolved
to a value in the message, the implementation MUST produce an error. to a value in the message, the implementation MUST produce an error.
Such situations are included but not limited to: Such situations are included but not limited to:
* The signer or verifier does not understand the content identifier. * The signer or verifier does not understand the content identifier.
* The identifier identifies a header field that is not present in * The identifier identifies a header field that is not present in
the message or whose value is malformed. the message or whose value is malformed.
* The identifier is a Dictionary member identifier that references a * The identifier is a Dictionary member identifier that references a
header field that is not present in the message, is not a header field that is not present in the message, is not a
Dictionary Structured Field, or whose value is malformed. Dictionary Structured Field, or whose value is malformed.
* The identifier is a List Prefix member identifier that references
a header field that is not present in the message, is not a List
Structured Field, or whose value is malformed.
* The identifier is a Dictionary member identifier that references a * The identifier is a Dictionary member identifier that references a
member that is not present in the header field value, or whose member that is not present in the header field value, or whose
value is malformed. E.g., the identifier is value is malformed. E.g., the identifier is
""x-dictionary";key=c" and the value of the "x-dictionary" header ""x-dictionary";key="c"" and the value of the "x-dictionary"
field is "a=1, b=2" header field is "a=1, b=2"
* The identifier is a List Prefix member identifier that specifies
more List members than are present the header field. E.g., the
identifier is ""x-list";prefix=3" and the value of the "x-list"
header field is "(1, 2)".
In the following non-normative example, the HTTP message being signed In the following non-normative example, the HTTP message being signed
is the following request: is the following request:
GET /foo HTTP/1.1 GET /foo HTTP/1.1
Host: example.org Host: example.org
Date: Tue, 20 Apr 2021 02:07:55 GMT Date: Tue, 20 Apr 2021 02:07:55 GMT
X-Example: Example header X-Example: Example header
with some whitespace. with some whitespace.
X-Empty-Header: X-Empty-Header:
Cache-Control: max-age=60 Cache-Control: max-age=60
Cache-Control: must-revalidate Cache-Control: must-revalidate
The covered content consists of the "@request-target" speciality The covered content consists of the "@request-target" specialty
header followed by the "Host", "Date", "Cache-Control", "X-Empty- content followed by the "Host", "Date", "Cache-Control", "X-Empty-
Header", "X-Example" HTTP headers, in order. The signature creation Header", "X-Example" HTTP headers, in order. The signature creation
timestamp is "1618884475" and the key identifier is "test-key-rsa- timestamp is "1618884475" and the key identifier is "test-key-rsa-
pss". The signature input string for this message with these pss". The signature input string for this message with these
parameters is: parameters is:
"@request-target": get /foo "@request-target": get /foo
"host": example.org "host": example.org
"date": Tue, 20 Apr 2021 02:07:55 GMT "date": Tue, 20 Apr 2021 02:07:55 GMT
"cache-control": max-age=60, must-revalidate "cache-control": max-age=60, must-revalidate
"x-empty-header": "x-empty-header":
skipping to change at page 18, line 43 skipping to change at page 17, line 33
4. The signer creates an ordered list of content identifiers 4. The signer creates an ordered list of content identifiers
representing the message content and signature metadata to be representing the message content and signature metadata to be
covered by the signature, and assigns this list as the covered by the signature, and assigns this list as the
signature's Covered Content. signature's Covered Content.
* Once an order of covered content is chosen, the order MUST NOT * Once an order of covered content is chosen, the order MUST NOT
change for the life of the signature. change for the life of the signature.
* Each covered content identifier MUST either reference an HTTP * Each covered content identifier MUST either reference an HTTP
header in the request message Section 2.1 or reference a header in the request message Section 2.1 or reference a
specialty content field listed in Section 2.4 or its specialty content field listed in Section 2.3 or its
associated registry. associated registry.
* Signers SHOULD include "@request-target" in the covered * Signers SHOULD include "@request-target" in the covered
content list list. content list.
* Signers SHOULD include a date stamp in some form, such as * Signers SHOULD include a date stamp in some form, such as
using the "date" header. Alternatively, the "created" using the "date" header. Alternatively, the "created"
signature metadata parameter can fulfil this role. signature metadata parameter can fulfil this role.
* Further guidance on what to include in this list and in what * Further guidance on what to include in this list and in what
order is out of scope for this document. However, note that order is out of scope for this document. However, note that
the list order is significant and once established for a given the list order is significant and once established for a given
signature it MUST be preserved for that signature. signature it MUST be preserved for that signature.
* Note that the "@signature-params" specialty identifier is not * Note that the "@signature-params" specialty identifier is not
explicitly listed in the list of covered content identifiers, explicitly listed in the list of covered content identifiers,
because it is required to always be present as the last line because it is required to always be present as the last line
in the signature input. This ensures that a signature always in the signature input. This ensures that a signature always
covers its own metadata. covers its own metadata.
5. The signer creates the signature input string. (Section 2.5) 5. The signer creates the signature input string. (Section 2.4)
6. The signer signs the signature input with the chosen signing 6. The signer signs the signature input with the chosen signing
algorithm using the key material chosen by the signer. Several algorithm using the key material chosen by the signer. Several
signing algorithms are defined in in Section 3.3. signing algorithms are defined in in Section 3.3.
7. The byte array output of the signature function is the HTTP 7. The byte array output of the signature function is the HTTP
message signature output value to be included in the "Signature" message signature output value to be included in the "Signature"
header as defined in Section 4.2. header as defined in Section 4.2.
For example, given the HTTP message and signature parameters in the For example, given the HTTP message and signature parameters in the
example in Section 2.5, the example signature input string when example in Section 2.4, the example signature input string when
signed with the "test-key-rsa-pss" key in Appendix B.1.2 gives the signed with the "test-key-rsa-pss" key in Appendix B.1.2 gives the
following message signature output value, encoded in Base64: following message signature output value, encoded in Base64:
:H00a6KdNCRWgOWBMvuRtxh6c/wrVxwt2p5KyqBJqmtPbNTd980hWwkUE6H4NWiTs5f2Ef0\ lPxkxqDEPhgrx1yPaKLO7eJ+oPjSwsQ5NjWNRfYP7Jw0FwnK1k8/GH7g5s2q0VTTKVm\
qJ3iypXT2bR9Pc+PVU9U2gAzTcZKK8MDJLjYKfaE835zg/9sOdGR+tlRJ1cbCoWMVoCgEPi\ xyfpUDp/HsDphh5Z7Fa/lvtujHyFe/0EP9z7bnVb7YBZrxV52LGvP8p4APhOYuG4yaH\
4t6QewbI0xgdx8AmP5ItTunYmhe8G0JR42lfvz60+szb8SpwJEmkMPr5dBOz6DLEeM3IgKN\ z478GsJav9BQYK0B2IOHdLFJe8qwWPJs07J47gPewpNwCt0To/zZ2KPpylGX5UHVgJP\
oBlJPp94WSJkgvwTM64rXw049ZkYenl9jwKlcXEmA1a4MNWoUElr6eh5k20djMZftCYTPUU\ Uom64KjX43u2OwIvSoPEYk4nuBvLR9yxYAHURaTfLoEDUCtY1FsU1hOfG3jAlcT6ill\
PMxZUavcQy+cp6lfKonz6HIDe3+n3VOTOo8uu1aSVfKQQzR+ZEwSaZQBrdQ==: fnyS72PEdSSzw1KsxroMj9IYpFhva77YxmJRk4pCIW0F0Kj0ukl7J4y2aZJHMCYI3g8\
yfqh/wQ==
Figure 2: Non-normative example signature value Figure 2: Non-normative example signature value
3.2. Verifying a Signature 3.2. Verifying a Signature
A verifier processes a signature and its associated signature input A verifier processes a signature and its associated signature input
parameters in concert with each other. parameters in concert with each other.
In order to verify a signature, a verifier MUST follow the following In order to verify a signature, a verifier MUST follow the following
algorithm: algorithm:
1. Parse the "Signature" and "Signature-Input" headers and extract 1. Parse the "Signature" and "Signature-Input" headers and extract
skipping to change at page 21, line 7 skipping to change at page 19, line 45
4. If the algorithm is specified in more that one location, such 4. If the algorithm is specified in more that one location, such
as through static configuration and the algorithm signature as through static configuration and the algorithm signature
parameter, or the algorithm signature parameter and from the parameter, or the algorithm signature parameter and from the
key material itself, the resolved algorithms MUST be the key material itself, the resolved algorithms MUST be the
same. If the algorithms are not the same, the verifier MUST same. If the algorithms are not the same, the verifier MUST
vail the verification. vail the verification.
7. Use the received HTTP message and the signature's metadata to 7. Use the received HTTP message and the signature's metadata to
recreate the signature input, using the process described in recreate the signature input, using the process described in
Section 2.5. The value of the "@signature-params" input is the Section 2.4. The value of the "@signature-params" input is the
value of the SignatureInput header field for this signature value of the SignatureInput header field for this signature
serialized according to the rules described in Section 2.4.2, not serialized according to the rules described in Section 2.3.2, not
including the signature's label from the "Signature-Input" including the signature's label from the "Signature-Input"
header. header.
8. If the key material is appropriate for the algorithm, apply the 8. If the key material is appropriate for the algorithm, apply the
verification algorithm to the signature, recalculated signature verification algorithm to the signature, recalculated signature
input, signature parameters, key material, and algorithm. input, signature parameters, key material, and algorithm.
Several algorithms are defined in Section 3.3. Several algorithms are defined in Section 3.3.
9. The results of the verification algorithm function are the final 9. The results of the verification algorithm function are the final
results of the signature verification. results of the signature verification.
skipping to change at page 22, line 15 skipping to change at page 21, line 11
Applications MUST enforce the requirements defined in this document. Applications MUST enforce the requirements defined in this document.
Regardless of use case, applications MUST NOT accept signatures that Regardless of use case, applications MUST NOT accept signatures that
do not conform to these requirements. do not conform to these requirements.
3.3. Signature Algorithm Methods 3.3. Signature Algorithm Methods
HTTP Message signatures MAY use any cryptographic digital signature HTTP Message signatures MAY use any cryptographic digital signature
or MAC method that is appropriate for the key material, environment, or MAC method that is appropriate for the key material, environment,
and needs of the signer and verifier. All signatures are generated and needs of the signer and verifier. All signatures are generated
from and verified against the byte values of the signature input from and verified against the byte values of the signature input
string defined in Section 2.5. string defined in Section 2.4.
Each signature algorithm method takes as its input the signature Each signature algorithm method takes as its input the signature
input string as a set of byte values ("I"), the signing key material input string as a set of byte values ("I"), the signing key material
("Ks"), and outputs the signed content as a set of byte values ("S"): ("Ks"), and outputs the signed content as a set of byte values ("S"):
HTTP_SIGN (I, Ks) -> S HTTP_SIGN (I, Ks) -> S
Each verification algorithm method takes as its input the Each verification algorithm method takes as its input the
recalculated signature input string as a set of byte values ("I"), recalculated signature input string as a set of byte values ("I"),
the verification key material ("Kv"), and the presented signature to the verification key material ("Kv"), and the presented signature to
be verified as a set of byte values ("S") and outputs the be verified as a set of byte values ("S") and outputs the
verification result ("V") as a boolean: verification result ("V") as a boolean:
HTTP_VERIFY (I, Kv, S) -> V HTTP_VERIFY (I, Kv, S) -> V
This section contains several common algorithm methods. The method This section contains several common algorithm methods. The method
to use can be communicated through the algorithm signature parameter to use can be communicated through the algorithm signature parameter
defined in Section 2.4.2, by reference to the key material, or defined in Section 2.3.2, by reference to the key material, or
through mutual agreement between the signer and verifier. through mutual agreement between the signer and verifier.
3.3.1. RSASSA-PSS using SHA-512 3.3.1. RSASSA-PSS using SHA-512
To sign using this algorithm, the signer applies the "RSASSA-PSS-SIGN To sign using this algorithm, the signer applies the "RSASSA-PSS-SIGN
(K, M)" function [RFC8017] with the signer's private signing key (K, M)" function [RFC8017] with the signer's private signing key
("K") and the signature input string ("M") (Section 2.5). The hash ("K") and the signature input string ("M") (Section 2.4). The mask
SHA-512 [RFC6234] is applied to the signature input string to create generation function is "MGF1" as specified in [RFC8017] with a hash
the digest content to which the digital signature is applied. The function of SHA-512 [RFC6234]. The salt length ("sLen") is 64 bytes.
resulting signed content byte array ("S") is the HTTP message The hash function ("Hash") SHA-512 [RFC6234] is applied to the
signature output used in Section 3.1. signature input string to create the digest content to which the
digital signature is applied. The resulting signed content byte
array ("S") is the HTTP message signature output used in Section 3.1.
To verify using this algorithm, the verifier applies the "RSASSA-PSS- To verify using this algorithm, the verifier applies the "RSASSA-PSS-
VERIFY ((n, e), M, S)" function [RFC8017] using the public key VERIFY ((n, e), M, S)" function [RFC8017] using the public key
portion of the verification key material ("(n, e)") and the signature portion of the verification key material ("(n, e)") and the signature
input string ("M") re-created as described in Section 3.2. The hash input string ("M") re-created as described in Section 3.2. The mask
function SHA-512 [RFC6234] is applied to the signature input string generation function is "MGF1" as specified in [RFC8017] with a hash
to create the digest content to which the verification function is function of SHA-512 [RFC6234]. The salt length ("sLen") is 64 bytes.
applied. The verifier extracts the HTTP message signature to be The hash function ("Hash") SHA-512 [RFC6234] is applied to the
verified ("S") as described in Section 3.2. The results of the signature input string to create the digest content to which the
verification function are compared to the http message signature to verification function is applied. The verifier extracts the HTTP
determine if the signature presented is valid. message signature to be verified ("S") as described in Section 3.2.
The results of the verification function are compared to the http
message signature to determine if the signature presented is valid.
3.3.2. RSASSA-PKCS1-v1_5 using SHA-256 3.3.2. RSASSA-PKCS1-v1_5 using SHA-256
To sign using this algorithm, the signer applies the "RSASSA- To sign using this algorithm, the signer applies the "RSASSA-
PKCS1-V1_5-SIGN (K, M)" function [RFC8017] with the signer's private PKCS1-V1_5-SIGN (K, M)" function [RFC8017] with the signer's private
signing key ("K") and the signature input string ("M") (Section 2.5). signing key ("K") and the signature input string ("M") (Section 2.4).
The hash SHA-256 [RFC6234] is applied to the signature input string The hash SHA-256 [RFC6234] is applied to the signature input string
to create the digest content to which the digital signature is to create the digest content to which the digital signature is
applied. The resulting signed content byte array ("S") is the HTTP applied. The resulting signed content byte array ("S") is the HTTP
message signature output used in Section 3.1. message signature output used in Section 3.1.
To verify using this algorithm, the verifier applies the "RSASSA-PSS- To verify using this algorithm, the verifier applies the "RSASSA-
VERIFY ((n, e), M, S)" function [RFC8017] using the public key PKCS1-V1_5-VERIFY ((n, e), M, S)" function [RFC8017] using the public
portion of the verification key material ("(n, e)") and the signature key portion of the verification key material ("(n, e)") and the
input string ("M") re-created as described in Section 3.2. The hash signature input string ("M") re-created as described in Section 3.2.
function SHA-256 [RFC6234] is applied to the signature input string The hash function SHA-256 [RFC6234] is applied to the signature input
to create the digest content to which the verification function is string to create the digest content to which the verification
applied. The verifier extracts the HTTP message signature to be function is applied. The verifier extracts the HTTP message
verified ("S") as described in Section 3.2. The results of the signature to be verified ("S") as described in Section 3.2. The
verification function are compared to the http message signature to results of the verification function are compared to the http message
determine if the signature presented is valid. signature to determine if the signature presented is valid.
3.3.3. HMAC using SHA-256 3.3.3. HMAC using SHA-256
To sign and verify using this algorithm, the signer applies the To sign and verify using this algorithm, the signer applies the
"HMAC" function [RFC2104] with the shared signing key ("K") and the "HMAC" function [RFC2104] with the shared signing key ("K") and the
signature input string ("text") (Section 2.5). The hash function signature input string ("text") (Section 2.4). The hash function
SHA-256 [RFC6234] is applied to the signature input string to create SHA-256 [RFC6234] is applied to the signature input string to create
the digest content to which the HMAC is applied, giving the signature the digest content to which the HMAC is applied, giving the signature
result. result.
For signing, the resulting value is the HTTP message signature output For signing, the resulting value is the HTTP message signature output
used in Section 3.1. used in Section 3.1.
For verification, the verifier extracts the HTTP message signature to For verification, the verifier extracts the HTTP message signature to
be verified ("S") as described in Section 3.2. The output of the be verified ("S") as described in Section 3.2. The output of the
HMAC function is compared to the value of the HTTP message signature, HMAC function is compared to the value of the HTTP message signature,
and the results of the comparison determine the validity of the and the results of the comparison determine the validity of the
signature presented. signature presented.
3.3.4. ECDSA using curve P-256 DSS and SHA-256 3.3.4. ECDSA using curve P-256 DSS and SHA-256
To sign using this algorithm, the signer applies the "ECDSA" To sign using this algorithm, the signer applies the "ECDSA"
algorithm [FIPS186-4] using curve P-256 with the signer's private algorithm [FIPS186-4] using curve P-256 with the signer's private
signing key and the signature input string (Section 2.5). The hash signing key and the signature input string (Section 2.4). The hash
SHA-256 [RFC6234] is applied to the signature input string to create SHA-256 [RFC6234] is applied to the signature input string to create
the digest content to which the digital signature is applied. The the digest content to which the digital signature is applied. The
resulting signed content byte array is the HTTP message signature resulting signed content byte array is the HTTP message signature
output used in Section 3.1. output used in Section 3.1.
To verify using this algorithm, the verifier applies the "ECDSA" To verify using this algorithm, the verifier applies the "ECDSA"
algorithm [FIPS186-4] using the public key portion of the algorithm [FIPS186-4] using the public key portion of the
verification key material and the signature input string re-created verification key material and the signature input string re-created
as described in Section 3.2. The hash function SHA-256 [RFC6234] is as described in Section 3.2. The hash function SHA-256 [RFC6234] is
applied to the signature input string to create the digest content to applied to the signature input string to create the digest content to
skipping to change at page 24, line 36 skipping to change at page 23, line 36
3.3.5. JSON Web Signature (JWS) algorithms 3.3.5. JSON Web Signature (JWS) algorithms
If the signing algorithm is a JOSE signing algorithm from the JSON If the signing algorithm is a JOSE signing algorithm from the JSON
Web Signature and Encryption Algorithms Registry established by Web Signature and Encryption Algorithms Registry established by
[RFC7518], the JWS algorithm definition determines the signature and [RFC7518], the JWS algorithm definition determines the signature and
hashing algorithms to apply for both signing and verification. There hashing algorithms to apply for both signing and verification. There
is no use of the explicit "alg" signature parameter when using JOSE is no use of the explicit "alg" signature parameter when using JOSE
signing algorithms. signing algorithms.
For both signing and verification, the HTTP messages signature input For both signing and verification, the HTTP messages signature input
string (Section 2.5) is used as the entire "JWS Signing Input". The string (Section 2.4) is used as the entire "JWS Signing Input". The
JOSE Header defined in [RFC7517] is not used, and the signature input JOSE Header defined in [RFC7517] is not used, and the signature input
string is not first encoded in Base64 before applying the algorithm. string is not first encoded in Base64 before applying the algorithm.
The output of the JWS signature is taken as a byte array prior to the The output of the JWS signature is taken as a byte array prior to the
Base64url encoding used in JOSE. Base64url encoding used in JOSE.
The JWS algorithm MUST NOT be "none" and MUST NOT be any algorithm The JWS algorithm MUST NOT be "none" and MUST NOT be any algorithm
with a JOSE Implementation Requirement of "Prohibited". with a JOSE Implementation Requirement of "Prohibited".
4. Including a Message Signature in a Message 4. Including a Message Signature in a Message
Message signatures can be included within an HTTP message via the Message signatures can be included within an HTTP message via the
"Signature-Input" and "Signature" HTTP header fields, both defined "Signature-Input" and "Signature" HTTP header fields, both defined
within this specification. within this specification.
An HTTP message signature MUST use both headers: the "Signature" HTTP An HTTP message signature MUST use both headers: the "Signature" HTTP
header field contains the signature value, while the "Signature- header field contains the signature value, while the "Signature-
Input" HTTP header field identifies the covered content and Input" HTTP header field identifies the covered content and
parameters that describe how the signature was generated. The Each parameters that describe how the signature was generated. Each
header MAY contain multiple labeled values, where the labels header MAY contain multiple labeled values, where the labels
determine the correlation between the "Signature" and "Signature- determine the correlation between the "Signature" and "Signature-
Input" fields. Input" fields.
4.1. The 'Signature-Input' HTTP Header 4.1. The 'Signature-Input' HTTP Header
The "Signature-Input" HTTP header field is a Dictionary Structured The "Signature-Input" HTTP header field is a Dictionary Structured
Header [RFC8941] containing the metadata for one or more message Header [RFC8941] containing the metadata for one or more message
signatures generated from content within the HTTP message. Each signatures generated from content within the HTTP message. Each
member describes a single message signature. The member's name is an member describes a single message signature. The member's name is an
identifier that uniquely identifies the message signature within the identifier that uniquely identifies the message signature within the
context of the HTTP message. The member's value is the serialization context of the HTTP message. The member's value is the serialization
of the covered content including all signature metadata parameters, of the covered content including all signature metadata parameters,
using the serialization process defined in Section 2.4.2. using the serialization process defined in Section 2.3.2.
Signature-Input: sig1=("@request-target" "host" "date" "cache-control" \ Signature-Input: sig1=("@request-target" "host" "date" \
"x-empty-header" "x-example");created=1618884475;\ "cache-control" "x-empty-header" "x-example");created=1618884475\
keyid="test-key-rsa-pss" ;keyid="test-key-rsa-pss"
To facilitate signature validation, the "Signature-Input" header To facilitate signature validation, the "Signature-Input" header
value MUST contain the same serialized value used in generating the value MUST contain the same serialized value used in generating the
signature input string's "@signature-params" value. signature input string's "@signature-params" value.
4.2. The 'Signature' HTTP Header 4.2. The 'Signature' HTTP Header
The "Signature" HTTP header field is a Dictionary Structured Header The "Signature" HTTP header field is a Dictionary Structured Header
[RFC8941] containing one or more message signatures generated from [RFC8941] containing one or more message signatures generated from
content within the HTTP message. Each member's name is a signature content within the HTTP message. Each member's name is a signature
identifier that is present as a member name in the "Signature-Input" identifier that is present as a member name in the "Signature-Input"
Structured Header within the HTTP message. Each member's value is a Structured Header within the HTTP message. Each member's value is a
Byte Sequence containing the signature value for the message Byte Sequence containing the signature value for the message
signature identified by the member name. Any member in the signature identified by the member name. Any member in the
"Signature" HTTP header field that does not have a corresponding "Signature" HTTP header field that does not have a corresponding
member in the HTTP message's "Signature-Input" HTTP header field MUST member in the HTTP message's "Signature-Input" HTTP header field MUST
be ignored. be ignored.
Signature: sig1=:H00a6KdNCRWgOWBMvuRtxh6c/wrVxwt2p5KyqBJqmtPbNTd980hWwk\ Signature: sig1=:lPxkxqDEPhgrx1yPaKLO7eJ+oPjSwsQ5NjWNRfYP7Jw0FwnK1k\
UE6H4NWiTs5f2Ef0qJ3iypXT2bR9Pc+PVU9U2gAzTcZKK8MDJLjYKfaE835zg/9sOdGR+\ 8/GH7g5s2q0VTTKVmxyfpUDp/HsDphh5Z7Fa/lvtujHyFe/0EP9z7bnVb7YBZrxV5\
tlRJ1cbCoWMVoCgEPi4t6QewbI0xgdx8AmP5ItTunYmhe8G0JR42lfvz60+szb8SpwJEm\ 2LGvP8p4APhOYuG4yaHz478GsJav9BQYK0B2IOHdLFJe8qwWPJs07J47gPewpNwCt\
kMPr5dBOz6DLEeM3IgKNoBlJPp94WSJkgvwTM64rXw049ZkYenl9jwKlcXEmA1a4MNWoU\ 0To/zZ2KPpylGX5UHVgJPUom64KjX43u2OwIvSoPEYk4nuBvLR9yxYAHURaTfLoED\
Elr6eh5k20djMZftCYTPUUPMxZUavcQy+cp6lfKonz6HIDe3+n3VOTOo8uu1aSVfKQQzR\ UCtY1FsU1hOfG3jAlcT6illfnyS72PEdSSzw1KsxroMj9IYpFhva77YxmJRk4pCIW\
+ZEwSaZQBrdQ==: 0F0Kj0ukl7J4y2aZJHMCYI3g8yfqh/wQ==:
4.3. Multiple Signatures 4.3. Multiple Signatures
Since "Signature-Input" and "Signature" are both defined as Since "Signature-Input" and "Signature" are both defined as
Dictionary Structured Headers, they can be used to include multiple Dictionary Structured Headers, they can be used to include multiple
signatures within the same HTTP message. For example, a signer may signatures within the same HTTP message. For example, a signer may
include multiple signatures signing the same content with different include multiple signatures signing the same content with different
keys or algorithms to support verifiers with different capabilities, keys or algorithms to support verifiers with different capabilities,
or a reverse proxy may include information about the client in header or a reverse proxy may include information about the client in header
fields when forwarding the request to a service host, including a fields when forwarding the request to a service host, including a
signature over those fields and the client's original signature. signature over those fields and the client's original signature.
The following is a non-normative example of header fields a reverse The following is a non-normative example of header fields a reverse
proxy in addition to the examples in the previous sections. The proxy sets in addition to the examples in the previous sections. The
original signature is included under the identifier "sig1", and the original signature is included under the identifier "sig1", and the
reverse proxy's signature is included under "proxy_sig". The proxy reverse proxy's signature is included under "proxy_sig". The proxy
uses the key "rsa-test-key" to create its signature using the "rsa- uses the key "rsa-test-key" to create its signature using the "rsa-
v1_5-sha256" signature value. This results in a signature input v1_5-sha256" signature value. This results in a signature input
string of: string of:
"signature";key="sig1": :H00a6KdNCRWgOWBMvuRtxh6c/wrVxwt2p5KyqBJqmtPbNT\ "signature";key="sig1": \
d980hWwkUE6H4NWiTs5f2Ef0qJ3iypXT2bR9Pc+PVU9U2gAzTcZKK8MDJLjYKfaE835zg\ :lPxkxqDEPhgrx1yPaKLO7eJ+oPjSwsQ5NjWNRfYP7Jw0FwnK1k8/GH7g5s2q0VTT\
/9sOdGR+tlRJ1cbCoWMVoCgEPi4t6QewbI0xgdx8AmP5ItTunYmhe8G0JR42lfvz60+sz\ KVmxyfpUDp/HsDphh5Z7Fa/lvtujHyFe/0EP9z7bnVb7YBZrxV52LGvP8p4APhOYu\
b8SpwJEmkMPr5dBOz6DLEeM3IgKNoBlJPp94WSJkgvwTM64rXw049ZkYenl9jwKlcXEmA\ G4yaHz478GsJav9BQYK0B2IOHdLFJe8qwWPJs07J47gPewpNwCt0To/zZ2KPpylGX\
1a4MNWoUElr6eh5k20djMZftCYTPUUPMxZUavcQy+cp6lfKonz6HIDe3+n3VOTOo8uu1a\ 5UHVgJPUom64KjX43u2OwIvSoPEYk4nuBvLR9yxYAHURaTfLoEDUCtY1FsU1hOfG3\
SVfKQQzR+ZEwSaZQBrdQ==: jAlcT6illfnyS72PEdSSzw1KsxroMj9IYpFhva77YxmJRk4pCIW0F0Kj0ukl7J4y2\
x-forwarded-for: 192.0.2.123 aZJHMCYI3g8yfqh/wQ==:
"@signature-params": ("signature";key="sig1" x-forwarded-for)\ "x-forwarded-for": 192.0.2.123
;created=1618884475;keyid="test-key-rsa";alg="rsa-v1_5-sha256" "@signature-params": ("signature";key="sig1" "x-forwarded-for")\
;created=1618884480;keyid="test-key-rsa";alg="rsa-v1_5-sha256"
And a signature output value of: And a signature output value of:
:NgQsRJwOL/EgoRXdcmHMOLZM+KWqLDsO76CrqoiLH279VJs9Fj6bn4V+perAEUbHBEMFCb\ XD1O/vEh772WVpY7jYvReXop2+b7xTIIPKH8/OCYzPn78Wd9jodCwAJPF5TYCn9L6n6\
l6tucEVgKrU+5IIyDMBI85FExQeuBrNPALczjCdxne6LUoBcWBAk8NoRyjfd++DXIAjAZcf\ 8j4EjGsqFOMkVLVdSQEZqMLjEbvMEdIe8m1a0CLd5kydeaAwoHoglqod6ijkwhhEtxt\
/hBUXLll+5veI0ynzBRFTZ4v8AbluYODjJlSprYEwUb2ndbFr12vzgIpy0uTQCslN+3rUUZ\ aD8tDZmihQw2mZEH8u4aMSnRntqy7ExCNld0JLharsHV0iCbRO9jIP+d2ApD7gB+eZp\
+lQWlrILvbR0CIvtGwk2+hE0dTRAG0R3wmlR24mhSqiE5RADyoSWQVjVxntp98XHAB6MZE9\ n3pIvvVJZlxTwPkahFpxKlQtNMPaSqa1lvejURx+ST8CEuz4sS+G/oLJiX3MZenuUoO\
2bbu2a8Uo951Hvah03XHWEk/WiYdq+mt3hwXVPLXlBU9DWCo2AaYD/rkXtQ==: R8HeOHDnjN/VLzrEN4x44iF7WIL+iY2PtK87LUWRAsJAX9GqHL/upsGh1nxIdoVaoLV\
V5w+fRw==
These values are added to the HTTP request message by the proxy. The These values are added to the HTTP request message by the proxy. The
different signature values are wrapped onto separate lines to different signature values are wrapped onto separate lines to
increase human-readability of the result. increase human-readability of the result.
X-Forwarded-For: 192.0.2.123 X-Forwarded-For: 192.0.2.123
Signature-Input: sig1=("@request-target" "host" "date" "cache-control" \ Signature-Input: sig1=("@request-target" "host" "date" \
"x-empty-header" "x-example");created=1618884475\ "cache-control" "x-empty-header" "x-example")\
;keyid="test-key-rsa-pss", \ ;created=1618884475;keyid="test-key-rsa-pss", \
proxy_sig=("signature";key="sig1" x-forwarded-for);created=1618884480\ proxy_sig=("signature";key="sig1" "x-forwarded-for")\
;keyid="test-key-rsa";alg="rsa-v1_5-sha256" ;created=1618884480;keyid="test-key-rsa";alg="rsa-v1_5-sha256"
Signature: sig1=:H00a6KdNCRWgOWBMvuRtxh6c/wrVxwt2p5KyqBJqmtPbNTd980hWwk\ Signature: sig1=:lPxkxqDEPhgrx1yPaKLO7eJ+oPjSwsQ5NjWNRfYP7Jw0FwnK1k\
UE6H4NWiTs5f2Ef0qJ3iypXT2bR9Pc+PVU9U2gAzTcZKK8MDJLjYKfaE835zg/9sOdG\ 8/GH7g5s2q0VTTKVmxyfpUDp/HsDphh5Z7Fa/lvtujHyFe/0EP9z7bnVb7YBZrx\
R+tlRJ1cbCoWMVoCgEPi4t6QewbI0xgdx8AmP5ItTunYmhe8G0JR42lfvz60+szb8Sp\ V52LGvP8p4APhOYuG4yaHz478GsJav9BQYK0B2IOHdLFJe8qwWPJs07J47gPewp\
wJEmkMPr5dBOz6DLEeM3IgKNoBlJPp94WSJkgvwTM64rXw049ZkYenl9jwKlcXEmA1a\ NwCt0To/zZ2KPpylGX5UHVgJPUom64KjX43u2OwIvSoPEYk4nuBvLR9yxYAHURa\
4MNWoUElr6eh5k20djMZftCYTPUUPMxZUavcQy+cp6lfKonz6HIDe3+n3VOTOo8uu1a\ TfLoEDUCtY1FsU1hOfG3jAlcT6illfnyS72PEdSSzw1KsxroMj9IYpFhva77Yxm\
SVfKQQzR+ZEwSaZQBrdQ==:, \ JRk4pCIW0F0Kj0ukl7J4y2aZJHMCYI3g8yfqh/wQ==:, \
proxy_sig=:NgQsRJwOL/EgoRXdcmHMOLZM+KWqLDsO76CrqoiLH279VJs9Fj6bn4V+pe\ proxy_sig=:XD1O/vEh772WVpY7jYvReXop2+b7xTIIPKH8/OCYzPn78Wd9jodCwA\
rAEUbHBEMFCbl6tucEVgKrU+5IIyDMBI85FExQeuBrNPALczjCdxne6LUoBcWBAk8No\ JPF5TYCn9L6n68j4EjGsqFOMkVLVdSQEZqMLjEbvMEdIe8m1a0CLd5kydeaAwoH\
Ryjfd++DXIAjAZcf/hBUXLll+5veI0ynzBRFTZ4v8AbluYODjJlSprYEwUb2ndbFr12\ oglqod6ijkwhhEtxtaD8tDZmihQw2mZEH8u4aMSnRntqy7ExCNld0JLharsHV0i\
vzgIpy0uTQCslN+3rUUZ+lQWlrILvbR0CIvtGwk2+hE0dTRAG0R3wmlR24mhSqiE5RA\ CbRO9jIP+d2ApD7gB+eZpn3pIvvVJZlxTwPkahFpxKlQtNMPaSqa1lvejURx+ST\
DyoSWQVjVxntp98XHAB6MZE92bbu2a8Uo951Hvah03XHWEk/WiYdq+mt3hwXVPLXlBU\ 8CEuz4sS+G/oLJiX3MZenuUoOR8HeOHDnjN/VLzrEN4x44iF7WIL+iY2PtK87LU\
9DWCo2AaYD/rkXtQ==: WRAsJAX9GqHL/upsGh1nxIdoVaoLVV5w+fRw==:
The proxy's signature and the client's original signature can be The proxy's signature and the client's original signature can be
verified independently for the same message, depending on the needs verified independently for the same message, depending on the needs
of the application. of the application.
5. IANA Considerations 5. IANA Considerations
5.1. HTTP Signature Algorithms Registry 5.1. HTTP Signature Algorithms Registry
This document defines HTTP Signature Algorithms, for which IANA is This document defines HTTP Signature Algorithms, for which IANA is
asked to create and maintain a new registry titled "HTTP Signature asked to create and maintain a new registry titled "HTTP Signature
Algorithms". Initial values for this registry are given in Algorithms". Initial values for this registry are given in
Section 5.1.2. Future assignments and modifications to existing Section 5.1.2. Future assignments and modifications to existing
assignment are to be made through the Expert Review registration assignment are to be made through the Expert Review registration
policy [RFC8126] and shall follow the template presented in policy [RFC8126] and shall follow the template presented in
Section 5.1.1. Section 5.1.1.
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 "rsa-pss-sha512" as referring to one specific
algorithm with its hash, mask, and salt values set as defined here.
Implementors do not parse out the "rsa", "pss", and "sha512" portions
of the identifier to determine parameters of the signing algorithm
from the string.
5.1.1. Registration Template 5.1.1. Registration Template
Algorithm Name: Algorithm Name:
An identifier for the HTTP Signature Algorithm. The name MUST be An identifier for the HTTP Signature Algorithm. The name MUST be
an ASCII string consisting only of lower-case characters (""a"" - an ASCII string consisting only of lower-case characters (""a"" -
""z""), digits (""0"" - ""9""), and hyphens (""-""), and SHOULD ""z""), digits (""0"" - ""9""), and hyphens (""-""), and SHOULD
NOT exceed 20 characters in length. The identifier MUST be unique NOT exceed 20 characters in length. The identifier MUST be unique
within the context of the registry. within the context of the registry.
Status: Status:
A brief text description of the status of the algorithm. The A brief text description of the status of the algorithm. The
description MUST begin with one of "Active" or "Deprecated", and description MUST begin with one of "Active" or "Deprecated", and
MAY provide further context or explanation as to the reason for MAY provide further context or explanation as to the reason for
the status. the status.
Description: Description:
A brief description of the algorithm used to sign the signature A brief description of the algorithm used to sign the signature
input string. input string.
Specification document(s): Specification document(s):
skipping to change at page 29, line 44 skipping to change at page 29, line 4
signature. IANA is asked to create and maintain a new registry signature. IANA is asked to create and maintain a new registry
titled "HTTP Signature Metadata Parameters" to record and maintain titled "HTTP Signature Metadata Parameters" to record and maintain
the set of parameters defined for use with member values in the the set of parameters defined for use with member values in the
"Signature-Input" Structured Header. Initial values for this "Signature-Input" Structured Header. Initial values for this
registry are given in Section 5.2.2. Future assignments and registry are given in Section 5.2.2. Future assignments and
modifications to existing assignments are to be made through the modifications to existing assignments are to be made through the
Expert Review registration policy [RFC8126] and shall follow the Expert Review registration policy [RFC8126] and shall follow the
template presented in Section 5.2.1. template presented in Section 5.2.1.
5.2.1. Registration Template 5.2.1. Registration Template
5.2.2. Initial Contents 5.2.2. Initial Contents
The table below contains the initial contents of the HTTP Signature The table below contains the initial contents of the HTTP Signature
Metadata Parameters Registry. Each row in the table represents a Metadata Parameters Registry. Each row in the table represents a
distinct entry in the registry. distinct entry in the registry.
+=========+========+================================+ +=========+========+================================+
| Name | Status | Reference(s) | | Name | Status | Reference(s) |
+=========+========+================================+ +=========+========+================================+
| alg | Active | Section 2.4.2 of this document | | alg | Active | Section 2.3.2 of this document |
+---------+--------+--------------------------------+ +---------+--------+--------------------------------+
| created | Active | Section 2.4.2 of this document | | created | Active | Section 2.3.2 of this document |
+---------+--------+--------------------------------+ +---------+--------+--------------------------------+
| expires | Active | Section 2.4.2 of this document | | expires | Active | Section 2.3.2 of this document |
+---------+--------+--------------------------------+ +---------+--------+--------------------------------+
| keyid | Active | Section 2.4.2 of this document | | keyid | Active | Section 2.3.2 of this document |
+---------+--------+--------------------------------+ +---------+--------+--------------------------------+
| nonce | Active | Section 2.4.2 of this document | | nonce | Active | Section 2.3.2 of this document |
+---------+--------+--------------------------------+ +---------+--------+--------------------------------+
Table 5: Initial contents of the HTTP Signature Table 4: Initial contents of the HTTP Signature
Metadata Parameters Registry. Metadata Parameters Registry.
5.3. HTTP Signature Specialty Content Identifiers Registry 5.3. HTTP Signature Specialty Content Identifiers Registry
This document defines a method for canonicalizing HTTP message This document defines a method for canonicalizing HTTP message
content, including content that can be generated from the context of content, including content that can be generated from the context of
the HTTP message outside of the HTTP headers. This content is the HTTP message outside of the HTTP headers. This content is
identified by a unique key. IANA is asked to create and maintain a identified by a unique key. IANA is asked to create and maintain a
new registry typed "HTTP Signature Specialty Content Identifiers" to new registry typed "HTTP Signature Specialty Content Identifiers" to
record and maintain the set of non-header content identifiers and record and maintain the set of non-header content identifiers and
skipping to change at page 30, line 46 skipping to change at page 30, line 8
5.3.1. Registration Template 5.3.1. Registration Template
5.3.2. Initial Contents 5.3.2. Initial Contents
The table below contains the initial contents of the HTTP Signature The table below contains the initial contents of the HTTP Signature
Specialty Content Identifiers Registry. Specialty Content Identifiers Registry.
+===================+========+================================+ +===================+========+================================+
| Name | Status | Reference(s) | | Name | Status | Reference(s) |
+===================+========+================================+ +===================+========+================================+
| @request-target | Active | Section 2.4.1 of this document | | @request-target | Active | Section 2.3.1 of this document |
+-------------------+--------+--------------------------------+ +-------------------+--------+--------------------------------+
| @signature-params | Active | Section 2.4.2 of this document | | @signature-params | Active | Section 2.3.2 of this document |
+-------------------+--------+--------------------------------+ +-------------------+--------+--------------------------------+
Table 6: Initial contents of the HTTP Signature Specialty Table 5: Initial contents of the HTTP Signature Specialty
Content Identifiers Registry. Content Identifiers Registry.
6. Security Considerations 6. Security Considerations
(( TODO: need to dive deeper on this section; not sure how much of (( TODO: need to dive deeper on this section; not sure how much of
what's referenced below is actually applicable, or if it covers what's referenced below is actually applicable, or if it covers
everything we need to worry about. )) everything we need to worry about. ))
(( TODO: Should provide some recommendations on how to determine what (( TODO: Should provide some recommendations on how to determine what
content needs to be signed for a given use case. )) content needs to be signed for a given use case. ))
skipping to change at page 33, line 20 skipping to change at page 32, line 30
"Security Considerations for HTTP Signatures", 2013, "Security Considerations for HTTP Signatures", 2013,
<https://web-payments.org/specs/source/http-signatures- <https://web-payments.org/specs/source/http-signatures-
audit/>. audit/>.
Appendix A. Detecting HTTP Message Signatures Appendix A. Detecting HTTP Message Signatures
There have been many attempts to create signed HTTP messages in the There have been many attempts to create signed HTTP messages in the
past, including other non-standard definitions of the "Signature" past, including other non-standard definitions of the "Signature"
header used within this specification. It is recommended that header used within this specification. It is recommended that
developers wishing to support both this specification and other developers wishing to support both this specification and other
historial drafts do so carefully and deliberately, as historical drafts do so carefully and deliberately, as
incompatibilities between this specification and various versions of incompatibilities between this specification and various versions of
other drafts could lead to problems. other drafts could lead to unexpected problems.
It is recommended that implementers first detect and validate the It is recommended that implementers first detect and validate the
"Signature-Input" header defined in this specification to detect that "Signature-Input" header defined in this specification to detect that
this standard is in use and not an alternative. If the "Signature- this standard is in use and not an alternative. If the "Signature-
Input" header is present, all "Signature" headers can be parsed and Input" header is present, all "Signature" headers can be parsed and
interpreted in the context of this draft. interpreted in the context of this draft.
Appendix B. Examples Appendix B. Examples
B.1. Example Keys B.1. Example Keys
skipping to change at page 34, line 42 skipping to change at page 33, line 47
9C+celgZd2PW7aGYLCHq7nPbmfDV0yHcWjOhXZ8jRMjmANVR/eLQ2EfsRLdW69bn 9C+celgZd2PW7aGYLCHq7nPbmfDV0yHcWjOhXZ8jRMjmANVR/eLQ2EfsRLdW69bn
f3ZD7JS1fwGnO3exGmHO3HZG+6AvberKYVYNHahNFEw5TsAcQWDLRpkGybBcxqZo f3ZD7JS1fwGnO3exGmHO3HZG+6AvberKYVYNHahNFEw5TsAcQWDLRpkGybBcxqZo
81YCqlqidwfeO5YtlO7etx1xLyqa2NsCeG9A86UjG+aeNnXEIDk1PDK+EuiThIUa 81YCqlqidwfeO5YtlO7etx1xLyqa2NsCeG9A86UjG+aeNnXEIDk1PDK+EuiThIUa
/2IxKzJKWl1BKr2d4xAfR0ZnEYuRrbeDQYgTImOlfW6/GuYIxKYgEKCFHFqJATAG /2IxKzJKWl1BKr2d4xAfR0ZnEYuRrbeDQYgTImOlfW6/GuYIxKYgEKCFHFqJATAG
IxHrq1PDOiSwXd2GmVVYyEmhZnbcp8CxaEMQoevxAta0ssMK3w6UsDtvUvYvF22m IxHrq1PDOiSwXd2GmVVYyEmhZnbcp8CxaEMQoevxAta0ssMK3w6UsDtvUvYvF22m
qQKBiD5GwESzsFPy3Ga0MvZpn3D6EJQLgsnrtUPZx+z2Ep2x0xc5orneB5fGyF1P qQKBiD5GwESzsFPy3Ga0MvZpn3D6EJQLgsnrtUPZx+z2Ep2x0xc5orneB5fGyF1P
WtP+fG5Q6Dpdz3LRfm+KwBCWFKQjg7uTxcjerhBWEYPmEMKYwTJF5PBG9/ddvHLQ WtP+fG5Q6Dpdz3LRfm+KwBCWFKQjg7uTxcjerhBWEYPmEMKYwTJF5PBG9/ddvHLQ
EQeNC8fHGg4UXU8mhHnSBt3EA10qQJfRDs15M38eG2cYwB1PZpDHScDnDA0= EQeNC8fHGg4UXU8mhHnSBt3EA10qQJfRDs15M38eG2cYwB1PZpDHScDnDA0=
-----END RSA PRIVATE KEY----- -----END RSA PRIVATE KEY-----
B.1.2. Example Key RSA PSS test B.1.2. Example RSA PSS Key
The following key is a 2048-bit RSA public and private key pair, The following key is a 2048-bit RSA public and private key pair,
referred to in this document as "test-key-rsa-pss": referred to in this document as "test-key-rsa-pss":
-----BEGIN PUBLIC KEY----- -----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr4tmm3r20Wd/PbqvP1s2 MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr4tmm3r20Wd/PbqvP1s2
+QEtvpuRaV8Yq40gjUR8y2Rjxa6dpG2GXHbPfvMs8ct+Lh1GH45x28Rw3Ry53mm+ +QEtvpuRaV8Yq40gjUR8y2Rjxa6dpG2GXHbPfvMs8ct+Lh1GH45x28Rw3Ry53mm+
oAXjyQ86OnDkZ5N8lYbggD4O3w6M6pAvLkhk95AndTrifbIFPNU8PPMO7OyrFAHq oAXjyQ86OnDkZ5N8lYbggD4O3w6M6pAvLkhk95AndTrifbIFPNU8PPMO7OyrFAHq
gDsznjPFmTOtCEcN2Z1FpWgchwuYLPL+Wokqltd11nqqzi+bJ9cvSKADYdUAAN5W gDsznjPFmTOtCEcN2Z1FpWgchwuYLPL+Wokqltd11nqqzi+bJ9cvSKADYdUAAN5W
Utzdpiy6LbTgSxP7ociU4Tn0g5I6aDZJ7A8Lzo0KSyZYoA485mqcO0GVAdVw9lq4 Utzdpiy6LbTgSxP7ociU4Tn0g5I6aDZJ7A8Lzo0KSyZYoA485mqcO0GVAdVw9lq4
skipping to change at page 35, line 44 skipping to change at page 34, line 44
OGIHDRp6HjMUcxHpHw7U+S1TETxePwKLnLKj6hw8jnX2/nZRgWHzgVcY+sPsReRx OGIHDRp6HjMUcxHpHw7U+S1TETxePwKLnLKj6hw8jnX2/nZRgWHzgVcY+sPsReRx
NJVf+Cfh6yOtznfX00p+JWOXdSY8glSSHJwRAMog+hFGW1AYdt7w80XBAoGBAImR NJVf+Cfh6yOtznfX00p+JWOXdSY8glSSHJwRAMog+hFGW1AYdt7w80XBAoGBAImR
NUugqapgaEA8TrFxkJmngXYaAqpA0iYRA7kv3S4QavPBUGtFJHBNULzitydkNtVZ NUugqapgaEA8TrFxkJmngXYaAqpA0iYRA7kv3S4QavPBUGtFJHBNULzitydkNtVZ
3w6hgce0h9YThTo/nKc+OZDZbgfN9s7cQ75x0PQCAO4fx2P91Q+mDzDUVTeG30mE 3w6hgce0h9YThTo/nKc+OZDZbgfN9s7cQ75x0PQCAO4fx2P91Q+mDzDUVTeG30mE
t2m3S0dGe47JiJxifV9P3wNBNrZGSIF3mrORBVNDAoGBAI0QKn2Iv7Sgo4T/XjND t2m3S0dGe47JiJxifV9P3wNBNrZGSIF3mrORBVNDAoGBAI0QKn2Iv7Sgo4T/XjND
dl2kZTXqGAk8dOhpUiw/HdM3OGWbhHj2NdCzBliOmPyQtAr770GITWvbAI+IRYyF dl2kZTXqGAk8dOhpUiw/HdM3OGWbhHj2NdCzBliOmPyQtAr770GITWvbAI+IRYyF
S7Fnk6ZVVVHsxjtaHy1uJGFlaZzKR4AGNaUTOJMs6NadzCmGPAxNQQOCqoUjn4XR S7Fnk6ZVVVHsxjtaHy1uJGFlaZzKR4AGNaUTOJMs6NadzCmGPAxNQQOCqoUjn4XR
rOjr9w349JooGXhOxbu8nOxX rOjr9w349JooGXhOxbu8nOxX
-----END PRIVATE KEY----- -----END PRIVATE KEY-----
B.1.3. Example ECC P-256 Test Key
The following key is an elliptical curve key over the curve P-256,
referred to in this document as "test-key-ecc-p256".
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIFKbhfNZfpDsW43+0+JjUr9K+bTeuxopu653+hBaXGA7oAoGCCqGSM49
AwEHoUQDQgAEqIVYZVLCrPZHGHjP17CTW0/+D9Lfw0EkjqF7xB4FivAxzic30tMM
4GF+hR6Dxh71Z50VGGdldkkDXZCnTNnoXQ==
-----END EC PRIVATE KEY-----
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEqIVYZVLCrPZHGHjP17CTW0/+D9Lf
w0EkjqF7xB4FivAxzic30tMM4GF+hR6Dxh71Z50VGGdldkkDXZCnTNnoXQ==
-----END PUBLIC KEY-----
B.1.4. Example Shared Secret
The following shared secret is 64 randomly-generated bytes encoded in
Base64, referred to in this document as "test-shared-secret".
uzvJfB4u3N0Jy4T7NZ75MDVcr8zSTInedJtkgcu46YW4XByzNJjxBdtjUkdJPBt\
bmHhIDi6pcl8jsasjlTMtDQ==
B.2. Test Cases B.2. Test Cases
This section provides non-normative examples that may be used as test This section provides non-normative examples that may be used as test
cases to validate implementation correctness. These examples are cases to validate implementation correctness. These examples are
based on the following HTTP message: based on the following HTTP messages:
For requests, this "test-request" message is used:
POST /foo?param=value&pet=dog HTTP/1.1 POST /foo?param=value&pet=dog HTTP/1.1
Host: example.com Host: example.com
Date: Tue, 20 Apr 2021 02:07:55 GMT Date: Tue, 20 Apr 2021 02:07:55 GMT
Content-Type: application/json Content-Type: application/json
Digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= Digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
Content-Length: 18 Content-Length: 18
{"hello": "world"} {"hello": "world"}
For responses, this "test-response" message is used:
HTTP/1.1 200 OK
Date: Tue, 20 Apr 2021 02:07:56 GMT
Content-Type: application/json
Digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
Content-Length: 18
{"hello": "world"}
B.2.1. Minimal Signature Header using rsa-pss-sha512 B.2.1. Minimal Signature Header using rsa-pss-sha512
This example presents a minimal "Signature-Input" and "Signature" This example presents a minimal "Signature-Input" and "Signature"
header for a signature using the "rsa-pss-sha512" algorithm, covering header for a signature using the "rsa-pss-sha512" algorithm over
none of the content of the HTTP message request but providing a "test-request", covering none of the content of the HTTP message
timestamped signature proof of possession of the key. request but providing a timestamped signature proof of possession of
the key.
The corresponding signature input is: The corresponding signature input is:
"@signature-params": ();created=1618884475;keyid="test-key-rsa-pss"\ "@signature-params": ();created=1618884475\
;alg="rsa-pss-sha512" ;keyid="test-key-rsa-pss";alg="rsa-pss-sha512"
This results in the following "Signature-Input" and "Signature" This results in the following "Signature-Input" and "Signature"
headers being added to the message: headers being added to the message:
Signature-Input: sig1=();created=1618884475;keyid="test-key-rsa-pss"\ Signature-Input: sig1=();created=1618884475\
;alg="rsa-pss-sha512" ;keyid="test-key-rsa-pss";alg="rsa-pss-sha512"
Signature: sig1=:qGKjr1213+iZCU1MCV8w2NTr/HvMGWYDzpqAWx7SrPE1y6gOkIQ3k2\ Signature: sig1=:VrfdC2KEFFLoGMYTbQz4PSlKat4hAxcr5XkVN7Mm/7OQQJG+uX\
GlZDu9KnKnLN6LKX0JRa2M5vU9v/b0GjV0WSInMMKQJExJ/e9Y9K8q2eE0G9saGebEaWd\ gOez7kA6n/yTCaR1VL+FmJd2IVFCsUfcc/jO9siZK3siadoK1Dfgp2ieh9eO781ty\
R3Ao47odxLh95hBtejKIdiUBmQcQSAzAkoQ4aOZgvrHgkmvQDZQL0w30+8lMz3VglmN73\ SS70OwvAkdORuQLWDnaDMRDlQhg5sNP6JaQghFLqD4qgFrM9HMPxLrznhAQugJ0Fd\
CKp/ijZemO1iPdNwrdhAtDvj9OdFVJ/wiUECfU78aQWkQocvwrZXTmHCX9BMVUHGneXMY\ RZLtSpnjECW6qsu2PVRoCYfnwe4gu8TfqH5GDx2SkpCF9BQ8CijuIWlOg7QP73tKt\
NQ0Y8umEHjxpnnLLvxUbw2KZrflp+l6m7WlhwXGJ15eAt1+mImanxUCtaKQJvEfcnOQ0S\ QNp65u14Si9VEVXHWGiLw4blyPLzWz/fqJbdLaq94Ep60Nq8WjYEAInYH6KyV7EAD\
2jHysSRLheTA==: 60LXdspwF50R3dkWXJP/x+gkAHSMsxbg==:
B.2.2. Header Coverage B.2.2. Header Coverage using rsa-pss-sha512
This example covers all the specified headers in the example message. This example covers all the specified headers in "test-request"
except for the body digest header using the "rsa-pss-sha512"
algorithm.
The corresponding signature input is: The corresponding signature input is:
"host": example.com "host": example.com
"date": Tue, 20 Apr 2021 02:07:55 GMT "date": Tue, 20 Apr 2021 02:07:55 GMT
"content-type": application/json "content-type": application/json
"@signature-params": ("host" "date" "content-type");created=1618884475\ "@signature-params": ("host" "date" "content-type")\
;keyid="test-key-rsa-pss" ;created=1618884475;keyid="test-key-rsa-pss"
This results in the following "Signature-Input" and "Signature" This results in the following "Signature-Input" and "Signature"
headers being added to the message: headers being added to the message:
Signature-Input: sig1=("host" "date" "content-type");created=1618884475\ Signature-Input: sig1=("host" "date" "content-type")\
;keyid="test-key-rsa-pss" ;created=1618884475;keyid="test-key-rsa-pss"
Signature: sig1=:NtIKWuXjr4SBEXj97gbick4O95ff378I0CZOa2VnIeEXZ1itzAdqTp\ Signature: sig1=:Zu48JBrHlXN+hVj3T5fPQUjMNEEhABM5vNmiWuUUl7BWNid5Rz\
SvG91XYrq5CfxCmk8zz1Zg7ZGYD+ngJyVn805r73rh2eFCPO+ZXDs45Is/Ex8srzGC9sf\ OH1tEjVi+jObYkYT8p09lZ2hrNuU3xm+JUBT8WNIlopJtt0EzxFnjGlHvkhu3KbJf\
VZfqeEfApRFFe5yXDmANVUwzFWCEnGM6+SJVmWl1/jyEn45qA6Hw+ZDHbrbp6qvD4N0S9\ xNlvCJVlOEdR4AivDLMeK/ZgASpZ7py1UNHJqRyGCYkYpeedinXUertL/ySNp+VbK\
2jlPyVVEh/SmCwnkeNiBgnbt+E0K5wCFNHPbo4X1Tj406W+bTtnKzaoKxBWKW8aIQ7rg9\ 2O/qCoui2jFgff2kXQd6rjL1Up83Fpr+/KoZ6HQkv3qwBdMBDyHQykfZHhLn4AO1I\
2zqE1oqBRjqtRi5/Q6P5ZYYGGINKzNyV3UjZtxeZNnNJ+MAnWS0mofFqcZHVgSU/1wUzP\ G+vKhOLJQDfaLsJ/fYfzsgc1s46j3GpPPD/W2nEEtdhNwu7oXq81qVRsENChIu1XI\
7MhzOKLca1Yg==: FKR9q7WpyHDKEWTtaNZDS8TFvIQRU22w==:
B.2.3. Full Coverage B.2.3. Full Coverage using rsa-pss-sha512
This example covers all headers in the example message plus the This example covers all headers in "test-request" plus the request
request target and message body digest. target and message body digest using the "rsa-pss-sha512" algorithm.
The corresponding signature input is: The corresponding signature input is:
"@request-target": post /foo?param=value&pet=dog "@request-target": post /foo?param=value&pet=dog
"host": example.com "host": example.com
"date": Tue, 20 Apr 2021 02:07:55 GMT "date": Tue, 20 Apr 2021 02:07:55 GMT
"content-type": application/json "content-type": application/json
"digest": SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= "digest": SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
"content-length": 18 "content-length": 18
"@signature-params": ("@request-target" "host" "date" "content-type" \ "@signature-params": ("@request-target" "host" "date" \
"digest" "content-length");created=1618884475\ "content-type" "digest" "content-length");created=1618884475\
;keyid="test-key-rsa-pss" ;keyid="test-key-rsa-pss"
This results in the following "Signature-Input" and "Signature" This results in the following "Signature-Input" and "Signature"
headers being added to the message: headers being added to the message:
Signature-Input: sig1=("@request-target" "host" "date" "content-type" \ Signature-Input: sig1=("@request-target" "host" "date" \
"digest" "content-length");created=1618884475\ "content-type" "digest" "content-length");created=1618884475\
;keyid="test-key-rsa-pss" ;keyid="test-key-rsa-pss"
Signature: sig1=:QNPZtqAGWN1YMtsLJ1oyQMLg9TuIwjsIBESTo1/YXUsG+6Sl1uKUdT\ Signature: \
e9xswwrc3Ui3gUd4/tLv48NGih2TRDc1AWbEQDuy6pjroxSPtFjquubqzbszxit1arPNh\ sig1=:iD5NhkJoGSuuTpWMzS0BI47DfbWwsGmHHLTwOxT0n+0cQFSC+1c26B7IOfI\
ONnyR/8yuIh3bOXfc/NYJ3KLNaWR6MKrGinCYKTNwrX/0V67EMdSgd5HHnW5xHFgKfRCj\ RTYofqD0sfYYrnSwCvWJfA1zthAEv9J1CxS/CZXe7CQvFpuKuFJxMpkAzVYdE/TA6\
rG3ncV+jbaeSPJ8e96RZgr8slcdwmqXdiwiIBCQDKRIQ3U2muJWvxyjV/IYhCTwAXJaUz\ fELxNZy9RJEWZUPBU4+aJ26d8PC0XhPObXe6JkP6/C7XvG2QinsDde7rduMdhFN/H\
sQPKzR5QWelXEVdHyv4WIB2lKaYh7mAsz0/ANxFYRRSp2Joms0OAnIAFX9kKCSp4p15/Q\ j2MuX1Ipzvv4EgbHJdKwmWRNamfmKJZC4U5Tn0F58lzGF+WIpU73V67/6aSGvJGM5\
8L9vSIGNpQtw==: 7U9bRHrBB7ExuQhOX2J2dvJMYkE33pEJA70XBUp9ZvciTI+vjIUgUQ2oRww3huWML\
mMMqEc95CliwIoL5aBdCnlQ==:
B.2.4. Signing a Response using ecdsa-p256-sha256
This example covers portions of the "test-response" response message
using the "ecdsa-p256-sha256" algorithm and the key "test-key-ecc-
p256".
The corresponding signature input is:
"date": Tue, 20 Apr 2021 02:07:56 GMT
"content-type": application/json
"digest": SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
"content-length": 18
"@signature-params": ("date" "content-type" "digest" \
"content-length");created=1618884475;keyid="test-key-ecc-p256"
This results in the following "Signature-Input" and "Signature"
headers being added to the message:
Signature-Input: sig1=("date" "content-type" "digest" \
"content-length");created=1618884475;keyid="test-key-ecc-p256"
Signature: \
sig1=:3zmRDW6r50/RETqqhtx/N5sdd5eTh8xmHdsrYRK9wK4rCNEwLjCOBlcQxTL\
2oJTCWGRkuqE2r9KyqZFY9jd+NQ==:
B.2.5. Signing a Request using hmac-sha256
This example covers portions of the "test-request" using the "hmac-
sha256" algorithm and the secret "test-shared-secret".
The corresponding signature input is:
"host": example.com
"date": Tue, 20 Apr 2021 02:07:55 GMT
"content-type": application/json
"@signature-params": ("host" "date" "content-type")\
;created=1618884475;keyid="test-shared-secret"
This results in the following "Signature-Input" and "Signature"
headers being added to the message:
Signature-Input: sig1=("host" "date" "content-type")\
;created=1618884475;keyid="test-shared-secret"
Signature: sig1=:x54VEvVOb0TMw8fUbsWdUHqqqOre+K7sB/LqHQvnfaQ=:
Acknowledgements Acknowledgements
This specification was initially based on the draft-cavage-http- This specification was initially based on the draft-cavage-http-
signatures internet draft. The editors would like to thank the signatures internet draft. The editors would like to thank the
authors of that draft, Mark Cavage and Manu Sporny, for their work on authors of that draft, Mark Cavage and Manu Sporny, for their work on
that draft and their continuing contributions. that draft and their continuing contributions.
The editors would also like to thank the following individuals for The editors would also like to thank the following individuals for
feedback, insight, and implementation of this draft and its feedback, insight, and implementation of this draft and its
skipping to change at page 38, line 23 skipping to change at page 39, line 17
Michael Richardson, Wojciech Rygielski, Adam Scarr, Cory J. Slep, Michael Richardson, Wojciech Rygielski, Adam Scarr, Cory J. Slep,
Dirk Stein, Henry Story, Lukasz Szewc, Chris Webber, and Jeffrey Dirk Stein, Henry Story, Lukasz Szewc, Chris Webber, and Jeffrey
Yasskin. Yasskin.
Document History Document History
_RFC EDITOR: please remove this section before publication_ _RFC EDITOR: please remove this section before publication_
* draft-ietf-httpbis-message-signatures * draft-ietf-httpbis-message-signatures
- -05
o Remove list prefixes.
o Clarify signature algorithm parameters.
o Update and fix examples.
o Add examples for ECC and HMAC.
- -04 - -04
o Moved signature component definitions up to intro. o Moved signature component definitions up to intro.
o Created formal function definitions for algorithms to o Created formal function definitions for algorithms to
fulfill. fulfill.
o Updated all examples. o Updated all examples.
o Added nonce parameter field. o Added nonce parameter field.
 End of changes. 97 change blocks. 
290 lines changed or deleted 354 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/