[Docs] [txt|pdf|xml|html] [Tracker] [Email] [Diff1] [Diff2] [Nits]

Versions: 00 01 02 03 04 05 06 07 08 09 10

Network Working Group                                          M. Cavage
Internet-Draft                                                    Joyent
Intended status: Standards Track                               M. Sporny
Expires: November 9, 2014                                 Digital Bazaar
                                                             May 8, 2014


                         Signing HTTP Messages
                    draft-cavage-http-signatures-02

Abstract

   When communicating over the Internet using the HTTP protocol, it can
   be desirable for a server or client to authenticate the sender of a
   particular message.  It can also be desirable to ensure that the
   message was not tampered with during transit.  This document
   describes a way for servers and clients to simultaneously add
   authentication and message integrity to HTTP messages by using a
   digital signature.

Feedback

   This specification is a part of the Web Payments [1] work.  Feedback
   related to this specification should be sent to public-
   webpayments@w3.org [2].

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at http://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on November 9, 2014.









Cavage & Sporny         Expires November 9, 2014                [Page 1]


Internet-Draft            Signing HTTP Messages                 May 2014


Copyright Notice

   Copyright (c) 2014 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (http://trustee.ietf.org/license-info) in effect on the date of
   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
     1.1.  Using Signatures in HTTP Requests . . . . . . . . . . . .   3
     1.2.  Using Signatures in HTTP Responses  . . . . . . . . . . .   4
   2.  The Components of a Signature . . . . . . . . . . . . . . . .   4
     2.1.  Signature Parameters  . . . . . . . . . . . . . . . . . .   5
       2.1.1.  keyId . . . . . . . . . . . . . . . . . . . . . . . .   5
       2.1.2.  algorithm . . . . . . . . . . . . . . . . . . . . . .   5
       2.1.3.  headers . . . . . . . . . . . . . . . . . . . . . . .   5
       2.1.4.  signature . . . . . . . . . . . . . . . . . . . . . .   5
     2.2.  Ambiguous Parameters  . . . . . . . . . . . . . . . . . .   5
     2.3.  Signature String Construction . . . . . . . . . . . . . .   6
   3.  The 'Signature' HTTP Authentication Scheme  . . . . . . . . .   6
     3.1.  Authorization Header  . . . . . . . . . . . . . . . . . .   6
       3.1.1.  Initiating Signature Authorization  . . . . . . . . .   7
       3.1.2.  RSA Example . . . . . . . . . . . . . . . . . . . . .   7
       3.1.3.  HMAC Example  . . . . . . . . . . . . . . . . . . . .   8
   4.  The 'Signature' HTTP Header . . . . . . . . . . . . . . . . .   8
     4.1.  Signature Header  . . . . . . . . . . . . . . . . . . . .   8
       4.1.1.  RSA Example . . . . . . . . . . . . . . . . . . . . .   9
       4.1.2.  HMAC Example  . . . . . . . . . . . . . . . . . . . .  10
   5.  References  . . . . . . . . . . . . . . . . . . . . . . . . .  10
     5.1.  Normative References  . . . . . . . . . . . . . . . . . .  10
     5.2.  Informative References  . . . . . . . . . . . . . . . . .  11
   Appendix A.  Security Considerations  . . . . . . . . . . . . . .  11
   Appendix B.  Extensions . . . . . . . . . . . . . . . . . . . . .  11
   Appendix C.  Test Values  . . . . . . . . . . . . . . . . . . . .  12
     C.1.  Default Test  . . . . . . . . . . . . . . . . . . . . . .  12
     C.2.  Basic Test  . . . . . . . . . . . . . . . . . . . . . . .  13
     C.3.  All Headers Test  . . . . . . . . . . . . . . . . . . . .  13
   Appendix D.  Acknowledgements . . . . . . . . . . . . . . . . . .  14
   Appendix E.  IANA Considerations  . . . . . . . . . . . . . . . .  14
     E.1.  Signature Authentication Scheme . . . . . . . . . . . . .  14
     E.2.  Signature Algorithm Registry  . . . . . . . . . . . . . .  14
   Authors' Addresses  . . . . . . . . . . . . . . . . . . . . . . .  15



Cavage & Sporny         Expires November 9, 2014                [Page 2]


Internet-Draft            Signing HTTP Messages                 May 2014


1.  Introduction

   This protocol extension is intended to provide a standard way for
   clients to sign HTTP messages.  HTTP Authentication [RFC2617] defines
   Basic and Digest authentication mechanisms, and TLS 1.2 [RFC5246]
   defines cryptographically stronger client authentication, all of
   which are widely employed on the Internet today.  The burdens of PKI
   prevent some web service operators from deploying that methodoloy,
   and so some of those organizations fall back to Basic or Digest
   authentication.  Basic and Digest authentication provide poor
   security characteristics when combined with common password usage
   behavior.

   Password database compromises between 2010 to 2014 have shown that
   people regularly use weak passwords and share the same password
   across multiple websites.  The use of Basic authentication over a
   regular HTTP channel provides very little protection.  Digest
   authentication, while providing a little more protection, still
   leaves the scheme open to brute-force attacks that are capable of
   discovering a weak or random 8 character password in less than 3
   hours using a single commodity computer and mere minutes using cloud-
   based rental servers to distribute the brute-force attack.

   While it is true that most Basic and Digest authentication approaches
   are operated over secure channels like TLS, revelations over
   pervasive monitoring in 2013 have shown that TLS alone may not be
   secure enough to protect sensitive data.

   Additionally, OAuth 2.0 [RFC6749] provides a fully-specified
   alternative for authorization of web service requests, but is not
   always ideal for machine to machine communication, as the token
   acquisition steps generally imply a fixed infrastructure that may not
   make sense to a service provider.  For example, the use of symmetric
   keys and the distribution of hundreds of thousands of those keys
   across multiple datacenters around the world create multiple points
   of attack where a successful attack results in a large gain for the
   attacker and thus an even bigger problem for the service provider and
   their customers.

   Several web service providers have invented their own schemes for
   signing HTTP messages, but to date, none have been standardized.
   While there are no techniques in this proposal that are novel beyond
   the previous art, it is useful to standardize a simple and
   cryptographically strong mechanism for digitally signing HTTP
   messages.

1.1.  Using Signatures in HTTP Requests




Cavage & Sporny         Expires November 9, 2014                [Page 3]


Internet-Draft            Signing HTTP Messages                 May 2014


   It is common practice to protect sensitive website API functionality
   via authentication mechanisms.  Often, the entity accessing these
   APIs is a piece of automated software outside of an interactive human
   session.  While there are mechanisms like OAuth and API secrets that
   are used to grant API access, each have their weaknesses such as
   unnecessary complexity for particular use cases or the use of shared
   secrets which may not be acceptable to an implementer.

   Digital signatures are widely used to provide authentication without
   the need for shared secrets.  They also do not require a round-trip
   in order to authenticate the client.  A server need only have a
   mapping between the key being used to sign the content and the
   authorized entity to verify that a message was signed by that entity.

   This specification provides two mechanisms that can be used by a
   server to authenticate a client.  The first is the 'Signature' HTTP
   Authentication Scheme, which may be used for interactive sessions.
   The second is the Signature HTTP Header, which is typically used by
   automated software agents.

1.2.  Using Signatures in HTTP Responses

   It is often assumed that if a server provides a certificate signed by
   a trusted Certificate Authority that the server has not been
   compromised.  After the pervasive monitoring revelations of 2013,
   that is no longer a commonly held belief.  For most low to moderate
   security transactions, TLS is acceptable.  However, for high security
   transactions, having an additional signature on the HTTP header
   allows a client to ensure that even if the transport channel has been
   compromised, that the content of the messages have not been
   compromised.

   This specification provides a HTTP Signature Header mechanism that
   can be used by a client to authenticate the sender of a message and
   ensure that particular headers have not been modified in transit.

2.  The Components of a Signature

   There are a number of components in a signature that are common
   between the 'Signature' HTTP Authentication Scheme and the
   'Signature' HTTP Header.  This section details the components of a
   digital signature.









Cavage & Sporny         Expires November 9, 2014                [Page 4]


Internet-Draft            Signing HTTP Messages                 May 2014


2.1.  Signature Parameters

   The following section details the signature parameters.

2.1.1.  keyId

   REQUIRED.  The `keyId` field is an opaque string that the server can
   use to look up the component they need to validate the signature.  It
   could be an SSH key fingerprint, a URL to machine-readable key data,
   an LDAP DN, etc.  Management of keys and assignment of `keyId` is out
   of scope for this document.

2.1.2.  algorithm

   REQUIRED.  The `algorithm` parameter is used to specify the digital
   signature algorithm to use when generating the signature.  Valid
   values for this parameter can be found in the Signature Algorithms
   registry located at http://www.iana.org/assignments/signature-
   algorithms [3] and MUST NOT be marked "deprecated".

2.1.3.  headers

   OPTIONAL.  The `headers` parameter is used to specify the list of
   HTTP headers included when generating the signature for message.  If
   specified, it should be a lowercased, quoted list of HTTP header
   fields, separated by a single space character.  By default, only one
   HTTP header is signed, which is the `Date` header.  Note that the
   list order is important, and MUST be specified in the order the
   values are concatenated together during signing.

2.1.4.  signature

   REQUIRED.  The `signature` parameter is a base 64 encoded digital
   signature, as described in RFC 4648 [RFC4648], Section 4 [4].  The
   client uses the `algorithm` and `headers` signature parameters to
   form a canonicalized `signing string`.  This `signing string` is then
   signed with the key associated with `keyId` and the algorithm
   corresponding to `algorithm`.  The `signature` parameter is then set
   to the base 64 encoding of the signature.

2.2.  Ambiguous Parameters

   If any of the parameters listed above are erroneously duplicated in
   the associated header field, then the last parameter defined MUST be
   used.  Any parameter that is not recognized as a parameter, or is not
   well-formed, MUST be ignored.





Cavage & Sporny         Expires November 9, 2014                [Page 5]


Internet-Draft            Signing HTTP Messages                 May 2014


2.3.  Signature String Construction

   In order to generate the string that is signed with a key, the client
   MUST use the values of each HTTP header field specified by `headers`
   in the order they appear.  It is out of scope for this document to
   dictate what header fields an application will want to enforce, but
   implementers SHOULD at minimum include the method + URL (request-
   line), Host, and Date header fields.

   To include the HTTP request line in the signature calculation, use
   the special `(request-line)` header field name.

   1.  If the header field name is `(request-line)` then generate the
       header field value by concatenating the lowercased method name,
       an ASCII space, and the method URL.

   2.  Create the header field string by concatenating the lowercased
       header field name followed with an ASCII colon `:`, an ASCII
       space ` `, and the header field value.  The value MUST NOT be
       modified or canonicalized in any way.  If there are multiple
       instances of the same header field, all header field values
       associated with the header field MUST be concatenated and used in
       the order in which they will appear in the transmitted HTTP
       message.

   3.  If value is not the last value then append an ASCII newline `\n`.

3.  The 'Signature' HTTP Authentication Scheme

   The "signature" authentication scheme is based on the model that the
   client must authenticate itself with a digital signature produced by
   either a private asymmetric key (e.g., RSA) or a shared symmetric key
   (e.g., HMAC).  The scheme is parameterized enough such that it is not
   bound to any particular key type or signing algorithm.  However, it
   does explicitly assume that clients can send an HTTP `Date` header.

3.1.  Authorization Header

   The client is expected to send an Authorization header (as defined in
   HTTPbis 1.1, Part 7 [I-D.ietf-httpbis-p7-auth], Section 4.1 [5])
   where the "auth-scheme" is "Signature" and the "auth-param"
   parameters meet the requirements listed in Section 2: The Components
   of a Signature.

   The rest if this section uses the following HTTP request as an
   example.





Cavage & Sporny         Expires November 9, 2014                [Page 6]


Internet-Draft            Signing HTTP Messages                 May 2014


   POST /foo HTTP/1.1
   Host: example.org
   Date: Tue, 07 Jun 2014 20:51:35 GMT
   Content-Type: application/json
   Digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
   Content-Length: 18

   {"hello": "world"}

   Note that the use of the `Digest` header field is per RFC 3230
   [RFC3230], Section 4.3.2 [6] and is included merely as a
   demonstration of how an implementer could include information about
   the body of the message in the signature.  The following sections
   also assume that the "rsa-key-1" keyId refers to a private key known
   to the client and a public key known to the server.  The "hmac-key-1"
   keyId refers to key known to the client and server.

3.1.1.  Initiating Signature Authorization

   A server may notify a client when a protected resource could be
   accessed by authenticating itself to the server.  To initiate this
   process, the server will request that the client authenticate itself
   via a 401 response code.  For example:

   HTTP/1.1 401 Unauthorized
   Date: Thu, 08 Jun 2014 18:32:30 GMT
   Content-Length: 1234
   Content-Type: text/html
   WWW-Authenticate: Signature realm="Example"

   ...

3.1.2.  RSA Example

   The authorization header and signature would be generated as:

   Authorization: Signature keyId="rsa-key-1",algorithm="rsa-sha256",
   headers="(request-line) host date digest content-length",
   signature="Base64(RSA-SHA256(signing string))"

   The client would compose the signing string as:

   (request-line): post /foo\n
   host: example.org\n
   date: Tue, 07 Jun 2014 20:51:35 GMT\n
   digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=\n
   content-length: 18




Cavage & Sporny         Expires November 9, 2014                [Page 7]


Internet-Draft            Signing HTTP Messages                 May 2014


   Note that the '\n' symbols above are included to demonstrate where
   the new line character should be inserted.  There is no new line on
   the final line of the signing string.

   For an RSA-based signature, the authorization header and signature
   would then be generated as:

   Authorization: Signature keyId="rsa-key-1",algorithm="rsa-sha256",
   headers="(request-line) host date digest content-length",
   signature="Base64(RSA-SHA256(signing string))"

3.1.3.  HMAC Example

   For an HMAC-based signature without a list of headers specified, the
   authorization header and signature would be generated as:

   Authorization: Signature keyId="hmac-key-1",algorithm="hmac-sha256",
   headers="(request-line) host date digest content-length",
   signature="Base64(HMAC-SHA256(signing string))"

   The only difference between the RSA Example and the HMAC Example is
   the signature algorithm that is used.  The client would compose the
   signing string in the same way as the RSA Example above:

   (request-line): post /foo\n
   host: example.org\n
   date: Tue, 07 Jun 2014 20:51:35 GMT\n
   digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=\n
   content-length: 18

4.  The 'Signature' HTTP Header

   The "signature" HTTP Header is based on the model that the sender
   must authenticate itself with a digital signature produced by either
   a private asymmetric key (e.g., RSA) or a shared symmetric key (e.g.,
   HMAC).  The scheme is parameterized enough such that it is not bound
   to any particular key type or signing algorithm.  However, it does
   explicitly assume that senders can send an HTTP `Date` header.

4.1.  Signature Header

   The sender is expected to transmit a header (as defined in HTTPbis
   1.1, Part 1 [I-D.ietf-httpbis-p1-messaging], Section 3.2 [7]) where
   the "field-name" is "Signature", and the "field-value" contains one
   or more "auth-param"s (as defined in HTTPbis 1.1, Part 7
   [I-D.ietf-httpbis-p7-auth], Section 4.1 [8]) where the "auth-param"
   parameters meet the requirements listed in Section 2: The Components
   of a Signature.



Cavage & Sporny         Expires November 9, 2014                [Page 8]


Internet-Draft            Signing HTTP Messages                 May 2014


   The rest if this section uses the following HTTP request as an
   example.

   POST /foo HTTP/1.1
   Host: example.org
   Date: Tue, 07 Jun 2014 20:51:35 GMT
   Content-Type: application/json
   Digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
   Content-Length: 18

   {"hello": "world"}

   The following sections assume that the "rsa-key-1" keyId refers to a
   private key known to the client and a public key known to the server.
   The "hmac-key-1" keyId refers to key known to the client and server.

4.1.1.  RSA Example

   The signature header and signature would be generated as:

   Signature: keyId="rsa-key-1",algorithm="rsa-sha256",
   headers="(request-line) host date digest content-length",
   signature="Base64(RSA-SHA256(signing string))"

   The client would compose the signing string as:

   (request-line): post /foo\n
   host: example.org\n
   date: Tue, 07 Jun 2014 20:51:35 GMT\n
   digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=\n
   content-length: 18

   Note that the '\n' symbols above are included to demonstrate where
   the new line character should be inserted.  There is no new line on
   the final line of the signing string.

   For an RSA-based signature, the authorization header and signature
   would then be generated as:

   Signature: keyId="rsa-key-1",algorithm="rsa-sha256",
   headers="(request-line) host date digest content-length",
   signature="Base64(RSA-SHA256(signing string))"









Cavage & Sporny         Expires November 9, 2014                [Page 9]


Internet-Draft            Signing HTTP Messages                 May 2014


4.1.2.  HMAC Example

   For an HMAC-based signature without a list of headers specified, the
   authorization header and signature would be generated as:

   Signature: keyId="hmac-key-1",algorithm="hmac-sha256",
   headers="(request-line) host date digest content-length",
   signature="Base64(HMAC-SHA256(signing string))"

   The only difference between the RSA Example and the HMAC Example is
   the signature algorithm that is used.  The client would compose the
   signing string in the same way as the RSA Example above:

   (request-line): post /foo\n
   host: example.org\n
   date: Tue, 07 Jun 2014 20:51:35 GMT\n
   digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=\n
   content-length: 18

5.  References

5.1.  Normative References

   [I-D.ietf-httpbis-p1-messaging]
              Fielding, R. and J. Reschke, "Hypertext Transfer Protocol
              (HTTP/1.1): Message Syntax and Routing", draft-ietf-
              httpbis-p1-messaging-25 (work in progress), November 2013.

   [I-D.ietf-httpbis-p7-auth]
              Fielding, R. and J. Reschke, "Hypertext Transfer Protocol
              (HTTP/1.1): Authentication", draft-ietf-httpbis-p7-auth-25
              (work in progress), November 2013.

   [I-D.ietf-jose-json-web-algorithms]
              Jones, M., "JSON Web Algorithms (JWA)", draft-ietf-jose-
              json-web-algorithms-20 (work in progress), January 2014.

   [RFC2119]  Bradner, S., "Key words for use in RFCs to Indicate
              Requirement Levels", BCP 14, RFC 2119, March 1997.

   [RFC4648]  Josefsson, S., "The Base16, Base32, and Base64 Data
              Encodings", RFC 4648, October 2006.

   [RFC6376]  Crocker, D., Hansen, T., and M. Kucherawy, "DomainKeys
              Identified Mail (DKIM) Signatures", STD 76, RFC 6376,
              September 2011.





Cavage & Sporny         Expires November 9, 2014               [Page 10]


Internet-Draft            Signing HTTP Messages                 May 2014


5.2.  Informative References

   [RFC2617]  Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S.,
              Leach, P., Luotonen, A., and L. Stewart, "HTTP
              Authentication: Basic and Digest Access Authentication",
              RFC 2617, June 1999.

   [RFC3230]  Mogul, J. and A. Van Hoff, "Instance Digests in HTTP", RFC
              3230, January 2002.

   [RFC5246]  Dierks, T. and E. Rescorla, "The Transport Layer Security
              (TLS) Protocol Version 1.2", RFC 5246, August 2008.

   [RFC6749]  Hardt, D., "The OAuth 2.0 Authorization Framework", RFC
              6749, October 2012.

Appendix A.  Security Considerations

   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 Security Considerations for HTTP
   Signatures [9].

Appendix B.  Extensions

   This specification was designed to be simple, modular, and
   extensible.  There are a number of other specifications that build on
   this one.  For example, the HTTP Signature Nonces [10] specification
   details how to use HTTP Signatures over a non-secured channel like
   HTTP and the HTTP Signature Trailers [11] specification explains how
   to apply HTTP Signatures to streaming content.  Developers that
   desire more functionality than this specification provides are urged
   to ensure that an extension specification doesn't already exist
   before implementing a proprietary extension.

   If extensions to this specification are made by adding new Signature
   Parameters, those extension parameters MUST be registered in the
   Signature Authentication Scheme Registry.  The registry will be
   created and maintained at (the suggested URI) http://www.iana.org/
   assignments/http-auth-scheme-signature [12].  An example entry in
   this registry is included below:

   Signature Parameter: nonce
   Reference to specification: [HTTP_AUTH_SIGNATURE_NONCE], Section XYZ.
   Notes (optional): The HTTP Signature Nonces specification details
   how to use HTTP Signatures over a unsecured channel like HTTP.




Cavage & Sporny         Expires November 9, 2014               [Page 11]


Internet-Draft            Signing HTTP Messages                 May 2014


Appendix C.  Test Values

   The following test data uses the following RSA 2048-bit keys, which
   we will refer to as `keyId=Test` in the following samples:

   -----BEGIN PUBLIC KEY-----
   MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCFENGw33yGihy92pDjZQhl0C3
   6rPJj+CvfSC8+q28hxA161QFNUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6
   Z4UMR7EOcpfdUE9Hf3m/hs+FUR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJw
   oYi+1hqp1fIekaxsyQIDAQAB
   -----END PUBLIC KEY-----

   -----BEGIN RSA PRIVATE KEY-----
   MIICXgIBAAKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QF
   NUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6Z4UMR7EOcpfdUE9Hf3m/hs+F
   UR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJwoYi+1hqp1fIekaxsyQIDAQAB
   AoGBAJR8ZkCUvx5kzv+utdl7T5MnordT1TvoXXJGXK7ZZ+UuvMNUCdN2QPc4sBiA
   QWvLw1cSKt5DsKZ8UETpYPy8pPYnnDEz2dDYiaew9+xEpubyeW2oH4Zx71wqBtOK
   kqwrXa/pzdpiucRRjk6vE6YY7EBBs/g7uanVpGibOVAEsqH1AkEA7DkjVH28WDUg
   f1nqvfn2Kj6CT7nIcE3jGJsZZ7zlZmBmHFDONMLUrXR/Zm3pR5m0tCmBqa5RK95u
   412jt1dPIwJBANJT3v8pnkth48bQo/fKel6uEYyboRtA5/uHuHkZ6FQF7OUkGogc
   mSJluOdc5t6hI1VsLn0QZEjQZMEOWr+wKSMCQQCC4kXJEsHAve77oP6HtG/IiEn7
   kpyUXRNvFsDE0czpJJBvL/aRFUJxuRK91jhjC68sA7NsKMGg5OXb5I5Jj36xAkEA
   gIT7aFOYBFwGgQAQkWNKLvySgKbAZRTeLBacpHMuQdl1DfdntvAyqpAZ0lY0RKmW
   G6aFKaqQfOXKCyWoUiVknQJAXrlgySFci/2ueKlIE1QqIiLSZ8V8OlpFLRnb1pzI
   7U1yQXnTAEFYM560yJlzUpOb1V4cScGd365tiSMvxLOvTA==
   -----END RSA PRIVATE KEY-----

   All examples use this request:

   POST /foo?param=value&pet=dog HTTP/1.1
   Host: example.com
   Date: Thu, 05 Jan 2014 21:31:40 GMT
   Content-Type: application/json
   Digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
   Content-Length: 18

   {"hello": "world"}

C.1.  Default Test

   If a list of headers is not included, the date is the only header
   that is signed by default.  The string to sign would be:

   date: Thu, 05 Jan 2014 21:31:40 GMT

   The Authorization header would be:




Cavage & Sporny         Expires November 9, 2014               [Page 12]


Internet-Draft            Signing HTTP Messages                 May 2014


   Authorization: Signature keyId="Test",algorithm="rsa-sha256",
   signature="ATp0r26dbMIxOopqw0OfABDT7CKMIoENumuruOtarj8n/97Q3htH
   FYpH8yOSQk3Z5zh8UxUym6FYTb5+A0Nz3NRsXJibnYi7brE/4tx5But9kkFGzG+
   xpUmimN4c3TMN7OFH//+r8hBf7BT9/GmHDUVZT2JzWGLZES2xDOUuMtA="

   The Signature header would be:

   Signature: keyId="Test",algorithm="rsa-sha256",
   signature="ATp0r26dbMIxOopqw0OfABDT7CKMIoENumuruOtarj8n/97Q3htH
   FYpH8yOSQk3Z5zh8UxUym6FYTb5+A0Nz3NRsXJibnYi7brE/4tx5But9kkFGzG+
   xpUmimN4c3TMN7OFH//+r8hBf7BT9/GmHDUVZT2JzWGLZES2xDOUuMtA="

C.2.  Basic Test

   The minimum recommended data to sign is the (request-line), host, and
   date.  In this case, the string to sign would be:

   (request-line): post /foo?param=value&pet=dog
   host: example.com
   date: Thu, 05 Jan 2014 21:31:40 GMT

   The Authorization header would be:

   Authorization: Signature keyId="Test",algorithm="rsa-sha256",
   headers="(request-line) host date", signature="KcLSABBj/m3v2Dhxi
   CKJmzYJvnx74tDO1SaURD8Dr8XpugN5wpy8iBVJtpkHUIp4qBYpzx2QvD16t8X
   0BUMiKc53Age+baQFWwb2iYYJzvuUL+krrl/Q7H6fPBADBsHqEZ7IE8rR0Ys3l
   b7J5A6VB9J/4yVTRiBcxTypW/mpr5w="

C.3.  All Headers Test

   A strong signature including all of the headers and a digest of the
   body of the HTTP request would result in the following signing
   string:

   (request-line): post /foo?param=value&pet=dog
   host: example.com
   date: Thu, 05 Jan 2014 21:31:40 GMT
   content-type: application/json
   digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
   content-length: 18

   The Authorization header would be:








Cavage & Sporny         Expires November 9, 2014               [Page 13]


Internet-Draft            Signing HTTP Messages                 May 2014


   Authorization: Signature keyId="Test",algorithm="rsa-sha256",
   headers="(request-line) host date content-type digest content-length",
   signature="jgSqYK0yKclIHfF9zdApVEbDp5eqj8C4i4X76pE+XHoxugXv7q
   nVrGR+30bmBgtpR39I4utq17s9ghz/2QFVxlnToYAvbSVZJ9ulLd1HQBugO0j
   Oyn9sXOtcN7uNHBjqNCqUsnt0sw/cJA6B6nJZpyNqNyAXKdxZZItOuhIs78w="

   The Signature header would be:

   Signature: keyId="Test",algorithm="rsa-sha256",
   headers="(request-line) host date content-type digest content-length",
   signature="jgSqYK0yKclIHfF9zdApVEbDp5eqj8C4i4X76pE+XHoxugXv7q
   nVrGR+30bmBgtpR39I4utq17s9ghz/2QFVxlnToYAvbSVZJ9ulLd1HQBugO0j
   Oyn9sXOtcN7uNHBjqNCqUsnt0sw/cJA6B6nJZpyNqNyAXKdxZZItOuhIs78w="

Appendix D.  Acknowledgements

   The editor would like to thank the following individuals for feedback
   on and implementations of the specification (in alphabetical order):
   Stephen Farrell, Phillip Hallam-Baker, Dave Lehn, Dave Longley, James
   H. Manger, Mark Nottingham, Yoav Nir, Julian Reschke, and Michael
   Richardson.

Appendix E.  IANA Considerations

E.1.  Signature Authentication Scheme

   The following entry should be added to the Authentication Scheme
   Registry located at http://www.iana.org/assignments/http-authschemes
   [13]

   Authentication Scheme Name: Signature
   Reference: [RFC_THIS_DOCUMENT], Section 2.
   Notes (optional): The Signature scheme is designed for clients to
   authenticate themselves with a server.

E.2.  Signature Algorithm Registry

   The following initial entries should be added to the Signature
   Algorithm Registry to be created and maintained at (the suggested
   URI) http://www.iana.org/assignments/signature-algorithms [14]:

   Editor's note: The references in this section are problematic as many
   of the 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).



