draft-ietf-httpbis-message-signatures-02.txt   draft-ietf-httpbis-message-signatures-03.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: 16 September 2021 Bespoke Engineering Expires: 9 October 2021 Bespoke Engineering
M. Sporny M. Sporny
Digital Bazaar Digital Bazaar
15 March 2021 7 April 2021
Signing HTTP Messages Signing HTTP Messages
draft-ietf-httpbis-message-signatures-02 draft-ietf-httpbis-message-signatures-03
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 16 September 2021. This Internet-Draft will expire on 9 October 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
skipping to change at page 2, line 34 skipping to change at page 2, line 34
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 . . . . . . . . . . . . . . . . . . 5 1.3. Safe Transformations . . . . . . . . . . . . . . . . . . 5
1.4. Conventions and Terminology . . . . . . . . . . . . . . . 6 1.4. Conventions and Terminology . . . . . . . . . . . . . . . 6
1.5. Application of HTTP Message Signatures . . . . . . . . . 7 1.5. Application of HTTP Message Signatures . . . . . . . . . 7
2. Identifying and Canonicalizing Content . . . . . . . . . . . 8 2. HTTP Message Signature Covered Content . . . . . . . . . . . 8
2.1. HTTP Headers . . . . . . . . . . . . . . . . . . . . . . 8 2.1. HTTP Headers . . . . . . . . . . . . . . . . . . . . . . 9
2.1.1. Canonicalized Structured HTTP Headers . . . . . . . . 9 2.1.1. Canonicalized Structured HTTP Headers . . . . . . . . 9
2.1.2. Canonicalization Examples . . . . . . . . . . . . . . 9 2.1.2. Canonicalization Examples . . . . . . . . . . . . . . 9
2.2. Dictionary Structured Field Members . . . . . . . . . . . 10 2.2. Dictionary Structured Field Members . . . . . . . . . . . 10
2.2.1. Canonicalization Examples . . . . . . . . . . . . . . 10 2.2.1. Canonicalization Examples . . . . . . . . . . . . . . 10
2.3. List Prefixes . . . . . . . . . . . . . . . . . . . . . . 11 2.3. List Prefixes . . . . . . . . . . . . . . . . . . . . . . 11
2.3.1. Canonicalization Examples . . . . . . . . . . . . . . 11 2.3.1. Canonicalization Examples . . . . . . . . . . . . . . 11
2.4. Specialty Content Fields . . . . . . . . . . . . . . . . 12 2.4. Specialty Content Fields . . . . . . . . . . . . . . . . 12
2.4.1. Request Target . . . . . . . . . . . . . . . . . . . 12 2.4.1. Request Target . . . . . . . . . . . . . . . . . . . 12
2.4.2. Signature Parameters . . . . . . . . . . . . . . . . 13 2.4.2. Signature Parameters . . . . . . . . . . . . . . . . 13
3. HTTP Message Signatures . . . . . . . . . . . . . . . . . . . 14 2.5. Creating the Signature Input String . . . . . . . . . . . 16
3.1. Signature Metadata . . . . . . . . . . . . . . . . . . . 14 3. HTTP Message Signatures . . . . . . . . . . . . . . . . . . . 17
3.2. Creating a Signature . . . . . . . . . . . . . . . . . . 16 3.1. Creating a Signature . . . . . . . . . . . . . . . . . . 18
3.2.1. Choose and Set Signature Metadata Properties . . . . 16 3.2. Verifying a Signature . . . . . . . . . . . . . . . . . . 20
3.2.2. Create the Signature Input . . . . . . . . . . . . . 18 3.2.1. Enforcing Application Requirements . . . . . . . . . 21
3.2.3. Sign the Signature Input . . . . . . . . . . . . . . 19 3.3. Signature Algorithm Methods . . . . . . . . . . . . . . . 22
3.3. Verifying a Signature . . . . . . . . . . . . . . . . . . 19 3.3.1. RSASSA-PSS using SHA-512 . . . . . . . . . . . . . . 22
3.3.1. Enforcing Application Requirements . . . . . . . . . 20 3.3.2. RSASSA-PKCS1-v1_5 using SHA-256 . . . . . . . . . . . 22
3.3.3. HMAC using SHA-256 . . . . . . . . . . . . . . . . . 23
4. Including a Message Signature in a Message . . . . . . . . . 21 3.3.4. ECDSA using curve P-256 DSS and SHA-256 . . . . . . . 23
4.1. The 'Signature-Input' HTTP Header . . . . . . . . . . . . 21 3.3.5. JSON Web Signature (JWS) algorithms . . . . . . . . . 24
4.2. The 'Signature' HTTP Header . . . . . . . . . . . . . . . 21 4. Including a Message Signature in a Message . . . . . . . . . 24
4.3. Examples . . . . . . . . . . . . . . . . . . . . . . . . 22 4.1. The 'Signature-Input' HTTP Header . . . . . . . . . . . . 24
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 23 4.2. The 'Signature' HTTP Header . . . . . . . . . . . . . . . 25
5.1. HTTP Signature Algorithms Registry . . . . . . . . . . . 23 4.3. Examples . . . . . . . . . . . . . . . . . . . . . . . . 25
5.1.1. Registration Template . . . . . . . . . . . . . . . . 23 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 26
5.1.2. Initial Contents . . . . . . . . . . . . . . . . . . 24 5.1. HTTP Signature Algorithms Registry . . . . . . . . . . . 26
5.2. HTTP Signature Metadata Parameters Registry . . . . . . . 25 5.1.1. Registration Template . . . . . . . . . . . . . . . . 26
5.2.1. Registration Template . . . . . . . . . . . . . . . . 25 5.1.2. Initial Contents . . . . . . . . . . . . . . . . . . 27
5.2.2. Initial Contents . . . . . . . . . . . . . . . . . . 25 5.2. HTTP Signature Metadata Parameters Registry . . . . . . . 28
5.3. HTTP Signature Specialty Content Identifiers Registry . . 26 5.2.1. Registration Template . . . . . . . . . . . . . . . . 28
5.3.1. Registration Template . . . . . . . . . . . . . . . . 26 5.2.2. Initial Contents . . . . . . . . . . . . . . . . . . 28
5.3.2. Initial Contents . . . . . . . . . . . . . . . . . . 26 5.3. HTTP Signature Specialty Content Identifiers Registry . . 29
6. Security Considerations . . . . . . . . . . . . . . . . . . . 27 5.3.1. Registration Template . . . . . . . . . . . . . . . . 29
7. References . . . . . . . . . . . . . . . . . . . . . . . . . 27 5.3.2. Initial Contents . . . . . . . . . . . . . . . . . . 29
7.1. Normative References . . . . . . . . . . . . . . . . . . 27 6. Security Considerations . . . . . . . . . . . . . . . . . . . 30
7.2. Informative References . . . . . . . . . . . . . . . . . 28 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 30
Appendix A. Detecting HTTP Message Signatures . . . . . . . . . 29 7.1. Normative References . . . . . . . . . . . . . . . . . . 30
Appendix B. Examples . . . . . . . . . . . . . . . . . . . . . . 29 7.2. Informative References . . . . . . . . . . . . . . . . . 31
B.1. Example Keys . . . . . . . . . . . . . . . . . . . . . . 29 Appendix A. Detecting HTTP Message Signatures . . . . . . . . . 32
B.1.1. Example Key RSA test . . . . . . . . . . . . . . . . 29 Appendix B. Examples . . . . . . . . . . . . . . . . . . . . . . 32
B.2. Example keyid Values . . . . . . . . . . . . . . . . . . 30 B.1. Example Keys . . . . . . . . . . . . . . . . . . . . . . 32
B.3. Test Cases . . . . . . . . . . . . . . . . . . . . . . . 31 B.1.1. Example Key RSA test . . . . . . . . . . . . . . . . 32
B.3.1. Signature Generation . . . . . . . . . . . . . . . . 31 B.2. Example keyid Values . . . . . . . . . . . . . . . . . . 33
B.3.2. Signature Verification . . . . . . . . . . . . . . . 34 B.3. Test Cases . . . . . . . . . . . . . . . . . . . . . . . 34
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 36 B.3.1. Signature Verification . . . . . . . . . . . . . . . 34
Document History . . . . . . . . . . . . . . . . . . . . . . . . 37 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 35
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 39 Document History . . . . . . . . . . . . . . . . . . . . . . . . 35
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 38
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 4, line 33 skipping to change at page 4, line 35
message content using this nomenclature and rule set. message content using this nomenclature and rule set.
* A mechanism for attaching a signature and related metadata to an * A mechanism for attaching a signature and related metadata to an
HTTP message. HTTP message.
1.1. Requirements Discussion 1.1. Requirements Discussion
HTTP permits and sometimes requires intermediaries to transform HTTP permits and sometimes requires intermediaries to transform
messages in a variety of ways. This may result in a recipient messages in a variety of ways. This may result in a recipient
receiving a message that is not bitwise equivalent to the message receiving a message that is not bitwise equivalent to the message
that was oringally sent. In such a case, the recipient will be that was originally sent. In such a case, the recipient will be
unable to verify a signature over the raw bytes of the sender's HTTP unable to verify a signature over the raw bytes of the sender's HTTP
message, as verifying digital signatures or MACs requires both signer message, as verifying digital signatures or MACs requires both signer
and verifier to have the exact same signed content. Since the raw and verifier to have the exact same signed content. Since the raw
bytes of the message cannot be relied upon as signed content, the bytes of the message cannot be relied upon as signed content, the
signer and verifier must derive the signed content from their signer and verifier must derive the signed content from their
respective versions of the message, via a mechanism that is resilient respective versions of the message, via a mechanism that is resilient
to safe changes that do not alter the meaning of the message. to safe changes that do not alter the meaning of the message.
For a variety of reasons, it is impractical to strictly define what For a variety of reasons, it is impractical to strictly define what
constitutes a safe change versus an unsafe one. Applications use constitutes a safe change versus an unsafe one. Applications use
skipping to change at page 7, line 33 skipping to change at page 7, line 33
1.5. Application of HTTP Message Signatures 1.5. Application of HTTP Message Signatures
HTTP Message Signatures are designed to be a general-purpose security HTTP Message Signatures are designed to be a general-purpose security
mechanism applicable in a wide variety of circumstances and mechanism applicable in a wide variety of circumstances and
applications. In order to properly and safely apply HTTP Message applications. In order to properly and safely apply HTTP Message
Signatures, an application or profile of this specification MUST Signatures, an application or profile of this specification MUST
specify all of the following items: specify all of the following items:
* 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 would 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, as well as a "*created" field to allow authorization credentials and mandate the signature parameters
replay detection. contain a "created" parameter, while an API expecting HTTP message
bodies could require the "Digest" header to be present and
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" field of signature. An application will usually use the "keyid" parameter
the "Signature-Input" header value and define rules for resolving of the signature parameters Section 2.4.2 and define rules for
a key from there. resolving a key from there, though the appropriate key could be
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. signature content is appropriate for the key material. For
example, the process could use the "alg" parameter of the
signature parameters Section 2.4.2 to state the algorithm
explicitly, derive the algorithm from the key material, or use
some pre-configured algorithm agreed upon by the signer and
verifier.
* 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.
The details of this kind of profiling are the purview of the The details of this kind of profiling are the purview of the
application and outside the scope of this specification. application and outside the scope of this specification.
2. Identifying and Canonicalizing Content 2. HTTP Message Signature Covered Content
In order to allow signers and verifiers to establish which content is In order to allow signers and verifiers to establish which content is
covered by a signature, this document defines content identifiers for covered by a signature, this document defines content identifiers for
data items covered by an HTTP Message Signature. data items covered by an HTTP Message Signature as well as the means
for combining these canonicalized values into a signature input
string.
Some content within HTTP messages can undergo transformations that Some content within HTTP messages can undergo transformations that
change the bitwise value without altering meaning of the content (for change the bitwise value without altering meaning of the content (for
example, the merging together of header fields with the same name). example, the merging together of header fields with the same name).
Message content must therefore be canonicalized before it is signed, Message content must therefore be canonicalized before it is signed,
to ensure that a signature can be verified despite such intermediary to ensure that a signature can be verified despite such intermediary
transformations. This document defines rules for each content transformations. This document defines rules for each content
identifier that transform the identifier's associated content into identifier that transform the identifier's associated content into
such a canonical form. such a canonical form.
skipping to change at page 8, line 36 skipping to change at page 8, line 44
using the "parameters" rule. using the "parameters" rule.
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. rules. The method for combining content identifiers into the
signature input string is defined in Section 2.5.
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 28 skipping to change at page 12, line 28
Table 3: Non-normative examples of list Table 3: Non-normative examples of list
prefix canonicalization. prefix canonicalization.
2.4. Specialty Content Fields 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 speciality 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.4.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.4.2
Additional specialty content identifiers MAY be defined and Additional specialty content identifiers MAY be defined and
skipping to change at page 13, line 40 skipping to change at page 13, line 40
+-------------------------+-----------------+ +-------------------------+-----------------+
| 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 4: Non-normative examples of "@request-target"
canonicalization. canonicalization.
2.4.2. Signature Parameters 2.4.2. Signature Parameters
HTTP Message Signatures have metadata properties that provide
information regarding the signature's generation and/or verification.
The signature parameters special content is identified by the The signature parameters special 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. Section 3.1 with all associated parameters. The following metadata properties
are defined:
Covered Content:
An ordered list of content identifiers for headers Section 2.1 and
specialty content Section 2.4 that indicates the metadata and
message content that is covered by the signature. This list MUST
NOT include the "@signature-params" specialty content identifier
itself.
Algorithm:
An HTTP Signature Algorithm defined in the HTTP Signature
Algorithms Registry defined in this document, represented as a
string. It describes the signing and verification algorithms for
the signature.
Key Material:
The key material required to create or verify the signature.
Creation Time:
A timestamp representing the point in time that the signature was
generated, represented as an integer. Sub-second precision is not
supported. A signature's Creation Time MAY be undefined,
indicating that it is unknown.
Expiration Time:
A timestamp representing the point in time at which the signature
expires, represented as an integer. An expired signature always
fails verification. A signature's Expiration Time MAY be
undefined, indicating that the signature does not expire.
The signature parameters are serialized using the rules in [RFC8941]
section 4 as follows:
1. Let the output be an empty string.
2. Serialize the content identifiers of the covered content as an
ordered "inner-list" according to [RFC8941] section 4.1.1.1 and
append this to the output.
3. Append the signature metadata as parameters according to
[RFC8941] section 4.1.1.2 in the any order, skipping fields that
are not available:
* "alg": Algorithm as an "sf-string" value.
* "keyid": Identifier for the key material as an "sf-string"
value.
* "created": Creation time as an "sf-integer" timestamp value.
* "expires": Expiration time as an "sf-integer" timestamp value.
Note that the "inner-list" serialization is used for the covered
content instead of the "sf-list" serialization in order to facilitate
this value's additional inclusion in the "Signature-Input" header's
dictionary, as discussed in Section 4.1.
This example shows a canonicalized value for the parameters of a
given signature:
# NOTE: '\' line wrapping per RFC 8792
("@request-target" "host" "date" "cache-control" "x-empty-header"
"x-example"); keyid="test-key-a"; alg="rsa-pss-sha512"; \
created=1402170695; expires=1402170995
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.
2.4.2.1. Canonicalization Examples 2.4.2.1. Canonicalization Examples
Given the following signature parameters: Given the following signature parameters:
+==============+=========================================+ +==============+=========================================+
| Property | Value | | Property | Value |
+==============+=========================================+ +==============+=========================================+
| Algorithm | hs2019 | | Algorithm | rsa-pss-sha512 |
+--------------+-----------------------------------------+ +--------------+-----------------------------------------+
| Covered | "@request-target", "host", "date", | | Covered | "@request-target", "host", "date", |
| Content | "cache-control", "x-emptyheader", | | Content | "cache-control", "x-emptyheader", |
| | "x-example", "x-dictionary;key=b", | | | "x-example", "x-dictionary;key=b", |
| | "x-dictionary;key=a", "x-list;prefix=3" | | | "x-dictionary;key=a", "x-list;prefix=3" |
+--------------+-----------------------------------------+ +--------------+-----------------------------------------+
| Creation | 1402174295 | | Creation | 1402174295 |
| Time | | | Time | |
+--------------+-----------------------------------------+ +--------------+-----------------------------------------+
| Expiration | 1402174595 | | Expiration | 1402174595 |
skipping to change at page 14, line 34 skipping to change at page 16, line 5
+--------------+-----------------------------------------+ +--------------+-----------------------------------------+
| Verification | The public key provided in | | Verification | The public key provided in |
| Key Material | Appendix B.1.1 and identified by the | | Key Material | Appendix B.1.1 and identified by the |
| | "keyid" value "test-key-a". | | | "keyid" value "test-key-a". |
+--------------+-----------------------------------------+ +--------------+-----------------------------------------+
Table 5 Table 5
The signature parameter value is defined as: The signature parameter value is defined as:
"@signature-params": ("@request-target" "host" "date" "cache-control" "x-empty-header" "x-example" "x-dictionary";key=b "x-dictionary";key=a "x-list";prefix=3); keyid="test-key-a"; alg="hs2019"; created=1402170695; expires=1402170995 # NOTE: '\' line wrapping per RFC 8792
"@signature-params": ("@request-target" "host" "date" "cache-control" \
"x-empty-header" "x-example" "x-dictionary";key=b \
"x-dictionary";key=a "x-list";prefix=3); keyid="test-key-a"; \
alg="rsa-pss-sha512"; created=1402170695; expires=1402170995
3. HTTP Message Signatures 2.5. Creating the Signature Input String
An HTTP Message Signature is a signature over a string generated from The signature input is a US-ASCII string containing the content that
a subset of the content in an HTTP message and metadata about the is covered by the signature. To create the signature input string,
signature itself. When successfully verified against an HTTP the signer or verifier concatenates together entries for each
message, it provides cryptographic proof that with respect to the identifier in the signature's covered content and parameters using
subset of content that was signed, the message is semantically the following algorithm:
equivalent to the message for which the signature was generated.
3.1. Signature Metadata 1. Let the output be an empty string.
HTTP Message Signatures have metadata properties that provide 2. For each covered content item in the covered content list (in
information regarding the signature's generation and/or verification. order):
The following metadata properties are defined:
Algorithm: 1. Append the identifier for the covered content serialized
according to the "content-identifier" rule.
An HTTP Signature Algorithm defined in the HTTP Signature 2. Append a single colon "":""
Algorithms Registry defined in this document, represented as a
string. It describes the signing and verification algorithms for
the signature.
Creation Time: 3. Append a single space "" ""
A timestamp representing the point in time that the signature was
generated, represented as an integer. Sub-second precision is not
supported. A signature's Creation Time MAY be undefined,
indicating that it is unknown.
Expiration Time: 4. Append the covered content's canonicalized value, as defined
A timestamp representing the point in time at which the signature by the covered content type. Section 2.1 and Section 2.4
expires, represented as an integer. An expired signature always
fails verification. A signature's Expiration Time MAY be
undefined, indicating that the signature does not expire.
Verification Key Material: 5. Append a single newline ""\\n""
The key material required to verify the signature.
Covered Content: 3. Append the signature parameters Section 2.4.2 as follows:
An ordered list of content identifiers (Section 2) that indicates
the metadata and message content that is covered by the signature.
This list MUST NOT include the "@signature-params" content
identifier.
The signature metadata is serialized using the rules in [RFC8941] 1. Append the identifier for the signature parameters serialized
section 4 as follows: according to the "content-identifier" rule, ""@signature-
params""
1. Let the output be an empty string. 2. Append a single colon "":""
2. Serialize the content identifiers as an ordered "inner-list" 3. Append a single space "" ""
according to [RFC8941] section 4.1.1.1 and append this to the
output.
3. Append the signature metadata as parameters according to 4. Append the signature parameters' canonicalized value as
[RFC8941] section 4.1.1.2 in the any order, skipping fields that defined in Section 2.4.2
are not available:
* "alg": Algorithm as an "sf-string" value. 4. Return the output string.
* "keyid": Verification Key Material as an "sf-string" value. If covered content references an identifier that cannot be resolved
to a value in the message, the implementation MUST produce an error.
Such situations are included but not limited to: * The signer or
verifier does not understand the content identifier. * The identifier
identifies a header field that is not present in the message or whose
value is malformed. * The identifier is a Dictionary member
identifier that references a header field that is not present in the
message, is not a 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 member
that is not present in the header field value, or whose value is
malformed. E.g., the identifier is ""x-dictionary";key=c" and the
value of the "x-dictionary" 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)".
* "created": Creation Time as an "sf-integer" timestamp value. For the non-normative example Signature metadata in Table 6, the
corresponding Signature Input is:
* "expires": Expiration Time as an "sf-integer" timestamp value. # NOTE: '\' line wrapping per RFC 8792
"@request-target": get /foo
"host": example.org
"date": Tue, 07 Jun 2014 20:51:35 GMT
"cache-control": max-age=60, must-revalidate
"x-emptyheader":
"x-example": Example header with some whitespace.
"x-dictionary";key=b: 2
"x-dictionary";key=a: 1
"x-list";prefix=3: (a, b, c)
"@signature-params": ("@request-target" "host" "date" "cache-control" \
"x-empty-header" "x-example" "x-dictionary";key=b \
"x-dictionary";key=a "x-list";prefix=3); keyid="test-key-a"; \
created=1402170695; expires=1402170995
Note that the "inner-list" serialization is used instead of the "sf- Figure 1: Non-normative example Signature Input
list" serialization in order to facilitate this value's inclusion in
the "Signature-Input" header's dictionary, as discussed in
Section 4.1.
The Table 6 values would be serialized as follows: 3. HTTP Message Signatures
("@request-target" "host" "date" "cache-control" "x-empty-header" "x-example"); keyid="test-key-a"; alg="hs2019"; created=1402170695; expires=1402170995 An HTTP Message Signature is a signature over a string generated from
a subset of the content in an HTTP message and metadata about the
signature itself. When successfully verified against an HTTP
message, it provides cryptographic proof that with respect to the
subset of content that was signed, the message is semantically
equivalent to the message for which the signature was generated.
3.2. Creating a Signature 3.1. Creating a Signature
In order to create a signature, a signer completes the following In order to create a signature, a signer completes the following
process: process:
1. Choose key material and algorithm, and set metadata properties 1. The signer chooses an HTTP signature algorithm and key material
Section 3.2.1 for signing. The signer MUST choose key material that is
appropriate for the signature's algorithm, and that conforms to
2. Create the Signature Input Section 3.2.2 any requirements defined by the algorithm, such as key size or
format. The mechanism by which the signer chooses the algorithm
3. Sign the Signature Input Section 3.2.3 and key material is out of scope for this document.
The following sections describe each of these steps in detail.
3.2.1. Choose and Set Signature Metadata Properties
1. The signer chooses an HTTP Signature Algorithm from those
registered in the HTTP Signature Algorithms Registry defined by
this document, and sets the signature's Algorithm property to
that value. The signer MUST NOT choose an algorithm marked
"Deprecated". The mechanism by which the signer chooses an
algorithm is out of scope for this document.
2. The signer chooses key material to use for signing and
verification, and sets the signature's Verification Key Material
property to the key material required for verification. The
signer MUST choose key material that is appropriate for the
signature's Algorithm, and that conforms to any requirements
defined by the Algorithm, such as key size or format. The
mechanism by which the signer chooses key material is out of
scope for this document.
3. The signer sets the signature's Creation Time property to the 2. The signer sets the signature's creation time to the current
current time. time.
4. The signer sets the signature's Expiration Time property to the 3. If applicable, the signer sets the signature's expiration time
time at which the signature is to expire, or to undefined if the property to the time at which the signature is to expire.
signature will not expire.
5. 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.
* Each identifier MUST be one of those defined in Section 2. * Each covered content identifier MUST reference either an HTTP
header or a specialty content field listed in Section 2.4 or
* This list MUST NOT be empty, as this would result in creating its associated registry.
a signature over the empty string.
* Signers SHOULD include "@request-target" in the list. * Signers SHOULD include "@request-target" in the covered
content list list.
* Signers SHOULD include a date stamp, such as the "date" * Signers SHOULD include a date stamp in some form, such as
header. Alternatively, the "created" signature metadata using the "date" header. Alternatively, the "created"
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, the list order is out of scope for this document. However, note that
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 metadata is not included in the * Note that the "@signature-params" specialty identifier is not
explicit list of covered content identifiers since its value explicitly listed in the list of covered content identifiers,
is always covered. because it is required to always be present as the last line
in the signature input. This ensures that a signature always
covers its own metadata.
5. The signer creates the signature input string. Section 2.5
6. The signer signs the signature input with the chosen signing
algorithm using the key material chosen by the signer. Several
signing algorithms are defined in in Section 3.3.
7. The signer then encodes the result of that operation as a
Base64-encoded string [RFC4648]. This string is the signature
output value.
For example, given the following HTTP message: For example, given the following HTTP message:
GET /foo HTTP/1.1 GET /foo HTTP/1.1
Host: example.org Host: example.org
Date: Sat, 07 Jun 2014 20:51:35 GMT Date: Sat, 07 Jun 2014 20:51:35 GMT
X-Example: Example header X-Example: Example header
with some whitespace. with some whitespace.
X-EmptyHeader: X-EmptyHeader:
X-Dictionary: a=1, b=2 X-Dictionary: a=1, b=2
X-List: (a b c d) X-List: (a b c d)
Cache-Control: max-age=60 Cache-Control: max-age=60
Cache-Control: must-revalidate Cache-Control: must-revalidate
The following table presents a non-normative example of metadata The following table presents a non-normative example of metadata
values that a signer may choose: values that a signer may choose:
+==============+=========================================+ +==============+=========================================+
| Property | Value | | Property | Value |
+==============+=========================================+ +==============+=========================================+
| Algorithm | hs2019 |
+--------------+-----------------------------------------+
| Covered | "@request-target", "host", "date", | | Covered | "@request-target", "host", "date", |
| Content | "cache-control", "x-emptyheader", | | Content | "cache-control", "x-emptyheader", |
| | "x-example", "x-dictionary;key=b", | | | "x-example", "x-dictionary;key=b", |
| | "x-dictionary;key=a", "x-list;prefix=3" | | | "x-dictionary;key=a", "x-list;prefix=3" |
+--------------+-----------------------------------------+ +--------------+-----------------------------------------+
| Creation | 1402174295 | | Creation | 1402174295 |
| Time | | | Time | |
+--------------+-----------------------------------------+ +--------------+-----------------------------------------+
| Expiration | 1402174595 | | Expiration | 1402174595 |
| Time | | | Time | |
+--------------+-----------------------------------------+ +--------------+-----------------------------------------+
| Verification | The public key provided in | | Verification | The public key provided in |
| Key Material | Appendix B.1.1 and identified by the | | Key Material | Appendix B.1.1 and identified by the |
| | "keyid" value "test-key-a". | | | "keyid" value "test-key-a". |
+--------------+-----------------------------------------+ +--------------+-----------------------------------------+
Table 6: Non-normative example metadata values Table 6: Non-normative example metadata values
3.2.2. Create the Signature Input For the non-normative example signature metadata and signature input
in Figure 1, the corresponding signature value is:
The Signature Input is a US-ASCII string containing the content that
will be signed. To create it, the signer or verifier concatenates
together entries for each identifier in the signature's Covered
Content in the order it occurs in the list, with each entry separated
by a newline ""\n"". An identifier's entry is a "sf-string" followed
with a colon "":"", a space "" "", and the identifier's canonicalized
value.
The signer or verifier then includes the signature metadata specialty
field "@signature-params" as the last entry in the covered content,
separated by a newline ""\n"". Section 2.4.2
If Covered Content contains an identifier for a header field that is
malformed or is not present in the message, the implementation MUST
produce an error.
If Covered Content contains an identifier for a Dictionary member
that references a header field using the "key" parameter that is not
present, is malformed in the message, or is not a Dictionary
Structured Field, the implementation MUST produce an error. If the
header field value does not contain the specified member, the
implementation MUST produce an error.
If Covered Content contains an identifier for a List Prefix that
references a header field using the "prefix" parameter that is not
present, is malformed in the message, or is not a List Structured
Field, the implementation MUST produce an error. If the header field
value contains fewer than the specified number of members, the
implementation MUST produce an error.
For the non-normative example Signature metadata in Table 6, the
corresponding Signature Input is:
"@request-target": get /foo
"host": example.org
"date": Tue, 07 Jun 2014 20:51:35 GMT
"cache-control": max-age=60, must-revalidate
"x-emptyheader":
"x-example": Example header with some whitespace.
"x-dictionary";key=b: 2
"x-dictionary";key=a: 1
"x-list";prefix=3: (a, b, c)
"@signature-params": ("@request-target" "host" "date" "cache-control" "x-empty-header" "x-example" "x-dictionary";key=b "x-dictionary";key=b "x-list";prefix=3); keyid="test-key-a"; alg="hs2019"; created=1402170695; expires=1402170995
Figure 1: Non-normative example Signature Input # NOTE: '\' line wrapping per RFC 8792
K2qGT5srn2OGbOIDzQ6kYT+ruaycnDAAUpKv+ePFfD0RAxn/1BUeZx/Kdrq32DrfakQ6b\
PsvB9aqZqognNT6be4olHROIkeV879RrsrObury8L9SCEibeoHyqU/yCjphSmEdd7WD+z\
rchK57quskKwRefy2iEC5S2uAH0EPyOZKWlvbKmKu5q4CaB8X/I5/+HLZLGvDiezqi6/7\
p2Gngf5hwZ0lSdy39vyNMaaAT0tKo6nuVw0S1MVg1Q7MpWYZs0soHjttq0uLIA3DIbQfL\
iIvK6/l0BdWTU7+2uQj7lBkQAsFZHoA96ZZgFquQrXRlmYOh+Hx5D9fJkXcXe5tmAg==
3.2.3. Sign the Signature Input Figure 2: Non-normative example signature value
The signer signs the Signature Input using the signing algorithm 3.2. Verifying a Signature
described by the signature's Algorithm property, and the key material
chosen by the signer. The signer then encodes the result of that
operation as a base 64-encoded string [RFC4648]. This string is the
signature value.
For the non-normative example Signature metadata in Section 3.2.1 and In order to verify a signature, a verifier MUST follow the following
Signature Input in Figure 1, the corresponding signature value is: algorithm:
K2qGT5srn2OGbOIDzQ6kYT+ruaycnDAAUpKv+ePFfD0RAxn/1BUeZx/Kdrq32DrfakQ6b 1. Examine the signature's parameters to confirm that the signature
PsvB9aqZqognNT6be4olHROIkeV879RrsrObury8L9SCEibeoHyqU/yCjphSmEdd7WD+z meets the requirements described in this document, as well as any
rchK57quskKwRefy2iEC5S2uAH0EPyOZKWlvbKmKu5q4CaB8X/I5/+HLZLGvDiezqi6/7 additional requirements defined by the application such as which
p2Gngf5hwZ0lSdy39vyNMaaAT0tKo6nuVw0S1MVg1Q7MpWYZs0soHjttq0uLIA3DIbQfL contents are required to be covered by the signature.
iIvK6/l0BdWTU7+2uQj7lBkQAsFZHoA96ZZgFquQrXRlmYOh+Hx5D9fJkXcXe5tmAg== Section 3.2.1
Figure 2: Non-normative example signature value 2. Determine the verification key material for this signature. If
the key material is known through external means such as static
configuration or external protocol negotiation, the verifier will
use that. If the key is identified in the signature parameters,
the verifier will dereference this to appropriate key material to
use with the signature. The verifier has to determine the
trustworthiness of the key material for the context in which the
signature is presented.
3.3. Verifying a Signature 3. Determine the algorithm to apply for verification:
In order to verify a signature, a verifier MUST: 1. If the algorithm is known through external means such as
static configuration or external protocol negotiation, the
verifier will use this algorithm.
1. Examine the signature's metadata to confirm that the signature 2. If the algorithm is explicitly stated in the signature
meets the requirements described in this document, as well as any parameters using a value from the HTTP Message Signatures
additional requirements defined by the application such as which registry, the verifier will use the referenced algorithm.
header fields or other content are required to be covered by the
signature.
2. Use the received HTTP message and the signature's metadata to 3. If the algorithm can be determined from the keying material,
recreate the Signature Input, using the process described in such as through an algorithm field on the key value itself,
Section 3.2.2. The value of the "@signature-params" input is the the verifier will use this algorithm.
value of the signature input header field for this signature, not
including the signature's label.
3. Use the signature's Algorithm and Verification Key Material with 4. Use the received HTTP message and the signature's metadata to
the recreated Signing Input to verify the signature value. recreate the signature input, using the process described in
Section 2.5. The value of the "@signature-params" input is the
value of the SignatureInput header field for this signature
serialized according to the rules described in Section 2.4.2, not
including the signature's label from the SignatureInput header.
A signature with a Creation Time that is in the future or an 5. If the key material is appropriate for the algorithm, apply the
Expiration Time that is in the past MUST NOT be processed. verification algorithm to the signature, signature input,
signature parameters, key material, and algorithm. The results
of the verification algorithm function are the final results of
the signature verification. Several algorithms are defined in
Section 3.3.
The verifier MUST ensure that a signature's Algorithm is appropriate If any of the above steps fail, the signature validation fails.
for the key material the verifier will use to verify the signature.
If the Algorithm is not appropriate for the key material (for
example, if it is the wrong size, or in the wrong format), the
signature MUST NOT be processed.
3.3.1. Enforcing Application Requirements 3.2.1. Enforcing Application Requirements
The verification requirements specified in this document are intended The verification requirements specified in this document are intended
as a baseline set of restrictions that are generally applicable to as a baseline set of restrictions that are generally applicable to
all use cases. Applications using HTTP Message Signatures MAY impose all use cases. Applications using HTTP Message Signatures MAY impose
requirements above and beyond those specified by this document, as requirements above and beyond those specified by this document, as
appropriate for their use case. appropriate for their use case.
Some non-normative examples of additional requirements an application Some non-normative examples of additional requirements an application
might define are: might define are:
skipping to change at page 21, line 15 skipping to change at page 22, line 5
Application-specific requirements are expected and encouraged. When Application-specific requirements are expected and encouraged. When
an application defines additional requirements, it MUST enforce them an application defines additional requirements, it MUST enforce them
during the signature verification process, and signature verification during the signature verification process, and signature verification
MUST fail if the signature does not conform to the application's MUST fail if the signature does not conform to the application's
requirements. requirements.
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
HTTP Message signatures MAY use any cryptographic digital signature
or MAC method that allows for the signing of the signature input
string. This section contains several common algorithm parameters
that can be communicated through the algorithm signature parameter
defined in Section 2.4.2, by reference to the key material, or
through agreement between the signer and verifier.
Signatures are generated from and verified against the byte values of
the signature input string defined in Section 2.5.
3.3.1. RSASSA-PSS using SHA-512
To sign using this algorithm, the signer applies the "RSASSA-PSS-SIGN
(K, M)" function [RFC8017] with the signer's private signing key
("K") and the signature input string ("M") Section 2.5. The hash
SHA-512 [RFC6234] is applied to the signature input string to create
the digest content to which the digital signature is applied. The
resulting signed content ("S") is Base64-encoded as described in
Section 3.1. The resulting encoded value is the HTTP message
signature output.
To verify using this algorithm, the verifier applies the "RSASSA-PSS-
VERIFY ((n, e), M, S)" function [RFC8017] using the public key
material ("(n, e)"). The verifier re-creates the signature input
string ("M") from the received message, as defined in Section 2.5.
The hash function SHA-512 [RFC6234] is applied to the signature input
string to create the digest content to which the verification
function is applied. The verifier decodes the HTTP message signature
from Base64 as described in Section 3.2 to give the http message
signature to be verified ("S"). 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
To sign using this algorithm, the signer applies the "RSASSA-
PKCS1-V1_5-SIGN (K, M)" function [RFC8017] to signer's private
signing key ("K") and the signature input string ("M") Section 2.5.
The hash SHA-256 [RFC6234] is applied to the signature input string
to create the digest content to which the digital signature is
applied. The resulting signed content ("S") is Base64-encoded as
described in Section 3.1. The resulting encoded value is the HTTP
message signature output.
To verify using this algorithm, the verifier applies the "RSASSA-
PKCS1-V1_5-VERIFY ((n, e), M, S)" function [RFC8017] using the public
key material ("(n, e)"). The verifier re-creates the signature input
string ("M") from the received message, as defined in Section 2.5.
The hash function SHA-256 [RFC6234] is applied to the signature input
string to create the digest content to which the verification
function is applied. The verifier decodes the HTTP message signature
from Base64 as described in Section 3.2 to give the http message
signature to be verified ("S"). The results of the verification
function are compared to the http message signature to determine if
the signature presented is valid.
3.3.3. HMAC using SHA-256
To sign and verify using this algorithm, the signer applies the
"HMAC" function [RFC2104] with the shared signing key ("K") and the
signature input string ("text") Section 2.5. The hash function
SHA-256 [RFC6234] is applied to the signature input string to create
the digest content to which the HMAC is applied, giving the signature
result.
For signing, the resulting signed content is Base64-encoded as
described in Section 3.1. The resulting encoded value is the HTTP
message signature output.
For verification, the verifier decodes the HTTP message signature
from Base64 as described in Section 3.2 to give the signature to be
compared to the output of the HMAC function. The results of the
comparison determine the validity of the signature presented.
3.3.4. ECDSA using curve P-256 DSS and SHA-256
To sign using this algorithm, the signer applies the "ECDSA"
algorithm [FIPS186-4] using curve P-256 with signer's private signing
key and the signature input string Section 2.5. The hash function
SHA-256 [RFC6234] is applied to the signature input string to create
the digest content to which the digital signature is applied. The
resulting signed content is Base64-encoded as described in
Section 3.1. The resulting encoded value is the HTTP message
signature output.
To verify using this algorithm, the verifier applies the "ECDSA"
algorithm [FIPS186-4] using the public key material. The verifier
re-creates the signature input string defined in Section 2.5. The
hash function SHA-256 [RFC6234] is applied to the signature input
string to create the digest content to which the verification
function is applied. The verifier decodes the HTTP message signature
from Base64 as described in Section 3.2 to give the signature to be
verified. The results of the verification function are compared to
the http message signature to determine if the signature presented is
valid.
3.3.5. JSON Web Signature (JWS) algorithms
If the signing algorithm is a JOSE signing algorithm from the JSON
Web Signature and Encryption Algorithms Registry established by
[RFC7518], the JWS algorithm definition determines the signature and
hashing algorithms to apply for both signing and verification.
For both signing and verification, the HTTP messages signature input
string Section 2.5 is used as the entire "JWS Signing Input". The
JWS Header defined in [RFC7517] is not used, nor is the input string
first encoded in Base64 before applying the algorithm.
The JWS algorithm MUST NOT be "none" and MUST NOT be any algorithm
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. The "Signature" HTTP header field within this specification. The "Signature" HTTP header field
contains signature values, while the "Signature-Input" HTTP header contains signature values, while the "Signature-Input" HTTP header
field identifies the Covered Content and metadata that describe how field identifies the Covered Content and metadata that describe how
each signature was generated. each signature was generated.
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 zero or more message Header [RFC8941] containing the metadata for zero 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,
described in Section 3.1. using the serialization process defined in Section 2.4.2.
# NOTE: '\' line wrapping per RFC 8792
Signature-Input: sig1=("@request-target" "host" "date" Signature-Input: sig1=("@request-target" "host" "date"
"cache-control" "x-empty-header" "x-example"); keyid="test-key-a"; "cache-control" "x-empty-header" "x-example"); keyid="test-key-a";
alg="hs2019"; created=1402170695; expires=1402170995 alg="rsa-pss-sha512"; created=1402170695; expires=1402170995
To facilitate signature validation, the "Signature-Input" header MUST To facilitate signature validation, the "Signature-Input" header MUST
contain the same serialization value used in generating the signature contain the same serialization value used in generating the signature
input. input.
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 zero or more message signatures generated from [RFC8941] containing zero 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.
# NOTE: '\' line wrapping per RFC 8792
Signature: sig1=:K2qGT5srn2OGbOIDzQ6kYT+ruaycnDAAUpKv+ePFfD0RAxn/1BUe\ Signature: sig1=:K2qGT5srn2OGbOIDzQ6kYT+ruaycnDAAUpKv+ePFfD0RAxn/1BUe\
Zx/Kdrq32DrfakQ6bPsvB9aqZqognNT6be4olHROIkeV879RrsrObury8L9SCEibe\ Zx/Kdrq32DrfakQ6bPsvB9aqZqognNT6be4olHROIkeV879RrsrObury8L9SCEibe\
oHyqU/yCjphSmEdd7WD+zrchK57quskKwRefy2iEC5S2uAH0EPyOZKWlvbKmKu5q4\ oHyqU/yCjphSmEdd7WD+zrchK57quskKwRefy2iEC5S2uAH0EPyOZKWlvbKmKu5q4\
CaB8X/I5/+HLZLGvDiezqi6/7p2Gngf5hwZ0lSdy39vyNMaaAT0tKo6nuVw0S1MVg\ CaB8X/I5/+HLZLGvDiezqi6/7p2Gngf5hwZ0lSdy39vyNMaaAT0tKo6nuVw0S1MVg\
1Q7MpWYZs0soHjttq0uLIA3DIbQfLiIvK6/l0BdWTU7+2uQj7lBkQAsFZHoA96ZZg\ 1Q7MpWYZs0soHjttq0uLIA3DIbQfLiIvK6/l0BdWTU7+2uQj7lBkQAsFZHoA96ZZg\
FquQrXRlmYOh+Hx5D9fJkXcXe5tmAg==: FquQrXRlmYOh+Hx5D9fJkXcXe5tmAg==:
4.3. Examples 4.3. Examples
The following is a non-normative example of "Signature-Input" and The following is a non-normative example of "Signature-Input" and
"Signature" HTTP header fields representing the signature in "Signature" HTTP header fields representing the signature in
Figure 2: Figure 2:
# NOTE: '\' line wrapping per RFC 8792 # NOTE: '\' line wrapping per RFC 8792
Signature-Input: sig1=("@request-target" "host" "date" Signature-Input: sig1=("@request-target" "host" "date"
"cache-control" "x-empty-header" "x-example"); keyid="test-key-a"; "cache-control" "x-empty-header" "x-example"); keyid="test-key-a";
alg="hs2019"; created=1402170695; expires=1402170995 alg="rsa-pss-sha512"; created=1402170695; expires=1402170995
Signature: sig1=:K2qGT5srn2OGbOIDzQ6kYT+ruaycnDAAUpKv+ePFfD0RAxn/1BUe\ Signature: sig1=:K2qGT5srn2OGbOIDzQ6kYT+ruaycnDAAUpKv+ePFfD0RAxn/1BUe\
Zx/Kdrq32DrfakQ6bPsvB9aqZqognNT6be4olHROIkeV879RrsrObury8L9SCEibe\ Zx/Kdrq32DrfakQ6bPsvB9aqZqognNT6be4olHROIkeV879RrsrObury8L9SCEibe\
oHyqU/yCjphSmEdd7WD+zrchK57quskKwRefy2iEC5S2uAH0EPyOZKWlvbKmKu5q4\ oHyqU/yCjphSmEdd7WD+zrchK57quskKwRefy2iEC5S2uAH0EPyOZKWlvbKmKu5q4\
CaB8X/I5/+HLZLGvDiezqi6/7p2Gngf5hwZ0lSdy39vyNMaaAT0tKo6nuVw0S1MVg\ CaB8X/I5/+HLZLGvDiezqi6/7p2Gngf5hwZ0lSdy39vyNMaaAT0tKo6nuVw0S1MVg\
1Q7MpWYZs0soHjttq0uLIA3DIbQfLiIvK6/l0BdWTU7+2uQj7lBkQAsFZHoA96ZZg\ 1Q7MpWYZs0soHjttq0uLIA3DIbQfLiIvK6/l0BdWTU7+2uQj7lBkQAsFZHoA96ZZg\
FquQrXRlmYOh+Hx5D9fJkXcXe5tmAg==: FquQrXRlmYOh+Hx5D9fJkXcXe5tmAg==:
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 easily include Dictionary Structured Headers, they can be used to easily include
multiple signatures within the same HTTP message. For example, a multiple signatures within the same HTTP message. For example, a
skipping to change at page 23, line 10 skipping to change at page 26, line 22
host, and may also include a signature over those fields and the host, and may also include a signature over those fields and the
client's signature. The following is a non-normative example of client's signature. The following is a non-normative example of
header fields a reverse proxy might add to a forwarded request that header fields a reverse proxy might add to a forwarded request that
contains the signature in the above example: contains the signature in the above example:
# NOTE: '\' line wrapping per RFC 8792 # NOTE: '\' line wrapping per RFC 8792
X-Forwarded-For: 192.0.2.123 X-Forwarded-For: 192.0.2.123
Signature-Input: reverse_proxy_sig=("host" "date" Signature-Input: reverse_proxy_sig=("host" "date"
"signature";key=sig1 "x-forwarded-for"); keyid="test-key-a"; "signature";key=sig1 "x-forwarded-for"); keyid="test-key-a";
alg="hs2019"; created=1402170695; expires=1402170695 alg="rsa-pss-sha512"; created=1402170695; expires=1402170695
Signature: reverse_proxy_sig=:ON3HsnvuoTlX41xfcGWaOEVo1M3bJDRBOp0Pc/O\ Signature: reverse_proxy_sig=:ON3HsnvuoTlX41xfcGWaOEVo1M3bJDRBOp0Pc/O\
jAOWKQn0VMY0SvMMWXS7xG+xYVa152rRVAo6nMV7FS3rv0rR5MzXL8FCQ2A35DCEN\ jAOWKQn0VMY0SvMMWXS7xG+xYVa152rRVAo6nMV7FS3rv0rR5MzXL8FCQ2A35DCEN\
LOhEgj/S1IstEAEFsKmE9Bs7McBsCtJwQ3hMqdtFenkDffSoHOZOInkTYGafkoy78\ LOhEgj/S1IstEAEFsKmE9Bs7McBsCtJwQ3hMqdtFenkDffSoHOZOInkTYGafkoy78\
l1VZvmb3Y4yf7McJwAvk2R3gwKRWiiRCw448Nt7JTWzhvEwbh7bN2swc/v3NJbg/w\ l1VZvmb3Y4yf7McJwAvk2R3gwKRWiiRCw448Nt7JTWzhvEwbh7bN2swc/v3NJbg/w\
JYyYVbelZx4IywuZnYFxgPl/qvqbAjeEVvaLKLgSMr11y+uzxCHoMnDUnTYhMrmOT\ JYyYVbelZx4IywuZnYFxgPl/qvqbAjeEVvaLKLgSMr11y+uzxCHoMnDUnTYhMrmOT\
4O8lBLfRFOcoJPKBdoKg9U0a96U2mUug1bFOozEVYFg==: 4O8lBLfRFOcoJPKBdoKg9U0a96U2mUug1bFOozEVYFg==:
5. IANA Considerations 5. IANA Considerations
5.1. HTTP Signature Algorithms Registry 5.1. HTTP Signature Algorithms Registry
skipping to change at page 23, line 40 skipping to change at page 27, line 4
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 description of the algorithm used to sign the signing string A brief description of the algorithm used to sign the signature
when generating an HTTP Message Signature, or instructions on how input string.
to determine that algorithm. When the description specifies an
algorithm, it MUST include a reference to the document or
documents that define the algorithm.
5.1.2. Initial Contents Specification document(s):
Reference to the document(s) that specify the token endpoint
authorization method, preferably including a URI that can be used
to retrieve a copy of the document(s). An indication of the
relevant sections may also be included but is not required.
(( MS: The references in this section are problematic as many of the 5.1.2. Initial Contents
specifications that they refer to are too implementation specific,
rather than just pointing to the proper signature and hashing
specifications. A better approach might be just specifying the
signature and hashing function specifications, leaving implementers
to connect the dots (which are not that hard to connect). ))
5.1.2.1. hs2019 5.1.2.1. rsa-pss-sha512
Algorithm Name: Algorithm Name:
"hs2019" "rsa-pss-sha512"
Status: Status:
active Active
Description:
Derived from metadata associated with keyid. Recommend support
for:
* RSASSA-PSS [RFC8017] using SHA-512 [RFC6234]
* HMAC [RFC2104] using SHA-512 [RFC6234]
* ECDSA using curve P-256 DSS [FIPS186-4] and SHA-512 [RFC6234] Definition:
RSASSA-PSS using SHA-256
* Ed25519ph, Ed25519ctx, and Ed25519 [RFC8032] Specification document(s):
[[This document]] Section 3.3.1
5.1.2.2. rsa-sha1 5.1.2.2. rsa-v1_5-sha256
Algorithm Name: Algorithm Name:
"rsa-sha1" "rsa-v1_5-sha256"
Status: Status:
Deprecated; SHA-1 not secure. Active
Description: Description:
RSASSA-PKCS1-v1_5 [RFC8017] using SHA-1 [RFC6234] RSASSA-PKCS1-v1_5 using SHA-256
5.1.2.3. rsa-sha256
Algorithm Name:
"rsa-sha256"
Status:
Deprecated; specifying signature algorithm enables attack vector.
Description: Specification document(s):
RSASSA-PKCS1-v1_5 [RFC8017] using SHA-256 [RFC6234] [[This document]] Section 3.3.2
5.1.2.4. hmac-sha256 5.1.2.3. hmac-sha256
Algorithm Name: Algorithm Name:
"hmac-sha256" "hmac-sha256"
Status: Status:
Deprecated; specifying signature algorithm enables attack vector. Active
Description: Description:
HMAC [RFC2104] using SHA-256 [RFC6234] HMAC using SHA-256
5.1.2.5. ecdsa-sha256 Specification document(s):
[[This document]] Section 3.3.3
5.1.2.4. ecdsa-p256-sha256
Algorithm Name: Algorithm Name:
"ecdsa-sha256" "ecdsa-p256-sha256"
Status: Status:
Deprecated; specifying signature algorithm enables attack vector. Active
Description: Description:
ECDSA using curve P-256 DSS [FIPS186-4] and SHA-256 [RFC6234] ECDSA using curve P-256 DSS and SHA-256
Specification document(s):
[[This document]] Section 3.3.4
5.2. HTTP Signature Metadata Parameters Registry 5.2. HTTP Signature Metadata Parameters Registry
This document defines the "Signature-Input" Structured Header, whose This document defines the "Signature-Input" Structured Header, whose
member values may have parameters containing metadata about a message member values may have parameters containing metadata about a message
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
skipping to change at page 26, line 5 skipping to change at page 29, line 5
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 3.1 of this document | | alg | Active | Section 2.4.2 of this document |
+---------+--------+------------------------------+ +---------+--------+--------------------------------+
| created | Active | Section 3.1 of this document | | created | Active | Section 2.4.2 of this document |
+---------+--------+------------------------------+ +---------+--------+--------------------------------+
| expires | Active | Section 3.1 of this document | | expires | Active | Section 2.4.2 of this document |
+---------+--------+------------------------------+ +---------+--------+--------------------------------+
| keyid | Active | Section 3.1 of this document | | keyid | Active | Section 2.4.2 of this document |
+---------+--------+------------------------------+ +---------+--------+--------------------------------+
Table 7: Initial contents of the HTTP Signature Table 7: 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
skipping to change at page 28, line 39 skipping to change at page 31, line 39
[RFC6234] Eastlake 3rd, D. and T. Hansen, "US Secure Hash Algorithms [RFC6234] Eastlake 3rd, D. and T. Hansen, "US Secure Hash Algorithms
(SHA and SHA-based HMAC and HKDF)", RFC 6234, (SHA and SHA-based HMAC and HKDF)", RFC 6234,
DOI 10.17487/RFC6234, May 2011, DOI 10.17487/RFC6234, May 2011,
<https://www.rfc-editor.org/rfc/rfc6234>. <https://www.rfc-editor.org/rfc/rfc6234>.
[RFC7239] Petersson, A. and M. Nilsson, "Forwarded HTTP Extension", [RFC7239] Petersson, A. and M. Nilsson, "Forwarded HTTP Extension",
RFC 7239, DOI 10.17487/RFC7239, June 2014, RFC 7239, DOI 10.17487/RFC7239, June 2014,
<https://www.rfc-editor.org/rfc/rfc7239>. <https://www.rfc-editor.org/rfc/rfc7239>.
[RFC7517] Jones, M., "JSON Web Key (JWK)", RFC 7517,
DOI 10.17487/RFC7517, May 2015,
<https://www.rfc-editor.org/rfc/rfc7517>.
[RFC7518] Jones, M., "JSON Web Algorithms (JWA)", RFC 7518,
DOI 10.17487/RFC7518, May 2015,
<https://www.rfc-editor.org/rfc/rfc7518>.
[RFC8017] Moriarty, K., Ed., Kaliski, B., Jonsson, J., and A. Rusch, [RFC8017] Moriarty, K., Ed., Kaliski, B., Jonsson, J., and A. Rusch,
"PKCS #1: RSA Cryptography Specifications Version 2.2", "PKCS #1: RSA Cryptography Specifications Version 2.2",
RFC 8017, DOI 10.17487/RFC8017, November 2016, RFC 8017, DOI 10.17487/RFC8017, November 2016,
<https://www.rfc-editor.org/rfc/rfc8017>. <https://www.rfc-editor.org/rfc/rfc8017>.
[RFC8032] Josefsson, S. and I. Liusvaara, "Edwards-Curve Digital
Signature Algorithm (EdDSA)", RFC 8032,
DOI 10.17487/RFC8032, January 2017,
<https://www.rfc-editor.org/rfc/rfc8032>.
[RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for
Writing an IANA Considerations Section in RFCs", BCP 26, Writing an IANA Considerations Section in RFCs", BCP 26,
RFC 8126, DOI 10.17487/RFC8126, June 2017, RFC 8126, DOI 10.17487/RFC8126, June 2017,
<https://www.rfc-editor.org/rfc/rfc8126>. <https://www.rfc-editor.org/rfc/rfc8126>.
[TLS] Rescorla, E., "The Transport Layer Security (TLS) Protocol [TLS] Rescorla, E., "The Transport Layer Security (TLS) Protocol
Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018,
<https://www.rfc-editor.org/rfc/rfc8446>. <https://www.rfc-editor.org/rfc/rfc8446>.
[WP-HTTP-Sig-Audit] [WP-HTTP-Sig-Audit]
skipping to change at page 31, line 5 skipping to change at page 34, line 5
The table below maps example "keyid" values to associated algorithms The table below maps example "keyid" values to associated algorithms
and/or keys. These are example mappings that are valid only within and/or keys. These are example mappings that are valid only within
the context of examples in examples within this and future documents the context of examples in examples within this and future documents
that reference this section. Unless otherwise specified, within the that reference this section. Unless otherwise specified, within the
context of examples it should be assumed that the signer and verifier context of examples it should be assumed that the signer and verifier
understand these "keyid" mappings. These "keyid" values are not understand these "keyid" mappings. These "keyid" values are not
reserved, and deployments are free to use them, with these reserved, and deployments are free to use them, with these
associations or others. associations or others.
+============+=================================+================+ +============+=================+==========================+
| keyid | Algorithm | Verification | | keyid | Algorithm | Verification Key |
| | | Key | +============+=================+==========================+
+============+=================================+================+ | test-key-a | rsa-pss-sha512 | The public key specified |
| test-key-a | "hs2019", using RSASSA-PSS | The public key | | | | in Appendix B.1.1 |
| | [RFC8017] and SHA-512 [RFC6234] | specified in | +------------+-----------------+--------------------------+
| | | Appendix B.1.1 | | test-key-b | rsa-v1_5-sha256 | The public key specified |
+------------+---------------------------------+----------------+ | | | in Appendix B.1.1 |
| test-key-b | rsa-sha256 | The public key | +------------+-----------------+--------------------------+
| | | specified in |
| | | Appendix B.1.1 |
+------------+---------------------------------+----------------+
Table 9 Table 9
B.3. Test Cases B.3. 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 message:
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, 07 Jun 2014 20:51:35 GMT Date: Tue, 07 Jun 2014 20:51:35 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"}
B.3.1. Signature Generation B.3.1. Signature Verification
B.3.1.1. hs2019 signature over minimal recommended content
This presents metadata for a Signature using "hs2019", over minimum
recommended data to sign:
+==============+===================================+
| Property | Value |
+==============+===================================+
| Algorithm | "hs2019", using RSASSA-PSS |
| | [RFC8017] using SHA-512 [RFC6234] |
+--------------+-----------------------------------+
| Covered | @request-target |
| Content | |
+--------------+-----------------------------------+
| Creation | 8:51:35 PM GMT, June 7th, 2014 |
| Time | |
+--------------+-----------------------------------+
| Expiration | Undefined |
| Time | |
+--------------+-----------------------------------+
| Verification | The public key specified in |
| Key Material | Appendix B.1.1. |
+--------------+-----------------------------------+
Table 10
The Signature Input is:
"@request-target": post /foo?param=value&pet=dog
"@signature-params": ("@request-target"); keyid="test-key-a"; created=1402170695
The signature value is:
QaVaWYfF2da6tG66Xtd0GrVFChJ0fOWUe/C6kaYESPiYYwnMH9egOgyKqgLLY9NQJFk7b
QY834sHEUwjS5ByEBaO3QNwIvqEY1qAAU/2MX14tc9Yn7ELBnaaNHaHkV3xVO9KIuLT7V
6e4OUuGb1axfbXpMgPEql6CEFrn6K95CLuuKP5/gOEcBtmJp5L58gN4VvZrk2OVA6U971
YiEDNuDa4CwMcQMvcGssbc/L3OULTUffD/1VcPtdGImP2uvVQntpT8b2lBeBpfh8MuaV2
vtzidyBYFtAUoYhRWO8+ntqA1q2OK4LMjM2XgDScSVWvGdVd459A0wI9lRlnPap3zg==
A possible "Signature-Input" and "Signature" header containing this
signature is:
# NOTE: '\' line wrapping per RFC 8792
Signature-Input: sig1=("@request-target");
keyid="test-key-a"; created=1402170695
Signature: sig1=:QaVaWYfF2da6tG66Xtd0GrVFChJ0fOWUe/C6kaYESPiYYwnMH9eg\
OgyKqgLLY9NQJFk7bQY834sHEUwjS5ByEBaO3QNwIvqEY1qAAU/2MX14tc9Yn7ELB\
naaNHaHkV3xVO9KIuLT7V6e4OUuGb1axfbXpMgPEql6CEFrn6K95CLuuKP5/gOEcB\
tmJp5L58gN4VvZrk2OVA6U971YiEDNuDa4CwMcQMvcGssbc/L3OULTUffD/1VcPtd\
GImP2uvVQntpT8b2lBeBpfh8MuaV2vtzidyBYFtAUoYhRWO8+ntqA1q2OK4LMjM2X\
gDScSVWvGdVd459A0wI9lRlnPap3zg==:
B.3.1.2. hs2019 signature covering all header fields
This presents metadata for a Signature using "hs2019" that covers all
header fields in the request:
+==============+============================================+
| Property | Value |
+==============+============================================+
| Algorithm | "hs2019", using RSASSA-PSS [RFC8017] using |
| | SHA-512 [RFC6234] |
+--------------+--------------------------------------------+
| Covered | "@request-target", "host", "date", |
| Content | "content-type", "digest", "content-length" |
+--------------+--------------------------------------------+
| Creation | 8:51:35 PM GMT, June 7th, 2014 |
| Time | |
+--------------+--------------------------------------------+
| Expiration | Undefined |
| Time | |
+--------------+--------------------------------------------+
| Verification | The public key specified in |
| Key Material | Appendix B.1.1. |
+--------------+--------------------------------------------+
Table 11
The Signature Input is:
"@request-target": post /foo?param=value&pet=dog
"host": example.com
"date": Tue, 07 Jun 2014 20:51:35 GMT
"content-type": application/json
"digest": SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
"content-length": 18
"@signature-params": ("@request-target" "host" "date" "content-type" "digest" "content-length"); keyid="test-key-a"; alg="hs2019"; created=1402170695
The signature value is:
B24UG4FaiE2kSXBNKV4DA91J+mElAhS3mncrgyteAye1GKMpmzt8jkHNjoudtqw3GngGY
3n0mmwjdfn1eA6nAjgeHwl0WXced5tONcCPNzLswqPOiobGeA5y4WE8iBveel30OKYVel
0lZ1OnXOmN5TIEIIPo9LrE+LzZis6A0HA1FRMtKgKGhT3N965pkqfhKbq/V48kpJKT8+c
Zs0TOn4HFMG+OIy6c9ofSBrXD68yxP6QYTz6xH0GMWawLyPLYR52j3I05fK1ylAb6K0ox
PxzQ5nwrLD+mUVPZ9rDs1En6fmOX9xfkZTblG/5D+s1fHHs9dDXCOVkT5dLS8DjdIA==
A possible "Signature-Input" and "Signature" header containing this
signature is:
# NOTE: '\' line wrapping per RFC 8792
Signature-Input: sig1=("@request-target" "host" "date"
"content-type" "digest" "content-length"); keyid="test-key-a";
alg="hs2019"; created=1402170695
Signature: sig1=:B24UG4FaiE2kSXBNKV4DA91J+mElAhS3mncrgyteAye1GKMpmzt8\
jkHNjoudtqw3GngGY3n0mmwjdfn1eA6nAjgeHwl0WXced5tONcCPNzLswqPOiobGe\
A5y4WE8iBveel30OKYVel0lZ1OnXOmN5TIEIIPo9LrE+LzZis6A0HA1FRMtKgKGhT\
3N965pkqfhKbq/V48kpJKT8+cZs0TOn4HFMG+OIy6c9ofSBrXD68yxP6QYTz6xH0G\
MWawLyPLYR52j3I05fK1ylAb6K0oxPxzQ5nwrLD+mUVPZ9rDs1En6fmOX9xfkZTbl\
G/5D+s1fHHs9dDXCOVkT5dLS8DjdIA==:
B.3.2. Signature Verification
B.3.2.1. Minimal Required Signature Header
This presents a "Signature-Input" and "Signature" header containing
only the minimal required parameters:
# NOTE: '\' line wrapping per RFC 8792
Signature-Input: sig1=(); keyid="test-key-a"; created=1402170695
Signature: sig1=:cxieW5ZKV9R9A70+Ua1A/1FCvVayuE6Z77wDGNVFSiluSzR9TYFV\
vwUjeU6CTYUdbOByGMCee5q1eWWUOM8BIH04Si6VndEHjQVdHqshAtNJk2Quzs6WC\
2DkV0vysOhBSvFZuLZvtCmXRQfYGTGhZqGwq/AAmFbt5WNLQtDrEe0ErveEKBfaz+\
IJ35zhaj+dun71YZ82b/CRfO6fSSt8VXeJuvdqUuVPWqjgJD4n9mgZpZFGBaDdPiw\
pfbVZHzcHrumFJeFHWXH64a+c5GN+TWlP8NPg2zFdEc/joMymBiRelq236WGm5VvV\
9a22RW2/yLmaU/uwf9v40yGR/I1NRA==:
The corresponding signature metadata derived from this header field
is:
+=================+==========================================+
| Property | Value |
+=================+==========================================+
| Algorithm | "hs2019", using RSASSA-PSS using SHA-256 |
+-----------------+------------------------------------------+
| Covered Content | `` |
+-----------------+------------------------------------------+
| Creation Time | 8:51:35 PM GMT, June 7th, 2014 |
+-----------------+------------------------------------------+
| Expiration Time | Undefined |
+-----------------+------------------------------------------+
| Verification | The public key specified in |
| Key Material | Appendix B.1.1. |
+-----------------+------------------------------------------+
Table 12
The corresponding Signature Input is:
"@signature-params": sig1=(); alg="hs2019"; keyid="test-key-a"; created=1402170695
B.3.2.2. Minimal Recommended Signature Header
This presents a "Signature-Input" and "Signature" header containing
only the minimal required and recommended parameters:
# NOTE: '\' line wrapping per RFC 8792
Signature-Input: sig1=(); alg="hs2019"; keyid="test-key-a";
created=1402170695
Signature: sig1=:cxieW5ZKV9R9A70+Ua1A/1FCvVayuE6Z77wDGNVFSiluSzR9TYFV\
vwUjeU6CTYUdbOByGMCee5q1eWWUOM8BIH04Si6VndEHjQVdHqshAtNJk2Quzs6WC\
2DkV0vysOhBSvFZuLZvtCmXRQfYGTGhZqGwq/AAmFbt5WNLQtDrEe0ErveEKBfaz+\
IJ35zhaj+dun71YZ82b/CRfO6fSSt8VXeJuvdqUuVPWqjgJD4n9mgZpZFGBaDdPiw\
pfbVZHzcHrumFJeFHWXH64a+c5GN+TWlP8NPg2zFdEc/joMymBiRelq236WGm5VvV\
9a22RW2/yLmaU/uwf9v40yGR/I1NRA==:
The corresponding signature metadata derived from this header field
is:
+=================+==========================================+
| Property | Value |
+=================+==========================================+
| Algorithm | "hs2019", using RSASSA-PSS using SHA-512 |
+-----------------+------------------------------------------+
| Covered Content | `` |
+-----------------+------------------------------------------+
| Creation Time | 8:51:35 PM GMT, June 7th, 2014 |
+-----------------+------------------------------------------+
| Expiration Time | Undefined |
+-----------------+------------------------------------------+
| Verification | The public key specified in |
| Key Material | Appendix B.1.1. |
+-----------------+------------------------------------------+
Table 13
The corresponding Signature Input is:
"@signature-params": sig1=(); alg="rsa-sha256"; keyid="test-key-b"
B.3.2.3. Minimal Signature Header using rsa-sha256 B.3.1.1. Minimal Signature Header using rsa-pss-sha512
This presents a minimal "Signature-Input" and "Signature" header for This presents a minimal "Signature-Input" and "Signature" header for
a signature using the "rsa-sha256" algorithm: a signature using the "rsa-pss-sha512" algorithm:
# NOTE: '\' line wrapping per RFC 8792 # NOTE: '\' line wrapping per RFC 8792
Signature: sig1=("date"); alg=rsa-sha256; keyid="test-key-b" Signature: sig1=("date"); alg="rsa-pss-sha512"; keyid="test-key-b"
Signature: sig1=:HtXycCl97RBVkZi66ADKnC9c5eSSlb57GnQ4KFqNZplOpNfxqk62\ Signature: sig1=:HtXycCl97RBVkZi66ADKnC9c5eSSlb57GnQ4KFqNZplOpNfxqk62\
JzZ484jXgLvoOTRaKfR4hwyxlcyb+BWkVasApQovBSdit9Ml/YmN2IvJDPncrlhPD\ JzZ484jXgLvoOTRaKfR4hwyxlcyb+BWkVasApQovBSdit9Ml/YmN2IvJDPncrlhPD\
VDv36Z9/DiSO+RNHD7iLXugdXo1+MGRimW1RmYdenl/ITeb7rjfLZ4b9VNnLFtVWw\ VDv36Z9/DiSO+RNHD7iLXugdXo1+MGRimW1RmYdenl/ITeb7rjfLZ4b9VNnLFtVWw\
rjhAiwIqeLjodVImzVc5srrk19HMZNuUejK6I3/MyN3+3U8tIRW4LWzx6ZgGZUaEE\ rjhAiwIqeLjodVImzVc5srrk19HMZNuUejK6I3/MyN3+3U8tIRW4LWzx6ZgGZUaEE\
P0aBlBkt7Fj0Tt5/P5HNW/Sa/m8smxbOHnwzAJDa10PyjzdIbywlnWIIWtZKPPsoV\ P0aBlBkt7Fj0Tt5/P5HNW/Sa/m8smxbOHnwzAJDa10PyjzdIbywlnWIIWtZKPPsoV\
oKVopUWEU3TNhpWmaVhFrUL/O6SN3w==: oKVopUWEU3TNhpWmaVhFrUL/O6SN3w==:
The corresponding signature metadata derived from this header field The corresponding signature metadata derived from this header field
is: is:
+===========================+==========================+ +===========================+==========================+
| Property | Value | | Property | Value |
+===========================+==========================+ +===========================+==========================+
| Algorithm | rsa-sha256 | | Algorithm | rsa-pss-sha512 |
+---------------------------+--------------------------+ +---------------------------+--------------------------+
| Covered Content | date | | Covered Content | date |
+---------------------------+--------------------------+ +---------------------------+--------------------------+
| Creation Time | Undefined | | Creation Time | Undefined |
+---------------------------+--------------------------+ +---------------------------+--------------------------+
| Expiration Time | Undefined | | Expiration Time | Undefined |
+---------------------------+--------------------------+ +---------------------------+--------------------------+
| Verification Key Material | The public key specified | | Verification Key Material | The public key specified |
| | in Appendix B.1.1. | | | in Appendix B.1.1. |
+---------------------------+--------------------------+ +---------------------------+--------------------------+
Table 14 Table 10
The corresponding Signature Input is: The corresponding Signature Input is:
"date": Tue, 07 Jun 2014 20:51:35 GMT "date": Tue, 07 Jun 2014 20:51:35 GMT
"@signature-params": ("date"); alg=rsa-sha256; keyid="test-key-b" "@signature-params": ("date"); alg="rsa-pss-sha512"; keyid="test-key-b"
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 editor would also like to thank the following individuals for The editor would also like to thank the following individuals for
feedback on and implementations of the draft-cavage-http-signatures feedback on and implementations of the draft-cavage-http-signatures
skipping to change at page 37, line 16 skipping to change at page 35, line 51
Lucas Pardue, Roberto Polli, Julian Reschke, Michael Richardson, Lucas Pardue, Roberto Polli, Julian Reschke, Michael Richardson,
Wojciech Rygielski, Adam Scarr, Cory J. Slep, Dirk Stein, Henry Wojciech Rygielski, Adam Scarr, Cory J. Slep, Dirk Stein, Henry
Story, Lukasz Szewc, Chris Webber, and Jeffrey Yasskin Story, Lukasz Szewc, Chris Webber, and Jeffrey 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
- Since -02 - -03
o Clarified signing and verification processes.
o Updated algorithm and key selection method.
o Clearly defined core algorithm set.
o Defined JOSE signature mapping process.
o Removed legacy signature methods.
o Define signature parameters separately from "signature"
object model.
o Define serialization values for signature-input header based
on signature input.
- -02 - -02
o Removed editorial comments on document sources. o Removed editorial comments on document sources.
o Removed in-document issues list in favor of tracked issues. o Removed in-document issues list in favor of tracked issues.
o Replaced unstructured "Signature" header with "Signature- o Replaced unstructured "Signature" header with "Signature-
Input" and "Signature" Dictionary Structured Header Fields. Input" and "Signature" Dictionary Structured Header Fields.
 End of changes. 108 change blocks. 
522 lines changed or deleted 504 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/