idnits 2.17.1 draft-jones-json-web-signature-04.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 : ---------------------------------------------------------------------------- == There are 4 instances of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (December 13, 2011) is 4517 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: '123' on line 1207 -- Looks like a reference, but probably isn't: '34' on line 1207 -- Looks like a reference, but probably isn't: '97' on line 1207 -- Looks like a reference, but probably isn't: '108' on line 1207 -- Looks like a reference, but probably isn't: '103' on line 1207 -- Looks like a reference, but probably isn't: '58' on line 1207 -- Looks like a reference, but probably isn't: '82' on line 1043 -- Looks like a reference, but probably isn't: '83' on line 1207 -- Looks like a reference, but probably isn't: '50' on line 1207 -- Looks like a reference, but probably isn't: '53' on line 1207 -- Looks like a reference, but probably isn't: '54' on line 1207 -- Looks like a reference, but probably isn't: '125' on line 1207 -- Looks like a reference, but probably isn't: '1' on line 1107 -- Looks like a reference, but probably isn't: '0' on line 1412 -- Looks like a reference, but probably isn't: '69' on line 1207 -- Possible downref: Non-RFC (?) normative reference: ref. 'JWK' ** Downref: Normative reference to an Historic RFC: RFC 1421 ** Obsolete normative reference: RFC 1738 (Obsoleted by RFC 4248, RFC 4266) ** Downref: Normative reference to an Informational RFC: RFC 2104 ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 3447 (Obsoleted by RFC 8017) ** Obsolete normative reference: RFC 4627 (Obsoleted by RFC 7158, RFC 7159) ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) ** Obsolete normative reference: RFC 6125 (Obsoleted by RFC 9525) -- Possible downref: Non-RFC (?) normative reference: ref. 'USA15' Summary: 9 errors (**), 0 flaws (~~), 2 warnings (==), 18 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group M. Jones 3 Internet-Draft Microsoft 4 Intended status: Standards Track D. Balfanz 5 Expires: June 15, 2012 Google 6 J. Bradley 7 independent 8 Y. Goland 9 Microsoft 10 J. Panzer 11 Google 12 N. Sakimura 13 Nomura Research Institute 14 P. Tarjan 15 Facebook 16 December 13, 2011 18 JSON Web Signature (JWS) 19 draft-jones-json-web-signature-04 21 Abstract 23 JSON Web Signature (JWS) is a means of representing signed content 24 using JSON data structures. Related encryption capabilities are 25 described in the separate JSON Web Encryption (JWE) specification. 27 Requirements Language 29 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 30 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 31 document are to be interpreted as described in RFC 2119 [RFC2119]. 33 Status of this Memo 35 This Internet-Draft is submitted in full conformance with the 36 provisions of BCP 78 and BCP 79. 38 Internet-Drafts are working documents of the Internet Engineering 39 Task Force (IETF). Note that other groups may also distribute 40 working documents as Internet-Drafts. The list of current Internet- 41 Drafts is at http://datatracker.ietf.org/drafts/current/. 43 Internet-Drafts are draft documents valid for a maximum of six months 44 and may be updated, replaced, or obsoleted by other documents at any 45 time. It is inappropriate to use Internet-Drafts as reference 46 material or to cite them other than as "work in progress." 48 This Internet-Draft will expire on June 15, 2012. 50 Copyright Notice 52 Copyright (c) 2011 IETF Trust and the persons identified as the 53 document authors. All rights reserved. 55 This document is subject to BCP 78 and the IETF Trust's Legal 56 Provisions Relating to IETF Documents 57 (http://trustee.ietf.org/license-info) in effect on the date of 58 publication of this document. Please review these documents 59 carefully, as they describe your rights and restrictions with respect 60 to this document. Code Components extracted from this document must 61 include Simplified BSD License text as described in Section 4.e of 62 the Trust Legal Provisions and are provided without warranty as 63 described in the Simplified BSD License. 65 Table of Contents 67 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 68 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4 69 3. JSON Web Signature (JWS) Overview . . . . . . . . . . . . . . 5 70 3.1. Example JWS . . . . . . . . . . . . . . . . . . . . . . . 5 71 4. JWS Header . . . . . . . . . . . . . . . . . . . . . . . . . . 6 72 4.1. Reserved Header Parameter Names . . . . . . . . . . . . . 6 73 4.2. Public Header Parameter Names . . . . . . . . . . . . . . 9 74 4.3. Private Header Parameter Names . . . . . . . . . . . . . . 9 75 5. Rules for Creating and Validating a JWS . . . . . . . . . . . 9 76 6. Signing JWSs with Cryptographic Algorithms . . . . . . . . . . 11 77 6.1. Creating a JWS with HMAC SHA-256, HMAC SHA-384, or 78 HMAC SHA-512 . . . . . . . . . . . . . . . . . . . . . . . 12 79 6.2. Creating a JWS with RSA SHA-256, RSA SHA-384, or RSA 80 SHA-512 . . . . . . . . . . . . . . . . . . . . . . . . . 13 81 6.3. Creating a JWS with ECDSA P-256 SHA-256, ECDSA P-384 82 SHA-384, or ECDSA P-521 SHA-512 . . . . . . . . . . . . . 14 83 6.4. Additional Algorithms . . . . . . . . . . . . . . . . . . 16 84 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 16 85 8. Security Considerations . . . . . . . . . . . . . . . . . . . 16 86 8.1. Unicode Comparison Security Issues . . . . . . . . . . . . 17 87 9. Open Issues and Things To Be Done (TBD) . . . . . . . . . . . 17 88 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 19 89 10.1. Normative References . . . . . . . . . . . . . . . . . . . 19 90 10.2. Informative References . . . . . . . . . . . . . . . . . . 20 91 Appendix A. JWS Examples . . . . . . . . . . . . . . . . . . . . 21 92 A.1. JWS using HMAC SHA-256 . . . . . . . . . . . . . . . . . . 21 93 A.1.1. Encoding . . . . . . . . . . . . . . . . . . . . . . . 21 94 A.1.2. Decoding . . . . . . . . . . . . . . . . . . . . . . . 23 95 A.1.3. Validating . . . . . . . . . . . . . . . . . . . . . . 23 96 A.2. JWS using RSA SHA-256 . . . . . . . . . . . . . . . . . . 23 97 A.2.1. Encoding . . . . . . . . . . . . . . . . . . . . . . . 23 98 A.2.2. Decoding . . . . . . . . . . . . . . . . . . . . . . . 27 99 A.2.3. Validating . . . . . . . . . . . . . . . . . . . . . . 27 100 A.3. JWS using ECDSA P-256 SHA-256 . . . . . . . . . . . . . . 28 101 A.3.1. Encoding . . . . . . . . . . . . . . . . . . . . . . . 28 102 A.3.2. Decoding . . . . . . . . . . . . . . . . . . . . . . . 30 103 A.3.3. Validating . . . . . . . . . . . . . . . . . . . . . . 30 104 Appendix B. Algorithm Identifier Cross-Reference . . . . . . . . 30 105 Appendix C. Notes on implementing base64url encoding without 106 padding . . . . . . . . . . . . . . . . . . . . . . . 32 107 Appendix D. Acknowledgements . . . . . . . . . . . . . . . . . . 33 108 Appendix E. Document History . . . . . . . . . . . . . . . . . . 34 109 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 35 111 1. Introduction 113 JSON Web Signature (JWS) is a compact signature format intended for 114 space constrained environments such as HTTP Authorization headers and 115 URI query parameters. It represents signed content using JSON 116 [RFC4627] data structures. The JWS signature mechanisms are 117 independent of the type of content being signed, allowing arbitrary 118 content to be signed. A related encryption capability is described 119 in a separate JSON Web Encryption (JWE) [JWE] specification. 121 2. Terminology 123 JSON Web Signature (JWS) A data structure cryptographically securing 124 a JWS Header and a JWS Payload with a JWS Signature. 126 JWS Header A string representing a JSON object that describes the 127 signature applied to the JWS Header and the JWS Payload to create 128 the JWS Signature. 130 JWS Payload The bytes to be signed - a.k.a., the message. 132 JWS Signature A byte array containing the cryptographic material 133 that secures the contents of the JWS Header and the JWS Payload. 135 Encoded JWS Header Base64url encoding of the bytes of the UTF-8 RFC 136 3629 [RFC3629] representation of the JWS Header. 138 Encoded JWS Payload Base64url encoding of the JWS Payload. 140 Encoded JWS Signature Base64url encoding of the JWS Signature. 142 JWS Signing Input The concatenation of the Encoded JWS Header, a 143 period ('.') character, and the Encoded JWS Payload. 145 Header Parameter Names The names of the members within the JSON 146 object represented in a JWS Header. 148 Header Parameter Values The values of the members within the JSON 149 object represented in a JWS Header. 151 Digital Signature For the purposes of this specification, we use 152 this term to encompass both Hash-based Message Authentication 153 Codes (HMACs), which can provide authenticity but not non- 154 repudiation, and digital signatures using public key algorithms, 155 which can provide both. Readers should be aware of this 156 distinction, despite the decision to use a single term for both 157 concepts to improve readability of the specification. 159 Base64url Encoding For the purposes of this specification, this term 160 always refers to the URL- and filename-safe Base64 encoding 161 described in RFC 4648 [RFC4648], Section 5, with the (non URL- 162 safe) '=' padding characters omitted, as permitted by Section 3.2. 163 (See Appendix C for notes on implementing base64url encoding 164 without padding.) 166 3. JSON Web Signature (JWS) Overview 168 JWS represents signed content using JSON data structures and 169 base64url encoding. The representation consists of three parts: the 170 JWS Header, the JWS Payload, and the JWS Signature. The three parts 171 are base64url-encoded for transmission, and typically represented as 172 the concatenation of the encoded strings in that order, with the 173 three strings being separated by period ('.') characters. 175 The JWS Header describes the signature method and parameters 176 employed. The JWS Payload is the message content to be secured. The 177 JWS Signature ensures the integrity of both the JWS Header and the 178 JWS Payload. 180 3.1. Example JWS 182 The following example JWS Header declares that the encoded object is 183 a JSON Web Token (JWT) [JWT] and the JWS Header and the JWS Payload 184 are signed using the HMAC SHA-256 algorithm: 185 {"typ":"JWT", 186 "alg":"HS256"} 188 Base64url encoding the bytes of the UTF-8 representation of the JWS 189 Header yields this Encoded JWS Header value: 190 eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9 192 The following is an example of a JSON object that can be used as a 193 JWS Payload. (Note that the payload can be any content, and need not 194 be a representation of a JSON object.) 195 {"iss":"joe", 196 "exp":1300819380, 197 "http://example.com/is_root":true} 199 Base64url encoding the bytes of the UTF-8 representation of the JSON 200 object yields the following Encoded JWS Payload (with line breaks for 201 display purposes only): 202 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 203 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 205 Signing the UTF-8 representation of the JWS Signing Input (the 206 concatenation of the Encoded JWS Header, a period ('.') character, 207 and the Encoded JWS Payload) with the HMAC SHA-256 algorithm and 208 base64url encoding the result, as per Section 6.1, yields this 209 Encoded JWS Signature value: 210 dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk 212 Concatenating these parts in the order Header.Payload.Signature with 213 period characters between the parts yields this complete JWS 214 representation (with line breaks for display purposes only): 215 eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9 216 . 217 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 218 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 219 . 220 dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk 222 This computation is illustrated in more detail in Appendix A.1. 224 4. JWS Header 226 The members of the JSON object represented by the JWS Header describe 227 the signature applied to the Encoded JWS Header and the Encoded JWS 228 Payload and optionally additional properties of the JWS. The Header 229 Parameter Names within this object MUST be unique. Implementations 230 MUST understand the entire contents of the header; otherwise, the JWS 231 MUST be rejected for processing. 233 The JWS Header MUST contain an "alg" parameter, the value of which is 234 a string that unambiguously identifies the algorithm used to sign the 235 JWS Header and the JWS Payload to produce the JWS Signature. 237 There are three classes of Header Parameter Names: Reserved Header 238 Parameter Names, Public Header Parameter Names, and Private Header 239 Parameter Names. 241 4.1. Reserved Header Parameter Names 243 The following header parameter names are reserved. All the names are 244 short because a core goal of JWSs is for the representations to be 245 compact. 247 +-----------+--------+-------------+--------------------------------+ 248 | Header | JSON | Header | Header Parameter Semantics | 249 | Parameter | Value | Parameter | | 250 | Name | Type | Syntax | | 251 +-----------+--------+-------------+--------------------------------+ 252 | alg | string | StringOrURI | The "alg" (algorithm) header | 253 | | | | parameter identifies the | 254 | | | | cryptographic algorithm used | 255 | | | | to secure the JWS. A list of | 256 | | | | defined "alg" values is | 257 | | | | presented in Table 3. The | 258 | | | | processing of the "alg" header | 259 | | | | parameter requires that the | 260 | | | | value MUST be one that is both | 261 | | | | supported and for which there | 262 | | | | exists a key for use with that | 263 | | | | algorithm associated with the | 264 | | | | signer of the content. The | 265 | | | | "alg" parameter value is case | 266 | | | | sensitive. This header | 267 | | | | parameter is REQUIRED. | 268 | typ | string | String | The "typ" (type) header | 269 | | | | parameter is used to declare | 270 | | | | the type of the signed | 271 | | | | content. The "typ" value is | 272 | | | | case sensitive. This header | 273 | | | | parameter is OPTIONAL. | 274 | jku | string | URL | The "jku" (JSON Web Key URL) | 275 | | | | header parameter is an | 276 | | | | absolute URL that refers to a | 277 | | | | resource for a set of | 278 | | | | JSON-encoded public keys, one | 279 | | | | of which corresponds to the | 280 | | | | key that was used to sign the | 281 | | | | JWS. The keys MUST be encoded | 282 | | | | as described in the JSON Web | 283 | | | | Key (JWK) [JWK] specification. | 284 | | | | The protocol used to acquire | 285 | | | | the resource MUST provide | 286 | | | | integrity protection. An HTTP | 287 | | | | GET request to retrieve the | 288 | | | | certificate MUST use TLS RFC | 289 | | | | 2818 [RFC2818] RFC 5246 | 290 | | | | [RFC5246] with server | 291 | | | | authentication RFC 6125 | 292 | | | | [RFC6125]. This header | 293 | | | | parameter is OPTIONAL. | 294 | kid | string | String | The "kid" (key ID) header | 295 | | | | parameter is a hint indicating | 296 | | | | which specific key owned by | 297 | | | | the signer should be used to | 298 | | | | validate the signature. This | 299 | | | | allows signers to explicitly | 300 | | | | signal a change of key to | 301 | | | | recipients. The | 302 | | | | interpretation of the contents | 303 | | | | of the "kid" parameter is | 304 | | | | unspecified. This header | 305 | | | | parameter is OPTIONAL. | 306 | x5u | string | URL | The "x5u" (X.509 URL) header | 307 | | | | parameter is an absolute URL | 308 | | | | that refers to a resource for | 309 | | | | the X.509 public key | 310 | | | | certificate or certificate | 311 | | | | chain corresponding to the key | 312 | | | | used to sign the JWS. The | 313 | | | | identified resource MUST | 314 | | | | provide a representation of | 315 | | | | the certificate or certificate | 316 | | | | chain that conforms to RFC | 317 | | | | 5280 [RFC5280] in PEM encoded | 318 | | | | form RFC 1421 [RFC1421]. The | 319 | | | | protocol used to acquire the | 320 | | | | resource MUST provide | 321 | | | | integrity protection. An HTTP | 322 | | | | GET request to retrieve the | 323 | | | | certificate MUST use TLS RFC | 324 | | | | 2818 [RFC2818] RFC 5246 | 325 | | | | [RFC5246] with server | 326 | | | | authentication RFC 6125 | 327 | | | | [RFC6125]. This header | 328 | | | | parameter is OPTIONAL. | 329 | x5t | string | String | The "x5t" (x.509 certificate | 330 | | | | thumbprint) header parameter | 331 | | | | provides a base64url encoded | 332 | | | | SHA-1 thumbprint (a.k.a. | 333 | | | | digest) of the DER encoding of | 334 | | | | an X.509 certificate that can | 335 | | | | be used to match the | 336 | | | | certificate. This header | 337 | | | | parameter is OPTIONAL. | 338 +-----------+--------+-------------+--------------------------------+ 340 Table 1: Reserved Header Parameter Definitions 342 Additional reserved header parameter names MAY be defined via the 343 IANA JSON Web Signature Header Parameters registry, as per Section 7. 344 The syntax values used above are defined as follows: 346 +-------------+-----------------------------------------------------+ 347 | Syntax Name | Syntax Definition | 348 +-------------+-----------------------------------------------------+ 349 | IntDate | The number of seconds from 1970-01-01T0:0:0Z as | 350 | | measured in UTC until the desired date/time. See | 351 | | RFC 3339 [RFC3339] for details regarding date/times | 352 | | in general and UTC in particular. | 353 | String | Any string value MAY be used. | 354 | StringOrURI | Any string value MAY be used but a value containing | 355 | | a ":" character MUST be a URI as defined in RFC | 356 | | 3986 [RFC3986]. | 357 | URL | A URL as defined in RFC 1738 [RFC1738]. | 358 +-------------+-----------------------------------------------------+ 360 Table 2: Header Parameter Syntax Definitions 362 4.2. Public Header Parameter Names 364 Additional header parameter names can be defined by those using JWSs. 365 However, in order to prevent collisions, any new header parameter 366 name or algorithm value SHOULD either be defined in the IANA JSON Web 367 Signature Header Parameters registry or be defined as a URI that 368 contains a collision resistant namespace. In each case, the definer 369 of the name or value needs to take reasonable precautions to make 370 sure they are in control of the part of the namespace they use to 371 define the header parameter name. 373 New header parameters should be introduced sparingly, as they can 374 result in non-interoperable JWSs. 376 4.3. Private Header Parameter Names 378 A producer and consumer of a JWS may agree to any header parameter 379 name that is not a Reserved Name Section 4.1 or a Public Name 380 Section 4.2. Unlike Public Names, these private names are subject to 381 collision and should be used with caution. 383 New header parameters should be introduced sparingly, as they can 384 result in non-interoperable JWSs. 386 5. Rules for Creating and Validating a JWS 388 To create a JWS, one MUST perform these steps: 390 1. Create the content to be used as the JWS Payload. 392 2. Base64url encode the bytes of the JWS Payload. This encoding 393 becomes the Encoded JWS Payload. 395 3. Create a JWS Header containing the desired set of header 396 parameters. Note that white space is explicitly allowed in the 397 representation and no canonicalization is performed before 398 encoding. 400 4. Base64url encode the bytes of the UTF-8 representation of the JWS 401 Header to create the Encoded JWS Header. 403 5. Compute the JWS Signature in the manner defined for the 404 particular algorithm being used. The JWS Signing Input is always 405 the concatenation of the Encoded JWS Header, a period ('.') 406 character, and the Encoded JWS Payload. The "alg" header 407 parameter MUST be present in the JSON Header, with the algorithm 408 value accurately representing the algorithm used to construct the 409 JWS Signature. 411 6. Base64url encode the representation of the JWS Signature to 412 create the Encoded JWS Signature. 414 When validating a JWS, the following steps MUST be taken. If any of 415 the listed steps fails, then the signed content MUST be rejected. 417 1. The Encoded JWS Header MUST be successfully base64url decoded 418 following the restriction given in this specification that no 419 padding characters have been used. 421 2. The JWS Header MUST be completely valid JSON syntax conforming to 422 RFC 4627 [RFC4627]. 424 3. The JWS Header MUST be validated to only include parameters and 425 values whose syntax and semantics are both understood and 426 supported. 428 4. The Encoded JWS Payload MUST be successfully base64url decoded 429 following the restriction given in this specification that no 430 padding characters have been used. 432 5. The Encoded JWS Signature MUST be successfully base64url decoded 433 following the restriction given in this specification that no 434 padding characters have been used. 436 6. The JWS Signature MUST be successfully validated against the JWS 437 Header and JWS Payload in the manner defined for the algorithm 438 being used, which MUST be accurately represented by the value of 439 the "alg" header parameter, which MUST be present. 441 Processing a JWS inevitably requires comparing known strings to 442 values in the header. For example, in checking what the algorithm 443 is, the Unicode string encoding "alg" will be checked against the 444 member names in the JWS Header to see if there is a matching header 445 parameter name. A similar process occurs when determining if the 446 value of the "alg" header parameter represents a supported algorithm. 448 Comparisons between JSON strings and other Unicode strings MUST be 449 performed as specified below: 451 1. Remove any JSON applied escaping to produce an array of Unicode 452 code points. 454 2. Unicode Normalization [USA15] MUST NOT be applied at any point to 455 either the JSON string or to the string it is to be compared 456 against. 458 3. Comparisons between the two strings MUST be performed as a 459 Unicode code point to code point equality comparison. 461 6. Signing JWSs with Cryptographic Algorithms 463 JWSs use specific cryptographic algorithms to sign the contents of 464 the JWS Header and the JWS Payload. The use of the following 465 algorithms for producing JWSs is defined in this section. The table 466 below is the list of "alg" header parameter values defined by this 467 specification, each of which is explained in more detail in the 468 following sections: 470 +--------------------+----------------------------------------------+ 471 | Alg Parameter | Algorithm | 472 | Value | | 473 +--------------------+----------------------------------------------+ 474 | HS256 | HMAC using SHA-256 hash algorithm | 475 | HS384 | HMAC using SHA-384 hash algorithm | 476 | HS512 | HMAC using SHA-512 hash algorithm | 477 | RS256 | RSA using SHA-256 hash algorithm | 478 | RS384 | RSA using SHA-384 hash algorithm | 479 | RS512 | RSA using SHA-512 hash algorithm | 480 | ES256 | ECDSA using P-256 curve and SHA-256 hash | 481 | | algorithm | 482 | ES384 | ECDSA using P-384 curve and SHA-384 hash | 483 | | algorithm | 484 | ES512 | ECDSA using P-521 curve and SHA-512 hash | 485 | | algorithm | 486 +--------------------+----------------------------------------------+ 488 Table 3: JWS Defined "alg" Parameter Values 490 See Appendix B for a table cross-referencing the "alg" values used in 491 this specification with the equivalent identifiers used by other 492 standards and software packages. 494 Of these algorithms, only HMAC SHA-256 MUST be implemented by 495 conforming implementations. It is RECOMMENDED that implementations 496 also support the RSA SHA-256 and ECDSA P-256 SHA-256 algorithms. 497 Support for other algorithms and key sizes is OPTIONAL. 499 The signed content for a JWS is the same for all algorithms: the 500 concatenation of the Encoded JWS Header, a period ('.') character, 501 and the Encoded JWS Payload. This character sequence is referred to 502 as the JWS Signing Input. Note that if the JWS represents a JWT, 503 this corresponds to the portion of the JWT representation preceding 504 the second period character. The UTF-8 representation of the JWS 505 Signing Input is passed to the respective signing algorithms. 507 6.1. Creating a JWS with HMAC SHA-256, HMAC SHA-384, or HMAC SHA-512 509 Hash based Message Authentication Codes (HMACs) enable one to use a 510 secret plus a cryptographic hash function to generate a Message 511 Authentication Code (MAC). This can be used to demonstrate that the 512 MAC matches the hashed content, in this case the JWS Signing Input, 513 which therefore demonstrates that whoever generated the MAC was in 514 possession of the secret. The means of exchanging the shared key is 515 outside the scope of this specification. 517 The algorithm for implementing and validating HMACs is provided in 518 RFC 2104 [RFC2104]. This section defines the use of the HMAC SHA- 519 256, HMAC SHA-384, and HMAC SHA-512 cryptographic hash functions as 520 defined in FIPS 180-3 [FIPS.180-3]. The "alg" header parameter 521 values "HS256", "HS384", and "HS512" are used in the JWS Header to 522 indicate that the Encoded JWS Signature contains a base64url encoded 523 HMAC value using the respective hash function. 525 The HMAC SHA-256 MAC is generated as follows: 527 1. Apply the HMAC SHA-256 algorithm to the UTF-8 representation of 528 the JWS Signing Input using the shared key to produce an HMAC 529 value. 531 2. Base64url encode the resulting HMAC value. 533 The output is the Encoded JWS Signature for that JWS. 535 The HMAC SHA-256 MAC for a JWS is validated as follows: 537 1. Apply the HMAC SHA-256 algorithm to the UTF-8 representation of 538 the JWS Signing Input of the JWS using the shared key. 540 2. Base64url encode the resulting HMAC value. 542 3. If the JWS Signature and the base64url encoded HMAC value exactly 543 match, then one has confirmation that the shared key was used to 544 generate the HMAC on the JWS and that the contents of the JWS 545 have not be tampered with. 547 4. If the validation fails, the signed content MUST be rejected. 549 Signing with the HMAC SHA-384 and HMAC SHA-512 algorithms is 550 performed identically to the procedure for HMAC SHA-256 - just with 551 correspondingly longer key and result values. 553 6.2. Creating a JWS with RSA SHA-256, RSA SHA-384, or RSA SHA-512 555 This section defines the use of the RSASSA-PKCS1-v1_5 signature 556 algorithm as defined in RFC 3447 [RFC3447], Section 8.2 (commonly 557 known as PKCS#1), using SHA-256, SHA-384, or SHA-512 as the hash 558 function. The RSASSA-PKCS1-v1_5 algorithm is described in FIPS 186-3 559 [FIPS.186-3], Section 5.5, and the SHA-256, SHA-384, and SHA-512 560 cryptographic hash functions are defined in FIPS 180-3 [FIPS.180-3]. 561 The "alg" header parameter values "RS256", "RS384", and "RS512" are 562 used in the JWS Header to indicate that the Encoded JWS Signature 563 contains a base64url encoded RSA signature using the respective hash 564 function. 566 The public keys employed can be identified using Header Parameter 567 methods described in Section 4.1 or can be distributed using methods 568 that are outside the scope of this specification. 570 A 2048-bit or longer key length MUST be used with this algorithm. 572 The RSA SHA-256 signature is generated as follows: 574 1. Generate a digital signature of the UTF-8 representation of the 575 JWS Signing Input using RSASSA-PKCS1-V1_5-SIGN and the SHA-256 576 hash function with the desired private key. The output will be a 577 byte array. 579 2. Base64url encode the resulting byte array. 581 The output is the Encoded JWS Signature for that JWS. 583 The RSA SHA-256 signature for a JWS is validated as follows: 585 1. Take the Encoded JWS Signature and base64url decode it into a 586 byte array. If decoding fails, the signed content MUST be 587 rejected. 589 2. Submit the UTF-8 representation of the JWS Signing Input and the 590 public key corresponding to the private key used by the signer to 591 the RSASSA-PKCS1-V1_5-VERIFY algorithm using SHA-256 as the hash 592 function. 594 3. If the validation fails, the signed content MUST be rejected. 596 Signing with the RSA SHA-384 and RSA SHA-512 algorithms is performed 597 identically to the procedure for RSA SHA-256 - just with 598 correspondingly longer key and result values. 600 6.3. Creating a JWS with ECDSA P-256 SHA-256, ECDSA P-384 SHA-384, or 601 ECDSA P-521 SHA-512 603 The Elliptic Curve Digital Signature Algorithm (ECDSA) is defined by 604 FIPS 186-3 [FIPS.186-3]. ECDSA provides for the use of Elliptic 605 Curve cryptography, which is able to provide equivalent security to 606 RSA cryptography but using shorter key lengths and with greater 607 processing speed. This means that ECDSA signatures will be 608 substantially smaller in terms of length than equivalently strong RSA 609 Digital Signatures. 611 This specification defines the use of ECDSA with the P-256 curve and 612 the SHA-256 cryptographic hash function, ECDSA with the P-384 curve 613 and the SHA-384 hash function, and ECDSA with the P-521 curve and the 614 SHA-512 hash function. The P-256, P-384, and P-521 curves are also 615 defined in FIPS 186-3. The "alg" header parameter values "ES256", 616 "ES384", and "ES512" are used in the JWS Header to indicate that the 617 Encoded JWS Signature contains a base64url encoded ECDSA P-256 SHA- 618 256, ECDSA P-384 SHA-384, or ECDSA P-521 SHA-512 signature, 619 respectively. 621 The public keys employed can be identified using Header Parameter 622 methods described in Section 4.1 or can be distributed using methods 623 that are outside the scope of this specification. 625 A JWS is signed with an ECDSA P-256 SHA-256 signature as follows: 627 1. Generate a digital signature of the UTF-8 representation of the 628 JWS Signing Input using ECDSA P-256 SHA-256 with the desired 629 private key. The output will be the EC point (R, S), where R and 630 S are unsigned integers. 632 2. Turn R and S into byte arrays in big endian order. Each array 633 will be 32 bytes long. 635 3. Concatenate the two byte arrays in the order R and then S. 637 4. Base64url encode the resulting 64 byte array. 639 The output is the Encoded JWS Signature for the JWS. 641 The ECDSA P-256 SHA-256 signature for a JWS is validated as follows: 643 1. Take the Encoded JWS Signature and base64url decode it into a 644 byte array. If decoding fails, the signed content MUST be 645 rejected. 647 2. The output of the base64url decoding MUST be a 64 byte array. 649 3. Split the 64 byte array into two 32 byte arrays. The first array 650 will be R and the second S. Remember that the byte arrays are in 651 big endian byte order; please check the ECDSA validator in use to 652 see what byte order it requires. 654 4. Submit the UTF-8 representation of the JWS Signing Input, R, S 655 and the public key (x, y) to the ECDSA P-256 SHA-256 validator. 657 5. If the validation fails, the signed content MUST be rejected. 659 The ECDSA validator will then determine if the digital signature is 660 valid, given the inputs. Note that ECDSA digital signature contains 661 a value referred to as K, which is a random number generated for each 662 digital signature instance. This means that two ECDSA digital 663 signatures using exactly the same input parameters will output 664 different signatures because their K values will be different. The 665 consequence of this is that one must validate an ECDSA signature by 666 submitting the previously specified inputs to an ECDSA validator. 668 Signing with the ECDSA P-384 SHA-384 and ECDSA P-521 SHA-512 669 algorithms is performed identically to the procedure for ECDSA P-256 670 SHA-256 - just with correspondingly longer key and result values. 672 6.4. Additional Algorithms 674 Additional algorithms MAY be used to protect JWSs with corresponding 675 "alg" header parameter values being defined to refer to them. New 676 "alg" header parameter values SHOULD either be defined in the IANA 677 JSON Web Signature Algorithms registry or be a URI that contains a 678 collision resistant namespace. In particular, it is permissible to 679 use the algorithm identifiers defined in XML DSIG [RFC3275] and 680 related specifications as "alg" values. 682 7. IANA Considerations 684 This specification calls for: 686 o A new IANA registry entitled "JSON Web Signature Header 687 Parameters" for reserved header parameter names is defined in 688 Section 4.1. Inclusion in the registry is RFC Required in the RFC 689 5226 [RFC5226] sense for reserved JWS header parameter names that 690 are intended to be interoperable between implementations. The 691 registry will just record the reserved header parameter name and a 692 pointer to the RFC that defines it. This specification defines 693 inclusion of the header parameter names defined in Table 1. 695 o A new IANA registry entitled "JSON Web Signature Algorithms" for 696 values of the "alg" header parameter is defined in Section 6.4. 697 Inclusion in the registry is RFC Required in the RFC 5226 698 [RFC5226] sense. The registry will just record the "alg" value 699 and a pointer to the RFC that defines it. This specification 700 defines inclusion of the algorithm values defined in Table 3. 702 8. Security Considerations 704 TBD: Lots of work to do here. We need to remember to look into any 705 issues relating to security and JSON parsing. One wonders just how 706 secure most JSON parsing libraries are. Were they ever hardened for 707 security scenarios? If not, what kind of holes does that open up? 708 Also, we need to walk through the JSON standard and see what kind of 709 issues we have especially around comparison of names. For instance, 710 comparisons of header parameter names and other parameters must occur 711 after they are unescaped. Need to also put in text about: Importance 712 of keeping secrets secret. Rotating keys. Strengths and weaknesses 713 of the different algorithms. 715 TBD: Need to put in text about why strict JSON validation is 716 necessary. Basically, that if malformed JSON is received then the 717 intent of the sender is impossible to reliably discern. One example 718 of malformed JSON that MUST be rejected is an object in which the 719 same member name occurs multiple times. 721 TBD: Write security considerations about the implications of using a 722 SHA-1 hash (for compatibility reasons) for the "x5t" (x.509 723 certificate thumbprint). 725 When utilizing TLS to retrieve information, the authority providing 726 the resource MUST be authenticated and the information retrieved MUST 727 be free from modification. 729 8.1. Unicode Comparison Security Issues 731 Header parameter names in JWSs are Unicode strings. For security 732 reasons, the representations of these names must be compared verbatim 733 after performing any escape processing (as per RFC 4627 [RFC4627], 734 Section 2.5). 736 This means, for instance, that these JSON strings must compare as 737 being equal ("sig", "\u0073ig"), whereas these must all compare as 738 being not equal to the first set or to each other ("SIG", "Sig", 739 "si\u0047"). 741 JSON strings MAY contain characters outside the Unicode Basic 742 Multilingual Plane. For instance, the G clef character (U+1D11E) may 743 be represented in a JSON string as "\uD834\uDD1E". Ideally, JWS 744 implementations SHOULD ensure that characters outside the Basic 745 Multilingual Plane are preserved and compared correctly; 746 alternatively, if this is not possible due to these characters 747 exercising limitations present in the underlying JSON implementation, 748 then input containing them MUST be rejected. 750 9. Open Issues and Things To Be Done (TBD) 752 The following items remain to be done in this draft: 754 o Consider whether there is a better term than "Digital Signature" 755 for the concept that includes both HMACs and digital signatures 756 using public keys. 758 o Clarify the optional ability to provide type information in the 759 JWS header. Specifically, clarify the intended use of the "typ" 760 Header Parameter, whether it conveys syntax or semantics, and 761 indeed, whether this is the right approach. Also clarify the 762 relationship between these type values and MIME [RFC2045] types. 764 o Clarify the semantics of the "kid" (key ID) header parameter. 765 Open issues include: What happens if a "kid" header is received 766 with an unrecognized value? Is that an error? Should it be 767 treated as if it's empty? What happens if the header has a 768 recognized value but the value doesn't match the key associated 769 with that value, but it does match another key that is associated 770 with the issuer? Is that an error? 772 o Consider whether a key type parameter should also be introduced. 774 o Since RFC 3447 Section 8 explicitly calls for people NOT to adopt 775 RSASSA-PKCS1 for new applications and instead requests that people 776 transition to RSASSA-PSS, we probably need some Security 777 Considerations text explaining why RSASSA-PKCS1 is being used 778 (it's what's commonly implemented) and what the potential 779 consequences are. 781 o Add Security Considerations text on timing attacks. 783 o It would be good to have a confirmation method element so it could 784 be used with holder-of-key. 786 o Consider whether to add parameters for directly including keys in 787 the header, either as JWK Key Objects, or X.509 cert values, or 788 both. 790 o Consider whether to add version numbers. 792 o Think about how to best describe the concept currently described 793 as "the bytes of the UTF-8 representation of". Possible terms to 794 use instead of "bytes of" include "byte sequence", "octet series", 795 and "octet sequence". Also consider whether we want to add an 796 overall clarifying statement somewhere in each spec something like 797 "every place we say 'the UTF-8 representation of X', we mean 'the 798 bytes of the UTF-8 representation of X'". That would potentially 799 allow us to omit the "the bytes of" part everywhere else. 801 o Finish the Security Considerations section. 803 o Add an example in which the payload is not a base64url encoded 804 JSON object. 806 o Consider having an algorithm that is a MAC using SHA-256 that 807 provides content integrity but for which there is no associated 808 secret. This would be like the JWT "alg":"none", in that no 809 validation of the authenticity content is performed but a checksum 810 is provided. 812 o Consider whether to define "alg":"none" here, rather than in the 813 JWT spec. 815 10. References 817 10.1. Normative References 819 [FIPS.180-3] 820 National Institute of Standards and Technology, "Secure 821 Hash Standard (SHS)", FIPS PUB 180-3, October 2008. 823 [FIPS.186-3] 824 National Institute of Standards and Technology, "Digital 825 Signature Standard (DSS)", FIPS PUB 186-3, June 2009. 827 [JWK] Jones, M., "JSON Web Key (JWK)", December 2011. 829 [RFC1421] Linn, J., "Privacy Enhancement for Internet Electronic 830 Mail: Part I: Message Encryption and Authentication 831 Procedures", RFC 1421, February 1993. 833 [RFC1738] Berners-Lee, T., Masinter, L., and M. McCahill, "Uniform 834 Resource Locators (URL)", RFC 1738, December 1994. 836 [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 837 Extensions (MIME) Part One: Format of Internet Message 838 Bodies", RFC 2045, November 1996. 840 [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 841 Hashing for Message Authentication", RFC 2104, 842 February 1997. 844 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 845 Requirement Levels", BCP 14, RFC 2119, March 1997. 847 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 849 [RFC3339] Klyne, G., Ed. and C. Newman, "Date and Time on the 850 Internet: Timestamps", RFC 3339, July 2002. 852 [RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography 853 Standards (PKCS) #1: RSA Cryptography Specifications 854 Version 2.1", RFC 3447, February 2003. 856 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 857 10646", STD 63, RFC 3629, November 2003. 859 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 860 Resource Identifier (URI): Generic Syntax", STD 66, 861 RFC 3986, January 2005. 863 [RFC4627] Crockford, D., "The application/json Media Type for 864 JavaScript Object Notation (JSON)", RFC 4627, July 2006. 866 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 867 Encodings", RFC 4648, October 2006. 869 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 870 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 871 May 2008. 873 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 874 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 876 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 877 Housley, R., and W. Polk, "Internet X.509 Public Key 878 Infrastructure Certificate and Certificate Revocation List 879 (CRL) Profile", RFC 5280, May 2008. 881 [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and 882 Verification of Domain-Based Application Service Identity 883 within Internet Public Key Infrastructure Using X.509 884 (PKIX) Certificates in the Context of Transport Layer 885 Security (TLS)", RFC 6125, March 2011. 887 [USA15] Davis, M., Whistler, K., and M. Duerst, "Unicode 888 Normalization Forms", Unicode Standard Annex 15, 09 2009. 890 10.2. Informative References 892 [CanvasApp] 893 Facebook, "Canvas Applications", 2010. 895 [JCA] Oracle, "Java Cryptography Architecture", 2011. 897 [JSS] Bradley, J. and N. Sakimura (editor), "JSON Simple Sign", 898 September 2010. 900 [JWE] Jones, M., Rescorla, E., and J. Hildebrand, "JSON Web 901 Encryption (JWE)", December 2011. 903 [JWT] Jones, M., Balfanz, D., Bradley, J., Goland, Y., Panzer, 904 J., Sakimura, N., and P. Tarjan, "JSON Web Token (JWT)", 905 December 2011. 907 [MagicSignatures] 908 Panzer (editor), J., Laurie, B., and D. Balfanz, "Magic 909 Signatures", August 2010. 911 [RFC3275] Eastlake, D., Reagle, J., and D. Solo, "(Extensible Markup 912 Language) XML-Signature Syntax and Processing", RFC 3275, 913 March 2002. 915 Appendix A. JWS Examples 917 This section provides several examples of JWSs. While these examples 918 all represent JSON Web Tokens (JWTs) [JWT], the payload can be any 919 base64url encoded content. 921 A.1. JWS using HMAC SHA-256 923 A.1.1. Encoding 925 The following example JWS Header declares that the data structure is 926 a JSON Web Token (JWT) [JWT] and the JWS Signing Input is signed 927 using the HMAC SHA-256 algorithm. Note that white space is 928 explicitly allowed in JWS Header strings and no canonicalization is 929 performed before encoding. 930 {"typ":"JWT", 931 "alg":"HS256"} 933 The following byte array contains the UTF-8 characters for the JWS 934 Header: 936 [123, 34, 116, 121, 112, 34, 58, 34, 74, 87, 84, 34, 44, 13, 10, 32, 937 34, 97, 108, 103, 34, 58, 34, 72, 83, 50, 53, 54, 34, 125] 939 Base64url encoding this UTF-8 representation yields this Encoded JWS 940 Header value: 941 eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9 943 The JWS Payload used in this example follows. (Note that the payload 944 can be any base64url encoded content, and need not be a base64url 945 encoded JSON object.) 946 {"iss":"joe", 947 "exp":1300819380, 948 "http://example.com/is_root":true} 950 The following byte array contains the UTF-8 characters for the JWS 951 Payload: 953 [123, 34, 105, 115, 115, 34, 58, 34, 106, 111, 101, 34, 44, 13, 10, 954 32, 34, 101, 120, 112, 34, 58, 49, 51, 48, 48, 56, 49, 57, 51, 56, 955 48, 44, 13, 10, 32, 34, 104, 116, 116, 112, 58, 47, 47, 101, 120, 97, 956 109, 112, 108, 101, 46, 99, 111, 109, 47, 105, 115, 95, 114, 111, 957 111, 116, 34, 58, 116, 114, 117, 101, 125] 959 Base64url encoding the above yields the Encoded JWS Payload value 960 (with line breaks for display purposes only): 961 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 962 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 964 Concatenating the Encoded JWS Header, a period character, and the 965 Encoded JWS Payload yields this JWS Signing Input value (with line 966 breaks for display purposes only): 967 eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9 968 . 969 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 970 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 972 The UTF-8 representation of the JWS Signing Input is the following 973 byte array: 975 [101, 121, 74, 48, 101, 88, 65, 105, 79, 105, 74, 75, 86, 49, 81, 976 105, 76, 65, 48, 75, 73, 67, 74, 104, 98, 71, 99, 105, 79, 105, 74, 977 73, 85, 122, 73, 49, 78, 105, 74, 57, 46, 101, 121, 74, 112, 99, 51, 978 77, 105, 79, 105, 74, 113, 98, 50, 85, 105, 76, 65, 48, 75, 73, 67, 979 74, 108, 101, 72, 65, 105, 79, 106, 69, 122, 77, 68, 65, 52, 77, 84, 980 107, 122, 79, 68, 65, 115, 68, 81, 111, 103, 73, 109, 104, 48, 100, 981 72, 65, 54, 76, 121, 57, 108, 101, 71, 70, 116, 99, 71, 120, 108, 76, 982 109, 78, 118, 98, 83, 57, 112, 99, 49, 57, 121, 98, 50, 57, 48, 73, 983 106, 112, 48, 99, 110, 86, 108, 102, 81] 985 HMACs are generated using keys. This example uses the key 986 represented by the following byte array: 988 [3, 35, 53, 75, 43, 15, 165, 188, 131, 126, 6, 101, 119, 123, 166, 989 143, 90, 179, 40, 230, 240, 84, 201, 40, 169, 15, 132, 178, 210, 80, 990 46, 191, 211, 251, 90, 146, 210, 6, 71, 239, 150, 138, 180, 195, 119, 991 98, 61, 34, 61, 46, 33, 114, 5, 46, 79, 8, 192, 205, 154, 245, 103, 992 208, 128, 163] 994 Running the HMAC SHA-256 algorithm on the UTF-8 representation of the 995 JWS Signing Input with this key yields the following byte array: 997 [116, 24, 223, 180, 151, 153, 224, 37, 79, 250, 96, 125, 216, 173, 998 187, 186, 22, 212, 37, 77, 105, 214, 191, 240, 91, 88, 5, 88, 83, 999 132, 141, 121] 1001 Base64url encoding the above HMAC output yields the Encoded JWS 1002 Signature value: 1003 dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk 1005 A.1.2. Decoding 1007 Decoding the JWS first requires removing the base64url encoding from 1008 the Encoded JWS Header, the Encoded JWS Payload, and the Encoded JWS 1009 Signature. We base64url decode the inputs and turn them into the 1010 corresponding byte arrays. We translate the header input byte array 1011 containing UTF-8 encoded characters into the JWS Header string. 1013 A.1.3. Validating 1015 Next we validate the decoded results. Since the "alg" parameter in 1016 the header is "HS256", we validate the HMAC SHA-256 signature 1017 contained in the JWS Signature. If any of the validation steps fail, 1018 the signed content MUST be rejected. 1020 First, we validate that the JWS Header string is legal JSON. 1022 To validate the signature, we repeat the previous process of using 1023 the correct key and the UTF-8 representation of the JWS Signing Input 1024 as input to a SHA-256 HMAC function and then taking the output and 1025 determining if it matches the JWS Signature. If it matches exactly, 1026 the signature has been validated. 1028 A.2. JWS using RSA SHA-256 1030 A.2.1. Encoding 1032 The JWS Header in this example is different from the previous example 1033 in two ways: First, because a different algorithm is being used, the 1034 "alg" value is different. Second, for illustration purposes only, 1035 the optional "typ" parameter is not used. (This difference is not 1036 related to the signature algorithm employed.) The JWS Header used 1037 is: 1038 {"alg":"RS256"} 1040 The following byte array contains the UTF-8 characters for the JWS 1041 Header: 1043 [123, 34, 97, 108, 103, 34, 58, 34, 82, 83, 50, 53, 54, 34, 125] 1045 Base64url encoding this UTF-8 representation yields this Encoded JWS 1046 Header value: 1047 eyJhbGciOiJSUzI1NiJ9 1049 The JWS Payload used in this example, which follows, is the same as 1050 in the previous example. Since the Encoded JWS Payload will 1051 therefore be the same, its computation is not repeated here. 1052 {"iss":"joe", 1053 "exp":1300819380, 1054 "http://example.com/is_root":true} 1056 Concatenating the Encoded JWS Header, a period character, and the 1057 Encoded JWS Payload yields this JWS Signing Input value (with line 1058 breaks for display purposes only): 1059 eyJhbGciOiJSUzI1NiJ9 1060 . 1061 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 1062 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 1064 The UTF-8 representation of the JWS Signing Input is the following 1065 byte array: 1067 [101, 121, 74, 104, 98, 71, 99, 105, 79, 105, 74, 83, 85, 122, 73, 1068 49, 78, 105, 74, 57, 46, 101, 121, 74, 112, 99, 51, 77, 105, 79, 105, 1069 74, 113, 98, 50, 85, 105, 76, 65, 48, 75, 73, 67, 74, 108, 101, 72, 1070 65, 105, 79, 106, 69, 122, 77, 68, 65, 52, 77, 84, 107, 122, 79, 68, 1071 65, 115, 68, 81, 111, 103, 73, 109, 104, 48, 100, 72, 65, 54, 76, 1072 121, 57, 108, 101, 71, 70, 116, 99, 71, 120, 108, 76, 109, 78, 118, 1073 98, 83, 57, 112, 99, 49, 57, 121, 98, 50, 57, 48, 73, 106, 112, 48, 1074 99, 110, 86, 108, 102, 81] 1076 The RSA key consists of a public part (n, e), and a private exponent 1077 d. The values of the RSA key used in this example, presented as the 1078 byte arrays representing big endian integers are: 1080 +-----------+-------------------------------------------------------+ 1081 | Parameter | Value | 1082 | Name | | 1083 +-----------+-------------------------------------------------------+ 1084 | n | [161, 248, 22, 10, 226, 227, 201, 180, 101, 206, 141, | 1085 | | 45, 101, 98, 99, 54, 43, 146, 125, 190, 41, 225, 240, | 1086 | | 36, 119, 252, 22, 37, 204, 144, 161, 54, 227, 139, | 1087 | | 217, 52, 151, 197, 182, 234, 99, 221, 119, 17, 230, | 1088 | | 124, 116, 41, 249, 86, 176, 251, 138, 143, 8, 154, | 1089 | | 220, 75, 105, 137, 60, 193, 51, 63, 83, 237, 208, 25, | 1090 | | 184, 119, 132, 37, 47, 236, 145, 79, 228, 133, 119, | 1091 | | 105, 89, 75, 234, 66, 128, 211, 44, 15, 85, 191, 98, | 1092 | | 148, 79, 19, 3, 150, 188, 110, 155, 223, 110, 189, | 1093 | | 210, 189, 163, 103, 142, 236, 160, 198, 104, 247, 1, | 1094 | | 179, 141, 191, 251, 56, 200, 52, 44, 226, 254, 109, | 1095 | | 39, 250, 222, 74, 90, 72, 116, 151, 157, 212, 185, | 1096 | | 207, 154, 222, 196, 199, 91, 5, 133, 44, 44, 15, 94, | 1097 | | 248, 165, 193, 117, 3, 146, 249, 68, 232, 237, 100, | 1098 | | 193, 16, 198, 182, 71, 96, 154, 164, 120, 58, 235, | 1099 | | 156, 108, 154, 215, 85, 49, 48, 80, 99, 139, 131, | 1100 | | 102, 92, 111, 111, 122, 130, 163, 150, 112, 42, 31, | 1101 | | 100, 27, 130, 211, 235, 242, 57, 34, 25, 73, 31, 182, | 1102 | | 134, 135, 44, 87, 22, 245, 10, 248, 53, 141, 154, | 1103 | | 139, 157, 23, 195, 64, 114, 143, 127, 135, 216, 154, | 1104 | | 24, 216, 252, 171, 103, 173, 132, 89, 12, 46, 207, | 1105 | | 117, 147, 57, 54, 60, 7, 3, 77, 111, 96, 111, 158, | 1106 | | 33, 224, 84, 86, 202, 229, 233, 161] | 1107 | e | [1, 0, 1] | 1108 | d | [18, 174, 113, 164, 105, 205, 10, 43, 195, 126, 82, | 1109 | | 108, 69, 0, 87, 31, 29, 97, 117, 29, 100, 233, 73, | 1110 | | 112, 123, 98, 89, 15, 157, 11, 165, 124, 150, 60, 64, | 1111 | | 30, 63, 207, 47, 44, 211, 189, 236, 136, 229, 3, 191, | 1112 | | 198, 67, 155, 11, 40, 200, 47, 125, 55, 151, 103, 31, | 1113 | | 82, 19, 238, 216, 193, 90, 37, 216, 213, 206, 160, 2, | 1114 | | 94, 227, 171, 46, 139, 127, 121, 33, 111, 198, 59, | 1115 | | 234, 86, 39, 83, 180, 6, 68, 198, 161, 81, 39, 217, | 1116 | | 178, 149, 69, 64, 160, 187, 225, 163, 5, 86, 152, 45, | 1117 | | 78, 159, 222, 95, 100, 37, 241, 77, 75, 113, 52, 65, | 1118 | | 181, 93, 199, 59, 155, 74, 237, 204, 146, 172, 227, | 1119 | | 146, 126, 55, 245, 125, 12, 253, 94, 117, 129, 250, | 1120 | | 81, 44, 143, 73, 97, 169, 235, 11, 128, 248, 168, 7, | 1121 | | 70, 114, 138, 85, 255, 70, 71, 31, 52, 37, 6, 59, | 1122 | | 157, 83, 100, 47, 94, 222, 30, 132, 214, 19, 8, 26, | 1123 | | 250, 92, 34, 208, 81, 40, 91, 214, 59, 148, 59, 86, | 1124 | | 93, 137, 138, 5, 104, 84, 19, 229, 60, 60, 108, 101, | 1125 | | 37, 255, 31, 227, 78, 61, 220, 112, 240, 213, 100, | 1126 | | 80, 253, 164, 139, 161, 46, 16, 78, 157, 235, 159, | 1127 | | 184, 24, 129, 225, 196, 189, 242, 93, 146, 71, 244, | 1128 | | 80, 200, 101, 146, 121, 104, 231, 115, 52, 244, 65, | 1129 | | 79, 117, 167, 80, 225, 57, 84, 110, 58, 138, 115, | 1130 | | 157] | 1131 +-----------+-------------------------------------------------------+ 1133 The RSA private key (n, d) is then passed to the RSA signing 1134 function, which also takes the hash type, SHA-256, and the UTF-8 1135 representation of the JWS Signing Input as inputs. The result of the 1136 signature is a byte array S, which represents a big endian integer. 1137 In this example, S is: 1139 +--------+----------------------------------------------------------+ 1140 | Result | Value | 1141 | Name | | 1142 +--------+----------------------------------------------------------+ 1143 | S | [112, 46, 33, 137, 67, 232, 143, 209, 30, 181, 216, 45, | 1144 | | 191, 120, 69, 243, 65, 6, 174, 27, 129, 255, 247, 115, | 1145 | | 17, 22, 173, 209, 113, 125, 131, 101, 109, 66, 10, 253, | 1146 | | 60, 150, 238, 221, 115, 162, 102, 62, 81, 102, 104, 123, | 1147 | | 0, 11, 135, 34, 110, 1, 135, 237, 16, 115, 249, 69, 229, | 1148 | | 130, 173, 252, 239, 22, 216, 90, 121, 142, 232, 198, | 1149 | | 109, 219, 61, 184, 151, 91, 23, 208, 148, 2, 190, 237, | 1150 | | 213, 217, 217, 112, 7, 16, 141, 178, 129, 96, 213, 248, | 1151 | | 4, 12, 167, 68, 87, 98, 184, 31, 190, 127, 249, 217, 46, | 1152 | | 10, 231, 111, 36, 242, 91, 51, 187, 230, 244, 74, 230, | 1153 | | 30, 177, 4, 10, 203, 32, 4, 77, 62, 249, 18, 142, 212, | 1154 | | 1, 48, 121, 91, 212, 189, 59, 65, 238, 202, 208, 102, | 1155 | | 171, 101, 25, 129, 253, 228, 141, 247, 127, 55, 45, 195, | 1156 | | 139, 159, 175, 221, 59, 239, 177, 139, 93, 163, 204, 60, | 1157 | | 46, 176, 47, 158, 58, 65, 214, 18, 202, 173, 21, 145, | 1158 | | 18, 115, 160, 95, 35, 185, 232, 56, 250, 175, 132, 157, | 1159 | | 105, 132, 41, 239, 90, 30, 136, 121, 130, 54, 195, 212, | 1160 | | 14, 96, 69, 34, 165, 68, 200, 242, 122, 122, 45, 184, 6, | 1161 | | 99, 209, 108, 247, 202, 234, 86, 222, 64, 92, 178, 33, | 1162 | | 90, 69, 178, 194, 85, 102, 181, 90, 193, 167, 72, 160, | 1163 | | 112, 223, 200, 163, 42, 70, 149, 67, 208, 25, 238, 251, | 1164 | | 71] | 1165 +--------+----------------------------------------------------------+ 1167 Base64url encoding the signature produces this value for the Encoded 1168 JWS Signature (with line breaks for display purposes only): 1169 cC4hiUPoj9Eetdgtv3hF80EGrhuB__dzERat0XF9g2VtQgr9PJbu3XOiZj5RZmh7 1170 AAuHIm4Bh-0Qc_lF5YKt_O8W2Fp5jujGbds9uJdbF9CUAr7t1dnZcAcQjbKBYNX4 1171 BAynRFdiuB--f_nZLgrnbyTyWzO75vRK5h6xBArLIARNPvkSjtQBMHlb1L07Qe7K 1172 0GarZRmB_eSN9383LcOLn6_dO--xi12jzDwusC-eOkHWEsqtFZESc6BfI7noOPqv 1173 hJ1phCnvWh6IeYI2w9QOYEUipUTI8np6LbgGY9Fs98rqVt5AXLIhWkWywlVmtVrB 1174 p0igcN_IoypGlUPQGe77Rw 1176 A.2.2. Decoding 1178 Decoding the JWS from this example requires processing the Encoded 1179 JWS Header and Encoded JWS Payload exactly as done in the first 1180 example. 1182 A.2.3. Validating 1184 Since the "alg" parameter in the header is "RS256", we validate the 1185 RSA SHA-256 signature contained in the JWS Signature. If any of the 1186 validation steps fail, the signed content MUST be rejected. 1188 First, we validate that the JWS Header string is legal JSON. 1190 Validating the JWS Signature is a little different from the previous 1191 example. First, we base64url decode the Encoded JWS Signature to 1192 produce a signature S to check. We then pass (n, e), S and the UTF-8 1193 representation of the JWS Signing Input to an RSA signature verifier 1194 that has been configured to use the SHA-256 hash function. 1196 A.3. JWS using ECDSA P-256 SHA-256 1198 A.3.1. Encoding 1200 The JWS Header for this example differs from the previous example 1201 because a different algorithm is being used. The JWS Header used is: 1202 {"alg":"ES256"} 1204 The following byte array contains the UTF-8 characters for the JWS 1205 Header: 1207 [123, 34, 97, 108, 103, 34, 58, 34, 69, 83, 50, 53, 54, 34, 125] 1209 Base64url encoding this UTF-8 representation yields this Encoded JWS 1210 Header value: 1211 eyJhbGciOiJFUzI1NiJ9 1213 The JWS Payload used in this example, which follows, is the same as 1214 in the previous examples. Since the Encoded JWS Payload will 1215 therefore be the same, its computation is not repeated here. 1216 {"iss":"joe", 1217 "exp":1300819380, 1218 "http://example.com/is_root":true} 1220 Concatenating the Encoded JWS Header, a period character, and the 1221 Encoded JWS Payload yields this JWS Signing Input value (with line 1222 breaks for display purposes only): 1223 eyJhbGciOiJFUzI1NiJ9 1224 . 1225 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 1226 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 1228 The UTF-8 representation of the JWS Signing Input is the following 1229 byte array: 1231 [101, 121, 74, 104, 98, 71, 99, 105, 79, 105, 74, 70, 85, 122, 73, 1232 49, 78, 105, 74, 57, 46, 101, 121, 74, 112, 99, 51, 77, 105, 79, 105, 1233 74, 113, 98, 50, 85, 105, 76, 65, 48, 75, 73, 67, 74, 108, 101, 72, 1234 65, 105, 79, 106, 69, 122, 77, 68, 65, 52, 77, 84, 107, 122, 79, 68, 1235 65, 115, 68, 81, 111, 103, 73, 109, 104, 48, 100, 72, 65, 54, 76, 1236 121, 57, 108, 101, 71, 70, 116, 99, 71, 120, 108, 76, 109, 78, 118, 1237 98, 83, 57, 112, 99, 49, 57, 121, 98, 50, 57, 48, 73, 106, 112, 48, 1238 99, 110, 86, 108, 102, 81] 1240 The ECDSA key consists of a public part, the EC point (x, y), and a 1241 private part d. The values of the ECDSA key used in this example, 1242 presented as the byte arrays representing big endian integers are: 1244 +-----------+-------------------------------------------------------+ 1245 | Parameter | Value | 1246 | Name | | 1247 +-----------+-------------------------------------------------------+ 1248 | x | [127, 205, 206, 39, 112, 246, 196, 93, 65, 131, 203, | 1249 | | 238, 111, 219, 75, 123, 88, 7, 51, 53, 123, 233, 239, | 1250 | | 19, 186, 207, 110, 60, 123, 209, 84, 69] | 1251 | y | [199, 241, 68, 205, 27, 189, 155, 126, 135, 44, 223, | 1252 | | 237, 185, 238, 185, 244, 179, 105, 93, 110, 169, 11, | 1253 | | 36, 173, 138, 70, 35, 40, 133, 136, 229, 173] | 1254 | d | [142, 155, 16, 158, 113, 144, 152, 191, 152, 4, 135, | 1255 | | 223, 31, 93, 119, 233, 203, 41, 96, 110, 190, 210, | 1256 | | 38, 59, 95, 87, 194, 19, 223, 132, 244, 178] | 1257 +-----------+-------------------------------------------------------+ 1259 The ECDSA private part d is then passed to an ECDSA signing function, 1260 which also takes the curve type, P-256, the hash type, SHA-256, and 1261 the UTF-8 representation of the JWS Signing Input as inputs. The 1262 result of the signature is the EC point (R, S), where R and S are 1263 unsigned integers. In this example, the R and S values, given as 1264 byte arrays representing big endian integers are: 1266 +--------+----------------------------------------------------------+ 1267 | Result | Value | 1268 | Name | | 1269 +--------+----------------------------------------------------------+ 1270 | R | [14, 209, 33, 83, 121, 99, 108, 72, 60, 47, 127, 21, 88, | 1271 | | 7, 212, 2, 163, 178, 40, 3, 58, 249, 124, 126, 23, 129, | 1272 | | 154, 195, 22, 158, 166, 101] | 1273 | S | [197, 10, 7, 211, 140, 60, 112, 229, 216, 241, 45, 175, | 1274 | | 8, 74, 84, 128, 166, 101, 144, 197, 242, 147, 80, 154, | 1275 | | 143, 63, 127, 138, 131, 163, 84, 213] | 1276 +--------+----------------------------------------------------------+ 1278 Concatenating the S array to the end of the R array and base64url 1279 encoding the result produces this value for the Encoded JWS Signature 1280 (with line breaks for display purposes only): 1281 DtEhU3ljbEg8L38VWAfUAqOyKAM6-Xx-F4GawxaepmXFCgfTjDxw5djxLa8ISlSA 1282 pmWQxfKTUJqPP3-Kg6NU1Q 1284 A.3.2. Decoding 1286 Decoding the JWS from this example requires processing the Encoded 1287 JWS Header and Encoded JWS Payload exactly as done in the first 1288 example. 1290 A.3.3. Validating 1292 Since the "alg" parameter in the header is "ES256", we validate the 1293 ECDSA P-256 SHA-256 signature contained in the JWS Signature. If any 1294 of the validation steps fail, the signed content MUST be rejected. 1296 First, we validate that the JWS Header string is legal JSON. 1298 Validating the JWS Signature is a little different from the first 1299 example. First, we base64url decode the Encoded JWS Signature as in 1300 the previous examples but we then need to split the 64 member byte 1301 array that must result into two 32 byte arrays, the first R and the 1302 second S. We then pass (x, y), (R, S) and the UTF-8 representation of 1303 the JWS Signing Input to an ECDSA signature verifier that has been 1304 configured to use the P-256 curve with the SHA-256 hash function. 1306 As explained in Section 6.3, the use of the k value in ECDSA means 1307 that we cannot validate the correctness of the signature in the same 1308 way we validated the correctness of the HMAC. Instead, 1309 implementations MUST use an ECDSA validator to validate the 1310 signature. 1312 Appendix B. Algorithm Identifier Cross-Reference 1314 This appendix contains a table cross-referencing the "alg" values 1315 used in this specification with the equivalent identifiers used by 1316 other standards and software packages. See XML DSIG [RFC3275] and 1317 Java Cryptography Architecture [JCA] for more information about the 1318 names defined by those documents. 1320 +-------+-----+----------------------------+----------+-------------+ 1321 | Algor | JWS | XML DSIG | JCA | OID | 1322 | ithm | | | | | 1323 +-------+-----+----------------------------+----------+-------------+ 1324 | HMAC | HS2 | http://www.w3.org/2001/04/ | HmacSHA2 | 1.2.840.113 | 1325 | using | 56 | xmldsig-more#hmac-sha256 | 56 | 549.2.9 | 1326 | SHA-2 | | | | | 1327 | 56 | | | | | 1328 | hash | | | | | 1329 | algo | | | | | 1330 | rithm | | | | | 1331 | HMAC | HS3 | http://www.w3.org/2001/04/ | HmacSHA3 | 1.2.840.113 | 1332 | using | 84 | xmldsig-more#hmac-sha384 | 84 | 549.2.10 | 1333 | SHA-3 | | | | | 1334 | 84 | | | | | 1335 | hash | | | | | 1336 | algo | | | | | 1337 | rithm | | | | | 1338 | HMAC | HS5 | http://www.w3.org/2001/04/ | HmacSHA5 | 1.2.840.113 | 1339 | using | 12 | xmldsig-more#hmac-sha512 | 12 | 549.2.11 | 1340 | SHA-5 | | | | | 1341 | 12 | | | | | 1342 | hash | | | | | 1343 | algo | | | | | 1344 | rithm | | | | | 1345 | RSA | RS2 | http://www.w3.org/2001/04/ | SHA256wi | 1.2.840.113 | 1346 | using | 56 | xmldsig-more#rsa-sha256 | thRSA | 549.1.1.11 | 1347 | SHA-2 | | | | | 1348 | 56 | | | | | 1349 | hash | | | | | 1350 | algo | | | | | 1351 | rithm | | | | | 1352 | RSA | RS3 | http://www.w3.org/2001/04/ | SHA384wi | 1.2.840.113 | 1353 | using | 84 | xmldsig-more#rsa-sha384 | thRSA | 549.1.1.12 | 1354 | SHA-3 | | | | | 1355 | 84 | | | | | 1356 | hash | | | | | 1357 | algo | | | | | 1358 | rithm | | | | | 1359 | RSA | RS5 | http://www.w3.org/2001/04/ | SHA512wi | 1.2.840.113 | 1360 | using | 12 | xmldsig-more#rsa-sha512 | thRSA | 549.1.1.13 | 1361 | SHA-5 | | | | | 1362 | 12 | | | | | 1363 | hash | | | | | 1364 | algo | | | | | 1365 | rithm | | | | | 1366 | ECDSA | ES2 | http://www.w3.org/2001/04/ | SHA256wi | 1.2.840.100 | 1367 | using | 56 | xmldsig-more#ecdsa-sha256 | thECDSA | 45.4.3.2 | 1368 | P-256 | | | | | 1369 | curve | | | | | 1370 | and | | | | | 1371 | SHA-2 | | | | | 1372 | 56 | | | | | 1373 | hash | | | | | 1374 | algo | | | | | 1375 | rithm | | | | | 1376 | ECDSA | ES3 | http://www.w3.org/2001/04/ | SHA384wi | 1.2.840.100 | 1377 | using | 84 | xmldsig-more#ecdsa-sha384 | thECDSA | 45.4.3.3 | 1378 | P-384 | | | | | 1379 | curve | | | | | 1380 | and | | | | | 1381 | SHA-3 | | | | | 1382 | 84 | | | | | 1383 | hash | | | | | 1384 | algo | | | | | 1385 | rithm | | | | | 1386 | ECDSA | ES5 | http://www.w3.org/2001/04/ | SHA512wi | 1.2.840.100 | 1387 | using | 12 | xmldsig-more#ecdsa-sha512 | thECDSA | 45.4.3.4 | 1388 | P-521 | | | | | 1389 | curve | | | | | 1390 | and | | | | | 1391 | SHA-5 | | | | | 1392 | 12 | | | | | 1393 | hash | | | | | 1394 | algo | | | | | 1395 | rithm | | | | | 1396 +-------+-----+----------------------------+----------+-------------+ 1398 Table 4: Algorithm Identifier Cross-Reference 1400 Appendix C. Notes on implementing base64url encoding without padding 1402 This appendix describes how to implement base64url encoding and 1403 decoding functions without padding based upon standard base64 1404 encoding and decoding functions that do use padding. 1406 To be concrete, example C# code implementing these functions is shown 1407 below. Similar code could be used in other languages. 1409 static string base64urlencode(byte [] arg) 1410 { 1411 string s = Convert.ToBase64String(arg); // Standard base64 encoder 1412 s = s.Split('=')[0]; // Remove any trailing '='s 1413 s = s.Replace('+', '-'); // 62nd char of encoding 1414 s = s.Replace('/', '_'); // 63rd char of encoding 1415 return s; 1416 } 1418 static byte [] base64urldecode(string arg) 1419 { 1420 string s = arg; 1421 s = s.Replace('-', '+'); // 62nd char of encoding 1422 s = s.Replace('_', '/'); // 63rd char of encoding 1423 switch (s.Length % 4) // Pad with trailing '='s 1424 { 1425 case 0: break; // No pad chars in this case 1426 case 2: s += "=="; break; // Two pad chars 1427 case 3: s += "="; break; // One pad char 1428 default: throw new System.Exception( 1429 "Illegal base64url string!"); 1430 } 1431 return Convert.FromBase64String(s); // Standard base64 decoder 1432 } 1434 As per the example code above, the number of '=' padding characters 1435 that needs to be added to the end of a base64url encoded string 1436 without padding to turn it into one with padding is a deterministic 1437 function of the length of the encoded string. Specifically, if the 1438 length mod 4 is 0, no padding is added; if the length mod 4 is 2, two 1439 '=' padding characters are added; if the length mod 4 is 3, one '=' 1440 padding character is added; if the length mod 4 is 1, the input is 1441 malformed. 1443 An example correspondence between unencoded and encoded values 1444 follows. The byte sequence below encodes into the string below, 1445 which when decoded, reproduces the byte sequence. 1446 3 236 255 224 193 1447 A-z_4ME 1449 Appendix D. Acknowledgements 1451 Solutions for signing JSON content were previously explored by Magic 1452 Signatures [MagicSignatures], JSON Simple Sign [JSS], and Canvas 1453 Applications [CanvasApp], all of which influenced this draft. 1455 Appendix E. Document History 1457 -04 1459 o Removed "if present" clause from "alg" description. 1461 o Moved "MUST" requirements from the Overview to later in the spec. 1463 o Respect line length restrictions in examples. 1465 o Corrected OID numbers for ECDSA algorithms. 1467 o Applied other editorial improvements. 1469 -03 1471 o Simplified terminology to better match JWE, where the terms "JWS 1472 Header" and "Encoded JWS Header", are now used, for instance, 1473 rather than the previous terms "Decoded JWS Header Input" and "JWS 1474 Header Input". Likewise the terms "JWS Payload" and "JWS 1475 Signature" are now used, rather than "JWS Payload Input" and "JWS 1476 Crypto Output". 1478 o The "jku" and "x5u" URLs are now required to be absolute URLs. 1480 o Removed this unnecessary language from the "kid" description: 1481 "Omitting this parameter is equivalent to setting it to an empty 1482 string". 1484 o Changed StringAndURI to StringOrURI. 1486 -02 1488 o Reference the JSON Web Key (JWK) specification from the "jku" 1489 header parameter. 1491 -01 1493 o Changed RSA SHA-256 from MUST be supported to RECOMMENDED that it 1494 be supported. Rationale: Several people have objected to the 1495 requirement for implementing RSA SHA-256, some because they will 1496 only be using HMACs and symmetric keys, and others because they 1497 only want to use ECDSA when using asymmetric keys, either for 1498 security or key length reasons, or both. 1500 o Clarified that "x5u" is an HTTPS URL referencing a PEM-encoded 1501 certificate or certificate chain. 1503 o Clarified that the "alg" parameter value is case sensitive. 1505 o Changed "x5t" (x.509 certificate thumbprint) to use a SHA-1 hash, 1506 rather than a SHA-256 hash, for compatibility reasons. 1508 -00 1510 o Created first signature draft using content split from 1511 draft-jones-json-web-token-01. This split introduced no semantic 1512 changes. 1514 Authors' Addresses 1516 Michael B. Jones 1517 Microsoft 1519 Email: mbj@microsoft.com 1520 URI: http://self-issued.info/ 1522 Dirk Balfanz 1523 Google 1525 Email: balfanz@google.com 1527 John Bradley 1528 independent 1530 Email: ve7jtb@ve7jtb.com 1532 Yaron Y. Goland 1533 Microsoft 1535 Email: yarong@microsoft.com 1537 John Panzer 1538 Google 1540 Email: jpanzer@google.com 1541 Nat Sakimura 1542 Nomura Research Institute 1544 Email: n-sakimura@nri.co.jp 1546 Paul Tarjan 1547 Facebook 1549 Email: pt@fb.com