Cavage & Sporny         Expires November 9, 2014               [Page 14]


Internet-Draft            Signing HTTP Messages                 May 2014


   Algorithm Name: rsa-sha1
   Reference: RFC 6376 [RFC6376], Section 3.3.1
   Status: deprecated

   Algorithm Name: rsa-sha256
   Reference: RFC 6376 [RFC6376], Section 3.3.2
   Status: active

   Algorithm Name: hmac-sha256
   Reference: HS256 in JOSE JSON Web Algorithms
   [I-D.ietf-jose-json-web-algorithms], Section 3.2
   Status: active

   Algorithm Name: ecdsa-sha256
   Reference: ES256 in JOSE JSON Web Algorithms
   [I-D.ietf-jose-json-web-algorithms], Section 3.4
   Status: active

Authors' Addresses

   Mark Cavage
   Joyent
   One Embarcadero Center
   9th Floor
   San Francisco, CA  94111
   US

   Phone: +1 415 400 0626
   Email: mark.cavage@joyent.com
   URI:   http://www.joyent.com/


   Manu Sporny
   Digital Bazaar
   1700 Kraft Drive
   Suite 2408
   Blacksburg, VA  24060
   US

   Phone: +1 540 961 4469
   Email: msporny@digitalbazaar.com
   URI:   http://manu.sporny.org/









Cavage & Sporny         Expires November 9, 2014               [Page 15]


Html markup produced by rfcmarkup 1.129b, available from https://tools.ietf.org/tools/rfcmarkup/