idnits 2.17.1 draft-ietf-jose-json-web-signature-23.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 3, 2014) is 3700 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. 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 1667 -- Looks like a reference, but probably isn't: '34' on line 1667 -- Looks like a reference, but probably isn't: '97' on line 1677 -- Looks like a reference, but probably isn't: '108' on line 1677 -- Looks like a reference, but probably isn't: '103' on line 1667 -- Looks like a reference, but probably isn't: '58' on line 1667 -- Looks like a reference, but probably isn't: '82' on line 1430 -- Looks like a reference, but probably isn't: '83' on line 1667 -- Looks like a reference, but probably isn't: '50' on line 1667 -- Looks like a reference, but probably isn't: '53' on line 1667 -- Looks like a reference, but probably isn't: '54' on line 1558 -- Looks like a reference, but probably isn't: '125' on line 1667 -- Looks like a reference, but probably isn't: '69' on line 1667 -- Looks like a reference, but probably isn't: '49' on line 1667 -- Looks like a reference, but probably isn't: '80' on line 1677 -- Looks like a reference, but probably isn't: '121' on line 1677 -- Looks like a reference, but probably isn't: '111' on line 1677 -- Looks like a reference, but probably isn't: '100' on line 1677 -- Looks like a reference, but probably isn't: '0' on line 1985 -- Possible downref: Non-RFC (?) normative reference: ref. 'ECMAScript' -- Possible downref: Non-RFC (?) normative reference: ref. 'ITU.X690.1994' ** Downref: Normative reference to an Historic RFC: RFC 1421 ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) ** Obsolete normative reference: RFC 6125 (Obsoleted by RFC 9525) ** Obsolete normative reference: RFC 7158 (Obsoleted by RFC 7159) -- Possible downref: Non-RFC (?) normative reference: ref. 'USASCII' -- Obsolete informational reference (is this intentional?): RFC 5226 (Obsoleted by RFC 8126) Summary: 5 errors (**), 0 flaws (~~), 1 warning (==), 25 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 JOSE Working Group M. Jones 3 Internet-Draft Microsoft 4 Intended status: Standards Track J. Bradley 5 Expires: September 4, 2014 Ping Identity 6 N. Sakimura 7 NRI 8 March 3, 2014 10 JSON Web Signature (JWS) 11 draft-ietf-jose-json-web-signature-23 13 Abstract 15 JSON Web Signature (JWS) represents content secured with digital 16 signatures or Message Authentication Codes (MACs) using JavaScript 17 Object Notation (JSON) based data structures. Cryptographic 18 algorithms and identifiers for use with this specification are 19 described in the separate JSON Web Algorithms (JWA) specification and 20 an IANA registry defined by that specification. Related encryption 21 capabilities are described in the separate JSON Web Encryption (JWE) 22 specification. 24 Status of this Memo 26 This Internet-Draft is submitted in full conformance with the 27 provisions of BCP 78 and BCP 79. 29 Internet-Drafts are working documents of the Internet Engineering 30 Task Force (IETF). Note that other groups may also distribute 31 working documents as Internet-Drafts. The list of current Internet- 32 Drafts is at http://datatracker.ietf.org/drafts/current/. 34 Internet-Drafts are draft documents valid for a maximum of six months 35 and may be updated, replaced, or obsoleted by other documents at any 36 time. It is inappropriate to use Internet-Drafts as reference 37 material or to cite them other than as "work in progress." 39 This Internet-Draft will expire on September 4, 2014. 41 Copyright Notice 43 Copyright (c) 2014 IETF Trust and the persons identified as the 44 document authors. All rights reserved. 46 This document is subject to BCP 78 and the IETF Trust's Legal 47 Provisions Relating to IETF Documents 48 (http://trustee.ietf.org/license-info) in effect on the date of 49 publication of this document. Please review these documents 50 carefully, as they describe your rights and restrictions with respect 51 to this document. Code Components extracted from this document must 52 include Simplified BSD License text as described in Section 4.e of 53 the Trust Legal Provisions and are provided without warranty as 54 described in the Simplified BSD License. 56 Table of Contents 58 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 59 1.1. Notational Conventions . . . . . . . . . . . . . . . . . . 4 60 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 61 3. JSON Web Signature (JWS) Overview . . . . . . . . . . . . . . 6 62 3.1. Example JWS . . . . . . . . . . . . . . . . . . . . . . . 8 63 4. JWS Header . . . . . . . . . . . . . . . . . . . . . . . . . . 9 64 4.1. Registered Header Parameter Names . . . . . . . . . . . . 9 65 4.1.1. "alg" (Algorithm) Header Parameter . . . . . . . . . . 10 66 4.1.2. "jku" (JWK Set URL) Header Parameter . . . . . . . . . 10 67 4.1.3. "jwk" (JSON Web Key) Header Parameter . . . . . . . . 10 68 4.1.4. "kid" (Key ID) Header Parameter . . . . . . . . . . . 10 69 4.1.5. "x5u" (X.509 URL) Header Parameter . . . . . . . . . . 11 70 4.1.6. "x5c" (X.509 Certificate Chain) Header Parameter . . . 11 71 4.1.7. "x5t" (X.509 Certificate SHA-1 Thumbprint) Header 72 Parameter . . . . . . . . . . . . . . . . . . . . . . 11 73 4.1.8. "typ" (Type) Header Parameter . . . . . . . . . . . . 12 74 4.1.9. "cty" (Content Type) Header Parameter . . . . . . . . 12 75 4.1.10. "crit" (Critical) Header Parameter . . . . . . . . . . 13 76 4.2. Public Header Parameter Names . . . . . . . . . . . . . . 13 77 4.3. Private Header Parameter Names . . . . . . . . . . . . . . 14 78 5. Producing and Consuming JWSs . . . . . . . . . . . . . . . . . 14 79 5.1. Message Signature or MAC Computation . . . . . . . . . . . 14 80 5.2. Message Signature or MAC Validation . . . . . . . . . . . 15 81 5.3. String Comparison Rules . . . . . . . . . . . . . . . . . 16 82 6. Key Identification . . . . . . . . . . . . . . . . . . . . . . 16 83 7. Serializations . . . . . . . . . . . . . . . . . . . . . . . . 17 84 7.1. JWS Compact Serialization . . . . . . . . . . . . . . . . 17 85 7.2. JWS JSON Serialization . . . . . . . . . . . . . . . . . . 17 86 8. TLS Requirements . . . . . . . . . . . . . . . . . . . . . . . 19 87 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19 88 9.1. JSON Web Signature and Encryption Header Parameters 89 Registry . . . . . . . . . . . . . . . . . . . . . . . . . 20 90 9.1.1. Registration Template . . . . . . . . . . . . . . . . 21 91 9.1.2. Initial Registry Contents . . . . . . . . . . . . . . 21 92 9.2. Media Type Registration . . . . . . . . . . . . . . . . . 23 93 9.2.1. Registry Contents . . . . . . . . . . . . . . . . . . 23 94 10. Security Considerations . . . . . . . . . . . . . . . . . . . 24 95 10.1. Cryptographic Security Considerations . . . . . . . . . . 24 96 10.2. JSON Security Considerations . . . . . . . . . . . . . . . 25 97 10.3. Unicode Comparison Security Considerations . . . . . . . . 26 98 11. References . . . . . . . . . . . . . . . . . . . . . . . . . . 26 99 11.1. Normative References . . . . . . . . . . . . . . . . . . . 26 100 11.2. Informative References . . . . . . . . . . . . . . . . . . 28 101 Appendix A. JWS Examples . . . . . . . . . . . . . . . . . . . . 28 102 A.1. Example JWS using HMAC SHA-256 . . . . . . . . . . . . . . 29 103 A.1.1. Encoding . . . . . . . . . . . . . . . . . . . . . . . 29 104 A.1.2. Validating . . . . . . . . . . . . . . . . . . . . . . 31 105 A.2. Example JWS using RSASSA-PKCS-v1_5 SHA-256 . . . . . . . . 31 106 A.2.1. Encoding . . . . . . . . . . . . . . . . . . . . . . . 31 107 A.2.2. Validating . . . . . . . . . . . . . . . . . . . . . . 33 108 A.3. Example JWS using ECDSA P-256 SHA-256 . . . . . . . . . . 34 109 A.3.1. Encoding . . . . . . . . . . . . . . . . . . . . . . . 34 110 A.3.2. Validating . . . . . . . . . . . . . . . . . . . . . . 36 111 A.4. Example JWS using ECDSA P-521 SHA-512 . . . . . . . . . . 36 112 A.4.1. Encoding . . . . . . . . . . . . . . . . . . . . . . . 36 113 A.4.2. Validating . . . . . . . . . . . . . . . . . . . . . . 38 114 A.5. Example Plaintext JWS . . . . . . . . . . . . . . . . . . 38 115 A.6. Example JWS Using JWS JSON Serialization . . . . . . . . . 39 116 A.6.1. JWS Per-Signature Protected Headers . . . . . . . . . 40 117 A.6.2. JWS Per-Signature Unprotected Headers . . . . . . . . 40 118 A.6.3. Complete JWS Header Values . . . . . . . . . . . . . . 40 119 A.6.4. Complete JWS JSON Serialization Representation . . . . 41 120 Appendix B. "x5c" (X.509 Certificate Chain) Example . . . . . . . 41 121 Appendix C. Notes on implementing base64url encoding without 122 padding . . . . . . . . . . . . . . . . . . . . . . . 43 123 Appendix D. Notes on Key Selection . . . . . . . . . . . . . . . 44 124 Appendix E. Negative Test Case for "crit" Header Parameter . . . 46 125 Appendix F. Detached Content . . . . . . . . . . . . . . . . . . 46 126 Appendix G. Acknowledgements . . . . . . . . . . . . . . . . . . 47 127 Appendix H. Document History . . . . . . . . . . . . . . . . . . 47 128 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 55 130 1. Introduction 132 JSON Web Signature (JWS) represents content secured with digital 133 signatures or Message Authentication Codes (MACs) using JavaScript 134 Object Notation (JSON) [RFC7158] based data structures. The JWS 135 cryptographic mechanisms provide integrity protection for an 136 arbitrary sequence of octets. 138 Two closely related serializations for JWS objects are defined. The 139 JWS Compact Serialization is a compact, URL-safe representation 140 intended for space constrained environments such as HTTP 141 Authorization headers and URI query parameters. The JWS JSON 142 Serialization represents JWS objects as JSON objects and enables 143 multiple signatures and/or MACs to be applied to the same content. 144 Both share the same cryptographic underpinnings. 146 Cryptographic algorithms and identifiers for use with this 147 specification are described in the separate JSON Web Algorithms (JWA) 148 [JWA] specification and an IANA registry defined by that 149 specification. Related encryption capabilities are described in the 150 separate JSON Web Encryption (JWE) [JWE] specification. 152 Names defined by this specification are short because a core goal is 153 for the resulting representations to be compact. 155 1.1. Notational Conventions 157 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 158 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 159 "OPTIONAL" in this document are to be interpreted as described in Key 160 words for use in RFCs to Indicate Requirement Levels [RFC2119]. If 161 these words are used without being spelled in uppercase then they are 162 to be interpreted with their normal natural language meanings. 164 BASE64URL(OCTETS) denotes the base64url encoding of OCTETS, per 165 Section 2. 167 UTF8(STRING) denotes the octets of the UTF-8 [RFC3629] representation 168 of STRING. 170 ASCII(STRING) denotes the octets of the ASCII [USASCII] 171 representation of STRING. 173 The concatenation of two values A and B is denoted as A || B. 175 2. Terminology 177 JSON Web Signature (JWS) 178 A data structure representing a digitally signed or MACed message. 180 JWS Header 181 JSON object containing the parameters describing the cryptographic 182 operations and parameters employed. The JWS Header members are 183 the union of the members of the JWS Protected Header and the JWS 184 Unprotected Header. The members of the JWS Header are Header 185 Parameters. 187 JWS Payload 188 The sequence of octets to be secured -- a.k.a., the message. The 189 payload can contain an arbitrary sequence of octets. 191 JWS Signature 192 Digital signature or MAC over the JWS Protected Header and the JWS 193 Payload. 195 Header Parameter 196 A name/value pair that is member of the JWS Header. 198 JWS Protected Header 199 JSON object that contains the JWS Header Parameters that are 200 integrity protected by the JWS Signature digital signature or MAC 201 operation. For the JWS Compact Serialization, this comprises the 202 entire JWS Header. For the JWS JSON Serialization, this is one 203 component of the JWS Header. 205 JWS Unprotected Header 206 JSON object that contains the JWS Header Parameters that are not 207 integrity protected. This can only be present when using the JWS 208 JSON Serialization. 210 Base64url Encoding 211 Base64 encoding using the URL- and filename-safe character set 212 defined in Section 5 of RFC 4648 [RFC4648], with all trailing '=' 213 characters omitted (as permitted by Section 3.2) and without the 214 inclusion of any line breaks, white space, or other additional 215 characters. (See Appendix C for notes on implementing base64url 216 encoding without padding.) 218 JWS Signing Input 219 The input to the digital signature or MAC computation. Its value 220 is ASCII(BASE64URL(UTF8(JWS Protected Header)) || '.' || 221 BASE64URL(JWS Payload)). 223 JWS Compact Serialization 224 A representation of the JWS as a compact, URL-safe string. 226 JWS JSON Serialization 227 A representation of the JWS as a JSON object. Unlike the JWS 228 Compact Serialization, the JWS JSON Serialization enables multiple 229 digital signatures and/or MACs to be applied to the same content. 230 This representation is neither optimized for compactness nor URL- 231 safe. 233 Collision-Resistant Name 234 A name in a namespace that enables names to be allocated in a 235 manner such that they are highly unlikely to collide with other 236 names. Examples of collision-resistant namespaces include: Domain 237 Names, Object Identifiers (OIDs) as defined in the ITU-T X.660 and 238 X.670 Recommendation series, and Universally Unique IDentifiers 239 (UUIDs) [RFC4122]. When using an administratively delegated 240 namespace, the definer of a name needs to take reasonable 241 precautions to ensure they are in control of the portion of the 242 namespace they use to define the name. 244 StringOrURI 245 A JSON string value, with the additional requirement that while 246 arbitrary string values MAY be used, any value containing a ":" 247 character MUST be a URI [RFC3986]. StringOrURI values are 248 compared as case-sensitive strings with no transformations or 249 canonicalizations applied. 251 3. JSON Web Signature (JWS) Overview 253 JWS represents digitally signed or MACed content using JSON data 254 structures and base64url encoding. A JWS represents these logical 255 values: 257 JWS Header 258 JSON object containing the parameters describing the cryptographic 259 operations and parameters employed. The JWS Header members are 260 the union of the members of the JWS Protected Header and the JWS 261 Unprotected Header, as described below. 263 JWS Payload 264 The sequence of octets to be secured -- a.k.a., the message. The 265 payload can contain an arbitrary sequence of octets. 267 JWS Signature 268 Digital signature or MAC over the JWS Protected Header and the JWS 269 Payload. 271 The JWS Header represents the combination of these values: 273 JWS Protected Header 274 JSON object that contains the JWS Header Parameters that are 275 integrity protected by the JWS Signature digital signature or MAC 276 operation. 278 JWS Unprotected Header 279 JSON object that contains the JWS Header Parameters that are not 280 integrity protected. 282 This document defines two serializations for JWS objects: a compact, 283 URL-safe serialization called the JWS Compact Serialization and a 284 JSON serialization called the JWS JSON Serialization. In both 285 serializations, the JWS Protected Header, JWS Payload, and JWS 286 Signature are base64url encoded for transmission, since JSON lacks a 287 way to directly represent octet sequences. 289 In the JWS Compact Serialization, no JWS Unprotected Header is used. 290 In this case, the JWS Header and the JWS Protected Header are the 291 same. 293 In the JWS Compact Serialization, a JWS object is represented as the 294 combination of these three string values, 295 BASE64URL(UTF8(JWS Protected Header)), 296 BASE64URL(JWS Payload), and 297 BASE64URL(JWS Signature), 298 concatenated in that order, with the three strings being separated by 299 two period ('.') characters. 301 In the JWS JSON Serialization, one or both of the JWS Protected 302 Header and JWS Unprotected Header MUST be present. In this case, the 303 members of the JWS Header are the combination of the members of the 304 JWS Protected Header and the JWS Unprotected Header values that are 305 present. 307 In the JWS JSON Serialization, a JWS object is represented as the 308 combination of these four values, 309 BASE64URL(UTF8(JWS Protected Header)), 310 JWS Unprotected Header, 311 BASE64URL(JWS Payload), and 312 BASE64URL(JWS Signature), 313 with the three base64url encoding result strings and the JWS 314 Unprotected Header value being represented as members within a JSON 315 object. The inclusion of some of these values is OPTIONAL. The JWS 316 JSON Serialization can also represent multiple signature and/or MAC 317 values, rather than just one. See Section 7.2 for more information 318 about the JWS JSON Serialization. 320 3.1. Example JWS 322 This section provides an example of a JWS. Its computation is 323 described in more detail in Appendix A.1, including specifying the 324 exact octet sequences representing the JSON values used and the key 325 value used. 327 The following example JWS Protected Header declares that the encoded 328 object is a JSON Web Token (JWT) [JWT] and the JWS Protected Header 329 and the JWS Payload are secured using the HMAC SHA-256 algorithm: 331 {"typ":"JWT", 332 "alg":"HS256"} 334 Encoding this JWS Protected Header as BASE64URL(UTF8(JWS Protected 335 Header)) gives this value: 337 eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9 339 The UTF-8 representation of following JSON object is used as the JWS 340 Payload. (Note that the payload can be any content, and need not be 341 a representation of a JSON object.) 343 {"iss":"joe", 344 "exp":1300819380, 345 "http://example.com/is_root":true} 347 Encoding this JWS Payload as BASE64URL(JWS Payload) gives this value 348 (with line breaks for display purposes only): 350 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 351 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 353 Computing the HMAC of the JWS Signing Input ASCII(BASE64URL(UTF8(JWS 354 Protected Header)) || '.' || BASE64URL(JWS Payload)) with the HMAC 355 SHA-256 algorithm using the key specified in Appendix A.1 and 356 base64url encoding the result yields this BASE64URL(JWS Signature) 357 value: 359 dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk 361 Concatenating these values in the order Header.Payload.Signature with 362 period ('.') characters between the parts yields this complete JWS 363 representation using the JWS Compact Serialization (with line breaks 364 for display purposes only): 366 eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9 367 . 368 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 369 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 370 . 371 dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk 373 See Appendix A for additional examples. 375 4. JWS Header 377 The members of the JSON object(s) representing the JWS Header 378 describe the digital signature or MAC applied to the JWS Protected 379 Header and the JWS Payload and optionally additional properties of 380 the JWS. The Header Parameter names within the JWS Header MUST be 381 unique; recipients MUST either reject JWSs with duplicate Header 382 Parameter names or use a JSON parser that returns only the lexically 383 last duplicate member name, as specified in Section 15.12 (The JSON 384 Object) of ECMAScript 5.1 [ECMAScript]. 386 Implementations are required to understand the specific Header 387 Parameters defined by this specification that are designated as "MUST 388 be understood" and process them in the manner defined in this 389 specification. All other Header Parameters defined by this 390 specification that are not so designated MUST be ignored when not 391 understood. Unless listed as a critical Header Parameter, per 392 Section 4.1.10, all Header Parameters not defined by this 393 specification MUST be ignored when not understood. 395 There are three classes of Header Parameter names: Registered Header 396 Parameter names, Public Header Parameter names, and Private Header 397 Parameter names. 399 4.1. Registered Header Parameter Names 401 The following Header Parameter names are registered in the IANA JSON 402 Web Signature and Encryption Header Parameters registry defined in 403 Section 9.1, with meanings as defined below. 405 As indicated by the common registry, JWSs and JWEs share a common 406 Header Parameter space; when a parameter is used by both 407 specifications, its usage must be compatible between the 408 specifications. 410 4.1.1. "alg" (Algorithm) Header Parameter 412 The "alg" (algorithm) Header Parameter identifies the cryptographic 413 algorithm used to secure the JWS. The signature, MAC, or plaintext 414 value is not valid if the "alg" value does not represent a supported 415 algorithm, or if there is not a key for use with that algorithm 416 associated with the party that digitally signed or MACed the content. 417 "alg" values should either be registered in the IANA JSON Web 418 Signature and Encryption Algorithms registry defined in [JWA] or be a 419 value that contains a Collision-Resistant Name. The "alg" value is a 420 case-sensitive string containing a StringOrURI value. This Header 421 Parameter MUST be present and MUST be understood and processed by 422 implementations. 424 A list of defined "alg" values for this use can be found in the IANA 425 JSON Web Signature and Encryption Algorithms registry defined in 426 [JWA]; the initial contents of this registry are the values defined 427 in Section 3.1 of the JSON Web Algorithms (JWA) [JWA] specification. 429 4.1.2. "jku" (JWK Set URL) Header Parameter 431 The "jku" (JWK Set URL) Header Parameter is a URI [RFC3986] that 432 refers to a resource for a set of JSON-encoded public keys, one of 433 which corresponds to the key used to digitally sign the JWS. The 434 keys MUST be encoded as a JSON Web Key Set (JWK Set) [JWK]. The 435 protocol used to acquire the resource MUST provide integrity 436 protection; an HTTP GET request to retrieve the JWK Set MUST use TLS 437 [RFC2818] [RFC5246]; the identity of the server MUST be validated, as 438 per Section 3.1 of HTTP Over TLS [RFC2818]. Use of this Header 439 Parameter is OPTIONAL. 441 4.1.3. "jwk" (JSON Web Key) Header Parameter 443 The "jwk" (JSON Web Key) Header Parameter is the public key that 444 corresponds to the key used to digitally sign the JWS. This key is 445 represented as a JSON Web Key [JWK]. Use of this Header Parameter is 446 OPTIONAL. 448 4.1.4. "kid" (Key ID) Header Parameter 450 The "kid" (key ID) Header Parameter is a hint indicating which key 451 was used to secure the JWS. This parameter allows originators to 452 explicitly signal a change of key to recipients. The structure of 453 the "kid" value is unspecified. Its value MUST be a string. Use of 454 this Header Parameter is OPTIONAL. 456 When used with a JWK, the "kid" value is used to match a JWK "kid" 457 parameter value. 459 4.1.5. "x5u" (X.509 URL) Header Parameter 461 The "x5u" (X.509 URL) Header Parameter is a URI [RFC3986] that refers 462 to a resource for the X.509 public key certificate or certificate 463 chain [RFC5280] corresponding to the key used to digitally sign the 464 JWS. The identified resource MUST provide a representation of the 465 certificate or certificate chain that conforms to RFC 5280 [RFC5280] 466 in PEM encoded form [RFC1421]. The certificate containing the public 467 key corresponding to the key used to digitally sign the JWS MUST be 468 the first certificate. This MAY be followed by additional 469 certificates, with each subsequent certificate being the one used to 470 certify the previous one. The protocol used to acquire the resource 471 MUST provide integrity protection; an HTTP GET request to retrieve 472 the certificate MUST use TLS [RFC2818] [RFC5246]; the identity of the 473 server MUST be validated, as per Section 3.1 of HTTP Over TLS 474 [RFC2818]. Use of this Header Parameter is OPTIONAL. 476 4.1.6. "x5c" (X.509 Certificate Chain) Header Parameter 478 The "x5c" (X.509 Certificate Chain) Header Parameter contains the 479 X.509 public key certificate or certificate chain [RFC5280] 480 corresponding to the key used to digitally sign the JWS. The 481 certificate or certificate chain is represented as a JSON array of 482 certificate value strings. Each string in the array is a base64 483 encoded ([RFC4648] Section 4 -- not base64url encoded) DER 484 [ITU.X690.1994] PKIX certificate value. The certificate containing 485 the public key corresponding to the key used to digitally sign the 486 JWS MUST be the first certificate. This MAY be followed by 487 additional certificates, with each subsequent certificate being the 488 one used to certify the previous one. The recipient MUST validate 489 the certificate chain according to [RFC5280] and reject the signature 490 if any validation failure occurs. Use of this Header Parameter is 491 OPTIONAL. 493 See Appendix B for an example "x5c" value. 495 4.1.7. "x5t" (X.509 Certificate SHA-1 Thumbprint) Header Parameter 497 The "x5t" (X.509 Certificate SHA-1 Thumbprint) Header Parameter is a 498 base64url encoded SHA-1 thumbprint (a.k.a. digest) of the DER 499 encoding of the X.509 certificate [RFC5280] corresponding to the key 500 used to digitally sign the JWS. Use of this Header Parameter is 501 OPTIONAL. 503 If, in the future, certificate thumbprints need to be computed using 504 hash functions other than SHA-1, it is suggested that additional 505 related Header Parameters be defined for that purpose. For example, 506 it is suggested that a new "x5t#S256" (X.509 Certificate Thumbprint 507 using SHA-256) Header Parameter could be defined by registering it in 508 the IANA JSON Web Signature and Encryption Header Parameters registry 509 defined in Section 9.1. 511 4.1.8. "typ" (Type) Header Parameter 513 The "typ" (type) Header Parameter is used to declare the MIME Media 514 Type [IANA.MediaTypes] of this complete JWS object in contexts where 515 this is useful to the application. This parameter has no effect upon 516 the JWS processing. Use of this Header Parameter is OPTIONAL. 518 Per [RFC2045], all media type values, subtype values, and parameter 519 names are case-insensitive. However, parameter values are case- 520 sensitive unless otherwise specified for the specific parameter. 522 To keep messages compact in common situations, it is RECOMMENDED that 523 senders omit an "application/" prefix of a media type value in a 524 "typ" Header Parameter when no other '/' appears in the media type 525 value. A recipient using the media type value MUST treat it as if 526 "application/" were prepended to any "typ" value not containing a 527 '/'. For instance, a "typ" value of "example" SHOULD be used to 528 represent the "application/example" media type; whereas, the media 529 type "application/example;part="1/2"" cannot be shortened to 530 "example;part="1/2"". 532 The "typ" value "JOSE" can be used by applications to indicate that 533 this object is a JWS or JWE using the JWS Compact Serialization or 534 the JWE Compact Serialization. The "typ" value "JOSE+JSON" can be 535 used by applications to indicate that this object is a JWS or JWE 536 using the JWS JSON Serialization or the JWE JSON Serialization. 537 Other type values can also be used by applications. 539 4.1.9. "cty" (Content Type) Header Parameter 541 The "cty" (content type) Header Parameter is used to declare the MIME 542 Media Type [IANA.MediaTypes] of the secured content (the payload) in 543 contexts where this is useful to the application. This parameter has 544 no effect upon the JWS processing. Use of this Header Parameter is 545 OPTIONAL. 547 Per [RFC2045], all media type values, subtype values, and parameter 548 names are case-insensitive. However, parameter values are case- 549 sensitive unless otherwise specified for the specific parameter. 551 To keep messages compact in common situations, it is RECOMMENDED that 552 senders omit an "application/" prefix of a media type value in a 553 "cty" Header Parameter when no other '/' appears in the media type 554 value. A recipient using the media type value MUST treat it as if 555 "application/" were prepended to any "cty" value not containing a 556 '/'. For instance, a "cty" value of "example" SHOULD be used to 557 represent the "application/example" media type; whereas, the media 558 type "application/example;part="1/2"" cannot be shortened to 559 "example;part="1/2"". 561 4.1.10. "crit" (Critical) Header Parameter 563 The "crit" (critical) Header Parameter indicates that extensions to 564 the initial RFC versions of [[ this specification ]] and [JWA] are 565 being used that MUST be understood and processed. Its value is an 566 array listing the Header Parameter names present in the JWS Header 567 that use those extensions. If any of the listed extension Header 568 Parameters are not understood and supported by the receiver, it MUST 569 reject the JWS. Senders MUST NOT include Header Parameter names 570 defined by the initial RFC versions of [[ this specification ]] or 571 [JWA] for use with JWS, duplicate names, or names that do not occur 572 as Header Parameter names within the JWS Header in the "crit" list. 573 Senders MUST NOT use the empty list "[]" as the "crit" value. 574 Recipients MAY reject the JWS if the critical list contains any 575 Header Parameter names defined by the initial RFC versions of [[ this 576 specification ]] or [JWA] for use with JWS, or any other constraints 577 on its use are violated. This Header Parameter MUST be integrity 578 protected, and therefore MUST occur only within the JWS Protected 579 Header, when used. Use of this Header Parameter is OPTIONAL. This 580 Header Parameter MUST be understood and processed by implementations. 582 An example use, along with a hypothetical "exp" (expiration-time) 583 field is: 585 {"alg":"ES256", 586 "crit":["exp"], 587 "exp":1363284000 588 } 590 4.2. Public Header Parameter Names 592 Additional Header Parameter names can be defined by those using JWSs. 593 However, in order to prevent collisions, any new Header Parameter 594 name should either be registered in the IANA JSON Web Signature and 595 Encryption Header Parameters registry defined in Section 9.1 or be a 596 Public Name: a value that contains a Collision-Resistant Name. In 597 each case, the definer of the name or value needs to take reasonable 598 precautions to make sure they are in control of the part of the 599 namespace they use to define the Header Parameter name. 601 New Header Parameters should be introduced sparingly, as they can 602 result in non-interoperable JWSs. 604 4.3. Private Header Parameter Names 606 A producer and consumer of a JWS may agree to use Header Parameter 607 names that are Private Names: names that are not Registered Header 608 Parameter names Section 4.1 or Public Header Parameter names 609 Section 4.2. Unlike Public Header Parameter names, Private Header 610 Parameter names are subject to collision and should be used with 611 caution. 613 5. Producing and Consuming JWSs 615 5.1. Message Signature or MAC Computation 617 To create a JWS, one MUST perform these steps. The order of the 618 steps is not significant in cases where there are no dependencies 619 between the inputs and outputs of the steps. 620 1. Create the content to be used as the JWS Payload. 621 2. Compute the encoded payload value BASE64URL(JWS Payload). 622 3. Create the JSON object(s) containing the desired set of Header 623 Parameters, which together comprise the JWS Header: the JWS 624 Protected Header, and if the JWS JSON Serialization is being 625 used, the JWS Unprotected Header. 626 4. Compute the encoded header value BASE64URL(UTF8(JWS Protected 627 Header)). If the JWS Protected Header is not present (which can 628 only happen when using the JWS JSON Serialization and no 629 "protected" member is present), let this value be the empty 630 string. 631 5. Compute the JWS Signature in the manner defined for the 632 particular algorithm being used over the JWS Signing Input 633 ASCII(BASE64URL(UTF8(JWS Protected Header)) || '.' || 634 BASE64URL(JWS Payload)). The "alg" (algorithm) Header Parameter 635 MUST be present in the JWS Header, with the algorithm value 636 accurately representing the algorithm used to construct the JWS 637 Signature. 638 6. Compute the encoded signature value BASE64URL(JWS Signature). 639 7. These three encoded values are used in both the JWS Compact 640 Serialization and the JWS JSON Serialization representations. 641 8. If the JWS JSON Serialization is being used, repeat this process 642 (steps 3-7) for each digital signature or MAC operation being 643 performed. 644 9. Create the desired serialized output. The JWS Compact 645 Serialization of this result is BASE64URL(UTF8(JWS Protected 646 Header)) || '.' || BASE64URL(JWS Payload) || '.' || BASE64URL(JWS 647 Signature). The JWS JSON Serialization is described in 648 Section 7.2. 650 5.2. Message Signature or MAC Validation 652 When validating a JWS, the following steps MUST be taken. The order 653 of the steps is not significant in cases where there are no 654 dependencies between the inputs and outputs of the steps. If any of 655 the listed steps fails, then the signature or MAC cannot be 656 validated. 658 It is an application decision which signatures, MACs, or plaintext 659 values must successfully validate for the JWS to be accepted. In 660 some cases, all must successfully validate or the JWS will be 661 rejected. In other cases, only a specific signature, MAC, or 662 plaintext value needs to be successfully validated. However, in all 663 cases, at least one signature, MAC, or plaintext value MUST 664 successfully validate or the JWS MUST be rejected. 666 1. Parse the JWS representation to extract the serialized values 667 for the components of the JWS -- when using the JWS Compact 668 Serialization, the base64url encoded representations of the JWS 669 Protected Header, the JWS Payload, and the JWS Signature, and 670 when using the JWS JSON Serialization, also the unencoded JWS 671 Unprotected Header value. When using the JWS Compact 672 Serialization, the JWS Protected Header, the JWS Payload, and 673 the JWS Signature are represented as base64url encoded values in 674 that order, separated by two period ('.') characters. The JWS 675 JSON Serialization is described in Section 7.2. 676 2. The encoded representation of the JWS Protected Header MUST be 677 successfully base64url decoded following the restriction that no 678 padding characters have been used. 679 3. The resulting octet sequence MUST be a UTF-8 encoded 680 representation of a completely valid JSON object conforming to 681 [RFC7158], which is the JWS Protected Header. 682 4. If using the JWS Compact Serialization, let the JWS Header be 683 the JWS Protected Header; otherwise, when using the JWS JSON 684 Serialization, let the JWS Header be the union of the members of 685 the corresponding JWS Protected Header and JWS Unprotected 686 Header, all of which must be completely valid JSON objects. 687 5. The resulting JWS Header MUST NOT contain duplicate Header 688 Parameter names. When using the JWS JSON Serialization, this 689 restriction includes that the same Header Parameter name also 690 MUST NOT occur in distinct JSON object values that together 691 comprise the JWS Header. 692 6. Verify that the implementation understands and can process all 693 fields that it is required to support, whether required by this 694 specification, by the algorithm being used, or by the "crit" 695 Header Parameter value, and that the values of those parameters 696 are also understood and supported. 698 7. The encoded representation of the JWS Payload MUST be 699 successfully base64url decoded following the restriction that no 700 padding characters have been used. 701 8. The encoded representation of the JWS Signature MUST be 702 successfully base64url decoded following the restriction that no 703 padding characters have been used. 704 9. The JWS Signature MUST be successfully validated against the JWS 705 Signing Input ASCII(BASE64URL(UTF8(JWS Protected Header)) || '.' 706 || BASE64URL(JWS Payload)) in the manner defined for the 707 algorithm being used, which MUST be accurately represented by 708 the value of the "alg" (algorithm) Header Parameter, which MUST 709 be present. 710 10. If the JWS JSON Serialization is being used, repeat this process 711 (steps 4-9) for each digital signature or MAC value contained in 712 the representation. 714 5.3. String Comparison Rules 716 Processing a JWS inevitably requires comparing known strings to 717 members and values in a JSON object. For example, in checking what 718 the algorithm is, the Unicode string "alg" will be checked against 719 the member names in the JWS Header to see if there is a matching 720 Header Parameter name. The same process is then used to determine if 721 the value of the "alg" Header Parameter represents a supported 722 algorithm. 724 Since the only string comparison operations that are performed are 725 equality and inequality, the same rules can be used for comparing 726 both member names and member values against known strings. The JSON 727 rules for doing member name comparison are described in Section 8.3 728 of [RFC7158]. 730 Also, see the JSON security considerations in Section 10.2 and the 731 Unicode security considerations in Section 10.3. 733 6. Key Identification 735 It is necessary for the recipient of a JWS to be able to determine 736 the key that was employed for the digital signature or MAC operation. 737 The key employed can be identified using the Header Parameter methods 738 described in Section 4.1 or can be identified using methods that are 739 outside the scope of this specification. Specifically, the Header 740 Parameters "jku", "jwk", "kid", "x5u", "x5c", and "x5t" can be used 741 to identify the key used. These Header Parameters MUST be integrity 742 protected if the information that they convey is to be utilized in a 743 trust decision. 745 The sender SHOULD include sufficient information in the Header 746 Parameters to identify the key used, unless the application uses 747 another means or convention to determine the key used. Validation of 748 the signature or MAC fails when the algorithm used requires a key 749 (which is true of all algorithms except for "none") and the key used 750 cannot be determined. 752 The means of exchanging any shared symmetric keys used is outside the 753 scope of this specification. 755 Also, see Appendix D for notes on possible key selection algorithms. 757 7. Serializations 759 JWS objects use one of two serializations, the JWS Compact 760 Serialization or the JWS JSON Serialization. Applications using this 761 specification need to specify what serialization and serialization 762 features are used for that application. For instance, applications 763 might specify that only the JWS JSON Serialization is used, that only 764 JWS JSON Serialization support for a single signature or MAC value is 765 used, or that support for multiple signatures and/or MAC values is 766 used. JWS implementations only need to implement the features needed 767 for the applications they are designed to support. 769 7.1. JWS Compact Serialization 771 The JWS Compact Serialization represents digitally signed or MACed 772 content as a compact URL-safe string. This string is 773 BASE64URL(UTF8(JWS Protected Header)) || '.' || BASE64URL(JWS 774 Payload) || '.' || BASE64URL(JWS Signature). Only one signature/MAC 775 is supported by the JWS Compact Serialization and it provides no 776 syntax to represent a JWS Unprotected Header value. 778 7.2. JWS JSON Serialization 780 The JWS JSON Serialization represents digitally signed or MACed 781 content as a JSON object. Content using the JWS JSON Serialization 782 can be secured with more than one digital signature and/or MAC 783 operation. This representation is neither optimized for compactness 784 nor URL-safe. 786 The following members are defined for use in top-level JSON objects 787 used for the JWS JSON Serialization: 789 payload 790 The "payload" member MUST be present and contain the value 791 BASE64URL(JWS Payload). 792 signatures 793 The "signatures" member value MUST be an array of JSON objects. 794 Each object represents a signature or MAC over the JWS Payload and 795 the JWS Protected Header. 797 The following members are defined for use in the JSON objects that 798 are elements of the "signatures" array: 799 protected 800 The "protected" member MUST be present and contain the value 801 BASE64URL(UTF8(JWS Protected Header)) when the JWS Protected 802 Header value is non-empty; otherwise, it MUST be absent. These 803 Header Parameter values are integrity protected. 804 header 805 The "header" member MUST be present and contain the value JWS 806 Unprotected Header when the JWS Unprotected Header value is non- 807 empty; otherwise, it MUST be absent. This value is represented as 808 an unencoded JSON object, rather than as a string. These Header 809 Parameter values are not integrity protected. 810 signature 811 The "signature" member MUST be present and contain the value 812 BASE64URL(JWS Signature). 814 At least one of the "protected" and "header" members MUST be present 815 for each signature/MAC computation so that an "alg" Header Parameter 816 value is conveyed. 818 Additional members can be present in both the JSON objects defined 819 above; if not understood by implementations encountering them, they 820 MUST be ignored. 822 The Header Parameter values used when creating or validating 823 individual signature or MAC values are the union of the two sets of 824 Header Parameter values that may be present: (1) the JWS Protected 825 Header represented in the "protected" member of the signature/MAC's 826 array element, and (2) the JWS Unprotected Header in the "header" 827 member of the signature/MAC's array element. The union of these sets 828 of Header Parameters comprises the JWS Header. The Header Parameter 829 names in the two locations MUST be disjoint. 831 Each JWS Signature value is computed using the parameters of the 832 corresponding JWS Header value in the same manner as for the JWS 833 Compact Serialization. This has the desirable property that each JWS 834 Signature value represented in the "signatures" array is identical to 835 the value that would have been computed for the same parameter in the 836 JWS Compact Serialization, provided that the JWS Protected Header 837 value for that signature/MAC computation (which represents the 838 integrity-protected Header Parameter values) matches that used in the 839 JWS Compact Serialization. 841 In summary, the syntax of a JWS using the JWS JSON Serialization is 842 as follows: 844 { 845 "payload":"", 846 "signatures":[ 847 {"protected":"", 848 "header":, 849 "signature":""}, 850 ... 851 {"protected":"", 852 "header":, 853 "signature":""}] 854 } 856 See Appendix A.6 for an example of computing a JWS using the JWS JSON 857 Serialization. 859 8. TLS Requirements 861 Implementations MUST support TLS. Which version(s) ought to be 862 implemented will vary over time, and depend on the widespread 863 deployment and known security vulnerabilities at the time of 864 implementation. At the time of this writing, TLS version 1.2 865 [RFC5246] is the most recent version, but has very limited actual 866 deployment, and might not be readily available in implementation 867 toolkits. 869 To protect against information disclosure and tampering, 870 confidentiality protection MUST be applied using TLS with a 871 ciphersuite that provides confidentiality and integrity protection. 873 Whenever TLS is used, a TLS server certificate check MUST be 874 performed, per RFC 6125 [RFC6125]. 876 9. IANA Considerations 878 The following registration procedure is used for all the registries 879 established by this specification. 881 Values are registered with a Specification Required [RFC5226] after a 882 two-week review period on the [TBD]@ietf.org mailing list, on the 883 advice of one or more Designated Experts. However, to allow for the 884 allocation of values prior to publication, the Designated Expert(s) 885 may approve registration once they are satisfied that such a 886 specification will be published. 888 Registration requests must be sent to the [TBD]@ietf.org mailing list 889 for review and comment, with an appropriate subject (e.g., "Request 890 for access token type: example"). [[ Note to the RFC Editor: The name 891 of the mailing list should be determined in consultation with the 892 IESG and IANA. Suggested name: jose-reg-review. ]] 894 Within the review period, the Designated Expert(s) will either 895 approve or deny the registration request, communicating this decision 896 to the review list and IANA. Denials should include an explanation 897 and, if applicable, suggestions as to how to make the request 898 successful. Registration requests that are undetermined for a period 899 longer than 21 days can be brought to the IESG's attention (using the 900 iesg@iesg.org mailing list) for resolution. 902 Criteria that should be applied by the Designated Expert(s) includes 903 determining whether the proposed registration duplicates existing 904 functionality, determining whether it is likely to be of general 905 applicability or whether it is useful only for a single application, 906 and whether the registration makes sense. 908 IANA must only accept registry updates from the Designated Expert(s) 909 and should direct all requests for registration to the review mailing 910 list. 912 It is suggested that multiple Designated Experts be appointed who are 913 able to represent the perspectives of different applications using 914 this specification, in order to enable broadly-informed review of 915 registration decisions. In cases where a registration decision could 916 be perceived as creating a conflict of interest for a particular 917 Expert, that Expert should defer to the judgment of the other 918 Expert(s). 920 9.1. JSON Web Signature and Encryption Header Parameters Registry 922 This specification establishes the IANA JSON Web Signature and 923 Encryption Header Parameters registry for JWS and JWE Header 924 Parameter names. The registry records the Header Parameter name and 925 a reference to the specification that defines it. The same Header 926 Parameter name can be registered multiple times, provided that the 927 parameter usage is compatible between the specifications. Different 928 registrations of the same Header Parameter name will typically use 929 different Header Parameter Usage Location(s) values. 931 9.1.1. Registration Template 933 Header Parameter Name: 934 The name requested (e.g., "example"). Because a core goal of this 935 specification is for the resulting representations to be compact, 936 it is RECOMMENDED that the name be short -- not to exceed 8 937 characters without a compelling reason to do so. This name is 938 case-sensitive. Names may not match other registered names in a 939 case-insensitive manner unless the Designated Expert(s) state that 940 there is a compelling reason to allow an exception in this 941 particular case. 942 Header Parameter Description: 943 Brief description of the Header Parameter (e.g., "Example 944 description"). 945 Header Parameter Usage Location(s): 946 The Header Parameter usage locations, which should be one or more 947 of the values "JWS" or "JWE". 948 Change Controller: 949 For Standards Track RFCs, state "IESG". For others, give the name 950 of the responsible party. Other details (e.g., postal address, 951 email address, home page URI) may also be included. 952 Specification Document(s): 953 Reference to the document(s) that specify the parameter, 954 preferably including URI(s) that can be used to retrieve copies of 955 the document(s). An indication of the relevant sections may also 956 be included but is not required. 958 9.1.2. Initial Registry Contents 960 This specification registers the Header Parameter names defined in 961 Section 4.1 in this registry. 963 o Header Parameter Name: "alg" 964 o Header Parameter Description: Algorithm 965 o Header Parameter Usage Location(s): JWS 966 o Change Controller: IESG 967 o Specification Document(s): Section 4.1.1 of [[ this document ]] 969 o Header Parameter Name: "jku" 970 o Header Parameter Description: JWK Set URL 971 o Header Parameter Usage Location(s): JWS 972 o Change Controller: IESG 973 o Specification Document(s): Section 4.1.2 of [[ this document ]] 975 o Header Parameter Name: "jwk" 976 o Header Parameter Description: JSON Web Key 977 o Header Parameter Usage Location(s): JWS 978 o Change Controller: IESG 979 o Specification document(s): Section 4.1.3 of [[ this document ]] 981 o Header Parameter Name: "kid" 982 o Header Parameter Description: Key ID 983 o Header Parameter Usage Location(s): JWS 984 o Change Controller: IESG 985 o Specification Document(s): Section 4.1.4 of [[ this document ]] 987 o Header Parameter Name: "x5u" 988 o Header Parameter Description: X.509 URL 989 o Header Parameter Usage Location(s): JWS 990 o Change Controller: IESG 991 o Specification Document(s): Section 4.1.5 of [[ this document ]] 993 o Header Parameter Name: "x5c" 994 o Header Parameter Description: X.509 Certificate Chain 995 o Header Parameter Usage Location(s): JWS 996 o Change Controller: IESG 997 o Specification Document(s): Section 4.1.6 of [[ this document ]] 999 o Header Parameter Name: "x5t" 1000 o Header Parameter Description: X.509 Certificate SHA-1 Thumbprint 1001 o Header Parameter Usage Location(s): JWS 1002 o Change Controller: IESG 1003 o Specification Document(s): Section 4.1.7 of [[ this document ]] 1005 o Header Parameter Name: "typ" 1006 o Header Parameter Description: Type 1007 o Header Parameter Usage Location(s): JWS 1008 o Change Controller: IESG 1009 o Specification Document(s): Section 4.1.8 of [[ this document ]] 1011 o Header Parameter Name: "cty" 1012 o Header Parameter Description: Content Type 1013 o Header Parameter Usage Location(s): JWS 1014 o Change Controller: IESG 1015 o Specification Document(s): Section 4.1.9 of [[ this document ]] 1017 o Header Parameter Name: "crit" 1018 o Header Parameter Description: Critical 1019 o Header Parameter Usage Location(s): JWS 1020 o Change Controller: IESG 1021 o Specification Document(s): Section 4.1.10 of [[ this document ]] 1023 9.2. Media Type Registration 1025 9.2.1. Registry Contents 1027 This specification registers the "application/jose" Media Type 1028 [RFC2046] in the MIME Media Types registry [IANA.MediaTypes], which 1029 can be used to indicate that the content is a JWS or JWE object using 1030 the JWS Compact Serialization or the JWE Compact Serialization and 1031 the "application/jose+json" Media Type in the MIME Media Types 1032 registry, which can be used to indicate that the content is a JWS or 1033 JWE object using the JWS JSON Serialization or the JWE JSON 1034 Serialization. 1036 o Type name: application 1037 o Subtype name: jose 1038 o Required parameters: n/a 1039 o Optional parameters: n/a 1040 o Encoding considerations: 8bit; application/jose values are encoded 1041 as a series of base64url encoded values (some of which may be the 1042 empty string) separated by period ('.') characters. 1043 o Security considerations: See the Security Considerations section 1044 of [[ this document ]] 1045 o Interoperability considerations: n/a 1046 o Published specification: [[ this document ]] 1047 o Applications that use this media type: OpenID Connect, Mozilla 1048 Persona, Salesforce, Google, Android, Windows Azure, Xbox One, and 1049 numerous others that use JWTs 1050 o Additional information: Magic number(s): n/a, File extension(s): 1051 n/a, Macintosh file type code(s): n/a 1052 o Person & email address to contact for further information: Michael 1053 B. Jones, mbj@microsoft.com 1054 o Intended usage: COMMON 1055 o Restrictions on usage: none 1056 o Author: Michael B. Jones, mbj@microsoft.com 1057 o Change Controller: IESG 1059 o Type name: application 1060 o Subtype name: jose+json 1061 o Required parameters: n/a 1062 o Optional parameters: n/a 1063 o Encoding considerations: 8bit; application/jose+json values are 1064 represented as a JSON Object; UTF-8 encoding SHOULD be employed 1065 for the JSON object. 1066 o Security considerations: See the Security Considerations section 1067 of [[ this document ]] 1068 o Interoperability considerations: n/a 1069 o Published specification: [[ this document ]] 1070 o Applications that use this media type: TBD 1071 o Additional information: Magic number(s): n/a, File extension(s): 1072 n/a, Macintosh file type code(s): n/a 1073 o Person & email address to contact for further information: Michael 1074 B. Jones, mbj@microsoft.com 1075 o Intended usage: COMMON 1076 o Restrictions on usage: none 1077 o Author: Michael B. Jones, mbj@microsoft.com 1078 o Change Controller: IESG 1080 10. Security Considerations 1082 10.1. Cryptographic Security Considerations 1084 All of the security issues faced by any cryptographic application 1085 must be faced by a JWS/JWE/JWK agent. Among these issues are 1086 protecting the user's private and symmetric keys, preventing various 1087 attacks, and helping the user avoid mistakes such as inadvertently 1088 encrypting a message for the wrong recipient. The entire list of 1089 security considerations is beyond the scope of this document, but 1090 some significant concerns are listed here. 1092 All the security considerations in XML DSIG 2.0 1093 [W3C.CR-xmldsig-core2-20120124], also apply to this specification, 1094 other than those that are XML specific. Likewise, many of the best 1095 practices documented in XML Signature Best Practices 1096 [W3C.WD-xmldsig-bestpractices-20110809] also apply to this 1097 specification, other than those that are XML specific. 1099 Keys are only as strong as the amount of entropy used to generate 1100 them. A minimum of 128 bits of entropy should be used for all keys, 1101 and depending upon the application context, more may be required. In 1102 particular, it may be difficult to generate sufficiently random 1103 values in some browsers and application environments. 1105 Creators of JWSs should not allow third parties to insert arbitrary 1106 content into the message without adding entropy not controlled by the 1107 third party. 1109 When utilizing TLS to retrieve information, the authority providing 1110 the resource MUST be authenticated and the information retrieved MUST 1111 be free from modification. 1113 When cryptographic algorithms are implemented in such a way that 1114 successful operations take a different amount of time than 1115 unsuccessful operations, attackers may be able to use the time 1116 difference to obtain information about the keys employed. Therefore, 1117 such timing differences must be avoided. 1119 A SHA-1 hash is used when computing "x5t" (x.509 certificate 1120 thumbprint) values, for compatibility reasons. Should an effective 1121 means of producing SHA-1 hash collisions be developed, and should an 1122 attacker wish to interfere with the use of a known certificate on a 1123 given system, this could be accomplished by creating another 1124 certificate whose SHA-1 hash value is the same and adding it to the 1125 certificate store used by the intended victim. A prerequisite to 1126 this attack succeeding is the attacker having write access to the 1127 intended victim's certificate store. 1129 If, in the future, certificate thumbprints need to be computed using 1130 hash functions other than SHA-1, it is suggested that additional 1131 related Header Parameters be defined for that purpose. For example, 1132 it is suggested that a new "x5t#S256" (X.509 Certificate Thumbprint 1133 using SHA-256) Header Parameter could be defined and used. 1135 10.2. JSON Security Considerations 1137 Strict JSON validation is a security requirement. If malformed JSON 1138 is received, then the intent of the sender is impossible to reliably 1139 discern. Ambiguous and potentially exploitable situations could 1140 arise if the JSON parser used does not reject malformed JSON syntax. 1142 Section 4 of the JSON Data Interchange Format specification [RFC7158] 1143 states "The names within an object SHOULD be unique", whereas this 1144 specification states that "Header Parameter names within this object 1145 MUST be unique; recipients MUST either reject JWSs with duplicate 1146 Header Parameter names or use a JSON parser that returns only the 1147 lexically last duplicate member name, as specified in Section 15.12 1148 (The JSON Object) of ECMAScript 5.1 [ECMAScript]". Thus, this 1149 specification requires that the Section 4 "SHOULD" be treated as a 1150 "MUST" by senders and that it be either treated as a "MUST" or in the 1151 manner specified in ECMAScript 5.1 by receivers. Ambiguous and 1152 potentially exploitable situations could arise if the JSON parser 1153 used does not enforce the uniqueness of member names or returns an 1154 unpredictable value for duplicate member names. 1156 Some JSON parsers might not reject input that contains extra 1157 significant characters after a valid input. For instance, the input 1158 "{"tag":"value"}ABCD" contains a valid JSON object followed by the 1159 extra characters "ABCD". Such input MUST be rejected in its 1160 entirety. 1162 10.3. Unicode Comparison Security Considerations 1164 Header Parameter names and algorithm names are Unicode strings. For 1165 security reasons, the representations of these names must be compared 1166 verbatim after performing any escape processing (as per Section 8.3 1167 of [RFC7158]). This means, for instance, that these JSON strings 1168 must compare as being equal ("sig", "\u0073ig"), whereas these must 1169 all compare as being not equal to the first set or to each other 1170 ("SIG", "Sig", "si\u0047"). 1172 JSON strings can contain characters outside the Unicode Basic 1173 Multilingual Plane. For instance, the G clef character (U+1D11E) may 1174 be represented in a JSON string as "\uD834\uDD1E". Ideally, JWS 1175 implementations SHOULD ensure that characters outside the Basic 1176 Multilingual Plane are preserved and compared correctly; 1177 alternatively, if this is not possible due to these characters 1178 exercising limitations present in the underlying JSON implementation, 1179 then input containing them MUST be rejected. 1181 11. References 1183 11.1. Normative References 1185 [ECMAScript] 1186 Ecma International, "ECMAScript Language Specification, 1187 5.1 Edition", ECMA 262, June 2011. 1189 [IANA.MediaTypes] 1190 Internet Assigned Numbers Authority (IANA), "MIME Media 1191 Types", 2005. 1193 [ITU.X690.1994] 1194 International Telecommunications Union, "Information 1195 Technology - ASN.1 encoding rules: Specification of Basic 1196 Encoding Rules (BER), Canonical Encoding Rules (CER) and 1197 Distinguished Encoding Rules (DER)", ITU-T Recommendation 1198 X.690, 1994. 1200 [JWA] Jones, M., "JSON Web Algorithms (JWA)", 1201 draft-ietf-jose-json-web-algorithms (work in progress), 1202 March 2014. 1204 [JWK] Jones, M., "JSON Web Key (JWK)", 1205 draft-ietf-jose-json-web-key (work in progress), 1206 March 2014. 1208 [RFC1421] Linn, J., "Privacy Enhancement for Internet Electronic 1209 Mail: Part I: Message Encryption and Authentication 1210 Procedures", RFC 1421, February 1993. 1212 [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 1213 Extensions (MIME) Part One: Format of Internet Message 1214 Bodies", RFC 2045, November 1996. 1216 [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 1217 Extensions (MIME) Part Two: Media Types", RFC 2046, 1218 November 1996. 1220 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1221 Requirement Levels", BCP 14, RFC 2119, March 1997. 1223 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 1225 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 1226 10646", STD 63, RFC 3629, November 2003. 1228 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 1229 Resource Identifier (URI): Generic Syntax", STD 66, 1230 RFC 3986, January 2005. 1232 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 1233 Encodings", RFC 4648, October 2006. 1235 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 1236 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 1238 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 1239 Housley, R., and W. Polk, "Internet X.509 Public Key 1240 Infrastructure Certificate and Certificate Revocation List 1241 (CRL) Profile", RFC 5280, May 2008. 1243 [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and 1244 Verification of Domain-Based Application Service Identity 1245 within Internet Public Key Infrastructure Using X.509 1246 (PKIX) Certificates in the Context of Transport Layer 1247 Security (TLS)", RFC 6125, March 2011. 1249 [RFC7158] Bray, T., "The JavaScript Object Notation (JSON) Data 1250 Interchange Format", RFC 7158, March 2014. 1252 [USASCII] American National Standards Institute, "Coded Character 1253 Set -- 7-bit American Standard Code for Information 1254 Interchange", ANSI X3.4, 1986. 1256 11.2. Informative References 1258 [CanvasApp] 1259 Facebook, "Canvas Applications", 2010. 1261 [JSS] Bradley, J. and N. Sakimura (editor), "JSON Simple Sign", 1262 September 2010. 1264 [JWE] Jones, M., Rescorla, E., and J. Hildebrand, "JSON Web 1265 Encryption (JWE)", draft-ietf-jose-json-web-encryption 1266 (work in progress), March 2014. 1268 [JWT] Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token 1269 (JWT)", draft-ietf-oauth-json-web-token (work in 1270 progress), March 2014. 1272 [MagicSignatures] 1273 Panzer (editor), J., Laurie, B., and D. Balfanz, "Magic 1274 Signatures", January 2011. 1276 [RFC4122] Leach, P., Mealling, M., and R. Salz, "A Universally 1277 Unique IDentifier (UUID) URN Namespace", RFC 4122, 1278 July 2005. 1280 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 1281 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 1282 May 2008. 1284 [W3C.CR-xmldsig-core2-20120124] 1285 Cantor, S., Roessler, T., Eastlake, D., Yiu, K., Reagle, 1286 J., Solo, D., Datta, P., and F. Hirsch, "XML Signature 1287 Syntax and Processing Version 2.0", World Wide Web 1288 Consortium CR CR-xmldsig-core2-20120124, January 2012, 1289 . 1291 [W3C.WD-xmldsig-bestpractices-20110809] 1292 Datta, P. and F. Hirsch, "XML Signature Best Practices", 1293 World Wide Web Consortium WD WD-xmldsig-bestpractices- 1294 20110809, August 2011, . 1297 Appendix A. JWS Examples 1299 This section provides several examples of JWSs. While the first 1300 three examples all represent JSON Web Tokens (JWTs) [JWT], the 1301 payload can be any octet sequence, as shown in Appendix A.4. 1303 A.1. Example JWS using HMAC SHA-256 1305 A.1.1. Encoding 1307 The following example JWS Protected Header declares that the data 1308 structure is a JSON Web Token (JWT) [JWT] and the JWS Signing Input 1309 is secured using the HMAC SHA-256 algorithm. 1311 {"typ":"JWT", 1312 "alg":"HS256"} 1314 The octets representing UTF8(JWS Protected Header) in this case are: 1316 [123, 34, 116, 121, 112, 34, 58, 34, 74, 87, 84, 34, 44, 13, 10, 32, 1317 34, 97, 108, 103, 34, 58, 34, 72, 83, 50, 53, 54, 34, 125] 1319 Encoding this JWS Protected Header as BASE64URL(UTF8(JWS Protected 1320 Header)) gives this value: 1322 eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9 1324 The JWS Payload used in this example is the octets of the UTF-8 1325 representation of the JSON object below. (Note that the payload can 1326 be any base64url encoded octet sequence, and need not be a base64url 1327 encoded JSON object.) 1329 {"iss":"joe", 1330 "exp":1300819380, 1331 "http://example.com/is_root":true} 1333 The following octet sequence, which is the UTF-8 representation of 1334 the JSON object above, is the JWS Payload: 1336 [123, 34, 105, 115, 115, 34, 58, 34, 106, 111, 101, 34, 44, 13, 10, 1337 32, 34, 101, 120, 112, 34, 58, 49, 51, 48, 48, 56, 49, 57, 51, 56, 1338 48, 44, 13, 10, 32, 34, 104, 116, 116, 112, 58, 47, 47, 101, 120, 97, 1339 109, 112, 108, 101, 46, 99, 111, 109, 47, 105, 115, 95, 114, 111, 1340 111, 116, 34, 58, 116, 114, 117, 101, 125] 1342 Encoding this JWS Protected Header as BASE64URL(UTF8(JWS Protected 1343 Header)) gives this value (with line breaks for display purposes 1344 only): 1346 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 1347 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 1349 Combining these as BASE64URL(UTF8(JWS Protected Header)) || '.' || 1350 BASE64URL(JWS Payload) gives this string (with line breaks for 1351 display purposes only): 1353 eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9 1354 . 1355 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 1356 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 1358 The resulting JWS Signing Input value, which is the ASCII 1359 representation of above string, is the following octet sequence: 1361 [101, 121, 74, 48, 101, 88, 65, 105, 79, 105, 74, 75, 86, 49, 81, 1362 105, 76, 65, 48, 75, 73, 67, 74, 104, 98, 71, 99, 105, 79, 105, 74, 1363 73, 85, 122, 73, 49, 78, 105, 74, 57, 46, 101, 121, 74, 112, 99, 51, 1364 77, 105, 79, 105, 74, 113, 98, 50, 85, 105, 76, 65, 48, 75, 73, 67, 1365 74, 108, 101, 72, 65, 105, 79, 106, 69, 122, 77, 68, 65, 52, 77, 84, 1366 107, 122, 79, 68, 65, 115, 68, 81, 111, 103, 73, 109, 104, 48, 100, 1367 72, 65, 54, 76, 121, 57, 108, 101, 71, 70, 116, 99, 71, 120, 108, 76, 1368 109, 78, 118, 98, 83, 57, 112, 99, 49, 57, 121, 98, 50, 57, 48, 73, 1369 106, 112, 48, 99, 110, 86, 108, 102, 81] 1371 HMACs are generated using keys. This example uses the symmetric key 1372 represented in JSON Web Key [JWK] format below (with line breaks for 1373 display purposes only): 1375 {"kty":"oct", 1376 "k":"AyM1SysPpbyDfgZld3umj1qzKObwVMkoqQ-EstJQLr_T-1qS0gZH75 1377 aKtMN3Yj0iPS4hcgUuTwjAzZr1Z9CAow" 1378 } 1380 Running the HMAC SHA-256 algorithm on the JWS Signing Input with this 1381 key yields this JWS Signature octet sequence: 1383 [116, 24, 223, 180, 151, 153, 224, 37, 79, 250, 96, 125, 216, 173, 1384 187, 186, 22, 212, 37, 77, 105, 214, 191, 240, 91, 88, 5, 88, 83, 1385 132, 141, 121] 1387 Encoding this JWS Signature as BASE64URL(JWS Signature) gives this 1388 value: 1390 dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk 1392 Concatenating these values in the order Header.Payload.Signature with 1393 period ('.') characters between the parts yields this complete JWS 1394 representation using the JWS Compact Serialization (with line breaks 1395 for display purposes only): 1397 eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9 1398 . 1399 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 1400 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 1401 . 1402 dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk 1404 A.1.2. Validating 1406 Since the "alg" Header Parameter is "HS256", we validate the HMAC 1407 SHA-256 value contained in the JWS Signature. 1409 To validate the HMAC value, we repeat the previous process of using 1410 the correct key and the JWS Signing Input as input to the HMAC SHA- 1411 256 function and then taking the output and determining if it matches 1412 the JWS Signature. If it matches exactly, the HMAC has been 1413 validated. 1415 A.2. Example JWS using RSASSA-PKCS-v1_5 SHA-256 1417 A.2.1. Encoding 1419 The JWS Protected Header in this example is different from the 1420 previous example in two ways: First, because a different algorithm is 1421 being used, the "alg" value is different. Second, for illustration 1422 purposes only, the optional "typ" parameter is not used. (This 1423 difference is not related to the algorithm employed.) The JWS 1424 Protected Header used is: 1426 {"alg":"RS256"} 1428 The octets representing UTF8(JWS Protected Header) in this case are: 1430 [123, 34, 97, 108, 103, 34, 58, 34, 82, 83, 50, 53, 54, 34, 125] 1432 Encoding this JWS Protected Header as BASE64URL(UTF8(JWS Protected 1433 Header)) gives this value: 1435 eyJhbGciOiJSUzI1NiJ9 1437 The JWS Payload used in this example, which follows, is the same as 1438 in the previous example. Since the BASE64URL(JWS Payload) value will 1439 therefore be the same, its computation is not repeated here. 1441 {"iss":"joe", 1442 "exp":1300819380, 1443 "http://example.com/is_root":true} 1445 Combining these as BASE64URL(UTF8(JWS Protected Header)) || '.' || 1446 BASE64URL(JWS Payload) gives this string (with line breaks for 1447 display purposes only): 1449 eyJhbGciOiJSUzI1NiJ9 1450 . 1451 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 1452 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 1454 The resulting JWS Signing Input value, which is the ASCII 1455 representation of above string, is the following octet sequence: 1457 [101, 121, 74, 104, 98, 71, 99, 105, 79, 105, 74, 83, 85, 122, 73, 1458 49, 78, 105, 74, 57, 46, 101, 121, 74, 112, 99, 51, 77, 105, 79, 105, 1459 74, 113, 98, 50, 85, 105, 76, 65, 48, 75, 73, 67, 74, 108, 101, 72, 1460 65, 105, 79, 106, 69, 122, 77, 68, 65, 52, 77, 84, 107, 122, 79, 68, 1461 65, 115, 68, 81, 111, 103, 73, 109, 104, 48, 100, 72, 65, 54, 76, 1462 121, 57, 108, 101, 71, 70, 116, 99, 71, 120, 108, 76, 109, 78, 118, 1463 98, 83, 57, 112, 99, 49, 57, 121, 98, 50, 57, 48, 73, 106, 112, 48, 1464 99, 110, 86, 108, 102, 81] 1466 This example uses the RSA key represented in JSON Web Key [JWK] 1467 format below (with line breaks for display purposes only): 1469 {"kty":"RSA", 1470 "n":"ofgWCuLjybRlzo0tZWJjNiuSfb4p4fAkd_wWJcyQoTbji9k0l8W26mPddx 1471 HmfHQp-Vaw-4qPCJrcS2mJPMEzP1Pt0Bm4d4QlL-yRT-SFd2lZS-pCgNMs 1472 D1W_YpRPEwOWvG6b32690r2jZ47soMZo9wGzjb_7OMg0LOL-bSf63kpaSH 1473 SXndS5z5rexMdbBYUsLA9e-KXBdQOS-UTo7WTBEMa2R2CapHg665xsmtdV 1474 MTBQY4uDZlxvb3qCo5ZwKh9kG4LT6_I5IhlJH7aGhyxXFvUK-DWNmoudF8 1475 NAco9_h9iaGNj8q2ethFkMLs91kzk2PAcDTW9gb54h4FRWyuXpoQ", 1476 "e":"AQAB", 1477 "d":"Eq5xpGnNCivDflJsRQBXHx1hdR1k6Ulwe2JZD50LpXyWPEAeP88vLNO97I 1478 jlA7_GQ5sLKMgvfTeXZx9SE-7YwVol2NXOoAJe46sui395IW_GO-pWJ1O0 1479 BkTGoVEn2bKVRUCgu-GjBVaYLU6f3l9kJfFNS3E0QbVdxzubSu3Mkqzjkn 1480 439X0M_V51gfpRLI9JYanrC4D4qAdGcopV_0ZHHzQlBjudU2QvXt4ehNYT 1481 CBr6XCLQUShb1juUO1ZdiYoFaFQT5Tw8bGUl_x_jTj3ccPDVZFD9pIuhLh 1482 BOneufuBiB4cS98l2SR_RQyGWSeWjnczT0QU91p1DhOVRuOopznQ" 1483 } 1485 The RSA private key is then passed to the RSA signing function, which 1486 also takes the hash type, SHA-256, and the JWS Signing Input as 1487 inputs. The result of the digital signature is an octet sequence, 1488 which represents a big endian integer. In this example, it is: 1490 [112, 46, 33, 137, 67, 232, 143, 209, 30, 181, 216, 45, 191, 120, 69, 1491 243, 65, 6, 174, 27, 129, 255, 247, 115, 17, 22, 173, 209, 113, 125, 1492 131, 101, 109, 66, 10, 253, 60, 150, 238, 221, 115, 162, 102, 62, 81, 1493 102, 104, 123, 0, 11, 135, 34, 110, 1, 135, 237, 16, 115, 249, 69, 1494 229, 130, 173, 252, 239, 22, 216, 90, 121, 142, 232, 198, 109, 219, 1495 61, 184, 151, 91, 23, 208, 148, 2, 190, 237, 213, 217, 217, 112, 7, 1496 16, 141, 178, 129, 96, 213, 248, 4, 12, 167, 68, 87, 98, 184, 31, 1497 190, 127, 249, 217, 46, 10, 231, 111, 36, 242, 91, 51, 187, 230, 244, 1498 74, 230, 30, 177, 4, 10, 203, 32, 4, 77, 62, 249, 18, 142, 212, 1, 1499 48, 121, 91, 212, 189, 59, 65, 238, 202, 208, 102, 171, 101, 25, 129, 1500 253, 228, 141, 247, 127, 55, 45, 195, 139, 159, 175, 221, 59, 239, 1501 177, 139, 93, 163, 204, 60, 46, 176, 47, 158, 58, 65, 214, 18, 202, 1502 173, 21, 145, 18, 115, 160, 95, 35, 185, 232, 56, 250, 175, 132, 157, 1503 105, 132, 41, 239, 90, 30, 136, 121, 130, 54, 195, 212, 14, 96, 69, 1504 34, 165, 68, 200, 242, 122, 122, 45, 184, 6, 99, 209, 108, 247, 202, 1505 234, 86, 222, 64, 92, 178, 33, 90, 69, 178, 194, 85, 102, 181, 90, 1506 193, 167, 72, 160, 112, 223, 200, 163, 42, 70, 149, 67, 208, 25, 238, 1507 251, 71] 1509 Encoding the signature as BASE64URL(JWS Signature) produces this 1510 value (with line breaks for display purposes only): 1512 cC4hiUPoj9Eetdgtv3hF80EGrhuB__dzERat0XF9g2VtQgr9PJbu3XOiZj5RZmh7 1513 AAuHIm4Bh-0Qc_lF5YKt_O8W2Fp5jujGbds9uJdbF9CUAr7t1dnZcAcQjbKBYNX4 1514 BAynRFdiuB--f_nZLgrnbyTyWzO75vRK5h6xBArLIARNPvkSjtQBMHlb1L07Qe7K 1515 0GarZRmB_eSN9383LcOLn6_dO--xi12jzDwusC-eOkHWEsqtFZESc6BfI7noOPqv 1516 hJ1phCnvWh6IeYI2w9QOYEUipUTI8np6LbgGY9Fs98rqVt5AXLIhWkWywlVmtVrB 1517 p0igcN_IoypGlUPQGe77Rw 1519 Concatenating these values in the order Header.Payload.Signature with 1520 period ('.') characters between the parts yields this complete JWS 1521 representation using the JWS Compact Serialization (with line breaks 1522 for display purposes only): 1524 eyJhbGciOiJSUzI1NiJ9 1525 . 1526 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 1527 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 1528 . 1529 cC4hiUPoj9Eetdgtv3hF80EGrhuB__dzERat0XF9g2VtQgr9PJbu3XOiZj5RZmh7 1530 AAuHIm4Bh-0Qc_lF5YKt_O8W2Fp5jujGbds9uJdbF9CUAr7t1dnZcAcQjbKBYNX4 1531 BAynRFdiuB--f_nZLgrnbyTyWzO75vRK5h6xBArLIARNPvkSjtQBMHlb1L07Qe7K 1532 0GarZRmB_eSN9383LcOLn6_dO--xi12jzDwusC-eOkHWEsqtFZESc6BfI7noOPqv 1533 hJ1phCnvWh6IeYI2w9QOYEUipUTI8np6LbgGY9Fs98rqVt5AXLIhWkWywlVmtVrB 1534 p0igcN_IoypGlUPQGe77Rw 1536 A.2.2. Validating 1538 Since the "alg" Header Parameter is "RS256", we validate the RSASSA- 1539 PKCS-v1_5 SHA-256 digital signature contained in the JWS Signature. 1541 Validating the JWS Signature is a little different from the previous 1542 example. We pass (n, e), JWS Signature, and the JWS Signing Input to 1543 an RSASSA-PKCS-v1_5 signature verifier that has been configured to 1544 use the SHA-256 hash function. 1546 A.3. Example JWS using ECDSA P-256 SHA-256 1548 A.3.1. Encoding 1550 The JWS Protected Header for this example differs from the previous 1551 example because a different algorithm is being used. The JWS 1552 Protected Header used is: 1554 {"alg":"ES256"} 1556 The octets representing UTF8(JWS Protected Header) in this case are: 1558 [123, 34, 97, 108, 103, 34, 58, 34, 69, 83, 50, 53, 54, 34, 125] 1560 Encoding this JWS Protected Header as BASE64URL(UTF8(JWS Protected 1561 Header)) gives this value: 1563 eyJhbGciOiJFUzI1NiJ9 1565 The JWS Payload used in this example, which follows, is the same as 1566 in the previous examples. Since the BASE64URL(JWS Payload) value 1567 will therefore be the same, its computation is not repeated here. 1569 {"iss":"joe", 1570 "exp":1300819380, 1571 "http://example.com/is_root":true} 1573 Combining these as BASE64URL(UTF8(JWS Protected Header)) || '.' || 1574 BASE64URL(JWS Payload) gives this string (with line breaks for 1575 display purposes only): 1577 eyJhbGciOiJFUzI1NiJ9 1578 . 1579 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 1580 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 1582 The resulting JWS Signing Input value, which is the ASCII 1583 representation of above string, is the following octet sequence: 1585 [101, 121, 74, 104, 98, 71, 99, 105, 79, 105, 74, 70, 85, 122, 73, 1586 49, 78, 105, 74, 57, 46, 101, 121, 74, 112, 99, 51, 77, 105, 79, 105, 1587 74, 113, 98, 50, 85, 105, 76, 65, 48, 75, 73, 67, 74, 108, 101, 72, 1588 65, 105, 79, 106, 69, 122, 77, 68, 65, 52, 77, 84, 107, 122, 79, 68, 1589 65, 115, 68, 81, 111, 103, 73, 109, 104, 48, 100, 72, 65, 54, 76, 1590 121, 57, 108, 101, 71, 70, 116, 99, 71, 120, 108, 76, 109, 78, 118, 1591 98, 83, 57, 112, 99, 49, 57, 121, 98, 50, 57, 48, 73, 106, 112, 48, 1592 99, 110, 86, 108, 102, 81] 1594 This example uses the elliptic curve key represented in JSON Web Key 1595 [JWK] format below: 1597 {"kty":"EC", 1598 "crv":"P-256", 1599 "x":"f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU", 1600 "y":"x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0", 1601 "d":"jpsQnnGQmL-YBIffH1136cspYG6-0iY7X1fCE9-E9LI" 1602 } 1604 The ECDSA private part d is then passed to an ECDSA signing function, 1605 which also takes the curve type, P-256, the hash type, SHA-256, and 1606 the JWS Signing Input as inputs. The result of the digital signature 1607 is the EC point (R, S), where R and S are unsigned integers. In this 1608 example, the R and S values, given as octet sequences representing 1609 big endian integers are: 1611 +--------+----------------------------------------------------------+ 1612 | Result | Value | 1613 | Name | | 1614 +--------+----------------------------------------------------------+ 1615 | R | [14, 209, 33, 83, 121, 99, 108, 72, 60, 47, 127, 21, 88, | 1616 | | 7, 212, 2, 163, 178, 40, 3, 58, 249, 124, 126, 23, 129, | 1617 | | 154, 195, 22, 158, 166, 101] | 1618 | S | [197, 10, 7, 211, 140, 60, 112, 229, 216, 241, 45, 175, | 1619 | | 8, 74, 84, 128, 166, 101, 144, 197, 242, 147, 80, 154, | 1620 | | 143, 63, 127, 138, 131, 163, 84, 213] | 1621 +--------+----------------------------------------------------------+ 1623 The JWS Signature is the value R || S. Encoding the signature as 1624 BASE64URL(JWS Signature) produces this value (with line breaks for 1625 display purposes only): 1627 DtEhU3ljbEg8L38VWAfUAqOyKAM6-Xx-F4GawxaepmXFCgfTjDxw5djxLa8ISlSA 1628 pmWQxfKTUJqPP3-Kg6NU1Q 1630 Concatenating these values in the order Header.Payload.Signature with 1631 period ('.') characters between the parts yields this complete JWS 1632 representation using the JWS Compact Serialization (with line breaks 1633 for display purposes only): 1635 eyJhbGciOiJFUzI1NiJ9 1636 . 1637 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 1638 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 1639 . 1640 DtEhU3ljbEg8L38VWAfUAqOyKAM6-Xx-F4GawxaepmXFCgfTjDxw5djxLa8ISlSA 1641 pmWQxfKTUJqPP3-Kg6NU1Q 1643 A.3.2. Validating 1645 Since the "alg" Header Parameter is "ES256", we validate the ECDSA 1646 P-256 SHA-256 digital signature contained in the JWS Signature. 1648 Validating the JWS Signature is a little different from the first 1649 example. We need to split the 64 member octet sequence of the JWS 1650 Signature into two 32 octet sequences, the first R and the second S. 1651 We then pass (x, y), (R, S) and the JWS Signing Input to an ECDSA 1652 signature verifier that has been configured to use the P-256 curve 1653 with the SHA-256 hash function. 1655 A.4. Example JWS using ECDSA P-521 SHA-512 1657 A.4.1. Encoding 1659 The JWS Protected Header for this example differs from the previous 1660 example because different ECDSA curves and hash functions are used. 1661 The JWS Protected Header used is: 1663 {"alg":"ES512"} 1665 The octets representing UTF8(JWS Protected Header) in this case are: 1667 [123, 34, 97, 108, 103, 34, 58, 34, 69, 83, 53, 49, 50, 34, 125] 1669 Encoding this JWS Protected Header as BASE64URL(UTF8(JWS Protected 1670 Header)) gives this value: 1672 eyJhbGciOiJFUzUxMiJ9 1674 The JWS Payload used in this example, is the ASCII string "Payload". 1675 The representation of this string is the octet sequence: 1677 [80, 97, 121, 108, 111, 97, 100] 1679 Encoding this JWS Payload as BASE64URL(JWS Payload) gives this value: 1681 UGF5bG9hZA 1683 Combining these as BASE64URL(UTF8(JWS Protected Header)) || '.' || 1684 BASE64URL(JWS Payload) gives this string (with line breaks for 1685 display purposes only): 1687 eyJhbGciOiJFUzUxMiJ9.UGF5bG9hZA 1689 The resulting JWS Signing Input value, which is the ASCII 1690 representation of above string, is the following octet sequence: 1692 [101, 121, 74, 104, 98, 71, 99, 105, 79, 105, 74, 70, 85, 122, 85, 1693 120, 77, 105, 74, 57, 46, 85, 71, 70, 53, 98, 71, 57, 104, 90, 65] 1695 This example uses the elliptic curve key represented in JSON Web Key 1696 [JWK] format below (with line breaks for display purposes only): 1698 {"kty":"EC", 1699 "crv":"P-521", 1700 "x":"AekpBQ8ST8a8VcfVOTNl353vSrDCLLJXmPk06wTjxrrjcBpXp5EOnYG_ 1701 NjFZ6OvLFV1jSfS9tsz4qUxcWceqwQGk", 1702 "y":"ADSmRA43Z1DSNx_RvcLI87cdL07l6jQyyBXMoxVg_l2Th-x3S1WDhjDl 1703 y79ajL4Kkd0AZMaZmh9ubmf63e3kyMj2", 1704 "d":"AY5pb7A0UFiB3RELSD64fTLOSV_jazdF7fLYyuTw8lOfRhWg6Y6rUrPA 1705 xerEzgdRhajnu0ferB0d53vM9mE15j2C" 1706 } 1708 The ECDSA private part d is then passed to an ECDSA signing function, 1709 which also takes the curve type, P-521, the hash type, SHA-512, and 1710 the JWS Signing Input as inputs. The result of the digital signature 1711 is the EC point (R, S), where R and S are unsigned integers. In this 1712 example, the R and S values, given as octet sequences representing 1713 big endian integers are: 1715 +--------+----------------------------------------------------------+ 1716 | Result | Value | 1717 | Name | | 1718 +--------+----------------------------------------------------------+ 1719 | R | [1, 220, 12, 129, 231, 171, 194, 209, 232, 135, 233, | 1720 | | 117, 247, 105, 122, 210, 26, 125, 192, 1, 217, 21, 82, | 1721 | | 91, 45, 240, 255, 83, 19, 34, 239, 71, 48, 157, 147, | 1722 | | 152, 105, 18, 53, 108, 163, 214, 68, 231, 62, 153, 150, | 1723 | | 106, 194, 164, 246, 72, 143, 138, 24, 50, 129, 223, 133, | 1724 | | 206, 209, 172, 63, 237, 119, 109] | 1725 | S | [0, 111, 6, 105, 44, 5, 41, 208, 128, 61, 152, 40, 92, | 1726 | | 61, 152, 4, 150, 66, 60, 69, 247, 196, 170, 81, 193, | 1727 | | 199, 78, 59, 194, 169, 16, 124, 9, 143, 42, 142, 131, | 1728 | | 48, 206, 238, 34, 175, 83, 203, 220, 159, 3, 107, 155, | 1729 | | 22, 27, 73, 111, 68, 68, 21, 238, 144, 229, 232, 148, | 1730 | | 188, 222, 59, 242, 103] | 1731 +--------+----------------------------------------------------------+ 1733 The JWS Signature is the value R || S. Encoding the signature as 1734 BASE64URL(JWS Signature) produces this value (with line breaks for 1735 display purposes only): 1737 AdwMgeerwtHoh-l192l60hp9wAHZFVJbLfD_UxMi70cwnZOYaRI1bKPWROc-mZZq 1738 wqT2SI-KGDKB34XO0aw_7XdtAG8GaSwFKdCAPZgoXD2YBJZCPEX3xKpRwcdOO8Kp 1739 EHwJjyqOgzDO7iKvU8vcnwNrmxYbSW9ERBXukOXolLzeO_Jn 1741 Concatenating these values in the order Header.Payload.Signature with 1742 period ('.') characters between the parts yields this complete JWS 1743 representation using the JWS Compact Serialization (with line breaks 1744 for display purposes only): 1746 eyJhbGciOiJFUzUxMiJ9 1747 . 1748 UGF5bG9hZA 1749 . 1750 AdwMgeerwtHoh-l192l60hp9wAHZFVJbLfD_UxMi70cwnZOYaRI1bKPWROc-mZZq 1751 wqT2SI-KGDKB34XO0aw_7XdtAG8GaSwFKdCAPZgoXD2YBJZCPEX3xKpRwcdOO8Kp 1752 EHwJjyqOgzDO7iKvU8vcnwNrmxYbSW9ERBXukOXolLzeO_Jn 1754 A.4.2. Validating 1756 Since the "alg" Header Parameter is "ES512", we validate the ECDSA 1757 P-521 SHA-512 digital signature contained in the JWS Signature. 1759 Validating the JWS Signature is similar to the previous example. We 1760 need to split the 132 member octet sequence of the JWS Signature into 1761 two 66 octet sequences, the first R and the second S. We then pass 1762 (x, y), (R, S) and the JWS Signing Input to an ECDSA signature 1763 verifier that has been configured to use the P-521 curve with the 1764 SHA-512 hash function. 1766 A.5. Example Plaintext JWS 1768 The following example JWS Protected Header declares that the encoded 1769 object is a Plaintext JWS: 1771 {"alg":"none"} 1773 Encoding this JWS Protected Header as BASE64URL(UTF8(JWS Protected 1774 Header)) gives this value: 1776 eyJhbGciOiJub25lIn0 1778 The JWS Payload used in this example, which follows, is the same as 1779 in the previous examples. Since the BASE64URL(JWS Payload) value 1780 will therefore be the same, its computation is not repeated here. 1782 {"iss":"joe", 1783 "exp":1300819380, 1784 "http://example.com/is_root":true} 1786 The JWS Signature is the empty octet string and BASE64URL(JWS 1787 Signature) is the empty string. 1789 Concatenating these parts in the order Header.Payload.Signature with 1790 period ('.') characters between the parts yields this complete JWS 1791 (with line breaks for display purposes only): 1793 eyJhbGciOiJub25lIn0 1794 . 1795 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 1796 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 1797 . 1799 A.6. Example JWS Using JWS JSON Serialization 1801 This section contains an example using the JWS JSON Serialization. 1802 This example demonstrates the capability for conveying multiple 1803 digital signatures and/or MACs for the same payload. 1805 The JWS Payload used in this example is the same as that used in the 1806 examples in Appendix A.2 and Appendix A.3 (with line breaks for 1807 display purposes only): 1809 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 1810 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 1812 Two digital signatures are used in this example: the first using 1813 RSASSA-PKCS-v1_5 SHA-256 and the second using ECDSA P-256 SHA-256. 1814 For the first, the JWS Protected Header and key are the same as in 1815 Appendix A.2, resulting in the same JWS Signature value; therefore, 1816 its computation is not repeated here. For the second, the JWS 1817 Protected Header and key are the same as in Appendix A.3, resulting 1818 in the same JWS Signature value; therefore, its computation is not 1819 repeated here. 1821 A.6.1. JWS Per-Signature Protected Headers 1823 The JWS Protected Header value used for the first signature is: 1825 {"alg":"RS256"} 1827 Encoding this JWS Protected Header as BASE64URL(UTF8(JWS Protected 1828 Header)) gives this value: 1830 eyJhbGciOiJSUzI1NiJ9 1832 The JWS Protected Header value used for the second signature is: 1834 {"alg":"ES256"} 1836 Encoding this JWS Protected Header as BASE64URL(UTF8(JWS Protected 1837 Header)) gives this value: 1839 eyJhbGciOiJFUzI1NiJ9 1841 A.6.2. JWS Per-Signature Unprotected Headers 1843 Key ID values are supplied for both keys using per-signature Header 1844 Parameters. The two values used to represent these Key IDs are: 1846 {"kid":"2010-12-29"} 1848 and 1850 {"kid":"e9bc097a-ce51-4036-9562-d2ade882db0d"} 1852 A.6.3. Complete JWS Header Values 1854 Combining the protected and unprotected header values supplied, the 1855 JWS Header values used for the first and second signatures 1856 respectively are: 1858 {"alg":"RS256", 1859 "kid":"2010-12-29"} 1861 and 1863 {"alg":"ES256", 1864 "kid":"e9bc097a-ce51-4036-9562-d2ade882db0d"} 1866 A.6.4. Complete JWS JSON Serialization Representation 1868 The complete JSON Web Signature JSON Serialization for these values 1869 is as follows (with line breaks for display purposes only): 1871 {"payload": 1872 "eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGF 1873 tcGxlLmNvbS9pc19yb290Ijp0cnVlfQ", 1874 "signatures":[ 1875 {"protected":"eyJhbGciOiJSUzI1NiJ9", 1876 "header": 1877 {"kid":"2010-12-29"}, 1878 "signature": 1879 "cC4hiUPoj9Eetdgtv3hF80EGrhuB__dzERat0XF9g2VtQgr9PJbu3XOiZj5RZ 1880 mh7AAuHIm4Bh-0Qc_lF5YKt_O8W2Fp5jujGbds9uJdbF9CUAr7t1dnZcAcQjb 1881 KBYNX4BAynRFdiuB--f_nZLgrnbyTyWzO75vRK5h6xBArLIARNPvkSjtQBMHl 1882 b1L07Qe7K0GarZRmB_eSN9383LcOLn6_dO--xi12jzDwusC-eOkHWEsqtFZES 1883 c6BfI7noOPqvhJ1phCnvWh6IeYI2w9QOYEUipUTI8np6LbgGY9Fs98rqVt5AX 1884 LIhWkWywlVmtVrBp0igcN_IoypGlUPQGe77Rw"}, 1885 {"protected":"eyJhbGciOiJFUzI1NiJ9", 1886 "header": 1887 {"kid":"e9bc097a-ce51-4036-9562-d2ade882db0d"}, 1888 "signature": 1889 "DtEhU3ljbEg8L38VWAfUAqOyKAM6-Xx-F4GawxaepmXFCgfTjDxw5djxLa8IS 1890 lSApmWQxfKTUJqPP3-Kg6NU1Q"}] 1891 } 1893 Appendix B. "x5c" (X.509 Certificate Chain) Example 1895 The JSON array below is an example of a certificate chain that could 1896 be used as the value of an "x5c" (X.509 Certificate Chain) Header 1897 Parameter, per Section 4.1.6. Note that since these strings contain 1898 base64 encoded (not base64url encoded) values, they are allowed to 1899 contain white space and line breaks. 1901 ["MIIE3jCCA8agAwIBAgICAwEwDQYJKoZIhvcNAQEFBQAwYzELMAkGA1UEBhMCVVM 1902 xITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR2 1903 8gRGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExM 1904 TYwMTU0MzdaFw0yNjExMTYwMTU0MzdaMIHKMQswCQYDVQQGEwJVUzEQMA4GA1UE 1905 CBMHQXJpem9uYTETMBEGA1UEBxMKU2NvdHRzZGFsZTEaMBgGA1UEChMRR29EYWR 1906 keS5jb20sIEluYy4xMzAxBgNVBAsTKmh0dHA6Ly9jZXJ0aWZpY2F0ZXMuZ29kYW 1907 RkeS5jb20vcmVwb3NpdG9yeTEwMC4GA1UEAxMnR28gRGFkZHkgU2VjdXJlIENlc 1908 nRpZmljYXRpb24gQXV0aG9yaXR5MREwDwYDVQQFEwgwNzk2OTI4NzCCASIwDQYJ 1909 KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMQt1RWMnCZM7DI161+4WQFapmGBWTt 1910 wY6vj3D3HKrjJM9N55DrtPDAjhI6zMBS2sofDPZVUBJ7fmd0LJR4h3mUpfjWoqV 1911 Tr9vcyOdQmVZWt7/v+WIbXnvQAjYwqDL1CBM6nPwT27oDyqu9SoWlm2r4arV3aL 1912 GbqGmu75RpRSgAvSMeYddi5Kcju+GZtCpyz8/x4fKL4o/K1w/O5epHBp+YlLpyo 1913 7RJlbmr2EkRTcDCVw5wrWCs9CHRK8r5RsL+H0EwnWGu1NcWdrxcx+AuP7q2BNgW 1914 JCJjPOq8lh8BJ6qf9Z/dFjpfMFDniNoW1fho3/Rb2cRGadDAW/hOUoz+EDU8CAw 1915 EAAaOCATIwggEuMB0GA1UdDgQWBBT9rGEyk2xF1uLuhV+auud2mWjM5zAfBgNVH 1916 SMEGDAWgBTSxLDSkdRMEXGzYcs9of7dqGrU4zASBgNVHRMBAf8ECDAGAQH/AgEA 1917 MDMGCCsGAQUFBwEBBCcwJTAjBggrBgEFBQcwAYYXaHR0cDovL29jc3AuZ29kYWR 1918 keS5jb20wRgYDVR0fBD8wPTA7oDmgN4Y1aHR0cDovL2NlcnRpZmljYXRlcy5nb2 1919 RhZGR5LmNvbS9yZXBvc2l0b3J5L2dkcm9vdC5jcmwwSwYDVR0gBEQwQjBABgRVH 1920 SAAMDgwNgYIKwYBBQUHAgEWKmh0dHA6Ly9jZXJ0aWZpY2F0ZXMuZ29kYWRkeS5j 1921 b20vcmVwb3NpdG9yeTAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQEFBQADggE 1922 BANKGwOy9+aG2Z+5mC6IGOgRQjhVyrEp0lVPLN8tESe8HkGsz2ZbwlFalEzAFPI 1923 UyIXvJxwqoJKSQ3kbTJSMUA2fCENZvD117esyfxVgqwcSeIaha86ykRvOe5GPLL 1924 5CkKSkB2XIsKd83ASe8T+5o0yGPwLPk9Qnt0hCqU7S+8MxZC9Y7lhyVJEnfzuz9 1925 p0iRFEUOOjZv2kWzRaJBydTXRE4+uXR21aITVSzGh6O1mawGhId/dQb8vxRMDsx 1926 uxN89txJx9OjxUUAiKEngHUuHqDTMBqLdElrRhjZkAzVvb3du6/KFUJheqwNTrZ 1927 EjYx8WnM25sgVjOuH0aBsXBTWVU+4=", 1928 "MIIE+zCCBGSgAwIBAgICAQ0wDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1Z 1929 hbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIE 1930 luYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIgUG9saWN5IFZhbGlkYXRpb 1931 24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8x 1932 IDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTA0MDYyOTE3MDY 1933 yMFoXDTI0MDYyOTE3MDYyMFowYzELMAkGA1UEBhMCVVMxITAfBgNVBAoTGFRoZS 1934 BHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28gRGFkZHkgQ2xhc3MgM 1935 iBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQADggEN 1936 ADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XC 1937 APVYYYwhv2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux 1938 6wwdhFJ2+qN1j3hybX2C32qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLO 1939 tXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6jYGB0xUGlcmIbYsUfb18aQr4CUWWo 1940 riMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmYvLEHZ6IVDd2gWMZ 1941 Eewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjggHhMIIB3TAdBgNVHQ 1942 4EFgQU0sSw0pHUTBFxs2HLPaH+3ahq1OMwgdIGA1UdIwSByjCBx6GBwaSBvjCBu 1943 zEkMCIGA1UEBxMbVmFsaUNlcnQgVmFsaWRhdGlvbiBOZXR3b3JrMRcwFQYDVQQK 1944 Ew5WYWxpQ2VydCwgSW5jLjE1MDMGA1UECxMsVmFsaUNlcnQgQ2xhc3MgMiBQb2x 1945 pY3kgVmFsaWRhdGlvbiBBdXRob3JpdHkxITAfBgNVBAMTGGh0dHA6Ly93d3cudm 1946 FsaWNlcnQuY29tLzEgMB4GCSqGSIb3DQEJARYRaW5mb0B2YWxpY2VydC5jb22CA 1947 QEwDwYDVR0TAQH/BAUwAwEB/zAzBggrBgEFBQcBAQQnMCUwIwYIKwYBBQUHMAGG 1948 F2h0dHA6Ly9vY3NwLmdvZGFkZHkuY29tMEQGA1UdHwQ9MDswOaA3oDWGM2h0dHA 1949 6Ly9jZXJ0aWZpY2F0ZXMuZ29kYWRkeS5jb20vcmVwb3NpdG9yeS9yb290LmNybD 1950 BLBgNVHSAERDBCMEAGBFUdIAAwODA2BggrBgEFBQcCARYqaHR0cDovL2NlcnRpZ 1951 mljYXRlcy5nb2RhZGR5LmNvbS9yZXBvc2l0b3J5MA4GA1UdDwEB/wQEAwIBBjAN 1952 BgkqhkiG9w0BAQUFAAOBgQC1QPmnHfbq/qQaQlpE9xXUhUaJwL6e4+PrxeNYiY+ 1953 Sn1eocSxI0YGyeR+sBjUZsE4OWBsUs5iB0QQeyAfJg594RAoYC5jcdnplDQ1tgM 1954 QLARzLrUc+cb53S8wGd9D0VmsfSxOaFIqII6hR8INMqzW/Rn453HWkrugp++85j 1955 09VZw==", 1956 "MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ 1957 0IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNT 1958 AzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0a 1959 G9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkq 1960 hkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMTk1NFoXDTE 1961 5MDYyNjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTm 1962 V0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZ 1963 XJ0IENsYXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQD 1964 ExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9 1965 AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOOnHK5a 1966 vIWZJV16vYdA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVCCSRrCl6zf 1967 N1SLUzm1NZ9WlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwb 1968 P7RfZHM047QSv4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQU 1969 AA4GBADt/UG9vUJSZSWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQ 1970 C1u+mNr0HZDzTuIYEZoDJJKPTEjlbVUjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMM 1971 j4QssxsodyamEwCW/POuZ6lcg5Ktz885hZo+L7tdEy8W9ViH0Pd"] 1973 Appendix C. Notes on implementing base64url encoding without padding 1975 This appendix describes how to implement base64url encoding and 1976 decoding functions without padding based upon standard base64 1977 encoding and decoding functions that do use padding. 1979 To be concrete, example C# code implementing these functions is shown 1980 below. Similar code could be used in other languages. 1982 static string base64urlencode(byte [] arg) 1983 { 1984 string s = Convert.ToBase64String(arg); // Regular base64 encoder 1985 s = s.Split('=')[0]; // Remove any trailing '='s 1986 s = s.Replace('+', '-'); // 62nd char of encoding 1987 s = s.Replace('/', '_'); // 63rd char of encoding 1988 return s; 1989 } 1991 static byte [] base64urldecode(string arg) 1992 { 1993 string s = arg; 1994 s = s.Replace('-', '+'); // 62nd char of encoding 1995 s = s.Replace('_', '/'); // 63rd char of encoding 1996 switch (s.Length % 4) // Pad with trailing '='s 1997 { 1998 case 0: break; // No pad chars in this case 1999 case 2: s += "=="; break; // Two pad chars 2000 case 3: s += "="; break; // One pad char 2001 default: throw new System.Exception( 2002 "Illegal base64url string!"); 2003 } 2004 return Convert.FromBase64String(s); // Standard base64 decoder 2005 } 2007 As per the example code above, the number of '=' padding characters 2008 that needs to be added to the end of a base64url encoded string 2009 without padding to turn it into one with padding is a deterministic 2010 function of the length of the encoded string. Specifically, if the 2011 length mod 4 is 0, no padding is added; if the length mod 4 is 2, two 2012 '=' padding characters are added; if the length mod 4 is 3, one '=' 2013 padding character is added; if the length mod 4 is 1, the input is 2014 malformed. 2016 An example correspondence between unencoded and encoded values 2017 follows. The octet sequence below encodes into the string below, 2018 which when decoded, reproduces the octet sequence. 2019 3 236 255 224 193 2020 A-z_4ME 2022 Appendix D. Notes on Key Selection 2024 This appendix describes a set of possible algorithms for selecting 2025 the key to be used to validate the digital signature or MAC of a JWS 2026 object or for selecting the key to be used to decrypt a JWE object. 2027 This guidance describes a family of possible algorithms, rather than 2028 a single algorithm, because in different contexts, not all the 2029 sources of keys will be used, they can be tried in different orders, 2030 and sometimes not all the collected keys will be tried; hence, 2031 different algorithms will be used in different application contexts. 2033 The steps below are described for illustration purposes only; 2034 specific applications can and are likely to use different algorithms 2035 or perform some of the steps in different orders. Specific 2036 applications will frequently have a much simpler method of 2037 determining the keys to use, as there may be one or two key selection 2038 methods that are profiled for the application's use. This appendix 2039 supplements the normative information on key location in Section 6. 2041 These algorithms include the following steps. Note that the steps 2042 can be performed in any order and do not need to be treated as 2043 distinct. For example, keys can be tried as soon as they are found, 2044 rather than collecting all the keys before trying any. 2046 1. Collect the set of potentially applicable keys. Sources of keys 2047 may include: 2049 * Keys supplied by the application protocol being used. 2051 * Keys referenced by the "jku" (JWK Set URL) Header Parameter. 2053 * The key provided by the "jwk" (JSON Web Key) Header Parameter. 2055 * The key referenced by the "x5u" (X.509 URL) Header Parameter. 2057 * The key provided by the "x5c" (X.509 Certificate Chain) Header 2058 Parameter. 2060 * Other applicable keys available to the application. 2062 The order for collecting and trying keys from different key 2063 sources is typically application dependent. For example, 2064 frequently all keys from a one set of locations, such as local 2065 caches, will be tried before collecting and trying keys from 2066 other locations. 2068 2. Filter the set of collected keys. For instance, some 2069 applications will use only keys referenced by "kid" (key ID) or 2070 "x5t" (X.509 certificate SHA-1 thumbprint) parameters. If the 2071 application uses the "alg" (algorithm), "use" (public key use), 2072 or "key_ops" (key operations) parameters, keys with keys with 2073 inappropriate values of those parameters would be excluded. 2074 Additionally, keys might be filtered to include or exclude keys 2075 with certain other member values in an application specific 2076 manner. For some applications, no filtering will be applied. 2078 3. Order the set of collected keys. For instance, keys referenced 2079 by "kid" (Key ID) or "x5t" (X.509 Certificate SHA-1 Thumbprint) 2080 parameters might be tried before keys with neither of these 2081 values. Likewise, keys with certain member values might be 2082 ordered before keys with other member values. For some 2083 applications, no ordering will be applied. 2085 4. Make trust decisions about the keys. Signatures made with keys 2086 not meeting the application's trust criteria would not be 2087 accepted. Such criteria might include, but is not limited to the 2088 source of the key, whether the TLS certificate validates for keys 2089 retrieved from URLs, whether a key in an X.509 certificate is 2090 backed by a valid certificate chain, and other information known 2091 by the application. 2093 5. Attempt signature or MAC validation for a JWS object or 2094 decryption of a JWE object with some or all of the collected and 2095 possibly filtered and/or ordered keys. A limit on the number of 2096 keys to be tried might be applied. This process will normally 2097 terminate following a successful validation or decryption. 2099 Note that it is reasonable for some applications to perform signature 2100 or MAC validation prior to making a trust decision about a key, since 2101 keys for which the validation fails need no trust decision. 2103 Appendix E. Negative Test Case for "crit" Header Parameter 2105 Conforming implementations must reject input containing critical 2106 extensions that are not understood or cannot be processed. The 2107 following JWS must be rejected by all implementations, because it 2108 uses an extension Header Parameter name 2109 "http://example.invalid/UNDEFINED" that they do not understand. Any 2110 other similar input, in which the use of the value 2111 "http://example.invalid/UNDEFINED" is substituted for any other 2112 Header Parameter name not understood by the implementation, must also 2113 be rejected. 2115 The JWS Protected Header value for this JWS is: 2117 {"alg":"none", 2118 "crit":["http://example.invalid/UNDEFINED"], 2119 "http://example.invalid/UNDEFINED":true 2120 } 2122 The complete JWS that must be rejected is as follows (with line 2123 breaks for display purposes only): 2125 eyJhbGciOiJub25lIiwNCiAiY3JpdCI6WyJodHRwOi8vZXhhbXBsZS5jb20vVU5ERU 2126 ZJTkVEIl0sDQogImh0dHA6Ly9leGFtcGxlLmNvbS9VTkRFRklORUQiOnRydWUNCn0. 2127 RkFJTA. 2129 Appendix F. Detached Content 2131 In some contexts, it is useful integrity protect content that is not 2132 itself contained in a JWS object. One way to do this is create a JWS 2133 object in the normal fashion using a representation of the content as 2134 the payload, but then delete the payload representation from the JWS, 2135 and send this modified object to the recipient, rather than the JWS. 2136 When using the JWS Compact Serialization, the deletion is 2137 accomplished by replacing the second field (which contains 2138 BASE64URL(JWS Payload)) value with the empty string; when using the 2139 JWS JSON Serialization, the deletion is accomplished by deleting the 2140 "payload" member. This method assumes that the recipient can 2141 reconstruct the exact payload used in the JWS. To use the modified 2142 object, the recipient reconstructs the JWS by re-inserting the 2143 payload representation into the modified object, and uses the 2144 resulting JWS in the usual manner. Note that this method needs no 2145 support from JWS libraries, as applications can use this method by 2146 modifying the inputs and outputs of standard JWS libraries. 2148 Appendix G. Acknowledgements 2150 Solutions for signing JSON content were previously explored by Magic 2151 Signatures [MagicSignatures], JSON Simple Sign [JSS], and Canvas 2152 Applications [CanvasApp], all of which influenced this draft. 2154 Thanks to Axel Nennker for his early implementation and feedback on 2155 the JWS and JWE specifications. 2157 This specification is the work of the JOSE Working Group, which 2158 includes dozens of active and dedicated participants. In particular, 2159 the following individuals contributed ideas, feedback, and wording 2160 that influenced this specification: 2162 Dirk Balfanz, Richard Barnes, Brian Campbell, Breno de Medeiros, Dick 2163 Hardt, Joe Hildebrand, Jeff Hodges, Edmund Jay, Yaron Y. Goland, Ben 2164 Laurie, James Manger, Matt Miller, Tony Nadalin, Axel Nennker, John 2165 Panzer, Emmanuel Raviart, Eric Rescorla, Jim Schaad, Paul Tarjan, 2166 Hannes Tschofenig, and Sean Turner. 2168 Jim Schaad and Karen O'Donoghue chaired the JOSE working group and 2169 Sean Turner and Stephen Farrell served as Security area directors 2170 during the creation of this specification. 2172 Appendix H. Document History 2174 [[ to be removed by the RFC Editor before publication as an RFC ]] 2176 -23 2178 o Clarified that the base64url encoding includes no line breaks, 2179 white space, or other additional characters. 2181 -22 2183 o Corrected RFC 2119 terminology usage. 2185 o Replaced references to draft-ietf-json-rfc4627bis with RFC 7158. 2187 -21 2189 o Applied review comments to the appendix "Notes on Key Selection", 2190 addressing issue #93. 2192 o Changed some references from being normative to informative, 2193 addressing issue #90. 2195 o Applied review comments to the JSON Serialization section, 2196 addressing issue #121. 2198 -20 2200 o Made terminology definitions more consistent, addressing issue 2201 #165. 2203 o Restructured the JSON Serialization section to call out the 2204 parameters used in hanging lists, addressing issue #121. 2206 o Described key filtering and refined other aspects of the text in 2207 the appendix "Notes on Key Selection", addressing issue #93. 2209 o Replaced references to RFC 4627 with draft-ietf-json-rfc4627bis, 2210 addressing issue #90. 2212 -19 2214 o Added the appendix "Notes on Validation Key Selection", addressing 2215 issue #93. 2217 o Reordered the key selection parameters. 2219 -18 2221 o Updated the mandatory-to-implement (MTI) language to say that 2222 applications using this specification need to specify what 2223 serialization and serialization features are used for that 2224 application, addressing issue #119. 2226 o Changes to address editorial and minor issues #25, #89, #97, #110, 2227 #114, #115, #116, #117, #120, and #184. 2229 o Added and used Header Parameter Description registry field. 2231 -17 2233 o Refined the "typ" and "cty" definitions to always be MIME Media 2234 Types, with the omission of "application/" prefixes recommended 2235 for brevity, addressing issue #50. 2237 o Updated the mandatory-to-implement (MTI) language to say that 2238 general-purpose implementations must implement the single 2239 signature/MAC value case for both serializations whereas special- 2240 purpose implementations can implement just one serialization if 2241 that meets the needs of the use cases the implementation is 2242 designed for, addressing issue #119. 2244 o Explicitly named all the logical components of a JWS and defined 2245 the processing rules and serializations in terms of those 2246 components, addressing issues #60, #61, and #62. 2248 o Replaced verbose repetitive phases such as "base64url encode the 2249 octets of the UTF-8 representation of X" with mathematical 2250 notation such as "BASE64URL(UTF8(X))". 2252 o Terms used in multiple documents are now defined in one place and 2253 incorporated by reference. Some lightly used or obvious terms 2254 were also removed. This addresses issue #58. 2256 -16 2258 o Changes to address editorial and minor issues #50, #98, #99, #102, 2259 #104, #106, #107, #111, and #112. 2261 -15 2263 o Clarified that it is an application decision which signatures, 2264 MACs, or plaintext values must successfully validate for the JWS 2265 to be accepted, addressing issue #35. 2267 o Corrected editorial error in "ES512" example. 2269 o Changes to address editorial and minor issues #34, #96, #100, 2270 #101, #104, #105, and #106. 2272 -14 2274 o Stated that the "signature" parameter is to be omitted in the JWS 2275 JSON Serialization when its value would be empty (which is only 2276 the case for a Plaintext JWS). 2278 -13 2280 o Made all header parameter values be per-signature/MAC, addressing 2281 issue #24. 2283 -12 2285 o Clarified that the "typ" and "cty" header parameters are used in 2286 an application-specific manner and have no effect upon the JWS 2287 processing. 2289 o Replaced the MIME types "application/jws+json" and 2290 "application/jws" with "application/jose+json" and 2291 "application/jose". 2293 o Stated that recipients MUST either reject JWSs with duplicate 2294 Header Parameter Names or use a JSON parser that returns only the 2295 lexically last duplicate member name. 2297 o Added a Serializations section with parallel treatment of the JWS 2298 Compact Serialization and the JWS JSON Serialization and also 2299 moved the former Implementation Considerations content there. 2301 -11 2303 o Added Key Identification section. 2305 o For the JWS JSON Serialization, enable header parameter values to 2306 be specified in any of three parameters: the "protected" member 2307 that is integrity protected and shared among all recipients, the 2308 "unprotected" member that is not integrity protected and shared 2309 among all recipients, and the "header" member that is not 2310 integrity protected and specific to a particular recipient. (This 2311 does not affect the JWS Compact Serialization, in which all header 2312 parameter values are in a single integrity protected JWE Header 2313 value.) 2315 o Removed suggested compact serialization for multiple digital 2316 signatures and/or MACs. 2318 o Changed the MIME type name "application/jws-js" to 2319 "application/jws+json", addressing issue #22. 2321 o Tightened the description of the "crit" (critical) header 2322 parameter. 2324 o Added a negative test case for the "crit" header parameter 2326 -10 2328 o Added an appendix suggesting a possible compact serialization for 2329 JWSs with multiple digital signatures and/or MACs. 2331 -09 2333 o Added JWS JSON Serialization, as specified by 2334 draft-jones-jose-jws-json-serialization-04. 2336 o Registered "application/jws-js" MIME type and "JWS-JS" typ header 2337 parameter value. 2339 o Defined that the default action for header parameters that are not 2340 understood is to ignore them unless specifically designated as 2341 "MUST be understood" or included in the new "crit" (critical) 2342 header parameter list. This addressed issue #6. 2344 o Changed term "JWS Secured Input" to "JWS Signing Input". 2346 o Changed from using the term "byte" to "octet" when referring to 8 2347 bit values. 2349 o Changed member name from "recipients" to "signatures" in the JWS 2350 JSON Serialization. 2352 o Added complete values using the JWS Compact Serialization for all 2353 examples. 2355 -08 2357 o Applied editorial improvements suggested by Jeff Hodges and Hannes 2358 Tschofenig. Many of these simplified the terminology used. 2360 o Clarified statements of the form "This header parameter is 2361 OPTIONAL" to "Use of this header parameter is OPTIONAL". 2363 o Added a Header Parameter Usage Location(s) field to the IANA JSON 2364 Web Signature and Encryption Header Parameters registry. 2366 o Added seriesInfo information to Internet Draft references. 2368 -07 2370 o Updated references. 2372 -06 2374 o Changed "x5c" (X.509 Certificate Chain) representation from being 2375 a single string to being an array of strings, each containing a 2376 single base64 encoded DER certificate value, representing elements 2377 of the certificate chain. 2379 o Applied changes made by the RFC Editor to RFC 6749's registry 2380 language to this specification. 2382 -05 2384 o Added statement that "StringOrURI values are compared as case- 2385 sensitive strings with no transformations or canonicalizations 2386 applied". 2388 o Indented artwork elements to better distinguish them from the body 2389 text. 2391 -04 2393 o Completed JSON Security Considerations section, including 2394 considerations about rejecting input with duplicate member names. 2396 o Completed security considerations on the use of a SHA-1 hash when 2397 computing "x5t" (x.509 certificate thumbprint) values. 2399 o Refer to the registries as the primary sources of defined values 2400 and then secondarily reference the sections defining the initial 2401 contents of the registries. 2403 o Normatively reference XML DSIG 2.0 [W3C.CR-xmldsig-core2-20120124] 2404 for its security considerations. 2406 o Added this language to Registration Templates: "This name is case 2407 sensitive. Names that match other registered names in a case 2408 insensitive manner SHOULD NOT be accepted." 2410 o Reference draft-jones-jose-jws-json-serialization instead of 2411 draft-jones-json-web-signature-json-serialization. 2413 o Described additional open issues. 2415 o Applied editorial suggestions. 2417 -03 2419 o Added the "cty" (content type) header parameter for declaring type 2420 information about the secured content, as opposed to the "typ" 2421 (type) header parameter, which declares type information about 2422 this object. 2424 o Added "Collision Resistant Namespace" to the terminology section. 2426 o Reference ITU.X690.1994 for DER encoding. 2428 o Added an example JWS using ECDSA P-521 SHA-512. This has 2429 particular illustrative value because of the use of the 521 bit 2430 integers in the key and signature values. This is also an example 2431 in which the payload is not a base64url encoded JSON object. 2433 o Added an example "x5c" value. 2435 o No longer say "the UTF-8 representation of the JWS Secured Input 2436 (which is the same as the ASCII representation)". Just call it 2437 "the ASCII representation of the JWS Secured Input". 2439 o Added Registration Template sections for defined registries. 2441 o Added Registry Contents sections to populate registry values. 2443 o Changed name of the JSON Web Signature and Encryption "typ" Values 2444 registry to be the JSON Web Signature and Encryption Type Values 2445 registry, since it is used for more than just values of the "typ" 2446 parameter. 2448 o Moved registries JSON Web Signature and Encryption Header 2449 Parameters and JSON Web Signature and Encryption Type Values to 2450 the JWS specification. 2452 o Numerous editorial improvements. 2454 -02 2456 o Clarified that it is an error when a "kid" value is included and 2457 no matching key is found. 2459 o Removed assumption that "kid" (key ID) can only refer to an 2460 asymmetric key. 2462 o Clarified that JWSs with duplicate Header Parameter Names MUST be 2463 rejected. 2465 o Clarified the relationship between "typ" header parameter values 2466 and MIME types. 2468 o Registered application/jws MIME type and "JWS" typ header 2469 parameter value. 2471 o Simplified JWK terminology to get replace the "JWK Key Object" and 2472 "JWK Container Object" terms with simply "JSON Web Key (JWK)" and 2473 "JSON Web Key Set (JWK Set)" and to eliminate potential confusion 2474 between single keys and sets of keys. As part of this change, the 2475 Header Parameter Name for a public key value was changed from 2476 "jpk" (JSON Public Key) to "jwk" (JSON Web Key). 2478 o Added suggestion on defining additional header parameters such as 2479 "x5t#S256" in the future for certificate thumbprints using hash 2480 algorithms other than SHA-1. 2482 o Specify RFC 2818 server identity validation, rather than RFC 6125 2483 (paralleling the same decision in the OAuth specs). 2485 o Generalized language to refer to Message Authentication Codes 2486 (MACs) rather than Hash-based Message Authentication Codes (HMACs) 2487 unless in a context specific to HMAC algorithms. 2489 o Reformatted to give each header parameter its own section heading. 2491 -01 2493 o Moved definition of Plaintext JWSs (using "alg":"none") here from 2494 the JWT specification since this functionality is likely to be 2495 useful in more contexts that just for JWTs. 2497 o Added "jpk" and "x5c" header parameters for including JWK public 2498 keys and X.509 certificate chains directly in the header. 2500 o Clarified that this specification is defining the JWS Compact 2501 Serialization. Referenced the new JWS-JS spec, which defines the 2502 JWS JSON Serialization. 2504 o Added text "New header parameters should be introduced sparingly 2505 since an implementation that does not understand a parameter MUST 2506 reject the JWS". 2508 o Clarified that the order of the creation and validation steps is 2509 not significant in cases where there are no dependencies between 2510 the inputs and outputs of the steps. 2512 o Changed "no canonicalization is performed" to "no canonicalization 2513 need be performed". 2515 o Corrected the Magic Signatures reference. 2517 o Made other editorial improvements suggested by JOSE working group 2518 participants. 2520 -00 2522 o Created the initial IETF draft based upon 2523 draft-jones-json-web-signature-04 with no normative changes. 2525 o Changed terminology to no longer call both digital signatures and 2526 HMACs "signatures". 2528 Authors' Addresses 2530 Michael B. Jones 2531 Microsoft 2533 Email: mbj@microsoft.com 2534 URI: http://self-issued.info/ 2536 John Bradley 2537 Ping Identity 2539 Email: ve7jtb@ve7jtb.com 2540 URI: http://www.thread-safe.com/ 2542 Nat Sakimura 2543 Nomura Research Institute 2545 Email: n-sakimura@nri.co.jp 2546 URI: http://nat.sakimura.org/