idnits 2.17.1 draft-cavage-http-signatures-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack a Security Considerations section. ** There are 2 instances of too long lines in the document, the longest one being 1 character in excess of 72. ** The abstract seems to contain references ([2], [1]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (May 8, 2014) is 3641 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '1' on line 23 -- Looks like a reference, but probably isn't: '2' on line 25 -- Looks like a reference, but probably isn't: '3' on line 201 -- Looks like a reference, but probably isn't: '4' on line 216 -- Looks like a reference, but probably isn't: '5' on line 269 -- Looks like a reference, but probably isn't: '6' on line 287 -- Looks like a reference, but probably isn't: '7' on line 366 -- Looks like a reference, but probably isn't: '8' on line 369 -- Looks like a reference, but probably isn't: '9' on line 485 -- Looks like a reference, but probably isn't: '10' on line 491 -- Looks like a reference, but probably isn't: '11' on line 493 -- Looks like a reference, but probably isn't: '12' on line 503 -- Looks like a reference, but probably isn't: '13' on line 631 -- Looks like a reference, but probably isn't: '14' on line 642 == Unused Reference: 'RFC2119' is defined on line 453, but no explicit reference was found in the text == Outdated reference: A later version (-26) exists of draft-ietf-httpbis-p1-messaging-25 == Outdated reference: A later version (-26) exists of draft-ietf-httpbis-p7-auth-25 == Outdated reference: A later version (-40) exists of draft-ietf-jose-json-web-algorithms-20 -- Obsolete informational reference (is this intentional?): RFC 2617 (Obsoleted by RFC 7235, RFC 7615, RFC 7616, RFC 7617) -- Obsolete informational reference (is this intentional?): RFC 3230 (Obsoleted by RFC 9530) -- Obsolete informational reference (is this intentional?): RFC 5246 (Obsoleted by RFC 8446) Summary: 3 errors (**), 0 flaws (~~), 6 warnings (==), 18 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group M. Cavage 3 Internet-Draft Joyent 4 Intended status: Standards Track M. Sporny 5 Expires: November 9, 2014 Digital Bazaar 6 May 8, 2014 8 Signing HTTP Messages 9 draft-cavage-http-signatures-02 11 Abstract 13 When communicating over the Internet using the HTTP protocol, it can 14 be desirable for a server or client to authenticate the sender of a 15 particular message. It can also be desirable to ensure that the 16 message was not tampered with during transit. This document 17 describes a way for servers and clients to simultaneously add 18 authentication and message integrity to HTTP messages by using a 19 digital signature. 21 Feedback 23 This specification is a part of the Web Payments [1] work. Feedback 24 related to this specification should be sent to public- 25 webpayments@w3.org [2]. 27 Status of This Memo 29 This Internet-Draft is submitted in full conformance with the 30 provisions of BCP 78 and BCP 79. 32 Internet-Drafts are working documents of the Internet Engineering 33 Task Force (IETF). Note that other groups may also distribute 34 working documents as Internet-Drafts. The list of current Internet- 35 Drafts is at http://datatracker.ietf.org/drafts/current/. 37 Internet-Drafts are draft documents valid for a maximum of six months 38 and may be updated, replaced, or obsoleted by other documents at any 39 time. It is inappropriate to use Internet-Drafts as reference 40 material or to cite them other than as "work in progress." 42 This Internet-Draft will expire on November 9, 2014. 44 Copyright Notice 46 Copyright (c) 2014 IETF Trust and the persons identified as the 47 document authors. All rights reserved. 49 This document is subject to BCP 78 and the IETF Trust's Legal 50 Provisions Relating to IETF Documents 51 (http://trustee.ietf.org/license-info) in effect on the date of 52 publication of this document. Please review these documents 53 carefully, as they describe your rights and restrictions with respect 54 to this document. 56 Table of Contents 58 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 59 1.1. Using Signatures in HTTP Requests . . . . . . . . . . . . 3 60 1.2. Using Signatures in HTTP Responses . . . . . . . . . . . 4 61 2. The Components of a Signature . . . . . . . . . . . . . . . . 4 62 2.1. Signature Parameters . . . . . . . . . . . . . . . . . . 5 63 2.1.1. keyId . . . . . . . . . . . . . . . . . . . . . . . . 5 64 2.1.2. algorithm . . . . . . . . . . . . . . . . . . . . . . 5 65 2.1.3. headers . . . . . . . . . . . . . . . . . . . . . . . 5 66 2.1.4. signature . . . . . . . . . . . . . . . . . . . . . . 5 67 2.2. Ambiguous Parameters . . . . . . . . . . . . . . . . . . 5 68 2.3. Signature String Construction . . . . . . . . . . . . . . 6 69 3. The 'Signature' HTTP Authentication Scheme . . . . . . . . . 6 70 3.1. Authorization Header . . . . . . . . . . . . . . . . . . 6 71 3.1.1. Initiating Signature Authorization . . . . . . . . . 7 72 3.1.2. RSA Example . . . . . . . . . . . . . . . . . . . . . 7 73 3.1.3. HMAC Example . . . . . . . . . . . . . . . . . . . . 8 74 4. The 'Signature' HTTP Header . . . . . . . . . . . . . . . . . 8 75 4.1. Signature Header . . . . . . . . . . . . . . . . . . . . 8 76 4.1.1. RSA Example . . . . . . . . . . . . . . . . . . . . . 9 77 4.1.2. HMAC Example . . . . . . . . . . . . . . . . . . . . 10 78 5. References . . . . . . . . . . . . . . . . . . . . . . . . . 10 79 5.1. Normative References . . . . . . . . . . . . . . . . . . 10 80 5.2. Informative References . . . . . . . . . . . . . . . . . 11 81 Appendix A. Security Considerations . . . . . . . . . . . . . . 11 82 Appendix B. Extensions . . . . . . . . . . . . . . . . . . . . . 11 83 Appendix C. Test Values . . . . . . . . . . . . . . . . . . . . 12 84 C.1. Default Test . . . . . . . . . . . . . . . . . . . . . . 12 85 C.2. Basic Test . . . . . . . . . . . . . . . . . . . . . . . 13 86 C.3. All Headers Test . . . . . . . . . . . . . . . . . . . . 13 87 Appendix D. Acknowledgements . . . . . . . . . . . . . . . . . . 14 88 Appendix E. IANA Considerations . . . . . . . . . . . . . . . . 14 89 E.1. Signature Authentication Scheme . . . . . . . . . . . . . 14 90 E.2. Signature Algorithm Registry . . . . . . . . . . . . . . 14 91 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 15 93 1. Introduction 95 This protocol extension is intended to provide a standard way for 96 clients to sign HTTP messages. HTTP Authentication [RFC2617] defines 97 Basic and Digest authentication mechanisms, and TLS 1.2 [RFC5246] 98 defines cryptographically stronger client authentication, all of 99 which are widely employed on the Internet today. The burdens of PKI 100 prevent some web service operators from deploying that methodoloy, 101 and so some of those organizations fall back to Basic or Digest 102 authentication. Basic and Digest authentication provide poor 103 security characteristics when combined with common password usage 104 behavior. 106 Password database compromises between 2010 to 2014 have shown that 107 people regularly use weak passwords and share the same password 108 across multiple websites. The use of Basic authentication over a 109 regular HTTP channel provides very little protection. Digest 110 authentication, while providing a little more protection, still 111 leaves the scheme open to brute-force attacks that are capable of 112 discovering a weak or random 8 character password in less than 3 113 hours using a single commodity computer and mere minutes using cloud- 114 based rental servers to distribute the brute-force attack. 116 While it is true that most Basic and Digest authentication approaches 117 are operated over secure channels like TLS, revelations over 118 pervasive monitoring in 2013 have shown that TLS alone may not be 119 secure enough to protect sensitive data. 121 Additionally, OAuth 2.0 [RFC6749] provides a fully-specified 122 alternative for authorization of web service requests, but is not 123 always ideal for machine to machine communication, as the token 124 acquisition steps generally imply a fixed infrastructure that may not 125 make sense to a service provider. For example, the use of symmetric 126 keys and the distribution of hundreds of thousands of those keys 127 across multiple datacenters around the world create multiple points 128 of attack where a successful attack results in a large gain for the 129 attacker and thus an even bigger problem for the service provider and 130 their customers. 132 Several web service providers have invented their own schemes for 133 signing HTTP messages, but to date, none have been standardized. 134 While there are no techniques in this proposal that are novel beyond 135 the previous art, it is useful to standardize a simple and 136 cryptographically strong mechanism for digitally signing HTTP 137 messages. 139 1.1. Using Signatures in HTTP Requests 140 It is common practice to protect sensitive website API functionality 141 via authentication mechanisms. Often, the entity accessing these 142 APIs is a piece of automated software outside of an interactive human 143 session. While there are mechanisms like OAuth and API secrets that 144 are used to grant API access, each have their weaknesses such as 145 unnecessary complexity for particular use cases or the use of shared 146 secrets which may not be acceptable to an implementer. 148 Digital signatures are widely used to provide authentication without 149 the need for shared secrets. They also do not require a round-trip 150 in order to authenticate the client. A server need only have a 151 mapping between the key being used to sign the content and the 152 authorized entity to verify that a message was signed by that entity. 154 This specification provides two mechanisms that can be used by a 155 server to authenticate a client. The first is the 'Signature' HTTP 156 Authentication Scheme, which may be used for interactive sessions. 157 The second is the Signature HTTP Header, which is typically used by 158 automated software agents. 160 1.2. Using Signatures in HTTP Responses 162 It is often assumed that if a server provides a certificate signed by 163 a trusted Certificate Authority that the server has not been 164 compromised. After the pervasive monitoring revelations of 2013, 165 that is no longer a commonly held belief. For most low to moderate 166 security transactions, TLS is acceptable. However, for high security 167 transactions, having an additional signature on the HTTP header 168 allows a client to ensure that even if the transport channel has been 169 compromised, that the content of the messages have not been 170 compromised. 172 This specification provides a HTTP Signature Header mechanism that 173 can be used by a client to authenticate the sender of a message and 174 ensure that particular headers have not been modified in transit. 176 2. The Components of a Signature 178 There are a number of components in a signature that are common 179 between the 'Signature' HTTP Authentication Scheme and the 180 'Signature' HTTP Header. This section details the components of a 181 digital signature. 183 2.1. Signature Parameters 185 The following section details the signature parameters. 187 2.1.1. keyId 189 REQUIRED. The `keyId` field is an opaque string that the server can 190 use to look up the component they need to validate the signature. It 191 could be an SSH key fingerprint, a URL to machine-readable key data, 192 an LDAP DN, etc. Management of keys and assignment of `keyId` is out 193 of scope for this document. 195 2.1.2. algorithm 197 REQUIRED. The `algorithm` parameter is used to specify the digital 198 signature algorithm to use when generating the signature. Valid 199 values for this parameter can be found in the Signature Algorithms 200 registry located at http://www.iana.org/assignments/signature- 201 algorithms [3] and MUST NOT be marked "deprecated". 203 2.1.3. headers 205 OPTIONAL. The `headers` parameter is used to specify the list of 206 HTTP headers included when generating the signature for message. If 207 specified, it should be a lowercased, quoted list of HTTP header 208 fields, separated by a single space character. By default, only one 209 HTTP header is signed, which is the `Date` header. Note that the 210 list order is important, and MUST be specified in the order the 211 values are concatenated together during signing. 213 2.1.4. signature 215 REQUIRED. The `signature` parameter is a base 64 encoded digital 216 signature, as described in RFC 4648 [RFC4648], Section 4 [4]. The 217 client uses the `algorithm` and `headers` signature parameters to 218 form a canonicalized `signing string`. This `signing string` is then 219 signed with the key associated with `keyId` and the algorithm 220 corresponding to `algorithm`. The `signature` parameter is then set 221 to the base 64 encoding of the signature. 223 2.2. Ambiguous Parameters 225 If any of the parameters listed above are erroneously duplicated in 226 the associated header field, then the last parameter defined MUST be 227 used. Any parameter that is not recognized as a parameter, or is not 228 well-formed, MUST be ignored. 230 2.3. Signature String Construction 232 In order to generate the string that is signed with a key, the client 233 MUST use the values of each HTTP header field specified by `headers` 234 in the order they appear. It is out of scope for this document to 235 dictate what header fields an application will want to enforce, but 236 implementers SHOULD at minimum include the method + URL (request- 237 line), Host, and Date header fields. 239 To include the HTTP request line in the signature calculation, use 240 the special `(request-line)` header field name. 242 1. If the header field name is `(request-line)` then generate the 243 header field value by concatenating the lowercased method name, 244 an ASCII space, and the method URL. 246 2. Create the header field string by concatenating the lowercased 247 header field name followed with an ASCII colon `:`, an ASCII 248 space ` `, and the header field value. The value MUST NOT be 249 modified or canonicalized in any way. If there are multiple 250 instances of the same header field, all header field values 251 associated with the header field MUST be concatenated and used in 252 the order in which they will appear in the transmitted HTTP 253 message. 255 3. If value is not the last value then append an ASCII newline `\n`. 257 3. The 'Signature' HTTP Authentication Scheme 259 The "signature" authentication scheme is based on the model that the 260 client must authenticate itself with a digital signature produced by 261 either a private asymmetric key (e.g., RSA) or a shared symmetric key 262 (e.g., HMAC). The scheme is parameterized enough such that it is not 263 bound to any particular key type or signing algorithm. However, it 264 does explicitly assume that clients can send an HTTP `Date` header. 266 3.1. Authorization Header 268 The client is expected to send an Authorization header (as defined in 269 HTTPbis 1.1, Part 7 [I-D.ietf-httpbis-p7-auth], Section 4.1 [5]) 270 where the "auth-scheme" is "Signature" and the "auth-param" 271 parameters meet the requirements listed in Section 2: The Components 272 of a Signature. 274 The rest if this section uses the following HTTP request as an 275 example. 277 POST /foo HTTP/1.1 278 Host: example.org 279 Date: Tue, 07 Jun 2014 20:51:35 GMT 280 Content-Type: application/json 281 Digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= 282 Content-Length: 18 284 {"hello": "world"} 286 Note that the use of the `Digest` header field is per RFC 3230 287 [RFC3230], Section 4.3.2 [6] and is included merely as a 288 demonstration of how an implementer could include information about 289 the body of the message in the signature. The following sections 290 also assume that the "rsa-key-1" keyId refers to a private key known 291 to the client and a public key known to the server. The "hmac-key-1" 292 keyId refers to key known to the client and server. 294 3.1.1. Initiating Signature Authorization 296 A server may notify a client when a protected resource could be 297 accessed by authenticating itself to the server. To initiate this 298 process, the server will request that the client authenticate itself 299 via a 401 response code. For example: 301 HTTP/1.1 401 Unauthorized 302 Date: Thu, 08 Jun 2014 18:32:30 GMT 303 Content-Length: 1234 304 Content-Type: text/html 305 WWW-Authenticate: Signature realm="Example" 307 ... 309 3.1.2. RSA Example 311 The authorization header and signature would be generated as: 313 Authorization: Signature keyId="rsa-key-1",algorithm="rsa-sha256", 314 headers="(request-line) host date digest content-length", 315 signature="Base64(RSA-SHA256(signing string))" 317 The client would compose the signing string as: 319 (request-line): post /foo\n 320 host: example.org\n 321 date: Tue, 07 Jun 2014 20:51:35 GMT\n 322 digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=\n 323 content-length: 18 324 Note that the '\n' symbols above are included to demonstrate where 325 the new line character should be inserted. There is no new line on 326 the final line of the signing string. 328 For an RSA-based signature, the authorization header and signature 329 would then be generated as: 331 Authorization: Signature keyId="rsa-key-1",algorithm="rsa-sha256", 332 headers="(request-line) host date digest content-length", 333 signature="Base64(RSA-SHA256(signing string))" 335 3.1.3. HMAC Example 337 For an HMAC-based signature without a list of headers specified, the 338 authorization header and signature would be generated as: 340 Authorization: Signature keyId="hmac-key-1",algorithm="hmac-sha256", 341 headers="(request-line) host date digest content-length", 342 signature="Base64(HMAC-SHA256(signing string))" 344 The only difference between the RSA Example and the HMAC Example is 345 the signature algorithm that is used. The client would compose the 346 signing string in the same way as the RSA Example above: 348 (request-line): post /foo\n 349 host: example.org\n 350 date: Tue, 07 Jun 2014 20:51:35 GMT\n 351 digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=\n 352 content-length: 18 354 4. The 'Signature' HTTP Header 356 The "signature" HTTP Header is based on the model that the sender 357 must authenticate itself with a digital signature produced by either 358 a private asymmetric key (e.g., RSA) or a shared symmetric key (e.g., 359 HMAC). The scheme is parameterized enough such that it is not bound 360 to any particular key type or signing algorithm. However, it does 361 explicitly assume that senders can send an HTTP `Date` header. 363 4.1. Signature Header 365 The sender is expected to transmit a header (as defined in HTTPbis 366 1.1, Part 1 [I-D.ietf-httpbis-p1-messaging], Section 3.2 [7]) where 367 the "field-name" is "Signature", and the "field-value" contains one 368 or more "auth-param"s (as defined in HTTPbis 1.1, Part 7 369 [I-D.ietf-httpbis-p7-auth], Section 4.1 [8]) where the "auth-param" 370 parameters meet the requirements listed in Section 2: The Components 371 of a Signature. 373 The rest if this section uses the following HTTP request as an 374 example. 376 POST /foo HTTP/1.1 377 Host: example.org 378 Date: Tue, 07 Jun 2014 20:51:35 GMT 379 Content-Type: application/json 380 Digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= 381 Content-Length: 18 383 {"hello": "world"} 385 The following sections assume that the "rsa-key-1" keyId refers to a 386 private key known to the client and a public key known to the server. 387 The "hmac-key-1" keyId refers to key known to the client and server. 389 4.1.1. RSA Example 391 The signature header and signature would be generated as: 393 Signature: keyId="rsa-key-1",algorithm="rsa-sha256", 394 headers="(request-line) host date digest content-length", 395 signature="Base64(RSA-SHA256(signing string))" 397 The client would compose the signing string as: 399 (request-line): post /foo\n 400 host: example.org\n 401 date: Tue, 07 Jun 2014 20:51:35 GMT\n 402 digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=\n 403 content-length: 18 405 Note that the '\n' symbols above are included to demonstrate where 406 the new line character should be inserted. There is no new line on 407 the final line of the signing string. 409 For an RSA-based signature, the authorization header and signature 410 would then be generated as: 412 Signature: keyId="rsa-key-1",algorithm="rsa-sha256", 413 headers="(request-line) host date digest content-length", 414 signature="Base64(RSA-SHA256(signing string))" 416 4.1.2. HMAC Example 418 For an HMAC-based signature without a list of headers specified, the 419 authorization header and signature would be generated as: 421 Signature: keyId="hmac-key-1",algorithm="hmac-sha256", 422 headers="(request-line) host date digest content-length", 423 signature="Base64(HMAC-SHA256(signing string))" 425 The only difference between the RSA Example and the HMAC Example is 426 the signature algorithm that is used. The client would compose the 427 signing string in the same way as the RSA Example above: 429 (request-line): post /foo\n 430 host: example.org\n 431 date: Tue, 07 Jun 2014 20:51:35 GMT\n 432 digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=\n 433 content-length: 18 435 5. References 437 5.1. Normative References 439 [I-D.ietf-httpbis-p1-messaging] 440 Fielding, R. and J. Reschke, "Hypertext Transfer Protocol 441 (HTTP/1.1): Message Syntax and Routing", draft-ietf- 442 httpbis-p1-messaging-25 (work in progress), November 2013. 444 [I-D.ietf-httpbis-p7-auth] 445 Fielding, R. and J. Reschke, "Hypertext Transfer Protocol 446 (HTTP/1.1): Authentication", draft-ietf-httpbis-p7-auth-25 447 (work in progress), November 2013. 449 [I-D.ietf-jose-json-web-algorithms] 450 Jones, M., "JSON Web Algorithms (JWA)", draft-ietf-jose- 451 json-web-algorithms-20 (work in progress), January 2014. 453 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 454 Requirement Levels", BCP 14, RFC 2119, March 1997. 456 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 457 Encodings", RFC 4648, October 2006. 459 [RFC6376] Crocker, D., Hansen, T., and M. Kucherawy, "DomainKeys 460 Identified Mail (DKIM) Signatures", STD 76, RFC 6376, 461 September 2011. 463 5.2. Informative References 465 [RFC2617] Franks, J., Hallam-Baker, P., Hostetler, J., Lawrence, S., 466 Leach, P., Luotonen, A., and L. Stewart, "HTTP 467 Authentication: Basic and Digest Access Authentication", 468 RFC 2617, June 1999. 470 [RFC3230] Mogul, J. and A. Van Hoff, "Instance Digests in HTTP", RFC 471 3230, January 2002. 473 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 474 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 476 [RFC6749] Hardt, D., "The OAuth 2.0 Authorization Framework", RFC 477 6749, October 2012. 479 Appendix A. Security Considerations 481 There are a number of security considerations to take into account 482 when implementing or utilizing this specification. A thorough 483 security analysis of this protocol, including its strengths and 484 weaknesses, can be found in Security Considerations for HTTP 485 Signatures [9]. 487 Appendix B. Extensions 489 This specification was designed to be simple, modular, and 490 extensible. There are a number of other specifications that build on 491 this one. For example, the HTTP Signature Nonces [10] specification 492 details how to use HTTP Signatures over a non-secured channel like 493 HTTP and the HTTP Signature Trailers [11] specification explains how 494 to apply HTTP Signatures to streaming content. Developers that 495 desire more functionality than this specification provides are urged 496 to ensure that an extension specification doesn't already exist 497 before implementing a proprietary extension. 499 If extensions to this specification are made by adding new Signature 500 Parameters, those extension parameters MUST be registered in the 501 Signature Authentication Scheme Registry. The registry will be 502 created and maintained at (the suggested URI) http://www.iana.org/ 503 assignments/http-auth-scheme-signature [12]. An example entry in 504 this registry is included below: 506 Signature Parameter: nonce 507 Reference to specification: [HTTP_AUTH_SIGNATURE_NONCE], Section XYZ. 508 Notes (optional): The HTTP Signature Nonces specification details 509 how to use HTTP Signatures over a unsecured channel like HTTP. 511 Appendix C. Test Values 513 The following test data uses the following RSA 2048-bit keys, which 514 we will refer to as `keyId=Test` in the following samples: 516 -----BEGIN PUBLIC KEY----- 517 MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDCFENGw33yGihy92pDjZQhl0C3 518 6rPJj+CvfSC8+q28hxA161QFNUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6 519 Z4UMR7EOcpfdUE9Hf3m/hs+FUR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJw 520 oYi+1hqp1fIekaxsyQIDAQAB 521 -----END PUBLIC KEY----- 523 -----BEGIN RSA PRIVATE KEY----- 524 MIICXgIBAAKBgQDCFENGw33yGihy92pDjZQhl0C36rPJj+CvfSC8+q28hxA161QF 525 NUd13wuCTUcq0Qd2qsBe/2hFyc2DCJJg0h1L78+6Z4UMR7EOcpfdUE9Hf3m/hs+F 526 UR45uBJeDK1HSFHD8bHKD6kv8FPGfJTotc+2xjJwoYi+1hqp1fIekaxsyQIDAQAB 527 AoGBAJR8ZkCUvx5kzv+utdl7T5MnordT1TvoXXJGXK7ZZ+UuvMNUCdN2QPc4sBiA 528 QWvLw1cSKt5DsKZ8UETpYPy8pPYnnDEz2dDYiaew9+xEpubyeW2oH4Zx71wqBtOK 529 kqwrXa/pzdpiucRRjk6vE6YY7EBBs/g7uanVpGibOVAEsqH1AkEA7DkjVH28WDUg 530 f1nqvfn2Kj6CT7nIcE3jGJsZZ7zlZmBmHFDONMLUrXR/Zm3pR5m0tCmBqa5RK95u 531 412jt1dPIwJBANJT3v8pnkth48bQo/fKel6uEYyboRtA5/uHuHkZ6FQF7OUkGogc 532 mSJluOdc5t6hI1VsLn0QZEjQZMEOWr+wKSMCQQCC4kXJEsHAve77oP6HtG/IiEn7 533 kpyUXRNvFsDE0czpJJBvL/aRFUJxuRK91jhjC68sA7NsKMGg5OXb5I5Jj36xAkEA 534 gIT7aFOYBFwGgQAQkWNKLvySgKbAZRTeLBacpHMuQdl1DfdntvAyqpAZ0lY0RKmW 535 G6aFKaqQfOXKCyWoUiVknQJAXrlgySFci/2ueKlIE1QqIiLSZ8V8OlpFLRnb1pzI 536 7U1yQXnTAEFYM560yJlzUpOb1V4cScGd365tiSMvxLOvTA== 537 -----END RSA PRIVATE KEY----- 539 All examples use this request: 541 POST /foo?param=value&pet=dog HTTP/1.1 542 Host: example.com 543 Date: Thu, 05 Jan 2014 21:31:40 GMT 544 Content-Type: application/json 545 Digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= 546 Content-Length: 18 548 {"hello": "world"} 550 C.1. Default Test 552 If a list of headers is not included, the date is the only header 553 that is signed by default. The string to sign would be: 555 date: Thu, 05 Jan 2014 21:31:40 GMT 557 The Authorization header would be: 559 Authorization: Signature keyId="Test",algorithm="rsa-sha256", 560 signature="ATp0r26dbMIxOopqw0OfABDT7CKMIoENumuruOtarj8n/97Q3htH 561 FYpH8yOSQk3Z5zh8UxUym6FYTb5+A0Nz3NRsXJibnYi7brE/4tx5But9kkFGzG+ 562 xpUmimN4c3TMN7OFH//+r8hBf7BT9/GmHDUVZT2JzWGLZES2xDOUuMtA=" 564 The Signature header would be: 566 Signature: keyId="Test",algorithm="rsa-sha256", 567 signature="ATp0r26dbMIxOopqw0OfABDT7CKMIoENumuruOtarj8n/97Q3htH 568 FYpH8yOSQk3Z5zh8UxUym6FYTb5+A0Nz3NRsXJibnYi7brE/4tx5But9kkFGzG+ 569 xpUmimN4c3TMN7OFH//+r8hBf7BT9/GmHDUVZT2JzWGLZES2xDOUuMtA=" 571 C.2. Basic Test 573 The minimum recommended data to sign is the (request-line), host, and 574 date. In this case, the string to sign would be: 576 (request-line): post /foo?param=value&pet=dog 577 host: example.com 578 date: Thu, 05 Jan 2014 21:31:40 GMT 580 The Authorization header would be: 582 Authorization: Signature keyId="Test",algorithm="rsa-sha256", 583 headers="(request-line) host date", signature="KcLSABBj/m3v2Dhxi 584 CKJmzYJvnx74tDO1SaURD8Dr8XpugN5wpy8iBVJtpkHUIp4qBYpzx2QvD16t8X 585 0BUMiKc53Age+baQFWwb2iYYJzvuUL+krrl/Q7H6fPBADBsHqEZ7IE8rR0Ys3l 586 b7J5A6VB9J/4yVTRiBcxTypW/mpr5w=" 588 C.3. All Headers Test 590 A strong signature including all of the headers and a digest of the 591 body of the HTTP request would result in the following signing 592 string: 594 (request-line): post /foo?param=value&pet=dog 595 host: example.com 596 date: Thu, 05 Jan 2014 21:31:40 GMT 597 content-type: application/json 598 digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE= 599 content-length: 18 601 The Authorization header would be: 603 Authorization: Signature keyId="Test",algorithm="rsa-sha256", 604 headers="(request-line) host date content-type digest content-length", 605 signature="jgSqYK0yKclIHfF9zdApVEbDp5eqj8C4i4X76pE+XHoxugXv7q 606 nVrGR+30bmBgtpR39I4utq17s9ghz/2QFVxlnToYAvbSVZJ9ulLd1HQBugO0j 607 Oyn9sXOtcN7uNHBjqNCqUsnt0sw/cJA6B6nJZpyNqNyAXKdxZZItOuhIs78w=" 609 The Signature header would be: 611 Signature: keyId="Test",algorithm="rsa-sha256", 612 headers="(request-line) host date content-type digest content-length", 613 signature="jgSqYK0yKclIHfF9zdApVEbDp5eqj8C4i4X76pE+XHoxugXv7q 614 nVrGR+30bmBgtpR39I4utq17s9ghz/2QFVxlnToYAvbSVZJ9ulLd1HQBugO0j 615 Oyn9sXOtcN7uNHBjqNCqUsnt0sw/cJA6B6nJZpyNqNyAXKdxZZItOuhIs78w=" 617 Appendix D. Acknowledgements 619 The editor would like to thank the following individuals for feedback 620 on and implementations of the specification (in alphabetical order): 621 Stephen Farrell, Phillip Hallam-Baker, Dave Lehn, Dave Longley, James 622 H. Manger, Mark Nottingham, Yoav Nir, Julian Reschke, and Michael 623 Richardson. 625 Appendix E. IANA Considerations 627 E.1. Signature Authentication Scheme 629 The following entry should be added to the Authentication Scheme 630 Registry located at http://www.iana.org/assignments/http-authschemes 631 [13] 633 Authentication Scheme Name: Signature 634 Reference: [RFC_THIS_DOCUMENT], Section 2. 635 Notes (optional): The Signature scheme is designed for clients to 636 authenticate themselves with a server. 638 E.2. Signature Algorithm Registry 640 The following initial entries should be added to the Signature 641 Algorithm Registry to be created and maintained at (the suggested 642 URI) http://www.iana.org/assignments/signature-algorithms [14]: 644 Editor's note: The references in this section are problematic as many 645 of the specifications that they refer to are too implementation 646 specific, rather than just pointing to the proper signature and 647 hashing specifications. A better approach might be just specifying 648 the signature and hashing function specifications, leaving 649 implementers to connect the dots (which are not that hard to 650 connect). 652 Algorithm Name: rsa-sha1 653 Reference: RFC 6376 [RFC6376], Section 3.3.1 654 Status: deprecated 656 Algorithm Name: rsa-sha256 657 Reference: RFC 6376 [RFC6376], Section 3.3.2 658 Status: active 660 Algorithm Name: hmac-sha256 661 Reference: HS256 in JOSE JSON Web Algorithms 662 [I-D.ietf-jose-json-web-algorithms], Section 3.2 663 Status: active 665 Algorithm Name: ecdsa-sha256 666 Reference: ES256 in JOSE JSON Web Algorithms 667 [I-D.ietf-jose-json-web-algorithms], Section 3.4 668 Status: active 670 Authors' Addresses 672 Mark Cavage 673 Joyent 674 One Embarcadero Center 675 9th Floor 676 San Francisco, CA 94111 677 US 679 Phone: +1 415 400 0626 680 Email: mark.cavage@joyent.com 681 URI: http://www.joyent.com/ 683 Manu Sporny 684 Digital Bazaar 685 1700 Kraft Drive 686 Suite 2408 687 Blacksburg, VA 24060 688 US 690 Phone: +1 540 961 4469 691 Email: msporny@digitalbazaar.com 692 URI: http://manu.sporny.org/