Showing content from https://greenbytes.de/tech/webdav/draft-ietf-httpbis-message-signatures-06.xml below:
Introduction Message integrity and authenticity are important security properties that are critical to the secure operation of many HTTP applications. Application developers typically rely on the transport layer to provide these properties, by operating their application over . However, TLS only guarantees these properties over a single TLS connection, and the path between client and application may be composed of multiple independent TLS connections (for example, if the application is hosted behind a TLS-terminating gateway or if the client is behind a TLS Inspection appliance). In such cases, TLS cannot guarantee end-to-end message integrity or authenticity between the client and application. Additionally, some operating environments present obstacles that make it impractical to use TLS, or to use features necessary to provide message authenticity. Furthermore, some applications require the binding of an application-level key to the HTTP message, separate from any TLS certificates in use. Consequently, while TLS can meet message integrity and authenticity needs for many HTTP-based applications, it is not a universal solution. This document defines a mechanism for providing end-to-end integrity and authenticity for components of an HTTP message. The mechanism allows applications to create digital signatures or message authentication codes (MACs) over only the components of the message that are meaningful and appropriate for the application. Strict canonicalization rules ensure that the verifier can verify the signature even if the message has been transformed in any of the many ways permitted by HTTP. The signing mechanism described in this document consists of three parts: A common nomenclature and canonicalization rule set for the different protocol elements and other components of HTTP messages. Algorithms for generating and verifying signatures over HTTP message components using this nomenclature and rule set. A mechanism for attaching a signature and related metadata to an HTTP message. This document also provides a mechanism for one party to signal to another party that a signature is desired in one or more subsequent messages. This optional negotiation mechanism can be used along with opportunistic or application-driven message signatures by either party. Requirements Discussion HTTP permits and sometimes requires intermediaries to transform messages in a variety of ways. This may result in a recipient receiving a message that is not bitwise equivalent to the message that was originally sent. In such a case, the recipient will be unable to verify a signature over the raw bytes of the sender's HTTP message, as verifying digital signatures or MACs requires both signer and verifier to have the exact same signature input. Since the exact raw bytes of the message cannot be relied upon as a reliable source of signature input, the signer and verifier must derive the signature input from their respective versions of the message, via a mechanism that is resilient to safe changes that do not alter the meaning of the message. For a variety of reasons, it is impractical to strictly define what constitutes a safe change versus an unsafe one. Applications use HTTP in a wide variety of ways, and may disagree on whether a particular piece of information in a message (e.g., the body, or the Date header field) is relevant. Thus a general purpose solution must provide signers with some degree of control over which message components are signed. HTTP applications may be running in environments that do not provide complete access to or control over HTTP messages (such as a web browser's JavaScript environment), or may be using libraries that abstract away the details of the protocol (such as the Java HTTPClient library ). These applications need to be able to generate and verify signatures despite incomplete knowledge of the HTTP message. HTTP Message Transformations As mentioned earlier, HTTP explicitly permits and in some cases requires implementations to transform messages in a variety of ways. Implementations are required to tolerate many of these transformations. What follows is a non-normative and non-exhaustive list of transformations that may occur under HTTP, provided as context: Re-ordering of header fields with different header field names ( ). Combination of header fields with the same field name ( ). Removal of header fields listed in the Connection header field ( ). Addition of header fields that indicate control options ( ). Addition or removal of a transfer coding ( ). Addition of header fields such as Via ( ) and Forwarded ( ). Safe Transformations Based on the definition of HTTP and the requirements described above, we can identify certain types of transformations that should not prevent signature verification, even when performed on message components covered by the signature. The following list describes those transformations: Combination of header fields with the same field name. Reordering of header fields with different names. Conversion between different versions of the HTTP protocol (e.g., HTTP/1.x to HTTP/2, or vice-versa). Changes in casing (e.g., "Origin" to "origin") of any case-insensitive components such as header field names, request URI scheme, or host. Addition or removal of leading or trailing whitespace to a header field value. Addition or removal of obs-folds . Changes to the request-target and Host header field that when applied together do not result in a change to the message's effective request URI, as defined in . Additionally, all changes to components not covered by the signature are considered safe. Conventions and Terminology The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCPÂ 14 when, and only when, they appear in all capitals, as shown here. The terms "HTTP message", "HTTP request", "HTTP response", absolute-form , absolute-path , "effective request URI", "gateway", "header field", "intermediary", request-target , "sender", and "recipient" are used as defined in . The term "method" is to be interpreted as defined in . For brevity, the term "signature" on its own is used in this document to refer to both digital signatures and keyed MACs. Similarly, the verb "sign" refers to the generation of either a digital signature or keyed MAC over a given input string. The qualified term "digital signature" refers specifically to the output of an asymmetric cryptographic signing operation. In addition to those listed above, this document uses the following terms:
-
HTTP Message Signature:
-
A digital signature or keyed MAC that covers one or more portions of an HTTP message. Note that a given HTTP Message can contain multiple HTTP Message Signatures.
-
Signer:
-
The entity that is generating or has generated an HTTP Message Signature. Note that multiple entities can act as signers and apply separate HTTP Message Signatures to a given HTTP Message.
-
Verifier:
-
An entity that is verifying or has verified an HTTP Message Signature against an HTTP Message. Note that an HTTP Message Signature may be verified multiple times, potentially by different entities.
-
HTTP Message Component:
-
A portion of an HTTP message that is capable of being covered by an HTTP Message Signature.
-
HTTP Message Component Identifier:
-
A value that uniquely identifies a specific HTTP Message Component in respect to a particular HTTP Message Signature and the HTTP Message it applies to.
-
HTTP Message Component Value:
-
The value associated with a given component identifier within the context of a particular HTTP Message. Component values are derived from the HTTP Message and are usually subject to a canonicalization process.
-
Covered Components:
-
An ordered set of HTTP message component identifiers for fields ( ) and specialty components ( ) that indicates the set of message components covered by the signature, not including the @signature-params specialty identifier itself. The order of this set is preserved and communicated between the signer and verifier to facilitate reconstruction of the signature input.
-
Signature Input:
-
The sequence of bytes processed by the HTTP Message Signature algorithm to produce the HTTP Message Signature. The signature input is generated by the signer and verifier using the covered components set and the HTTP Message.
-
HTTP Message Signature Algorithm:
-
A cryptographic algorithm that describes the signing and verification process for the signature. When expressed explicitly, the value maps to a string defined in the HTTP Signature Algorithms Registry defined in this document.
-
Key Material:
-
The key material required to create or verify the signature. The key material is often identified with an explicit key identifier, allowing the signer to indicate to the verifier which key was used.
-
Creation Time:
-
A timestamp representing the point in time that the signature was generated, as asserted by the signer.
-
Expiration Time:
-
A timestamp representing the point in time at which the signature expires, as asserted by the signer. A signature's expiration time could be undefined, indicating that the signature does not expire from the perspective of the signer.
The term "Unix time" is defined by , Section 4.16 . This document contains non-normative examples of partial and complete HTTP messages. Some examples use a single trailing backslash '' to indicate line wrapping for long values, as per . The \ character and leading spaces on wrapped lines are not part of the value. Application of HTTP Message Signatures HTTP Message Signatures are designed to be a general-purpose security mechanism applicable in a wide variety of circumstances and applications. In order to properly and safely apply HTTP Message Signatures, an application or profile of this specification MUST specify all of the following items: The set of component identifiers that are expected and required. For example, an authorization protocol could mandate that the Authorization header be covered to protect the authorization credentials and mandate the signature parameters 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 signature. An application will usually use the keyid parameter of the signature parameters ( ) and define rules for 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 signature is appropriate for the key material. For example, the process could use the alg parameter of the signature parameters ( ) 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 the request are appropriate for the request being made. For example, a server expecting only ECDSA signatures should know to reject any RSA signatures, or a server expecting asymmetric cryptography should know to reject any symmetric cryptography. An application using signatures also has to ensure that the verifier will have access to all required information to re-create the signature input string. For example, a server behind a reverse proxy would need to know the original request URI to make use of identifiers like @target-uri . Additionally, an application using signatures in responses would need to ensure that clients receiving signed responses have access to all the signed portions, including any portions of the request that were signed by the server. The details of this kind of profiling are the purview of the application and outside the scope of this specification. HTTP Message Components In order to allow signers and verifiers to establish which components are covered by a signature, this document defines component identifiers for components covered by an HTTP Message Signature, a set of rules for deriving and canonicalizing the values associated with these component identifiers from the HTTP Message, and the means for combining these canonicalized values into a signature input string. The values for these items MUST be accessible to both the signer and the verifier of the message, which means these are usually derived from aspects of the HTTP message or signature itself. Some HTTP message components can undergo transformations that change the bitwise value without altering meaning of the component's value (for example, the merging together of header fields with the same name). Message component values must therefore be canonicalized before it is signed, to ensure that a signature can be verified despite such intermediary transformations. This document defines rules for each component identifier that transform the identifier's associated component value into such a canonical form. Component identifiers are serialized using the production grammar defined by RFC8941, Section 4 . The component identifier itself is an sf-string value and MAY define parameters which are included using the parameters rule. component-identifier = sf-string parameters Note that this means the value of the component identifier itself is encased in double quotes, with parameters following as a semicolon-separated list, such as "cache-control" , "date" , or "@signature-params" . The following sections define component identifier types, their parameters, their associated values, and the canonicalization rules for their values. The method for combining component identifiers into the signature input is defined in . HTTP Fields The component identifier for an HTTP field is the lowercased form of its field name. While HTTP field names are case-insensitive, implementations MUST use lowercased field names (e.g., content-type , date , etag ) when using them as component identifiers. Unless overridden by additional parameters and rules, the HTTP field value MUST be canonicalized with the following steps: Create an ordered list of the field values of each instance of the field in the message, in the order that they occur (or will occur) in the message. Strip leading and trailing whitespace from each item in the list. Concatenate the list items together, with a comma "," and space " " between each item. The resulting string is the canonicalized component value. Canonicalized Structured HTTP Fields If value of the the HTTP field in question is a structured field ( ), the component identifier MAY include the sf parameter. If this parameter is included, the HTTP field value MUST be canonicalized using the rules specified in Section 4 of RFC8941 . For example, this process will replace any optional internal whitespace with a single space character. The resulting string is used as the component value in . Canonicalization Examples This section contains non-normative examples of canonicalized values for header fields, given the following example HTTP message: Host: www.example.com Date: Tue, 07 Jun 2014 20:51:35 GMT X-OWS-Header: Leading and trailing whitespace. X-Obs-Fold-Header: Obsolete line folding. X-Empty-Header: Cache-Control: max-age=60 Cache-Control: must-revalidate X-Dictionary: a=1, b=2;x=1;y=2, c=(a b c) The following table shows example canonicalized values for header fields, given that message: Header Field Canonicalized Value "cache-control" max-age=60, must-revalidate "date" Tue, 07 Jun 2014 20:51:35 GMT "host" www.example.com "x-empty-header" Â "x-obs-fold-header" Obsolete line folding. "x-ows-header" Leading and trailing whitespace. "x-dictionary" a=1, b=2;x=1;y=2, c=(a b c) "x-dictionary";sf a=1, b=2;x=1;y=2, c=(a b c) Dictionary Structured Field Members An individual member in the value of a Dictionary Structured Field is identified by using the parameter key on the component identifier for the field. The value of this parameter is a the key being identified, without any parameters present on that key in the original dictionary. An individual member in the value of a Dictionary Structured Field is canonicalized by applying the serialization algorithm described in Section 4.1.2 of RFC8941 on a Dictionary containing only that item. Canonicalization Examples This section contains non-normative examples of canonicalized values for Dictionary Structured Field Members given the following example header field, whose value is known to be a Dictionary: X-Dictionary: a=1, b=2;x=1;y=2, c=(a b c) The following table shows example canonicalized values for different component identifiers, given that field: Component Identifier Component Value "x-dictionary";key=a 1 "x-dictionary";key=b 2;x=1;y=2 "x-dictionary";key=c (a, b, c) Specialty Components Message components not found in an HTTP field can be included in the signature input by defining a component identifier and the canonicalization method for its component value. To differentiate specialty component identifiers from HTTP fields, specialty component identifiers MUST start with the "at" @ character. This specification defines the following specialty component identifiers:
-
@signature-params
-
The signature metadata parameters for this signature. ( )
-
@method
-
The method used for a request. ( )
-
@target-uri
-
The full target URI for a request. ( )
-
@authority
-
The authority of the target URI for a request. ( )
-
@scheme
-
The scheme of the target URI for a request. ( )
-
@request-target
-
The request target. ( )
-
@path
-
The absolute path portion of the target URI for a request. ( )
-
@query
-
The query portion of the target URI for a request. ( )
-
@query-params
-
The parsed query parameters of the target URI for a request. ( )
-
@status
-
The status code for a response. ( ).
-
@request-response
-
A signature from a request message that resulted in this response message. ( )
Additional specialty component identifiers MAY be defined and registered in the HTTP Signatures Specialty Component Identifier Registry. ( ) Signature Parameters HTTP Message Signatures have metadata properties that provide information regarding the signature's generation and verification, such as the set of covered components, a timestamp, identifiers for verification key material, and other utilities. The signature parameters component identifier is @signature-params . The signature parameters component value is the serialization of the signature parameters for this signature, including the covered components set with all associated parameters. These parameters include any of the following: created : Creation time as an sf-integer UNIX timestamp value. Sub-second precision is not supported. Inclusion of this parameter is RECOMMENDED. expires : Expiration time as an sf-integer UNIX timestamp value. Sub-second precision is not supported. nonce : A random unique value generated for this signature. alg : The HTTP message signature algorithm from the HTTP Message Signature Algorithm Registry, as an sf-string value. keyid : The identifier for the key material as an sf-string value. Additional parameters can be defined in the HTTP Signature Parameters Registry . The signature parameters component value is serialized as a parameterized inner list using the rules in Section 4 of RFC8941 as follows: Let the output be an empty string. Determine an order for the component identifiers of the covered components. Once this order is chosen, it cannot be changed. This order MUST be the same order as used in creating the signature input ( ). Serialize the component identifiers of the covered components, including all parameters, as an ordered inner-list according to Section 4.1.1.1 of RFC8941 and append this to the output. Determine an order for any signature parameters. Once this order is chosen, it cannot be changed. Append the parameters to the inner-list in the chosen order according to Section 4.1.1.2 of RFC8941 , skipping parameters that are not available or not used for this message signature. The output contains the signature parameters component value. Note that the inner-list serialization is used for the covered component value instead of the sf-list serialization in order to facilitate this value's inclusion in message fields such as the Signature-Input field's dictionary, as discussed in . This example shows a canonicalized value for the parameters of a given signature: NOTE: '\' line wrapping per RFC 8792 ("@target-uri" "@authority" "date" "cache-control" "x-empty-header" \ "x-example");keyid="test-key-rsa-pss";alg="rsa-pss-sha512";\ created=1618884475;expires=1618884775 Note that an HTTP message could contain multiple signatures, but only the signature parameters used for the current signature are included in the entry. Method The @method component identifier refers to the HTTP method of a request message. The component value of is canonicalized by taking the value of the method as a string. Note that the method name is case-sensitive as per , and conventionally standardized method names are uppercase US-ASCII. If used, the @method component identifier MUST occur only once in the covered components. For example, the following request message: POST /path?param=value HTTP/1.1 Host: www.example.com Would result in the following @method value: "@method": POST If used in a response message, the @method component identifier refers to the associated component value of the request that triggered the response message being signed. Target URI The @target-uri component identifier refers to the target URI of a request message. The component value is the full absolute target URI of the request, potentially assembled from all available parts including the authority and request target as described in . If used, the @target-uri component identifier MUST occur only once in the covered components. For example, the following message sent over HTTPS: POST /path?param=value HTTP/1.1 Host: www.example.com Would result in the following @target-uri value: "@target-uri": https://www.example.com/path?param=value If used in a response message, the @target-uri component identifier refers to the associated component value of the request that triggered the response message being signed. Authority The @authority component identifier refers to the authority component of the target URI of the HTTP request message, as defined in . In HTTP 1.1, this is usually conveyed using the Host header, while in HTTP 2 and HTTP 3 it is conveyed using the :authority pseudo-header. The value is the fully-qualified authority component of the request, comprised of the host and, optionally, port of the request target, as a string. The component value MUST be normalized according to the rules in . Namely, the host name is normalized to lowercase and the default port is omitted. If used, the @authority component identifier MUST occur only once in the covered components. For example, the following request message: POST /path?param=value HTTP/1.1 Host: www.example.com Would result in the following @authority component value: "@authority": www.example.com If used in a response message, the @authority component identifier refers to the associated component value of the request that triggered the response message being signed. Scheme The @scheme component identifier refers to the scheme of the target URL of the HTTP request message. The component value is the scheme as a string as defined in . While the scheme itself is case-insensitive, it MUST be normalized to lowercase for inclusion in the signature input string. If used, the @scheme component identifier MUST occur only once in the covered components. For example, the following request message requested over plain HTTP: POST /path?param=value HTTP/1.1 Host: www.example.com Would result in the following @scheme value: "@scheme": http If used in a response message, the @scheme component identifier refers to the associated component value of the request that triggered the response message being signed. Request Target The @request-target component identifier refers to the full request target of the HTTP request message, as defined in . The component value of the request target can take different forms, depending on the type of request, as described below. If used, the @request-target component identifier MUST occur only once in the covered components. For HTTP 1.1, the component value is equivalent to the request target portion of the request line. However, this value is more difficult to reliably construct in other versions of HTTP. Therefore, it is NOT RECOMMENDED that this identifier be used when versions of HTTP other than 1.1 might be in use. The origin form value is combination of the absolute path and query components of the request URL. For example, the following request message: POST /path?param=value HTTP/1.1 Host: www.example.com Would result in the following @request-target component value: "@request-target": /path?param=value The following request to an HTTP proxy with the absolute-form value, containing the fully qualified target URI: GET https://www.example.com/path?param=value HTTP/1.1 Would result in the following @request-target component value: "@request-target": https://www.example.com/path?param=value The following CONNECT request with an authority-form value, containing the host and port of the target: CONNECT www.example.com:80 HTTP/1.1 Host: www.example.com Would result in the following @request-target component value: "@request-target": www.example.com:80 The following OPTIONS request message with the asterisk-form value, containing a single asterisk * character: OPTIONS * HTTP/1.1 Host: www.example.com Would result in the following @request-target component value: "@request-target": * If used in a response message, the @request-target component identifier refers to the associated component value of the request that triggered the response message being signed. Path The @path component identifier refers to the target path of the HTTP request message. The component value is the absolute path of the request target defined by , with no query component and no trailing ? character. The value is normalized according to the rules in . Namely, an empty path string is normalized as a single slash / character, and path components are represented by their values after decoding any percent-encoded octets. If used, the @path component identifier MUST occur only once in the covered components. For example, the following request message: POST /path?param=value HTTP/1.1 Host: www.example.com Would result in the following @path value: "@path": /path If used in a response message, the @path identifier refers to the associated component value of the request that triggered the response message being signed. Query The @query component identifier refers to the query component of the HTTP request message. The component value is the entire normalized query string defined by , including the leading ? character. The value is normalized according to the rules in . Namely, percent-encoded octets are decoded. If used, the @query component identifier MUST occur only once in the covered components. For example, the following request message: POST /path?param=value&foo=bar&baz=batman HTTP/1.1 Host: www.example.com Would result in the following @query value: "@query": ?param=value&foo=bar&baz=batman The following request message: POST /path?queryString HTTP/1.1 Host: www.example.com Would result in the following @query value: "@query": ?queryString If used in a response message, the @query component identifier refers to the associated component value of the request that triggered the response message being signed. Query Parameters If a request target URI uses HTML form parameters in the query string as defined in Section 5, the @query-params component identifier allows addressing of individual query parameters. The query parameters MUST be parsed according to Section 5.1, resulting in a list of ( nameString , valueString ) tuples. The REQUIRED name parameter of each input identifier contains the nameString of a single query parameter. Several different named query parameters MAY be included in the covered components. Single named parameters MAY occur in any order in the covered components. The component value of a single named parameter is the the valueString of the named query parameter defined by Section 5.1, which is the value after percent-encoded octets are decoded. Note that this value does not include any leading ? characters, equals sign = , or separating & characters. Named query parameters with an empty valueString are included with an empty string as the component value. If a parameter name occurs multiple times in a request, all parameter values of that name MUST be included in separate signature input lines in the order in which the parameters occur in the target URI. For example for the following request: POST /path?param=value&foo=bar&baz=batman&qux= HTTP/1.1 Host: www.example.com Indicating the baz , qux and param named query parameters in would result in the following @query-param value: "@query-params";name="baz": batman "@query-params";name="qux": "@query-params";name="param": value If used in a response message, the @query-params component identifier refers to the associated component value of the request that triggered the response message being signed. Status Code The @status component identifier refers to the three-digit numeric HTTP status code of a response message as defined in . The component value is the serialized three-digit integer of the HTTP response code, with no descriptive text. If used, the @status component identifier MUST occur only once in the covered components. For example, the following response message: HTTP/1.1 200 OK Date: Fri, 26 Mar 2010 00:05:00 GMT Would result in the following @status value: "@status": 200 The @status component identifier MUST NOT be used in a request message. Request-Response Signature Binding When a signed request message results in a signed response message, the @request-response component identifier can be used to cryptographically link the request and the response to each other by including the identified request signature value in the response's signature input without copying the value of the request's signature to the response directly. This component identifier has a single REQUIRED parameter:
-
key
-
Identifies which signature from the response to sign.
The component value is the sf-binary representation of the signature value of the referenced request identified by the key parameter. For example, when serving this signed request: NOTE: '\' line wrapping per RFC 8792 POST /foo?param=value&pet=dog HTTP/1.1 Host: example.com Date: Tue, 20 Apr 2021 02:07:55 GMT Content-Type: application/json Content-Length: 18 Signature-Input: sig1=("@authority" "content-type")\ ;created=1618884475;keyid="test-key-rsa-pss" Signature: sig1=:KuhJjsOKCiISnKHh2rln5ZNIrkRvue0DSu5rif3g7ckTbbX7C4\ Jp3bcGmi8zZsFRURSQTcjbHdJtN8ZXlRptLOPGHkUa/3Qov79gBeqvHNUO4bhI27p\ 4WzD1bJDG9+6ml3gkrs7rOvMtROObPuc78A95fa4+skS/t2T7OjkfsHAm/enxf1fA\ wkk15xj0n6kmriwZfgUlOqyff0XLwuH4XFvZ+ZTyxYNoo2+EfFg4NVfqtSJch2WDY\ 7n/qmhZOzMfyHlggWYFnDpyP27VrzQCQg8rM1Crp6MrwGLa94v6qP8pq0sQVq2DLt\ 4NJSoRRqXTvqlWIRnexmcKXjQFVz6YSA==: {"hello": "world"} This would result in the following unsigned response message: HTTP/1.1 200 OK Date: Tue, 20 Apr 2021 02:07:56 GMT Content-Type: application/json Content-Length: 62 {"busy": true, "message": "Your call is very important to us"} The server signs the response with its own key and includes the signature of sig1 from the request in the covered components of the response. The signature input string for this example is: NOTE: '\' line wrapping per RFC 8792 "content-type": application/json "content-length": 62 "@status": 200 "@request-response";key="sig1": :KuhJjsOKCiISnKHh2rln5ZNIrkRvue0DSu\ 5rif3g7ckTbbX7C4Jp3bcGmi8zZsFRURSQTcjbHdJtN8ZXlRptLOPGHkUa/3Qov79\ gBeqvHNUO4bhI27p4WzD1bJDG9+6ml3gkrs7rOvMtROObPuc78A95fa4+skS/t2T7\ OjkfsHAm/enxf1fAwkk15xj0n6kmriwZfgUlOqyff0XLwuH4XFvZ+ZTyxYNoo2+Ef\ Fg4NVfqtSJch2WDY7n/qmhZOzMfyHlggWYFnDpyP27VrzQCQg8rM1Crp6MrwGLa94\ v6qP8pq0sQVq2DLt4NJSoRRqXTvqlWIRnexmcKXjQFVz6YSA==: "@signature-params": ("content-type" "content-length" "@status" \ "@request-response";key="sig1");created=1618884475\ ;keyid="test-key-ecc-p256" The signed response message is: NOTE: '\' line wrapping per RFC 8792 HTTP/1.1 200 OK Date: Tue, 20 Apr 2021 02:07:56 GMT Content-Type: application/json Content-Length: 62 Signature-Input: sig1=("content-type" "content-length" "@status" \ "@request-response";key="sig1");created=1618884475\ ;keyid="test-key-ecc-p256" Signature: sig1=:crVqK54rxvdx0j7qnt2RL1oQSf+o21S/6Uk2hyFpoIfOT0q+Hv\ msYAXUXzo0Wn8NFWh/OjWQOXHAQdVnTk87Pw==: {"busy": true, "message": "Your call is very important to us"} Since the request's signature value itself is not repeated in the response, the requester MUST keep the original signature value around long enough to validate the signature of the response. The @request-response component identifier MUST NOT be used in a request message. Creating the Signature Input String The signature input is a US-ASCII string containing the canonicalized HTTP message components covered by the signature. To create the signature input string, the signer or verifier concatenates together entries for each identifier in the signature's covered components (including their parameters) using the following algorithm: Let the output be an empty string. For each message component item in the covered components set (in order): Append the component identifier for the covered component serialized according to the component-identifier rule. Append a single colon ":" Append a single space " " Append the covered component's canonicalized component value, as defined by the HTTP message component type. ( and ) Append a single newline "\\n" Append the signature parameters component ( ) as follows: Append the component identifier for the signature parameters serialized according to the component-identifier rule, i.e. "@signature-params" Append a single colon ":" Append a single space " " Append the signature parameters' canonicalized component value as defined in Return the output string. If covered components reference a component identifier that cannot be resolved to a component value in the message, the implementation MUST produce an error. Such situations are included but not limited to: The signer or verifier does not understand the component identifier. The component identifier identifies a field that is not present in the message or whose value is malformed. The component identifier is a Dictionary member identifier that references a field that is not present in the message, is not a Dictionary Structured Field, or whose value is malformed. The component identifier is a Dictionary member identifier that references a member that is not present in the field value, or whose value is malformed. E.g., the identifier is "x-dictionary";key="c" and the value of the x-dictionary header field is a=1, b=2 In the following non-normative example, the HTTP message being signed is the following request: GET /foo HTTP/1.1 Host: example.org Date: Tue, 20 Apr 2021 02:07:55 GMT X-Example: Example header with some whitespace. X-Empty-Header: Cache-Control: max-age=60 Cache-Control: must-revalidate The covered components consist of the @method , @path , and @authority specialty component identifiers followed by the Cache-Control , X-Empty-Header , X-Example HTTP headers, in order. The signature parameters consist of a creation timestamp is 1618884475 and the key identifier is test-key-rsa-pss . The signature input string for this message with these parameters is: NOTE: '\' line wrapping per RFC 8792 "@method": GET "@path": /foo "@authority": example.org "cache-control": max-age=60, must-revalidate "x-empty-header": "x-example": Example header with some whitespace. "@signature-params": ("@method" "@path" "@authority" \ "cache-control" "x-empty-header" "x-example");created=1618884475\ ;keyid="test-key-rsa-pss" HTTP Message Signatures An HTTP Message Signature is a signature over a string generated from a subset of the components of an HTTP message in addition to metadata about the signature itself. When successfully verified against an HTTP message, an HTTP Message Signature provides cryptographic proof that the message is semantically equivalent to the message for which the signature was generated, with respect to the subset of message components that was signed. Creating a Signature In order to create a signature, a signer MUST follow the following algorithm: The signer chooses an HTTP signature algorithm and key material for signing. The signer MUST choose key material that is appropriate for the signature's algorithm, and that conforms to any requirements defined by the algorithm, such as key size or format. The mechanism by which the signer chooses the algorithm and key material is out of scope for this document. The signer sets the signature's creation time to the current time. If applicable, the signer sets the signature's expiration time property to the time at which the signature is to expire. The signer creates an ordered set of component identifiers representing the message components to be covered by the signature, and attaches signature metadata parameters to this set. The serialized value of this is later used as the value of the Signature-Input field as described in . Once an order of covered components is chosen, the order MUST NOT change for the life of the signature. Each covered component identifier MUST be either an HTTP field in the message or a specialty component identifier listed in or its associated registry. Signers of a request SHOULD include some or all of the message control data in the covered components, such as the @method , @authority , @target-uri , or some combination thereof. Signers SHOULD include the created signature metadata parameter to indicate when the signature was created. The @signature-params specialty component identifier is not explicitly listed in the list of covered component identifiers, because it is required to always be present as the last line in the signature input. This ensures that a signature always covers its own metadata. Further guidance on what to include in this set and in what order is out of scope for this document. The signer creates the signature input string based on these signature parameters. ( ) 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 . The byte array output of the signature function is the HTTP message signature output value to be included in the Signature field as defined in . For example, given the HTTP message and signature parameters in the example in , the example signature input string when signed with the test-key-rsa-pss key in gives the following message signature output value, encoded in Base64: NOTE: '\' line wrapping per RFC 8792 P0wLUszWQjoi54udOtydf9IWTfNhy+r53jGFj9XZuP4uKwxyJo1RSHi+oEF1FuX6O29\ d+lbxwwBao1BAgadijW+7O/PyezlTnqAOVPWx9GlyntiCiHzC87qmSQjvu1CFyFuWSj\ dGa3qLYYlNm7pVaJFalQiKWnUaqfT4LyttaXyoyZW84jS8gyarxAiWI97mPXU+OVM64\ +HVBHmnEsS+lTeIsEQo36T3NFf2CujWARPQg53r58RmpZ+J9eKR2CD6IJQvacn5A4Ix\ 5BUAVGqlyp8JYm+S/CWJi31PNUjRRCusCVRj05NrxABNFv3r5S9IXf2fYJK+eyW4AiG\ VMvMcOg== Verifying a Signature A verifier processes a signature and its associated signature input parameters in concert with each other. In order to verify a signature, a verifier MUST follow the following algorithm: Parse the Signature and Signature-Input fields and extract the signatures to be verified. If there is more than one signature value present, determine which signature should be processed for this message. If an applicable signature is not found, produce an error. If the chosen Signature value does not have a corresponding Signature-Input value, produce an error. Parse the values of the chosen Signature-Input field to get the parameters for the signature to be verified. Parse the value of the corresponding Signature field to get the byte array value of the signature to be verified. Examine the signature parameters to confirm that the signature meets the requirements described in this document, as well as any additional requirements defined by the application such as which message components are required to be covered by the signature. ( ) Determine the verification key material for this signature. If the key material is known through external means such as static configuration or external protocol negotiation, the verifier will use that. If the key is identified in the signature parameters, the verifier will dereference this to appropriate key material to use with the signature. The verifier has to determine the trustworthiness of the key material for the context in which the signature is presented. If a key is identified that the verifier does not know, does not trust for this request, or does not match something preconfigured, the verification MUST fail. Determine the algorithm to apply for verification: If the algorithm is known through external means such as static configuration or external protocol negotiation, the verifier will use this algorithm. If the algorithm is explicitly stated in the signature parameters using a value from the HTTP Message Signatures registry, the verifier will use the referenced algorithm. If the algorithm can be determined from the keying material, such as through an algorithm field on the key value itself, the verifier will use this algorithm. If the algorithm is specified in more that one location, such as through static configuration and the algorithm signature parameter, or the algorithm signature parameter and from the key material itself, the resolved algorithms MUST be the same. If the algorithms are not the same, the verifier MUST vail the verification. Use the received HTTP message and the signature's metadata to recreate the signature input, using the process described in . The value of the @signature-params input is the value of the SignatureInput field for this signature serialized according to the rules described in , not including the signature's label from the Signature-Input field. If the key material is appropriate for the algorithm, apply the verification algorithm to the signature, recalculated signature input, signature parameters, key material, and algorithm. Several algorithms are defined in . The results of the verification algorithm function are the final results of the signature verification. If any of the above steps fail or produce an error, the signature validation fails. Enforcing Application Requirements The verification requirements specified in this document are intended as a baseline set of restrictions that are generally applicable to all use cases. Applications using HTTP Message Signatures MAY impose requirements above and beyond those specified by this document, as appropriate for their use case. Some non-normative examples of additional requirements an application might define are: Requiring a specific set of header fields to be signed (e.g., Authorization , Digest ). Enforcing a maximum signature age. Prohibition of signature metadata parameters, such as runtime algorithm signaling with the alg parameter. Prohibiting the use of certain algorithms, or mandating the use of a specific algorithm. Requiring keys to be of a certain size (e.g., 2048 bits vs. 1024 bits). Enforcing uniqueness of a nonce value. Application-specific requirements are expected and encouraged. When an application defines additional requirements, it MUST enforce them during the signature verification process, and signature verification MUST fail if the signature does not conform to the application's requirements. Applications MUST enforce the requirements defined in this document. Regardless of use case, applications MUST NOT accept signatures that do not conform to these requirements. Signature Algorithm Methods HTTP Message signatures MAY use any cryptographic digital signature or MAC method that is appropriate for the key material, environment, and needs of the signer and verifier. All signatures are generated from and verified against the byte values of the signature input string defined in . Each signature algorithm method takes as its input the signature input string as a set of byte values ( I ), the signing key material ( Ks ), and outputs the signature output as a set of byte values ( S ): HTTP_SIGN (I, Ks) -> S Each verification algorithm method takes as its input the recalculated signature input string as a set of byte values ( I ), the verification key material ( Kv ), and the presented signature to be verified as a set of byte values ( S ) and outputs the verification result ( V ) as a boolean: HTTP_VERIFY (I, Kv, S) -> V This section contains several common algorithm methods. The method to use can be communicated through the algorithm signature parameter defined in , by reference to the key material, or through mutual agreement between the signer and verifier. RSASSA-PSS using SHA-512 To sign using this algorithm, the signer applies the RSASSA-PSS-SIGN (K, M) function with the signer's private signing key ( K ) and the signature input string ( M ) ( ). The mask generation function is MGF1 as specified in with a hash function of SHA-512 . The salt length ( sLen ) is 64 bytes. The hash function ( Hash ) SHA-512 is applied to the signature input string to create the digest content to which the digital signature is applied. The resulting signed content byte array ( S ) is the HTTP message signature output used in . To verify using this algorithm, the verifier applies the RSASSA-PSS-VERIFY ((n, e), M, S) function using the public key portion of the verification key material ( (n, e) ) and the signature input string ( M ) re-created as described in . The mask generation function is MGF1 as specified in with a hash function of SHA-512 . The salt length ( sLen ) is 64 bytes. The hash function ( Hash ) SHA-512 is applied to the signature input string to create the digest content to which the verification function is applied. The verifier extracts the HTTP message signature to be verified ( S ) as described in . The results of the verification function are compared to the http message signature to determine if the signature presented is valid. RSASSA-PKCS1-v1_5 using SHA-256 To sign using this algorithm, the signer applies the RSASSA-PKCS1-V1_5-SIGN (K, M) function with the signer's private signing key ( K ) and the signature input string ( M ) ( ). The hash SHA-256 is applied to the signature input string to create the digest content to which the digital signature is applied. The resulting signed content byte array ( S ) is the HTTP message signature output used in . To verify using this algorithm, the verifier applies the RSASSA-PKCS1-V1_5-VERIFY ((n, e), M, S) function using the public key portion of the verification key material ( (n, e) ) and the signature input string ( M ) re-created as described in . The hash function SHA-256 is applied to the signature input string to create the digest content to which the verification function is applied. The verifier extracts the HTTP message signature to be verified ( S ) as described in . The results of the verification function are compared to the http message signature to determine if the signature presented is valid. HMAC using SHA-256 To sign and verify using this algorithm, the signer applies the HMAC function with the shared signing key ( K ) and the signature input string ( text ) ( ). The hash function SHA-256 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 value is the HTTP message signature output used in . For verification, the verifier extracts the HTTP message signature to be verified ( S ) as described in . The output of the HMAC function is compared to the value of the HTTP message signature, and the results of the comparison determine the validity of the signature presented. ECDSA using curve P-256 DSS and SHA-256 To sign using this algorithm, the signer applies the ECDSA algorithm using curve P-256 with the signer's private signing key and the signature input string ( ). The hash SHA-256 is applied to the signature input string to create the digest content to which the digital signature is applied. The resulting signed content byte array is the HTTP message signature output used in . To verify using this algorithm, the verifier applies the ECDSA algorithm using the public key portion of the verification key material and the signature input string re-created as described in . The hash function SHA-256 is applied to the signature input string to create the digest content to which the verification function is applied. The verifier extracts the HTTP message signature to be verified ( S ) as described in . The results of the verification function are compared to the http message signature to determine if the signature presented is valid. 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 , the JWS algorithm definition determines the signature and hashing algorithms to apply for both signing and verification. There is no use of the explicit alg signature parameter when using JOSE signing algorithms. For both signing and verification, the HTTP messages signature input string ( ) is used as the entire "JWS Signing Input". The JOSE Header defined in is not used, and the signature input string is not first encoded in Base64 before applying the algorithm. The output of the JWS signature is taken as a byte array prior to the Base64url encoding used in JOSE. The JWS algorithm MUST NOT be none and MUST NOT be any algorithm with a JOSE Implementation Requirement of Prohibited . Including a Message Signature in a Message Message signatures can be included within an HTTP message via the Signature-Input and Signature HTTP fields, both defined within this specification. When attached to a message, an HTTP message signature is identified by a label. This label MUST be unique within a given HTTP message and MUST be used in both the Signature-Input and Signature . The label is chosen by the signer, except where a specific label is dictated by protocol negotiations. An HTTP message signature MUST use both fields containing the same labels: the Signature HTTP field contains the signature value, while the Signature-Input HTTP field identifies the covered components and parameters that describe how the signature was generated. Each field contains labeled values and MAY contain multiple labeled values, where the labels determine the correlation between the Signature and Signature-Input fields. The 'Signature-Input' HTTP Field The Signature-Input HTTP field is a Dictionary Structured Field containing the metadata for one or more message signatures generated from components within the HTTP message. Each member describes a single message signature. The member's name is an identifier that uniquely identifies the message signature within the context of the HTTP message. The member's value is the serialization of the covered components including all signature metadata parameters, using the serialization process defined in . NOTE: '\' line wrapping per RFC 8792 Signature-Input: sig1=("@method" "@target-uri" "host" "date" \ "cache-control" "x-empty-header" "x-example");created=1618884475\ ;keyid="test-key-rsa-pss" To facilitate signature validation, the Signature-Input field value MUST contain the same serialized value used in generating the signature input string's @signature-params value. The signer MAY include the Signature-Input field as a trailer to facilitate signing a message after its content has been processed by the signer. However, since intermediaries are allowed to drop trailers as per , it is RECOMMENDED that the Signature-Input HTTP field be included only as a header to avoid signatures being inadvertently stripped from a message. Multiple Signature-Input fields MAY be included in a single HTTP message. The signature labels MUST be unique across all field values. The 'Signature' HTTP Field The Signature HTTP field is a Dictionary Structured field containing one or more message signatures generated from components within the HTTP message. Each member's name is a signature identifier that is present as a member name in the Signature-Input Structured field within the HTTP message. Each member's value is a Byte Sequence containing the signature value for the message signature identified by the member name. Any member in the Signature HTTP field that does not have a corresponding member in the HTTP message's Signature-Input HTTP field MUST be ignored. NOTE: '\' line wrapping per RFC 8792 Signature: sig1=:P0wLUszWQjoi54udOtydf9IWTfNhy+r53jGFj9XZuP4uKwxyJo\ 1RSHi+oEF1FuX6O29d+lbxwwBao1BAgadijW+7O/PyezlTnqAOVPWx9GlyntiCiHz\ C87qmSQjvu1CFyFuWSjdGa3qLYYlNm7pVaJFalQiKWnUaqfT4LyttaXyoyZW84jS8\ gyarxAiWI97mPXU+OVM64+HVBHmnEsS+lTeIsEQo36T3NFf2CujWARPQg53r58Rmp\ Z+J9eKR2CD6IJQvacn5A4Ix5BUAVGqlyp8JYm+S/CWJi31PNUjRRCusCVRj05NrxA\ BNFv3r5S9IXf2fYJK+eyW4AiGVMvMcOg==: The signer MAY include the Signature field as a trailer to facilitate signing a message after its content has been processed by the signer. However, since intermediaries are allowed to drop trailers as per , it is RECOMMENDED that the Signature-Input HTTP field be included only as a header to avoid signatures being inadvertently stripped from a message. Multiple Signature fields MAY be included in a single HTTP message. The signature labels MUST be unique across all field values. Multiple Signatures Multiple distinct signatures MAY be included in a single message. Since Signature-Input and Signature are both defined as Dictionary Structured fields, they can be used to include multiple signatures within the same HTTP message by using distinct signature labels. For example, a signer may include multiple signatures signing the same message components with different keys or algorithms to support verifiers with different capabilities, or a reverse proxy may include information about the client in fields when forwarding the request to a service host, including a signature over the client's original signature values. The following is a non-normative example of header fields a reverse proxy sets in addition to the examples in the previous sections. NOTE: '\' line wrapping per RFC 8792 Forwarded: for=192.0.2.123 Signature-Input: sig1=("@method" "@path" "@authority" \ "cache-control" "x-empty-header" "x-example")\ ;created=1618884475;keyid="test-key-rsa-pss" Signature: sig1=:P0wLUszWQjoi54udOtydf9IWTfNhy+r53jGFj9XZuP4uKwxyJo\ 1RSHi+oEF1FuX6O29d+lbxwwBao1BAgadijW+7O/PyezlTnqAOVPWx9GlyntiCi\ HzC87qmSQjvu1CFyFuWSjdGa3qLYYlNm7pVaJFalQiKWnUaqfT4LyttaXyoyZW8\ 4jS8gyarxAiWI97mPXU+OVM64+HVBHmnEsS+lTeIsEQo36T3NFf2CujWARPQg53\ r58RmpZ+J9eKR2CD6IJQvacn5A4Ix5BUAVGqlyp8JYm+S/CWJi31PNUjRRCusCV\ Rj05NrxABNFv3r5S9IXf2fYJK+eyW4AiGVMvMcOg==: The client's request includes a signature value under the label sig1 , which the proxy signs in addition to the Forwarded header defined in . Note that since the client's signature already covers the client's Signature-Input value for sig1 , this value is transitively covered by the proxy's signature and need not be added explicitly. This results in a signature input string of: NOTE: '\' line wrapping per RFC 8792 "signature";key="sig1": :P0wLUszWQjoi54udOtydf9IWTfNhy+r53jGFj9XZuP\ 4uKwxyJo1RSHi+oEF1FuX6O29d+lbxwwBao1BAgadijW+7O/PyezlTnqAOVPWx9Gl\ yntiCiHzC87qmSQjvu1CFyFuWSjdGa3qLYYlNm7pVaJFalQiKWnUaqfT4LyttaXyo\ yZW84jS8gyarxAiWI97mPXU+OVM64+HVBHmnEsS+lTeIsEQo36T3NFf2CujWARPQg\ 53r58RmpZ+J9eKR2CD6IJQvacn5A4Ix5BUAVGqlyp8JYm+S/CWJi31PNUjRRCusCV\ Rj05NrxABNFv3r5S9IXf2fYJK+eyW4AiGVMvMcOg==: "forwarded": for=192.0.2.123 "@signature-params": ("signature";key="sig1" "forwarded")\ ;created=1618884480;keyid="test-key-rsa";alg="rsa-v1_5-sha256" And a signature output value of: NOTE: '\' line wrapping per RFC 8792 cjGvZwbsq9JwexP9TIvdLiivxqLINwp/ybAc19KOSQuLvtmMt3EnZxNiE+797dXK2cj\ PPUFqoZxO8WWx1SnKhAU9SiXBr99NTXRmA1qGBjqus/1Yxwr8keB8xzFt4inv3J3zP0\ k6TlLkRJstkVnNjuhRIUA/ZQCo8jDYAl4zWJJjppy6Gd1XSg03iUa0sju1yj6rcKbMA\ BBuzhUz4G0u1hZkIGbQprCnk/FOsqZHpwaWvY8P3hmcDHkNaavcokmq+3EBDCQTzgwL\ qfDmV0vLCXtDda6CNO2Zyum/pMGboCnQn/VkQ+j8kSydKoFg6EbVuGbrQijth6I0dDX\ 2/HYcJg== These values are added to the HTTP request message by the proxy. The original signature is included under the identifier sig1 , and the reverse proxy's signature is included under the label proxy_sig . The proxy uses the key test-key-rsa to create its signature using the rsa-v1_5-sha256 signature algorithm, while the client's original signature was made using the key id of test-key-rsa-pss and an RSA PSS signature algorithm. NOTE: '\' line wrapping per RFC 8792 Forwarded: for=192.0.2.123 Signature-Input: sig1=("@method" "@path" "@authority" \ "cache-control" "x-empty-header" "x-example")\ ;created=1618884475;keyid="test-key-rsa-pss", \ proxy_sig=("signature";key="sig1" "forwarded")\ ;created=1618884480;keyid="test-key-rsa";alg="rsa-v1_5-sha256" Signature: sig1=:P0wLUszWQjoi54udOtydf9IWTfNhy+r53jGFj9XZuP4uKwxyJo\ 1RSHi+oEF1FuX6O29d+lbxwwBao1BAgadijW+7O/PyezlTnqAOVPWx9GlyntiCi\ HzC87qmSQjvu1CFyFuWSjdGa3qLYYlNm7pVaJFalQiKWnUaqfT4LyttaXyoyZW8\ 4jS8gyarxAiWI97mPXU+OVM64+HVBHmnEsS+lTeIsEQo36T3NFf2CujWARPQg53\ r58RmpZ+J9eKR2CD6IJQvacn5A4Ix5BUAVGqlyp8JYm+S/CWJi31PNUjRRCusCV\ Rj05NrxABNFv3r5S9IXf2fYJK+eyW4AiGVMvMcOg==:, \ proxy_sig=:cjGvZwbsq9JwexP9TIvdLiivxqLINwp/ybAc19KOSQuLvtmMt3EnZx\ NiE+797dXK2cjPPUFqoZxO8WWx1SnKhAU9SiXBr99NTXRmA1qGBjqus/1Yxwr8k\ eB8xzFt4inv3J3zP0k6TlLkRJstkVnNjuhRIUA/ZQCo8jDYAl4zWJJjppy6Gd1X\ Sg03iUa0sju1yj6rcKbMABBuzhUz4G0u1hZkIGbQprCnk/FOsqZHpwaWvY8P3hm\ cDHkNaavcokmq+3EBDCQTzgwLqfDmV0vLCXtDda6CNO2Zyum/pMGboCnQn/VkQ+\ j8kSydKoFg6EbVuGbrQijth6I0dDX2/HYcJg==: The proxy's signature and the client's original signature can be verified independently for the same message, based on the needs of the application. Since the proxy's signature covers the client signature, the backend service fronted by the proxy can trust that the proxy has validated the incoming signature. Requesting Signatures While a signer is free to attach a signature to a request or response without prompting, it is often desirable for a potential verifier to signal that it expects a signature from a potential signer using the Accept-Signature field. The message to which the requested signature is applied is known as the "target message". When the Accept-Signature field is sent in an HTTP Request message, the field indicates that the client desires the server to sign the response using the identified parameters and the target message is the response to this request. All responses from resources that support such signature negotiation SHOULD either be uncacheable or contain a Vary header field that lists Accept-Signature , in order to prevent a cache from returning a response with a signature intended for a different request. When the Accept-Signature field is used in an HTTP Response message, the field indicates that the server desires the client to sign its next request to the server with the identified parameters, and the target message is the client's next request. The client can choose to also continue signing future requests to the same server in the same way. The target message of an Accept-Signature field MUST include all labeled signatures indicated in the Accept-Header signature, each covering the same identified components of the Accept-Signature field. The sender of an Accept-Signature field MUST include identifiers that are appropriate for the type of the target message. For example, if the target message is a response, the identifiers can not include the @status identifier. The Accept-Signature Field The Accept-Signature HTTP header field is a Dictionary Structured field containing the metadata for one or more requested message signatures to be generated from message components of the target HTTP message. Each member describes a single message signature. The member's name is an identifier that uniquely identifies the requested message signature within the context of the target HTTP message. The member's value is the serialization of the desired covered components of the target message, including any allowed signature metadata parameters, using the serialization process defined in . NOTE: '\' line wrapping per RFC 8792 Accept-Signature: sig1=("@method" "@target-uri" "host" "date" \ "cache-control" "x-empty-header" "x-example")\ ;keyid="test-key-rsa-pss" The requested signature MAY include parameters, such as a desired algorithm or key identifier. These parameters MUST NOT include parameters that the signer is expected to generate, including the created and nonce parameters. Processing an Accept-Signature The receiver of an Accept-Signature field fulfills that header as follows: Parse the field value as a Dictionary For each member of the dictionary: The name of the member is the label of the output signature as specified in Parse the value of the member to obtain the set of covered component identifiers Process the requested parameters, such as the signing algorithm and key material. If any requested parameters cannot be fulfilled, or if the requested parameters conflict with those deemed appropriate to the target message, the process fails and returns an error. Select any additional parameters necessary for completing the signature Create the Signature-Input and Signature header values and associate them with the label Optionally create any additional Signature-Input and Signature values, with unique labels not found in the Accept-Signature field Combine all labeled Signature-Input and Signature values and attach both headers to the target message Note that by this process, a signature applied to a target message MUST have the same label, MUST have the same set of covered component, and MAY have additional parameters. Also note that the target message MAY include additional signatures not specified by the Accept-Signature field. IANA Considerations HTTP Signature Algorithms Registry This document defines HTTP Signature Algorithms, for which IANA is asked to create and maintain a new registry titled "HTTP Signature Algorithms". Initial values for this registry are given in . Future assignments and modifications to existing assignment are to be made through the Expert Review registration policy and shall follow the template presented in . 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. Registration Template
-
Algorithm Name:
-
An identifier for the HTTP Signature Algorithm. The name MUST be an ASCII string consisting only of lower-case characters ( "a" - "z" ), digits ( "0" - "9" ), and hyphens ( "-" ), and SHOULD NOT exceed 20 characters in length. The identifier MUST be unique within the context of the registry.
-
Status:
-
A brief text description of the status of the algorithm. The description MUST begin with one of "Active" or "Deprecated", and MAY provide further context or explanation as to the reason for the status.
-
Description:
-
A brief description of the algorithm used to sign the signature input string.
-
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.
Initial Contents rsa-pss-sha512
-
Algorithm Name:
-
rsa-pss-sha512
-
Status:
-
Active
-
Definition:
-
RSASSA-PSS using SHA-256
-
Specification document(s):
-
[[This document]],
rsa-v1_5-sha256
-
Algorithm Name:
-
rsa-v1_5-sha256
-
Status:
-
Active
-
Description:
-
RSASSA-PKCS1-v1_5 using SHA-256
-
Specification document(s):
-
[[This document]],
hmac-sha256
-
Algorithm Name:
-
hmac-sha256
-
Status:
-
Active
-
Description:
-
HMAC using SHA-256
-
Specification document(s):
-
[[This document]],
ecdsa-p256-sha256
-
Algorithm Name:
-
ecdsa-p256-sha256
-
Status:
-
Active
-
Description:
-
ECDSA using curve P-256 DSS and SHA-256
-
Specification document(s):
-
[[This document]],
HTTP Signature Metadata Parameters Registry This document defines the signature parameters structure, the values of which may have parameters containing metadata about a message signature. IANA is asked to create and maintain a new registry titled "HTTP Signature Metadata Parameters" to record and maintain the set of parameters defined for use with member values in the signature parameters structure. Initial values for this registry are given in . Future assignments and modifications to existing assignments are to be made through the Expert Review registration policy and shall follow the template presented in . Registration Template Initial Contents The table below contains the initial contents of the HTTP Signature Metadata Parameters Registry. Each row in the table represents a distinct entry in the registry. Name Status Reference(s) alg Active of this document created Active of this document expires Active of this document keyid Active of this document nonce Active of this document HTTP Signature Specialty Component Identifiers Registry This document defines a method for canonicalizing HTTP message components, including components that can be generated from the context of the HTTP message outside of the HTTP fields. These components are identified by a unique string, known as the component identifier. IANA is asked to create and maintain a new registry typed "HTTP Signature Specialty Component Identifiers" to record and maintain the set of non-field component identifiers and the methods to produce their associated component values. Initial values for this registry are given in . Future assignments and modifications to existing assignments are to be made through the Expert Review registration policy and shall follow the template presented in . Registration Template Initial Contents The table below contains the initial contents of the HTTP Signature Specialty Component Identifiers Registry. Name Status Target Reference @signature-params Active Request, Response of this document @method Active Request, Related-Response of this document @authority Active Request, Related-Response of this document @scheme Active Request, Related-Response of this document @target-uri Active Request, Related-Response of this document @request-target Active Request, Related-Response of this document @path Active Request, Related-Response of this document @query Active Request, Related-Response of this document @query-params Active Request, Related-Response of this document @status Active Response of this document @request-response Active of this document  Security Considerations (( TODO: need to dive deeper on this section; not sure how much of what's referenced below is actually applicable, or if it covers everything we need to worry about. )) (( TODO: Should provide some recommendations on how to determine what components need to be signed for a given use case. )) There are a number of security considerations to take into account when implementing or utilizing this specification. A thorough security analysis of this protocol, including its strengths and weaknesses, can be found in .
RetroSearch is an open source project built by @garambo
| Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4