idnits 2.17.1 draft-ietf-jose-json-web-signature-19.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 == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: The "crit" (critical) Header Parameter indicates that extensions to the initial RFC versions of [[ this specification ]] and [JWA] are being used that MUST be understood and processed. Its value is an array listing the Header Parameter names present in the JWS Header that use those extensions. If any of the listed extension Header Parameters are not understood and supported by the receiver, it MUST reject the JWS. Senders must not include Header Parameter names defined by the initial RFC versions of [[ this specification ]] or [JWA] for use with JWS, duplicate names, or names that do not occur as Header Parameter names within the JWS Header in the "crit" list. Senders MUST not use the empty list "[]" as the "crit" value. Recipients MAY reject the JWS if the critical list contains any Header Parameter names defined by the initial RFC versions of [[ this specification ]] or [JWA] for use with JWS, or any other constraints on its use are violated. This Header Parameter MUST be integrity protected, and therefore MUST occur only within the JWS Protected Header, when used. Use of this Header Parameter is OPTIONAL. This Header Parameter MUST be understood and processed by implementations. -- The document date (December 29, 2013) is 3768 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 1655 -- Looks like a reference, but probably isn't: '34' on line 1655 -- Looks like a reference, but probably isn't: '97' on line 1665 -- Looks like a reference, but probably isn't: '108' on line 1665 -- Looks like a reference, but probably isn't: '103' on line 1655 -- Looks like a reference, but probably isn't: '58' on line 1655 -- Looks like a reference, but probably isn't: '82' on line 1419 -- Looks like a reference, but probably isn't: '83' on line 1655 -- Looks like a reference, but probably isn't: '50' on line 1655 -- Looks like a reference, but probably isn't: '53' on line 1655 -- Looks like a reference, but probably isn't: '54' on line 1547 -- Looks like a reference, but probably isn't: '125' on line 1655 -- Looks like a reference, but probably isn't: '69' on line 1655 -- Looks like a reference, but probably isn't: '49' on line 1655 -- Looks like a reference, but probably isn't: '80' on line 1665 -- Looks like a reference, but probably isn't: '121' on line 1665 -- Looks like a reference, but probably isn't: '111' on line 1665 -- Looks like a reference, but probably isn't: '100' on line 1665 -- Looks like a reference, but probably isn't: '0' on line 1973 -- Possible downref: Non-RFC (?) normative reference: ref. 'ECMAScript' == Outdated reference: A later version (-10) exists of draft-ietf-json-rfc4627bis-07 -- Possible downref: Non-RFC (?) normative reference: ref. 'ITU.X690.1994' ** Downref: Normative reference to an Historic RFC: RFC 1421 ** Obsolete normative reference: RFC 2246 (Obsoleted by RFC 4346) ** Obsolete normative reference: RFC 2818 (Obsoleted by RFC 9110) ** Obsolete normative reference: RFC 4627 (Obsoleted by RFC 7158, RFC 7159) ** Obsolete normative reference: RFC 5226 (Obsoleted by RFC 8126) ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) ** Obsolete normative reference: RFC 6125 (Obsoleted by RFC 9525) -- Possible downref: Non-RFC (?) normative reference: ref. 'USASCII' Summary: 7 errors (**), 0 flaws (~~), 3 warnings (==), 24 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: July 2, 2014 Ping Identity 6 N. Sakimura 7 NRI 8 December 29, 2013 10 JSON Web Signature (JWS) 11 draft-ietf-jose-json-web-signature-19 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 July 2, 2014. 41 Copyright Notice 43 Copyright (c) 2013 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 . . . . . . . . . . . . . . . . . . . . . . . 7 63 4. JWS Header . . . . . . . . . . . . . . . . . . . . . . . . . . 8 64 4.1. Registered Header Parameter Names . . . . . . . . . . . . 9 65 4.1.1. "alg" (Algorithm) Header Parameter . . . . . . . . . . 9 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 . . . . . . . . . . 10 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 . . . . . . . . . . . . 11 74 4.1.9. "cty" (Content Type) Header Parameter . . . . . . . . 12 75 4.1.10. "crit" (Critical) Header Parameter . . . . . . . . . . 12 76 4.2. Public Header Parameter Names . . . . . . . . . . . . . . 13 77 4.3. Private Header Parameter Names . . . . . . . . . . . . . . 13 78 5. Producing and Consuming JWSs . . . . . . . . . . . . . . . . . 13 79 5.1. Message Signature or MAC Computation . . . . . . . . . . . 13 80 5.2. Message Signature or MAC Validation . . . . . . . . . . . 14 81 5.3. String Comparison Rules . . . . . . . . . . . . . . . . . 16 82 6. Key Identification . . . . . . . . . . . . . . . . . . . . . . 16 83 7. Serializations . . . . . . . . . . . . . . . . . . . . . . . . 16 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 . . . . . . . . . . . . . . . . 20 91 9.1.2. Initial Registry Contents . . . . . . . . . . . . . . 21 92 9.2. Media Type Registration . . . . . . . . . . . . . . . . . 22 93 9.2.1. Registry Contents . . . . . . . . . . . . . . . . . . 22 94 10. Security Considerations . . . . . . . . . . . . . . . . . . . 23 95 10.1. Cryptographic Security Considerations . . . . . . . . . . 23 96 10.2. JSON Security Considerations . . . . . . . . . . . . . . . 25 97 10.3. Unicode Comparison Security Considerations . . . . . . . . 25 98 11. References . . . . . . . . . . . . . . . . . . . . . . . . . . 26 99 11.1. Normative References . . . . . . . . . . . . . . . . . . . 26 100 11.2. Informative References . . . . . . . . . . . . . . . . . . 27 101 Appendix A. JWS Examples . . . . . . . . . . . . . . . . . . . . 28 102 A.1. Example JWS using HMAC SHA-256 . . . . . . . . . . . . . . 28 103 A.1.1. Encoding . . . . . . . . . . . . . . . . . . . . . . . 28 104 A.1.2. Validating . . . . . . . . . . . . . . . . . . . . . . 30 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 . . . . . . . . . . 33 109 A.3.1. Encoding . . . . . . . . . . . . . . . . . . . . . . . 33 110 A.3.2. Validating . . . . . . . . . . . . . . . . . . . . . . 35 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 . . . . . . . . . 39 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 . . . . 40 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 Validation Key Selection . . . . . . . . . . 44 124 Appendix E. Negative Test Case for "crit" Header Parameter . . . 45 125 Appendix F. Detached Content . . . . . . . . . . . . . . . . . . 45 126 Appendix G. Acknowledgements . . . . . . . . . . . . . . . . . . 46 127 Appendix H. Document History . . . . . . . . . . . . . . . . . . 46 128 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 53 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) [RFC4627] 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", "MAY", and "OPTIONAL" in this 159 document are to be interpreted as described in Key words for use in 160 RFCs to Indicate Requirement Levels [RFC2119]. If these words are 161 used without being spelled in uppercase then they are to be 162 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) A data structure representing a digitally 178 signed or MACed message. 180 JWS Header A JSON object (or JSON objects, when using the JWS JSON 181 Serialization) that describes the digital signature or MAC 182 operation applied to create the JWS Signature value. The members 183 of the JWS Header object(s) are Header Parameters. 185 JWS Payload The sequence of octets to be secured -- a.k.a., the 186 message. The payload can contain an arbitrary sequence of octets. 188 JWS Signature A sequence of octets containing the cryptographic 189 material that ensures the integrity of the JWS Protected Header 190 and the JWS Payload. The JWS Signature value is a digital 191 signature or MAC value calculated over the JWS Signing Input using 192 the parameters specified in the JWS Header. 194 JWS Protected Header A JSON object that contains the portion of the 195 JWS Header that is integrity protected. For the JWS Compact 196 Serialization, this comprises the entire JWS Header. For the JWS 197 JSON Serialization, this is one component of the JWS Header. 199 Header Parameter A name/value pair that is member of the JWS Header. 201 Base64url Encoding Base64 encoding using the URL- and filename-safe 202 character set defined in Section 5 of RFC 4648 [RFC4648], with all 203 trailing '=' characters omitted (as permitted by Section 3.2). 204 (See Appendix C for notes on implementing base64url encoding 205 without padding.) 207 JWS Signing Input The input to the digital signature or MAC 208 computation. Its value is ASCII(BASE64URL(UTF8(JWS Protected 209 Header)) || '.' || BASE64URL(JWS Payload)). 211 JWS Compact Serialization A representation of the JWS as a compact, 212 URL-safe string. 214 JWS JSON Serialization A representation of the JWS as a JSON object. 215 Unlike the JWS Compact Serialization, the JWS JSON Serialization 216 enables multiple digital signatures and/or MACs to be applied to 217 the same content. This representation is neither compact nor URL- 218 safe. 220 Collision-Resistant Name A name in a namespace that enables names to 221 be allocated in a manner such that they are highly unlikely to 222 collide with other names. Examples of collision-resistant 223 namespaces include: Domain Names, Object Identifiers (OIDs) as 224 defined in the ITU-T X.660 and X.670 Recommendation series, and 225 Universally Unique IDentifiers (UUIDs) [RFC4122]. When using an 226 administratively delegated namespace, the definer of a name needs 227 to take reasonable precautions to ensure they are in control of 228 the portion of the namespace they use to define the name. 230 StringOrURI A JSON string value, with the additional requirement 231 that while arbitrary string values MAY be used, any value 232 containing a ":" character MUST be a URI [RFC3986]. StringOrURI 233 values are compared as case-sensitive strings with no 234 transformations or canonicalizations applied. 236 3. JSON Web Signature (JWS) Overview 238 JWS represents digitally signed or MACed content using JSON data 239 structures and base64url encoding. A JWS represents these logical 240 values: 242 JWS Header JSON object containing the parameters describing the 243 cryptographic operations and parameters employed. The JWE Header 244 members are the union of the members of the JWS Protected Header 245 and the JWS Unprotected Header, as described below. 247 JWS Payload Message content to be secured. 249 JWS Signature Digital signature or MAC over the JWS Protected Header 250 and the JWS Payload. 252 The JWS Header represents the combination of these logical values: 254 JWS Protected Header JSON object containing some of the parameters 255 describing the cryptographic operations and parameters employed. 256 This value is integrity protected in the digital signature or MAC 257 calculation of the JWS Signature. 259 JWS Unprotected Header JSON object containing some of the parameters 260 describing the cryptographic operations and parameters employed. 261 This value is not integrity protected in the digital signature or 262 MAC calculation of the JWS Signature. 264 This document defines two serializations for JWS objects: a compact, 265 URL-safe serialization called the JWS Compact Serialization and a 266 JSON serialization called the JWS JSON Serialization. In both 267 serializations, the JWS Protected Header, JWS Payload, and JWS 268 Signature are base64url encoded for transmission, since JSON lacks a 269 way to directly represent octet sequences. 271 In the JWS Compact Serialization, no JWS Unprotected Header is used. 272 In this case, the JWS Header and the JWS Protected Header are the 273 same. 275 In the JWS Compact Serialization, a JWS object is represented as the 276 combination of these three string values, 277 BASE64URL(UTF8(JWS Protected Header)), 278 BASE64URL(JWS Payload), and 279 BASE64URL(JWS Signature), 280 concatenated in that order, with the three strings being separated by 281 two period ('.') characters. 283 In the JWS JSON Serialization, one or both of the JWS Protected 284 Header and JWS Unprotected Header MUST be present. In this case, the 285 members of the JWS Header are the combination of the members of the 286 JWS Protected Header and the JWS Unprotected Header values that are 287 present. 289 In the JWS JSON Serialization, a JWS object is represented as the 290 combination of these four values, 291 BASE64URL(UTF8(JWS Protected Header)), 292 JWS Unprotected Header, 293 BASE64URL(JWS Payload), and 294 BASE64URL(JWS Signature), 295 with the three base64url encoding result strings and the JWS 296 Unprotected Header value being represented as members within a JSON 297 object. The inclusion of some of these values is OPTIONAL. The JWS 298 JSON Serialization can also represent multiple signature and/or MAC 299 values, rather than just one. See Section 7.2 for more information 300 about the JWS JSON Serialization. 302 3.1. Example JWS 304 This section provides an example of a JWS. Its computation is 305 described in more detail in Appendix A.1, including specifying the 306 exact octet sequences representing the JSON values used and the key 307 value used. 309 The following example JWS Protected Header declares that the encoded 310 object is a JSON Web Token (JWT) [JWT] and the JWS Protected Header 311 and the JWS Payload are secured using the HMAC SHA-256 algorithm: 313 {"typ":"JWT", 314 "alg":"HS256"} 316 Encoding this JWS Protected Header as BASE64URL(UTF8(JWS Protected 317 Header)) gives this value: 319 eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9 321 The UTF-8 representation of following JSON object is used as the JWS 322 Payload. (Note that the payload can be any content, and need not be 323 a representation of a JSON object.) 325 {"iss":"joe", 326 "exp":1300819380, 327 "http://example.com/is_root":true} 329 Encoding this JWS Payload as BASE64URL(JWS Payload) gives this value 330 (with line breaks for display purposes only): 332 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 333 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 335 Computing the HMAC of the JWS Signing Input ASCII(BASE64URL(UTF8(JWS 336 Protected Header)) || '.' || BASE64URL(JWS Payload)) with the HMAC 337 SHA-256 algorithm using the key specified in Appendix A.1 and 338 base64url encoding the result yields this BASE64URL(JWS Signature) 339 value: 341 dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk 343 Concatenating these values in the order Header.Payload.Signature with 344 period ('.') characters between the parts yields this complete JWS 345 representation using the JWS Compact Serialization (with line breaks 346 for display purposes only): 348 eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9 349 . 350 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 351 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 352 . 353 dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk 355 See Appendix A for additional examples. 357 4. JWS Header 359 The members of the JSON object(s) representing the JWS Header 360 describe the digital signature or MAC applied to the JWS Protected 361 Header and the JWS Payload and optionally additional properties of 362 the JWS. The Header Parameter names within the JWS Header MUST be 363 unique; recipients MUST either reject JWSs with duplicate Header 364 Parameter names or use a JSON parser that returns only the lexically 365 last duplicate member name, as specified in Section 15.12 (The JSON 366 Object) of ECMAScript 5.1 [ECMAScript]. 368 Implementations are required to understand the specific Header 369 Parameters defined by this specification that are designated as "MUST 370 be understood" and process them in the manner defined in this 371 specification. All other Header Parameters defined by this 372 specification that are not so designated MUST be ignored when not 373 understood. Unless listed as a critical Header Parameter, per 374 Section 4.1.10, all Header Parameters not defined by this 375 specification MUST be ignored when not understood. 377 There are three classes of Header Parameter names: Registered Header 378 Parameter names, Public Header Parameter names, and Private Header 379 Parameter names. 381 4.1. Registered Header Parameter Names 383 The following Header Parameter names are registered in the IANA JSON 384 Web Signature and Encryption Header Parameters registry defined in 385 Section 9.1, with meanings as defined below. 387 As indicated by the common registry, JWSs and JWEs share a common 388 Header Parameter space; when a parameter is used by both 389 specifications, its usage must be compatible between the 390 specifications. 392 4.1.1. "alg" (Algorithm) Header Parameter 394 The "alg" (algorithm) Header Parameter identifies the cryptographic 395 algorithm used to secure the JWS. The signature, MAC, or plaintext 396 value is not valid if the "alg" value does not represent a supported 397 algorithm, or if there is not a key for use with that algorithm 398 associated with the party that digitally signed or MACed the content. 399 "alg" values should either be registered in the IANA JSON Web 400 Signature and Encryption Algorithms registry defined in [JWA] or be a 401 value that contains a Collision-Resistant Name. The "alg" value is a 402 case-sensitive string containing a StringOrURI value. This Header 403 Parameter MUST be present and MUST be understood and processed by 404 implementations. 406 A list of defined "alg" values for this use can be found in the IANA 407 JSON Web Signature and Encryption Algorithms registry defined in 408 [JWA]; the initial contents of this registry are the values defined 409 in Section 3.1 of the JSON Web Algorithms (JWA) [JWA] specification. 411 4.1.2. "jku" (JWK Set URL) Header Parameter 413 The "jku" (JWK Set URL) Header Parameter is a URI [RFC3986] that 414 refers to a resource for a set of JSON-encoded public keys, one of 415 which corresponds to the key used to digitally sign the JWS. The 416 keys MUST be encoded as a JSON Web Key Set (JWK Set) [JWK]. The 417 protocol used to acquire the resource MUST provide integrity 418 protection; an HTTP GET request to retrieve the JWK Set MUST use TLS 419 [RFC2818] [RFC5246]; the identity of the server MUST be validated, as 420 per Section 3.1 of HTTP Over TLS [RFC2818]. Use of this Header 421 Parameter is OPTIONAL. 423 4.1.3. "jwk" (JSON Web Key) Header Parameter 425 The "jwk" (JSON Web Key) Header Parameter is the public key that 426 corresponds to the key used to digitally sign the JWS. This key is 427 represented as a JSON Web Key [JWK]. Use of this Header Parameter is 428 OPTIONAL. 430 4.1.4. "kid" (Key ID) Header Parameter 432 The "kid" (key ID) Header Parameter is a hint indicating which key 433 was used to secure the JWS. This parameter allows originators to 434 explicitly signal a change of key to recipients. The structure of 435 the "kid" value is unspecified. Its value MUST be a string. Use of 436 this Header Parameter is OPTIONAL. 438 When used with a JWK, the "kid" value is used to match a JWK "kid" 439 parameter value. 441 4.1.5. "x5u" (X.509 URL) Header Parameter 443 The "x5u" (X.509 URL) Header Parameter is a URI [RFC3986] that refers 444 to a resource for the X.509 public key certificate or certificate 445 chain [RFC5280] corresponding to the key used to digitally sign the 446 JWS. The identified resource MUST provide a representation of the 447 certificate or certificate chain that conforms to RFC 5280 [RFC5280] 448 in PEM encoded form [RFC1421]. The certificate containing the public 449 key corresponding to the key used to digitally sign the JWS MUST be 450 the first certificate. This MAY be followed by additional 451 certificates, with each subsequent certificate being the one used to 452 certify the previous one. The protocol used to acquire the resource 453 MUST provide integrity protection; an HTTP GET request to retrieve 454 the certificate MUST use TLS [RFC2818] [RFC5246]; the identity of the 455 server MUST be validated, as per Section 3.1 of HTTP Over TLS 456 [RFC2818]. Use of this Header Parameter is OPTIONAL. 458 4.1.6. "x5c" (X.509 Certificate Chain) Header Parameter 460 The "x5c" (X.509 Certificate Chain) Header Parameter contains the 461 X.509 public key certificate or certificate chain [RFC5280] 462 corresponding to the key used to digitally sign the JWS. The 463 certificate or certificate chain is represented as a JSON array of 464 certificate value strings. Each string in the array is a base64 465 encoded ([RFC4648] Section 4 -- not base64url encoded) DER 466 [ITU.X690.1994] PKIX certificate value. The certificate containing 467 the public key corresponding to the key used to digitally sign the 468 JWS MUST be the first certificate. This MAY be followed by 469 additional certificates, with each subsequent certificate being the 470 one used to certify the previous one. The recipient MUST validate 471 the certificate chain according to [RFC5280] and reject the signature 472 if any validation failure occurs. Use of this Header Parameter is 473 OPTIONAL. 475 See Appendix B for an example "x5c" value. 477 4.1.7. "x5t" (X.509 Certificate SHA-1 Thumbprint) Header Parameter 479 The "x5t" (X.509 Certificate SHA-1 Thumbprint) Header Parameter is a 480 base64url encoded SHA-1 thumbprint (a.k.a. digest) of the DER 481 encoding of the X.509 certificate [RFC5280] corresponding to the key 482 used to digitally sign the JWS. Use of this Header Parameter is 483 OPTIONAL. 485 If, in the future, certificate thumbprints need to be computed using 486 hash functions other than SHA-1, it is suggested that additional 487 related Header Parameters be defined for that purpose. For example, 488 it is suggested that a new "x5t#S256" (X.509 Certificate Thumbprint 489 using SHA-256) Header Parameter could be defined by registering it in 490 the IANA JSON Web Signature and Encryption Header Parameters registry 491 defined in Section 9.1. 493 4.1.8. "typ" (Type) Header Parameter 495 The "typ" (type) Header Parameter is used to declare the MIME Media 496 Type [IANA.MediaTypes] of this complete JWS object in contexts where 497 this is useful to the application. This parameter has no effect upon 498 the JWS processing. Use of this Header Parameter is OPTIONAL. 500 Per [RFC2045], all media type values, subtype values, and parameter 501 names are case-insensitive. However, parameter values are case- 502 sensitive unless otherwise specified for the specific parameter. 504 To keep messages compact in common situations, it is RECOMMENDED that 505 senders omit an "application/" prefix of a media type value in a 506 "typ" Header Parameter when no other '/' appears in the media type 507 value. A recipient using the media type value MUST treat it as if 508 "application/" were prepended to any "typ" value not containing a 509 '/'. For instance, a "typ" value of "example" SHOULD be used to 510 represent the "application/example" media type; whereas, the media 511 type "application/example;part="1/2"" cannot be shortened to 512 "example;part="1/2"". 514 The "typ" value "JOSE" can be used by applications to indicate that 515 this object is a JWS or JWE using the JWS Compact Serialization or 516 the JWE Compact Serialization. The "typ" value "JOSE+JSON" can be 517 used by applications to indicate that this object is a JWS or JWE 518 using the JWS JSON Serialization or the JWE JSON Serialization. 519 Other type values can also be used by applications. 521 4.1.9. "cty" (Content Type) Header Parameter 523 The "cty" (content type) Header Parameter is used to declare the MIME 524 Media Type [IANA.MediaTypes] of the secured content (the payload) in 525 contexts where this is useful to the application. This parameter has 526 no effect upon the JWS processing. Use of this Header Parameter is 527 OPTIONAL. 529 Per [RFC2045], all media type values, subtype values, and parameter 530 names are case-insensitive. However, parameter values are case- 531 sensitive unless otherwise specified for the specific parameter. 533 To keep messages compact in common situations, it is RECOMMENDED that 534 senders omit an "application/" prefix of a media type value in a 535 "cty" Header Parameter when no other '/' appears in the media type 536 value. A recipient using the media type value MUST treat it as if 537 "application/" were prepended to any "cty" value not containing a 538 '/'. For instance, a "cty" value of "example" SHOULD be used to 539 represent the "application/example" media type; whereas, the media 540 type "application/example;part="1/2"" cannot be shortened to 541 "example;part="1/2"". 543 4.1.10. "crit" (Critical) Header Parameter 545 The "crit" (critical) Header Parameter indicates that extensions to 546 the initial RFC versions of [[ this specification ]] and [JWA] are 547 being used that MUST be understood and processed. Its value is an 548 array listing the Header Parameter names present in the JWS Header 549 that use those extensions. If any of the listed extension Header 550 Parameters are not understood and supported by the receiver, it MUST 551 reject the JWS. Senders must not include Header Parameter names 552 defined by the initial RFC versions of [[ this specification ]] or 553 [JWA] for use with JWS, duplicate names, or names that do not occur 554 as Header Parameter names within the JWS Header in the "crit" list. 555 Senders MUST not use the empty list "[]" as the "crit" value. 556 Recipients MAY reject the JWS if the critical list contains any 557 Header Parameter names defined by the initial RFC versions of [[ this 558 specification ]] or [JWA] for use with JWS, or any other constraints 559 on its use are violated. This Header Parameter MUST be integrity 560 protected, and therefore MUST occur only within the JWS Protected 561 Header, when used. Use of this Header Parameter is OPTIONAL. This 562 Header Parameter MUST be understood and processed by implementations. 564 An example use, along with a hypothetical "exp" (expiration-time) 565 field is: 567 {"alg":"ES256", 568 "crit":["exp"], 569 "exp":1363284000 570 } 572 4.2. Public Header Parameter Names 574 Additional Header Parameter names can be defined by those using JWSs. 575 However, in order to prevent collisions, any new Header Parameter 576 name should either be registered in the IANA JSON Web Signature and 577 Encryption Header Parameters registry defined in Section 9.1 or be a 578 Public Name: a value that contains a Collision-Resistant Name. In 579 each case, the definer of the name or value needs to take reasonable 580 precautions to make sure they are in control of the part of the 581 namespace they use to define the Header Parameter name. 583 New Header Parameters should be introduced sparingly, as they can 584 result in non-interoperable JWSs. 586 4.3. Private Header Parameter Names 588 A producer and consumer of a JWS may agree to use Header Parameter 589 names that are Private Names: names that are not Registered Header 590 Parameter names Section 4.1 or Public Header Parameter names 591 Section 4.2. Unlike Public Header Parameter names, Private Header 592 Parameter names are subject to collision and should be used with 593 caution. 595 5. Producing and Consuming JWSs 597 5.1. Message Signature or MAC Computation 599 To create a JWS, one MUST perform these steps. The order of the 600 steps is not significant in cases where there are no dependencies 601 between the inputs and outputs of the steps. 602 1. Create the content to be used as the JWS Payload. 603 2. Compute the encoded payload value BASE64URL(JWS Payload). 604 3. Create the JSON object(s) containing the desired set of Header 605 Parameters, which together comprise the JWS Header: the JWS 606 Protected Header, and if the JWS JSON Serialization is being 607 used, the JWS Unprotected Header. 608 4. Compute the encoded header value BASE64URL(UTF8(JWS Protected 609 Header)). If the JWS Protected Header is not present (which can 610 only happen when using the JWS JSON Serialization and no 611 "protected" member is present), let this value be the empty 612 string. 613 5. Compute the JWS Signature in the manner defined for the 614 particular algorithm being used over the JWS Signing Input 615 ASCII(BASE64URL(UTF8(JWS Protected Header)) || '.' || 616 BASE64URL(JWS Payload)). The "alg" (algorithm) Header Parameter 617 MUST be present in the JWS Header, with the algorithm value 618 accurately representing the algorithm used to construct the JWS 619 Signature. 620 6. Compute the encoded signature value BASE64URL(JWS Signature). 621 7. These three encoded values are used in both the JWS Compact 622 Serialization and the JWS JSON Serialization representations. 623 8. If the JWS JSON Serialization is being used, repeat this process 624 (steps 3-7) for each digital signature or MAC value being 625 applied. 626 9. Create the desired serialized output. The JWS Compact 627 Serialization of this result is BASE64URL(UTF8(JWS Protected 628 Header)) || '.' || BASE64URL(JWS Payload) || '.' || BASE64URL(JWS 629 Signature). The JWS JSON Serialization is described in 630 Section 7.2. 632 5.2. Message Signature or MAC Validation 634 When validating a JWS, the following steps MUST be taken. The order 635 of the steps is not significant in cases where there are no 636 dependencies between the inputs and outputs of the steps. If any of 637 the listed steps fails, then the signature or MAC cannot be 638 validated. 640 It is an application decision which signatures, MACs, or plaintext 641 values must successfully validate for the JWS to be accepted. In 642 some cases, all must successfully validate or the JWS will be 643 rejected. In other cases, only a specific signature, MAC, or 644 plaintext value needs to be successfully validated. However, in all 645 cases, at least one signature, MAC, or plaintext value MUST 646 successfully validate or the JWS MUST be rejected. 648 1. Parse the JWS representation to extract the serialized values 649 for the components of the JWS -- when using the JWS Compact 650 Serialization, the base64url encoded representations of the JWS 651 Protected Header, the JWS Payload, and the JWS Signature, and 652 when using the JWS JSON Serialization, also the unencoded JWS 653 Unprotected Header value. When using the JWS Compact 654 Serialization, the JWS Protected Header, the JWS Payload, and 655 the JWS Signature are represented as base64url encoded values in 656 that order, separated by two period ('.') characters. The JWS 657 JSON Serialization is described in Section 7.2. 658 2. The encoded representation of the JWS Protected Header MUST be 659 successfully base64url decoded following the restriction that no 660 padding characters have been used. 661 3. The resulting octet sequence MUST be a UTF-8 encoded 662 representation of a completely valid JSON object conforming to 663 RFC 4627 [RFC4627], which is the JWS Protected Header. 664 4. If using the JWS Compact Serialization, let the JWS Header be 665 the JWS Protected Header; otherwise, when using the JWS JSON 666 Serialization, let the JWS Header be the union of the members of 667 the corresponding JWS Protected Header and JWS Unprotected 668 Header, all of which must be completely valid JSON objects. 669 5. The resulting JWS Header MUST NOT contain duplicate Header 670 Parameter names. When using the JWS JSON Serialization, this 671 restriction includes that the same Header Parameter name also 672 MUST NOT occur in distinct JSON object values that together 673 comprise the JWS Header. 674 6. Verify that the implementation understands and can process all 675 fields that it is required to support, whether required by this 676 specification, by the algorithm being used, or by the "crit" 677 Header Parameter value, and that the values of those parameters 678 are also understood and supported. 679 7. The encoded representation of the JWS Payload MUST be 680 successfully base64url decoded following the restriction that no 681 padding characters have been used. 682 8. The encoded representation of the JWS Signature MUST be 683 successfully base64url decoded following the restriction that no 684 padding characters have been used. 685 9. The JWS Signature MUST be successfully validated against the JWS 686 Signing Input ASCII(BASE64URL(UTF8(JWS Protected Header)) || '.' 687 || BASE64URL(JWS Payload)) in the manner defined for the 688 algorithm being used, which MUST be accurately represented by 689 the value of the "alg" (algorithm) Header Parameter, which MUST 690 be present. 691 10. If the JWS JSON Serialization is being used, repeat this process 692 (steps 4-9) for each digital signature or MAC value contained in 693 the representation. 695 5.3. String Comparison Rules 697 Processing a JWS inevitably requires comparing known strings to 698 members and values in a JSON object. For example, in checking what 699 the algorithm is, the Unicode string "alg" will be checked against 700 the member names in the JWS Header to see if there is a matching 701 Header Parameter name. The same process is then used to determine if 702 the value of the "alg" Header Parameter represents a supported 703 algorithm. 705 Since the only string comparison operations that are performed are 706 equality and inequality, the same rules can be used for comparing 707 both member names and member values against known strings. The JSON 708 rules for doing member name comparison are described in Section 8.3 709 of [I-D.ietf-json-rfc4627bis]. 711 Also, see the JSON security considerations in Section 10.2 and the 712 Unicode security considerations in Section 10.3. 714 6. Key Identification 716 It is necessary for the recipient of a JWS to be able to determine 717 the key that was employed for the digital signature or MAC operation. 718 The key employed can be identified using the Header Parameter methods 719 described in Section 4.1 or can be identified using methods that are 720 outside the scope of this specification. Specifically, the Header 721 Parameters "jku", "jwk", "kid", "x5u", "x5c", and "x5t" can be used 722 to identify the key used. These Header Parameters MUST be integrity 723 protected if the information that they convey is to be utilized in a 724 trust decision. 726 The sender SHOULD include sufficient information in the Header 727 Parameters to identify the key used, unless the application uses 728 another means or convention to determine the key used. Validation of 729 the signature or MAC fails when the algorithm used requires a key 730 (which is true of all algorithms except for "none") and the key used 731 cannot be determined. 733 The means of exchanging any shared symmetric keys used is outside the 734 scope of this specification. 736 Also, see Appendix D for notes on possible key selection algorithms. 738 7. Serializations 740 JWS objects use one of two serializations, the JWS Compact 741 Serialization or the JWS JSON Serialization. Applications using this 742 specification need to specify what serialization and serialization 743 features are used for that application. For instance, applications 744 might specify that only the JWS JSON Serialization is used, that only 745 JWS JSON Serialization support for a single signature or MAC value is 746 used, or that support for multiple signatures and/or MAC values is 747 used. JWS implementations only need to implement the features needed 748 for the applications they are designed to support. 750 7.1. JWS Compact Serialization 752 The JWS Compact Serialization represents digitally signed or MACed 753 content as a compact URL-safe string. This string is 754 BASE64URL(UTF8(JWS Protected Header)) || '.' || BASE64URL(JWS 755 Payload) || '.' || BASE64URL(JWS Signature). Only one signature/MAC 756 is supported by the JWS Compact Serialization and it provides no 757 syntax to represent a JWS Unprotected Header value. 759 7.2. JWS JSON Serialization 761 The JWS JSON Serialization represents digitally signed or MACed 762 content as a JSON object. Unlike the JWS Compact Serialization, 763 content using the JWS JSON Serialization can be secured with more 764 than one digital signature and/or MAC value. 766 The representation is closely related to that used in the JWS Compact 767 Serialization, with the following differences for the JWS JSON 768 Serialization: 769 o Values in the JWS JSON Serialization are represented as members of 770 a JSON object, rather than as base64url encoded strings separated 771 by period ('.') characters. (However binary values and values 772 that are integrity protected are still base64url encoded.) 773 o The value BASE64URL(JWS Payload) is stored in the "payload" 774 member. 775 o There can be multiple signature and/or MAC values, rather than 776 just one. A JSON array in the "signatures" member is used to hold 777 values that are specific to a particular signature or MAC 778 computation, with one array element per signature/MAC represented. 779 These array elements are JSON objects. 780 o Each value BASE64URL(JWS Signature), if non-empty, is stored in 781 the "signature" member of a JSON object that is an element of the 782 "signatures" array. 783 o Each value BASE64URL(UTF8(JWS Protected Header)), if non-empty, is 784 stored in the "protected" member of the corresponding element of 785 the "signatures" array. 786 o Each JWS Unprotected Header value, if non-empty, is stored in the 787 "header" member of the corresponding element of the "signatures" 788 array. If present, a JWS Unprotected Header value is represented 789 as an unencoded JSON object, rather than as a string. 790 o The Header Parameter values used when creating or validating 791 individual signature or MAC values are the union of the two sets 792 of Header Parameter values that may be present: (1) the JWS 793 Protected Header values represented in the "protected" member of 794 the signature/MAC's array element, and (2) the JWS Unprotected 795 Header values in the "header" member of the signature/MAC's array 796 element. The union of these sets of Header Parameters comprises 797 the JWS Header. The Header Parameter names in the two locations 798 MUST be disjoint. 800 The syntax of a JWS using the JWS JSON Serialization is as follows: 802 { 803 "payload":"" 804 "signatures":[ 805 {"protected":", 806 "header":"", 807 "signature":""}, 808 ... 809 {"protected":", 810 "header":"", 811 "signature":""}], 812 } 814 Of these members, only the "payload", "signatures", and "signature" 815 members MUST be present. At least one of the "protected" and 816 "header" members MUST be present for each signature/MAC computation 817 so that an "alg" Header Parameter value is conveyed. 819 The contents of the JWS Payload and JWS Signature values are exactly 820 as defined in the rest of this specification. They are interpreted 821 and validated in the same manner, with each corresponding JWS 822 Signature and set of Header Parameter values being created and 823 validated together. The JWS Header values used are the union of the 824 Header Parameters in the corresponding JWS Protected Header and JWS 825 Unprotected Header values, as described earlier. 827 Each JWS Signature value is computed on the JWS Signing Input using 828 the parameters of the corresponding JWS Header value in the same 829 manner as for the JWS Compact Serialization. This has the desirable 830 property that each JWS Signature value represented in the 831 "signatures" array is identical to the value that would have been 832 computed for the same parameter in the JWS Compact Serialization, 833 provided that the JWS Protected Header value for that signature/MAC 834 computation (which represents the integrity-protected Header 835 Parameter values) matches that used in the JWS Compact Serialization. 837 See Appendix A.6 for an example of computing a JWS using the JWS JSON 838 Serialization. 840 8. TLS Requirements 842 Implementations MUST support TLS. Which version(s) ought to be 843 implemented will vary over time, and depend on the widespread 844 deployment and known security vulnerabilities at the time of 845 implementation. At the time of this writing, TLS version 1.2 846 [RFC5246] is the most recent version, but has very limited actual 847 deployment, and might not be readily available in implementation 848 toolkits. TLS version 1.0 [RFC2246] is the most widely deployed 849 version, and will give the broadest interoperability. 851 To protect against information disclosure and tampering, 852 confidentiality protection MUST be applied using TLS with a 853 ciphersuite that provides confidentiality and integrity protection. 855 Whenever TLS is used, a TLS server certificate check MUST be 856 performed, per RFC 6125 [RFC6125]. 858 9. IANA Considerations 860 The following registration procedure is used for all the registries 861 established by this specification. 863 Values are registered with a Specification Required [RFC5226] after a 864 two-week review period on the [TBD]@ietf.org mailing list, on the 865 advice of one or more Designated Experts. However, to allow for the 866 allocation of values prior to publication, the Designated Expert(s) 867 may approve registration once they are satisfied that such a 868 specification will be published. 870 Registration requests must be sent to the [TBD]@ietf.org mailing list 871 for review and comment, with an appropriate subject (e.g., "Request 872 for access token type: example"). [[ Note to the RFC Editor: The name 873 of the mailing list should be determined in consultation with the 874 IESG and IANA. Suggested name: jose-reg-review. ]] 876 Within the review period, the Designated Expert(s) will either 877 approve or deny the registration request, communicating this decision 878 to the review list and IANA. Denials should include an explanation 879 and, if applicable, suggestions as to how to make the request 880 successful. Registration requests that are undetermined for a period 881 longer than 21 days can be brought to the IESG's attention (using the 882 iesg@iesg.org mailing list) for resolution. 884 Criteria that should be applied by the Designated Expert(s) includes 885 determining whether the proposed registration duplicates existing 886 functionality, determining whether it is likely to be of general 887 applicability or whether it is useful only for a single application, 888 and whether the registration makes sense. 890 IANA must only accept registry updates from the Designated Expert(s) 891 and should direct all requests for registration to the review mailing 892 list. 894 It is suggested that multiple Designated Experts be appointed who are 895 able to represent the perspectives of different applications using 896 this specification, in order to enable broadly-informed review of 897 registration decisions. In cases where a registration decision could 898 be perceived as creating a conflict of interest for a particular 899 Expert, that Expert should defer to the judgment of the other 900 Expert(s). 902 9.1. JSON Web Signature and Encryption Header Parameters Registry 904 This specification establishes the IANA JSON Web Signature and 905 Encryption Header Parameters registry for JWS and JWE Header 906 Parameter names. The registry records the Header Parameter name and 907 a reference to the specification that defines it. The same Header 908 Parameter name can be registered multiple times, provided that the 909 parameter usage is compatible between the specifications. Different 910 registrations of the same Header Parameter name will typically use 911 different Header Parameter Usage Location(s) values. 913 9.1.1. Registration Template 915 Header Parameter Name: 916 The name requested (e.g., "example"). Because a core goal of this 917 specification is for the resulting representations to be compact, 918 it is RECOMMENDED that the name be short -- not to exceed 8 919 characters without a compelling reason to do so. This name is 920 case-sensitive. Names may not match other registered names in a 921 case-insensitive manner unless the Designated Expert(s) state that 922 there is a compelling reason to allow an exception in this 923 particular case. 924 Header Parameter Description: 925 Brief description of the Header Parameter (e.g., "Example 926 description"). 927 Header Parameter Usage Location(s): 928 The Header Parameter usage locations, which should be one or more 929 of the values "JWS" or "JWE". 931 Change Controller: 932 For Standards Track RFCs, state "IESG". For others, give the name 933 of the responsible party. Other details (e.g., postal address, 934 email address, home page URI) may also be included. 935 Specification Document(s): 936 Reference to the document(s) that specify the parameter, 937 preferably including URI(s) that can be used to retrieve copies of 938 the document(s). An indication of the relevant sections may also 939 be included but is not required. 941 9.1.2. Initial Registry Contents 943 This specification registers the Header Parameter names defined in 944 Section 4.1 in this registry. 946 o Header Parameter Name: "alg" 947 o Header Parameter Description: Algorithm 948 o Header Parameter Usage Location(s): JWS 949 o Change Controller: IESG 950 o Specification Document(s): Section 4.1.1 of [[ this document ]] 952 o Header Parameter Name: "jku" 953 o Header Parameter Description: JWK Set URL 954 o Header Parameter Usage Location(s): JWS 955 o Change Controller: IESG 956 o Specification Document(s): Section 4.1.2 of [[ this document ]] 958 o Header Parameter Name: "jwk" 959 o Header Parameter Description: JSON Web Key 960 o Header Parameter Usage Location(s): JWS 961 o Change Controller: IESG 962 o Specification document(s): Section 4.1.3 of [[ this document ]] 964 o Header Parameter Name: "kid" 965 o Header Parameter Description: Key ID 966 o Header Parameter Usage Location(s): JWS 967 o Change Controller: IESG 968 o Specification Document(s): Section 4.1.4 of [[ this document ]] 970 o Header Parameter Name: "x5u" 971 o Header Parameter Description: X.509 URL 972 o Header Parameter Usage Location(s): JWS 973 o Change Controller: IESG 974 o Specification Document(s): Section 4.1.5 of [[ this document ]] 976 o Header Parameter Name: "x5c" 977 o Header Parameter Description: X.509 Certificate Chain 978 o Header Parameter Usage Location(s): JWS 979 o Change Controller: IESG 980 o Specification Document(s): Section 4.1.6 of [[ this document ]] 982 o Header Parameter Name: "x5t" 983 o Header Parameter Description: X.509 Certificate SHA-1 Thumbprint 984 o Header Parameter Usage Location(s): JWS 985 o Change Controller: IESG 986 o Specification Document(s): Section 4.1.7 of [[ this document ]] 988 o Header Parameter Name: "typ" 989 o Header Parameter Description: Type 990 o Header Parameter Usage Location(s): JWS 991 o Change Controller: IESG 992 o Specification Document(s): Section 4.1.8 of [[ this document ]] 994 o Header Parameter Name: "cty" 995 o Header Parameter Description: Content Type 996 o Header Parameter Usage Location(s): JWS 997 o Change Controller: IESG 998 o Specification Document(s): Section 4.1.9 of [[ this document ]] 1000 o Header Parameter Name: "crit" 1001 o Header Parameter Description: Critical 1002 o Header Parameter Usage Location(s): JWS 1003 o Change Controller: IESG 1004 o Specification Document(s): Section 4.1.10 of [[ this document ]] 1006 9.2. Media Type Registration 1008 9.2.1. Registry Contents 1010 This specification registers the "application/jose" Media Type 1011 [RFC2046] in the MIME Media Types registry [IANA.MediaTypes], which 1012 can be used to indicate that the content is a JWS or JWE object using 1013 the JWS Compact Serialization or the JWE Compact Serialization and 1014 the "application/jose+json" Media Type in the MIME Media Types 1015 registry, which can be used to indicate that the content is a JWS or 1016 JWE object using the JWS JSON Serialization or the JWE JSON 1017 Serialization. 1019 o Type name: application 1020 o Subtype name: jose 1021 o Required parameters: n/a 1022 o Optional parameters: n/a 1023 o Encoding considerations: 8bit; application/jose values are encoded 1024 as a series of base64url encoded values (some of which may be the 1025 empty string) separated by period ('.') characters. 1026 o Security considerations: See the Security Considerations section 1027 of [[ this document ]] 1028 o Interoperability considerations: n/a 1029 o Published specification: [[ this document ]] 1030 o Applications that use this media type: OpenID Connect, Mozilla 1031 Persona, Salesforce, Google, Android, Windows Azure, Xbox One, and 1032 numerous others that use JWTs 1033 o Additional information: Magic number(s): n/a, File extension(s): 1034 n/a, Macintosh file type code(s): n/a 1035 o Person & email address to contact for further information: Michael 1036 B. Jones, mbj@microsoft.com 1037 o Intended usage: COMMON 1038 o Restrictions on usage: none 1039 o Author: Michael B. Jones, mbj@microsoft.com 1040 o Change Controller: IESG 1042 o Type name: application 1043 o Subtype name: jose+json 1044 o Required parameters: n/a 1045 o Optional parameters: n/a 1046 o Encoding considerations: 8bit; application/jose+json values are 1047 represented as a JSON Object; UTF-8 encoding SHOULD be employed 1048 for the JSON object. 1049 o Security considerations: See the Security Considerations section 1050 of [[ this document ]] 1051 o Interoperability considerations: n/a 1052 o Published specification: [[ this document ]] 1053 o Applications that use this media type: TBD 1054 o Additional information: Magic number(s): n/a, File extension(s): 1055 n/a, Macintosh file type code(s): n/a 1056 o Person & email address to contact for further information: Michael 1057 B. Jones, mbj@microsoft.com 1058 o Intended usage: COMMON 1059 o Restrictions on usage: none 1060 o Author: Michael B. Jones, mbj@microsoft.com 1061 o Change Controller: IESG 1063 10. Security Considerations 1065 10.1. Cryptographic Security Considerations 1067 All of the security issues faced by any cryptographic application 1068 must be faced by a JWS/JWE/JWK agent. Among these issues are 1069 protecting the user's private and symmetric keys, preventing various 1070 attacks, and helping the user avoid mistakes such as inadvertently 1071 encrypting a message for the wrong recipient. The entire list of 1072 security considerations is beyond the scope of this document, but 1073 some significant concerns are listed here. 1075 All the security considerations in XML DSIG 2.0 1076 [W3C.CR-xmldsig-core2-20120124], also apply to this specification, 1077 other than those that are XML specific. Likewise, many of the best 1078 practices documented in XML Signature Best Practices 1079 [W3C.WD-xmldsig-bestpractices-20110809] also apply to this 1080 specification, other than those that are XML specific. 1082 Keys are only as strong as the amount of entropy used to generate 1083 them. A minimum of 128 bits of entropy should be used for all keys, 1084 and depending upon the application context, more may be required. In 1085 particular, it may be difficult to generate sufficiently random 1086 values in some browsers and application environments. 1088 Creators of JWSs should not allow third parties to insert arbitrary 1089 content into the message without adding entropy not controlled by the 1090 third party. 1092 When utilizing TLS to retrieve information, the authority providing 1093 the resource MUST be authenticated and the information retrieved MUST 1094 be free from modification. 1096 When cryptographic algorithms are implemented in such a way that 1097 successful operations take a different amount of time than 1098 unsuccessful operations, attackers may be able to use the time 1099 difference to obtain information about the keys employed. Therefore, 1100 such timing differences must be avoided. 1102 A SHA-1 hash is used when computing "x5t" (x.509 certificate 1103 thumbprint) values, for compatibility reasons. Should an effective 1104 means of producing SHA-1 hash collisions be developed, and should an 1105 attacker wish to interfere with the use of a known certificate on a 1106 given system, this could be accomplished by creating another 1107 certificate whose SHA-1 hash value is the same and adding it to the 1108 certificate store used by the intended victim. A prerequisite to 1109 this attack succeeding is the attacker having write access to the 1110 intended victim's certificate store. 1112 If, in the future, certificate thumbprints need to be computed using 1113 hash functions other than SHA-1, it is suggested that additional 1114 related Header Parameters be defined for that purpose. For example, 1115 it is suggested that a new "x5t#S256" (X.509 Certificate Thumbprint 1116 using SHA-256) Header Parameter could be defined and used. 1118 10.2. JSON Security Considerations 1120 Strict JSON validation is a security requirement. If malformed JSON 1121 is received, then the intent of the sender is impossible to reliably 1122 discern. Ambiguous and potentially exploitable situations could 1123 arise if the JSON parser used does not reject malformed JSON syntax. 1125 Section 2.2 of the JavaScript Object Notation (JSON) specification 1126 [RFC4627] states "The names within an object SHOULD be unique", 1127 whereas this specification states that "Header Parameter names within 1128 this object MUST be unique; recipients MUST either reject JWSs with 1129 duplicate Header Parameter names or use a JSON parser that returns 1130 only the lexically last duplicate member name, as specified in 1131 Section 15.12 (The JSON Object) of ECMAScript 5.1 [ECMAScript]". 1132 Thus, this specification requires that the Section 2.2 "SHOULD" be 1133 treated as a "MUST" by senders and that it be either treated as a 1134 "MUST" or in the manner specified in ECMAScript 5.1 by receivers. 1135 Ambiguous and potentially exploitable situations could arise if the 1136 JSON parser used does not enforce the uniqueness of member names or 1137 returns an unpredictable value for duplicate member names. 1139 Some JSON parsers might not reject input that contains extra 1140 significant characters after a valid input. For instance, the input 1141 "{"tag":"value"}ABCD" contains a valid JSON object followed by the 1142 extra characters "ABCD". Such input MUST be rejected in its 1143 entirety. 1145 10.3. Unicode Comparison Security Considerations 1147 Header Parameter names and algorithm names are Unicode strings. For 1148 security reasons, the representations of these names must be compared 1149 verbatim after performing any escape processing (as per RFC 4627 1150 [RFC4627], Section 2.5). This means, for instance, that these JSON 1151 strings must compare as being equal ("sig", "\u0073ig"), whereas 1152 these must all compare as being not equal to the first set or to each 1153 other ("SIG", "Sig", "si\u0047"). 1155 JSON strings can contain characters outside the Unicode Basic 1156 Multilingual Plane. For instance, the G clef character (U+1D11E) may 1157 be represented in a JSON string as "\uD834\uDD1E". Ideally, JWS 1158 implementations SHOULD ensure that characters outside the Basic 1159 Multilingual Plane are preserved and compared correctly; 1160 alternatively, if this is not possible due to these characters 1161 exercising limitations present in the underlying JSON implementation, 1162 then input containing them MUST be rejected. 1164 11. References 1165 11.1. Normative References 1167 [ECMAScript] 1168 Ecma International, "ECMAScript Language Specification, 1169 5.1 Edition", ECMA 262, June 2011. 1171 [I-D.ietf-json-rfc4627bis] 1172 Bray, T., "The JSON Data Interchange Format", 1173 draft-ietf-json-rfc4627bis-07 (work in progress), 1174 November 2013. 1176 [IANA.MediaTypes] 1177 Internet Assigned Numbers Authority (IANA), "MIME Media 1178 Types", 2005. 1180 [ITU.X690.1994] 1181 International Telecommunications Union, "Information 1182 Technology - ASN.1 encoding rules: Specification of Basic 1183 Encoding Rules (BER), Canonical Encoding Rules (CER) and 1184 Distinguished Encoding Rules (DER)", ITU-T Recommendation 1185 X.690, 1994. 1187 [JWA] Jones, M., "JSON Web Algorithms (JWA)", 1188 draft-ietf-jose-json-web-algorithms (work in progress), 1189 December 2013. 1191 [JWK] Jones, M., "JSON Web Key (JWK)", 1192 draft-ietf-jose-json-web-key (work in progress), 1193 December 2013. 1195 [RFC1421] Linn, J., "Privacy Enhancement for Internet Electronic 1196 Mail: Part I: Message Encryption and Authentication 1197 Procedures", RFC 1421, February 1993. 1199 [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 1200 Extensions (MIME) Part One: Format of Internet Message 1201 Bodies", RFC 2045, November 1996. 1203 [RFC2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail 1204 Extensions (MIME) Part Two: Media Types", RFC 2046, 1205 November 1996. 1207 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1208 Requirement Levels", BCP 14, RFC 2119, March 1997. 1210 [RFC2246] Dierks, T. and C. Allen, "The TLS Protocol Version 1.0", 1211 RFC 2246, January 1999. 1213 [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. 1215 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 1216 10646", STD 63, RFC 3629, November 2003. 1218 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 1219 Resource Identifier (URI): Generic Syntax", STD 66, 1220 RFC 3986, January 2005. 1222 [RFC4627] Crockford, D., "The application/json Media Type for 1223 JavaScript Object Notation (JSON)", RFC 4627, July 2006. 1225 [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data 1226 Encodings", RFC 4648, October 2006. 1228 [RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an 1229 IANA Considerations Section in RFCs", BCP 26, RFC 5226, 1230 May 2008. 1232 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 1233 (TLS) Protocol Version 1.2", RFC 5246, August 2008. 1235 [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., 1236 Housley, R., and W. Polk, "Internet X.509 Public Key 1237 Infrastructure Certificate and Certificate Revocation List 1238 (CRL) Profile", RFC 5280, May 2008. 1240 [RFC6125] Saint-Andre, P. and J. Hodges, "Representation and 1241 Verification of Domain-Based Application Service Identity 1242 within Internet Public Key Infrastructure Using X.509 1243 (PKIX) Certificates in the Context of Transport Layer 1244 Security (TLS)", RFC 6125, March 2011. 1246 [USASCII] American National Standards Institute, "Coded Character 1247 Set -- 7-bit American Standard Code for Information 1248 Interchange", ANSI X3.4, 1986. 1250 [W3C.WD-xmldsig-bestpractices-20110809] 1251 Datta, P. and F. Hirsch, "XML Signature Best Practices", 1252 World Wide Web Consortium WD WD-xmldsig-bestpractices- 1253 20110809, August 2011, . 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), December 2013. 1268 [JWT] Jones, M., Bradley, J., and N. Sakimura, "JSON Web Token 1269 (JWT)", draft-ietf-oauth-json-web-token (work in 1270 progress), December 2013. 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 [W3C.CR-xmldsig-core2-20120124] 1281 Cantor, S., Roessler, T., Eastlake, D., Yiu, K., Reagle, 1282 J., Solo, D., Datta, P., and F. Hirsch, "XML Signature 1283 Syntax and Processing Version 2.0", World Wide Web 1284 Consortium CR CR-xmldsig-core2-20120124, January 2012, 1285 . 1287 Appendix A. JWS Examples 1289 This section provides several examples of JWSs. While the first 1290 three examples all represent JSON Web Tokens (JWTs) [JWT], the 1291 payload can be any octet sequence, as shown in Appendix A.4. 1293 A.1. Example JWS using HMAC SHA-256 1295 A.1.1. Encoding 1297 The following example JWS Protected Header declares that the data 1298 structure is a JSON Web Token (JWT) [JWT] and the JWS Signing Input 1299 is secured using the HMAC SHA-256 algorithm. 1301 {"typ":"JWT", 1302 "alg":"HS256"} 1304 The octets representing UTF8(JWS Protected Header) in this case are: 1306 [123, 34, 116, 121, 112, 34, 58, 34, 74, 87, 84, 34, 44, 13, 10, 32, 1307 34, 97, 108, 103, 34, 58, 34, 72, 83, 50, 53, 54, 34, 125] 1308 Encoding this JWS Protected Header as BASE64URL(UTF8(JWS Protected 1309 Header)) gives this value: 1311 eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9 1313 The JWS Payload used in this example is the octets of the UTF-8 1314 representation of the JSON object below. (Note that the payload can 1315 be any base64url encoded octet sequence, and need not be a base64url 1316 encoded JSON object.) 1318 {"iss":"joe", 1319 "exp":1300819380, 1320 "http://example.com/is_root":true} 1322 The following octet sequence, which is the UTF-8 representation of 1323 the JSON object above, is the JWS Payload: 1325 [123, 34, 105, 115, 115, 34, 58, 34, 106, 111, 101, 34, 44, 13, 10, 1326 32, 34, 101, 120, 112, 34, 58, 49, 51, 48, 48, 56, 49, 57, 51, 56, 1327 48, 44, 13, 10, 32, 34, 104, 116, 116, 112, 58, 47, 47, 101, 120, 97, 1328 109, 112, 108, 101, 46, 99, 111, 109, 47, 105, 115, 95, 114, 111, 1329 111, 116, 34, 58, 116, 114, 117, 101, 125] 1331 Encoding this JWS Protected Header as BASE64URL(UTF8(JWS Protected 1332 Header)) gives this value (with line breaks for display purposes 1333 only): 1335 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 1336 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 1338 Combining these as BASE64URL(UTF8(JWS Protected Header)) || '.' || 1339 BASE64URL(JWS Payload) gives this string (with line breaks for 1340 display purposes only): 1342 eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9 1343 . 1344 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 1345 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 1347 The resulting JWS Signing Input value, which is the ASCII 1348 representation of above string, is the following octet sequence: 1350 [101, 121, 74, 48, 101, 88, 65, 105, 79, 105, 74, 75, 86, 49, 81, 1351 105, 76, 65, 48, 75, 73, 67, 74, 104, 98, 71, 99, 105, 79, 105, 74, 1352 73, 85, 122, 73, 49, 78, 105, 74, 57, 46, 101, 121, 74, 112, 99, 51, 1353 77, 105, 79, 105, 74, 113, 98, 50, 85, 105, 76, 65, 48, 75, 73, 67, 1354 74, 108, 101, 72, 65, 105, 79, 106, 69, 122, 77, 68, 65, 52, 77, 84, 1355 107, 122, 79, 68, 65, 115, 68, 81, 111, 103, 73, 109, 104, 48, 100, 1356 72, 65, 54, 76, 121, 57, 108, 101, 71, 70, 116, 99, 71, 120, 108, 76, 1357 109, 78, 118, 98, 83, 57, 112, 99, 49, 57, 121, 98, 50, 57, 48, 73, 1358 106, 112, 48, 99, 110, 86, 108, 102, 81] 1360 HMACs are generated using keys. This example uses the symmetric key 1361 represented in JSON Web Key [JWK] format below (with line breaks for 1362 display purposes only): 1364 {"kty":"oct", 1365 "k":"AyM1SysPpbyDfgZld3umj1qzKObwVMkoqQ-EstJQLr_T-1qS0gZH75 1366 aKtMN3Yj0iPS4hcgUuTwjAzZr1Z9CAow" 1367 } 1369 Running the HMAC SHA-256 algorithm on the JWS Signing Input with this 1370 key yields this JWS Signature octet sequence: 1372 [116, 24, 223, 180, 151, 153, 224, 37, 79, 250, 96, 125, 216, 173, 1373 187, 186, 22, 212, 37, 77, 105, 214, 191, 240, 91, 88, 5, 88, 83, 1374 132, 141, 121] 1376 Encoding this JWS Signature as BASE64URL(JWS Signature) gives this 1377 value: 1379 dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk 1381 Concatenating these values in the order Header.Payload.Signature with 1382 period ('.') characters between the parts yields this complete JWS 1383 representation using the JWS Compact Serialization (with line breaks 1384 for display purposes only): 1386 eyJ0eXAiOiJKV1QiLA0KICJhbGciOiJIUzI1NiJ9 1387 . 1388 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 1389 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 1390 . 1391 dBjftJeZ4CVP-mB92K27uhbUJU1p1r_wW1gFWFOEjXk 1393 A.1.2. Validating 1395 Since the "alg" Header Parameter is "HS256", we validate the HMAC 1396 SHA-256 value contained in the JWS Signature. 1398 To validate the HMAC value, we repeat the previous process of using 1399 the correct key and the JWS Signing Input as input to the HMAC SHA- 1400 256 function and then taking the output and determining if it matches 1401 the JWS Signature. If it matches exactly, the HMAC has been 1402 validated. 1404 A.2. Example JWS using RSASSA-PKCS-v1_5 SHA-256 1406 A.2.1. Encoding 1408 The JWS Protected Header in this example is different from the 1409 previous example in two ways: First, because a different algorithm is 1410 being used, the "alg" value is different. Second, for illustration 1411 purposes only, the optional "typ" parameter is not used. (This 1412 difference is not related to the algorithm employed.) The JWS 1413 Protected Header used is: 1415 {"alg":"RS256"} 1417 The octets representing UTF8(JWS Protected Header) in this case are: 1419 [123, 34, 97, 108, 103, 34, 58, 34, 82, 83, 50, 53, 54, 34, 125] 1421 Encoding this JWS Protected Header as BASE64URL(UTF8(JWS Protected 1422 Header)) gives this value: 1424 eyJhbGciOiJSUzI1NiJ9 1426 The JWS Payload used in this example, which follows, is the same as 1427 in the previous example. Since the BASE64URL(JWS Payload) value will 1428 therefore be the same, its computation is not repeated here. 1430 {"iss":"joe", 1431 "exp":1300819380, 1432 "http://example.com/is_root":true} 1434 Combining these as BASE64URL(UTF8(JWS Protected Header)) || '.' || 1435 BASE64URL(JWS Payload) gives this string (with line breaks for 1436 display purposes only): 1438 eyJhbGciOiJSUzI1NiJ9 1439 . 1440 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 1441 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 1443 The resulting JWS Signing Input value, which is the ASCII 1444 representation of above string, is the following octet sequence: 1446 [101, 121, 74, 104, 98, 71, 99, 105, 79, 105, 74, 83, 85, 122, 73, 1447 49, 78, 105, 74, 57, 46, 101, 121, 74, 112, 99, 51, 77, 105, 79, 105, 1448 74, 113, 98, 50, 85, 105, 76, 65, 48, 75, 73, 67, 74, 108, 101, 72, 1449 65, 105, 79, 106, 69, 122, 77, 68, 65, 52, 77, 84, 107, 122, 79, 68, 1450 65, 115, 68, 81, 111, 103, 73, 109, 104, 48, 100, 72, 65, 54, 76, 1451 121, 57, 108, 101, 71, 70, 116, 99, 71, 120, 108, 76, 109, 78, 118, 1452 98, 83, 57, 112, 99, 49, 57, 121, 98, 50, 57, 48, 73, 106, 112, 48, 1453 99, 110, 86, 108, 102, 81] 1455 This example uses the RSA key represented in JSON Web Key [JWK] 1456 format below (with line breaks for display purposes only): 1458 {"kty":"RSA", 1459 "n":"ofgWCuLjybRlzo0tZWJjNiuSfb4p4fAkd_wWJcyQoTbji9k0l8W26mPddx 1460 HmfHQp-Vaw-4qPCJrcS2mJPMEzP1Pt0Bm4d4QlL-yRT-SFd2lZS-pCgNMs 1461 D1W_YpRPEwOWvG6b32690r2jZ47soMZo9wGzjb_7OMg0LOL-bSf63kpaSH 1462 SXndS5z5rexMdbBYUsLA9e-KXBdQOS-UTo7WTBEMa2R2CapHg665xsmtdV 1463 MTBQY4uDZlxvb3qCo5ZwKh9kG4LT6_I5IhlJH7aGhyxXFvUK-DWNmoudF8 1464 NAco9_h9iaGNj8q2ethFkMLs91kzk2PAcDTW9gb54h4FRWyuXpoQ", 1465 "e":"AQAB", 1466 "d":"Eq5xpGnNCivDflJsRQBXHx1hdR1k6Ulwe2JZD50LpXyWPEAeP88vLNO97I 1467 jlA7_GQ5sLKMgvfTeXZx9SE-7YwVol2NXOoAJe46sui395IW_GO-pWJ1O0 1468 BkTGoVEn2bKVRUCgu-GjBVaYLU6f3l9kJfFNS3E0QbVdxzubSu3Mkqzjkn 1469 439X0M_V51gfpRLI9JYanrC4D4qAdGcopV_0ZHHzQlBjudU2QvXt4ehNYT 1470 CBr6XCLQUShb1juUO1ZdiYoFaFQT5Tw8bGUl_x_jTj3ccPDVZFD9pIuhLh 1471 BOneufuBiB4cS98l2SR_RQyGWSeWjnczT0QU91p1DhOVRuOopznQ" 1472 } 1474 The RSA private key is then passed to the RSA signing function, which 1475 also takes the hash type, SHA-256, and the JWS Signing Input as 1476 inputs. The result of the digital signature is an octet sequence, 1477 which represents a big endian integer. In this example, it is: 1479 [112, 46, 33, 137, 67, 232, 143, 209, 30, 181, 216, 45, 191, 120, 69, 1480 243, 65, 6, 174, 27, 129, 255, 247, 115, 17, 22, 173, 209, 113, 125, 1481 131, 101, 109, 66, 10, 253, 60, 150, 238, 221, 115, 162, 102, 62, 81, 1482 102, 104, 123, 0, 11, 135, 34, 110, 1, 135, 237, 16, 115, 249, 69, 1483 229, 130, 173, 252, 239, 22, 216, 90, 121, 142, 232, 198, 109, 219, 1484 61, 184, 151, 91, 23, 208, 148, 2, 190, 237, 213, 217, 217, 112, 7, 1485 16, 141, 178, 129, 96, 213, 248, 4, 12, 167, 68, 87, 98, 184, 31, 1486 190, 127, 249, 217, 46, 10, 231, 111, 36, 242, 91, 51, 187, 230, 244, 1487 74, 230, 30, 177, 4, 10, 203, 32, 4, 77, 62, 249, 18, 142, 212, 1, 1488 48, 121, 91, 212, 189, 59, 65, 238, 202, 208, 102, 171, 101, 25, 129, 1489 253, 228, 141, 247, 127, 55, 45, 195, 139, 159, 175, 221, 59, 239, 1490 177, 139, 93, 163, 204, 60, 46, 176, 47, 158, 58, 65, 214, 18, 202, 1491 173, 21, 145, 18, 115, 160, 95, 35, 185, 232, 56, 250, 175, 132, 157, 1492 105, 132, 41, 239, 90, 30, 136, 121, 130, 54, 195, 212, 14, 96, 69, 1493 34, 165, 68, 200, 242, 122, 122, 45, 184, 6, 99, 209, 108, 247, 202, 1494 234, 86, 222, 64, 92, 178, 33, 90, 69, 178, 194, 85, 102, 181, 90, 1495 193, 167, 72, 160, 112, 223, 200, 163, 42, 70, 149, 67, 208, 25, 238, 1496 251, 71] 1498 Encoding the signature as BASE64URL(JWS Signature) produces this 1499 value (with line breaks for display purposes only): 1501 cC4hiUPoj9Eetdgtv3hF80EGrhuB__dzERat0XF9g2VtQgr9PJbu3XOiZj5RZmh7 1502 AAuHIm4Bh-0Qc_lF5YKt_O8W2Fp5jujGbds9uJdbF9CUAr7t1dnZcAcQjbKBYNX4 1503 BAynRFdiuB--f_nZLgrnbyTyWzO75vRK5h6xBArLIARNPvkSjtQBMHlb1L07Qe7K 1504 0GarZRmB_eSN9383LcOLn6_dO--xi12jzDwusC-eOkHWEsqtFZESc6BfI7noOPqv 1505 hJ1phCnvWh6IeYI2w9QOYEUipUTI8np6LbgGY9Fs98rqVt5AXLIhWkWywlVmtVrB 1506 p0igcN_IoypGlUPQGe77Rw 1508 Concatenating these values in the order Header.Payload.Signature with 1509 period ('.') characters between the parts yields this complete JWS 1510 representation using the JWS Compact Serialization (with line breaks 1511 for display purposes only): 1513 eyJhbGciOiJSUzI1NiJ9 1514 . 1515 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 1516 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 1517 . 1518 cC4hiUPoj9Eetdgtv3hF80EGrhuB__dzERat0XF9g2VtQgr9PJbu3XOiZj5RZmh7 1519 AAuHIm4Bh-0Qc_lF5YKt_O8W2Fp5jujGbds9uJdbF9CUAr7t1dnZcAcQjbKBYNX4 1520 BAynRFdiuB--f_nZLgrnbyTyWzO75vRK5h6xBArLIARNPvkSjtQBMHlb1L07Qe7K 1521 0GarZRmB_eSN9383LcOLn6_dO--xi12jzDwusC-eOkHWEsqtFZESc6BfI7noOPqv 1522 hJ1phCnvWh6IeYI2w9QOYEUipUTI8np6LbgGY9Fs98rqVt5AXLIhWkWywlVmtVrB 1523 p0igcN_IoypGlUPQGe77Rw 1525 A.2.2. Validating 1527 Since the "alg" Header Parameter is "RS256", we validate the RSASSA- 1528 PKCS-v1_5 SHA-256 digital signature contained in the JWS Signature. 1530 Validating the JWS Signature is a little different from the previous 1531 example. We pass (n, e), JWS Signature, and the JWS Signing Input to 1532 an RSASSA-PKCS-v1_5 signature verifier that has been configured to 1533 use the SHA-256 hash function. 1535 A.3. Example JWS using ECDSA P-256 SHA-256 1537 A.3.1. Encoding 1539 The JWS Protected Header for this example differs from the previous 1540 example because a different algorithm is being used. The JWS 1541 Protected Header used is: 1543 {"alg":"ES256"} 1545 The octets representing UTF8(JWS Protected Header) in this case are: 1547 [123, 34, 97, 108, 103, 34, 58, 34, 69, 83, 50, 53, 54, 34, 125] 1548 Encoding this JWS Protected Header as BASE64URL(UTF8(JWS Protected 1549 Header)) gives this value: 1551 eyJhbGciOiJFUzI1NiJ9 1553 The JWS Payload used in this example, which follows, is the same as 1554 in the previous examples. Since the BASE64URL(JWS Payload) value 1555 will therefore be the same, its computation is not repeated here. 1557 {"iss":"joe", 1558 "exp":1300819380, 1559 "http://example.com/is_root":true} 1561 Combining these as BASE64URL(UTF8(JWS Protected Header)) || '.' || 1562 BASE64URL(JWS Payload) gives this string (with line breaks for 1563 display purposes only): 1565 eyJhbGciOiJFUzI1NiJ9 1566 . 1567 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 1568 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 1570 The resulting JWS Signing Input value, which is the ASCII 1571 representation of above string, is the following octet sequence: 1573 [101, 121, 74, 104, 98, 71, 99, 105, 79, 105, 74, 70, 85, 122, 73, 1574 49, 78, 105, 74, 57, 46, 101, 121, 74, 112, 99, 51, 77, 105, 79, 105, 1575 74, 113, 98, 50, 85, 105, 76, 65, 48, 75, 73, 67, 74, 108, 101, 72, 1576 65, 105, 79, 106, 69, 122, 77, 68, 65, 52, 77, 84, 107, 122, 79, 68, 1577 65, 115, 68, 81, 111, 103, 73, 109, 104, 48, 100, 72, 65, 54, 76, 1578 121, 57, 108, 101, 71, 70, 116, 99, 71, 120, 108, 76, 109, 78, 118, 1579 98, 83, 57, 112, 99, 49, 57, 121, 98, 50, 57, 48, 73, 106, 112, 48, 1580 99, 110, 86, 108, 102, 81] 1582 This example uses the elliptic curve key represented in JSON Web Key 1583 [JWK] format below: 1585 {"kty":"EC", 1586 "crv":"P-256", 1587 "x":"f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU", 1588 "y":"x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0", 1589 "d":"jpsQnnGQmL-YBIffH1136cspYG6-0iY7X1fCE9-E9LI" 1590 } 1592 The ECDSA private part d is then passed to an ECDSA signing function, 1593 which also takes the curve type, P-256, the hash type, SHA-256, and 1594 the JWS Signing Input as inputs. The result of the digital signature 1595 is the EC point (R, S), where R and S are unsigned integers. In this 1596 example, the R and S values, given as octet sequences representing 1597 big endian integers are: 1599 +--------+----------------------------------------------------------+ 1600 | Result | Value | 1601 | Name | | 1602 +--------+----------------------------------------------------------+ 1603 | R | [14, 209, 33, 83, 121, 99, 108, 72, 60, 47, 127, 21, 88, | 1604 | | 7, 212, 2, 163, 178, 40, 3, 58, 249, 124, 126, 23, 129, | 1605 | | 154, 195, 22, 158, 166, 101] | 1606 | S | [197, 10, 7, 211, 140, 60, 112, 229, 216, 241, 45, 175, | 1607 | | 8, 74, 84, 128, 166, 101, 144, 197, 242, 147, 80, 154, | 1608 | | 143, 63, 127, 138, 131, 163, 84, 213] | 1609 +--------+----------------------------------------------------------+ 1611 The JWS Signature is the value R || S. Encoding the signature as 1612 BASE64URL(JWS Signature) produces this value (with line breaks for 1613 display purposes only): 1615 DtEhU3ljbEg8L38VWAfUAqOyKAM6-Xx-F4GawxaepmXFCgfTjDxw5djxLa8ISlSA 1616 pmWQxfKTUJqPP3-Kg6NU1Q 1618 Concatenating these values in the order Header.Payload.Signature with 1619 period ('.') characters between the parts yields this complete JWS 1620 representation using the JWS Compact Serialization (with line breaks 1621 for display purposes only): 1623 eyJhbGciOiJFUzI1NiJ9 1624 . 1625 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 1626 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 1627 . 1628 DtEhU3ljbEg8L38VWAfUAqOyKAM6-Xx-F4GawxaepmXFCgfTjDxw5djxLa8ISlSA 1629 pmWQxfKTUJqPP3-Kg6NU1Q 1631 A.3.2. Validating 1633 Since the "alg" Header Parameter is "ES256", we validate the ECDSA 1634 P-256 SHA-256 digital signature contained in the JWS Signature. 1636 Validating the JWS Signature is a little different from the first 1637 example. We need to split the 64 member octet sequence of the JWS 1638 Signature into two 32 octet sequences, the first R and the second S. 1639 We then pass (x, y), (R, S) and the JWS Signing Input to an ECDSA 1640 signature verifier that has been configured to use the P-256 curve 1641 with the SHA-256 hash function. 1643 A.4. Example JWS using ECDSA P-521 SHA-512 1645 A.4.1. Encoding 1647 The JWS Protected Header for this example differs from the previous 1648 example because different ECDSA curves and hash functions are used. 1649 The JWS Protected Header used is: 1651 {"alg":"ES512"} 1653 The octets representing UTF8(JWS Protected Header) in this case are: 1655 [123, 34, 97, 108, 103, 34, 58, 34, 69, 83, 53, 49, 50, 34, 125] 1657 Encoding this JWS Protected Header as BASE64URL(UTF8(JWS Protected 1658 Header)) gives this value: 1660 eyJhbGciOiJFUzUxMiJ9 1662 The JWS Payload used in this example, is the ASCII string "Payload". 1663 The representation of this string is the octet sequence: 1665 [80, 97, 121, 108, 111, 97, 100] 1667 Encoding this JWS Payload as BASE64URL(JWS Payload) gives this value: 1669 UGF5bG9hZA 1671 Combining these as BASE64URL(UTF8(JWS Protected Header)) || '.' || 1672 BASE64URL(JWS Payload) gives this string (with line breaks for 1673 display purposes only): 1675 eyJhbGciOiJFUzUxMiJ9.UGF5bG9hZA 1677 The resulting JWS Signing Input value, which is the ASCII 1678 representation of above string, is the following octet sequence: 1680 [101, 121, 74, 104, 98, 71, 99, 105, 79, 105, 74, 70, 85, 122, 85, 1681 120, 77, 105, 74, 57, 46, 85, 71, 70, 53, 98, 71, 57, 104, 90, 65] 1683 This example uses the elliptic curve key represented in JSON Web Key 1684 [JWK] format below (with line breaks for display purposes only): 1686 {"kty":"EC", 1687 "crv":"P-521", 1688 "x":"AekpBQ8ST8a8VcfVOTNl353vSrDCLLJXmPk06wTjxrrjcBpXp5EOnYG_ 1689 NjFZ6OvLFV1jSfS9tsz4qUxcWceqwQGk", 1690 "y":"ADSmRA43Z1DSNx_RvcLI87cdL07l6jQyyBXMoxVg_l2Th-x3S1WDhjDl 1691 y79ajL4Kkd0AZMaZmh9ubmf63e3kyMj2", 1692 "d":"AY5pb7A0UFiB3RELSD64fTLOSV_jazdF7fLYyuTw8lOfRhWg6Y6rUrPA 1693 xerEzgdRhajnu0ferB0d53vM9mE15j2C" 1694 } 1696 The ECDSA private part d is then passed to an ECDSA signing function, 1697 which also takes the curve type, P-521, the hash type, SHA-512, and 1698 the JWS Signing Input as inputs. The result of the digital signature 1699 is the EC point (R, S), where R and S are unsigned integers. In this 1700 example, the R and S values, given as octet sequences representing 1701 big endian integers are: 1703 +--------+----------------------------------------------------------+ 1704 | Result | Value | 1705 | Name | | 1706 +--------+----------------------------------------------------------+ 1707 | R | [1, 220, 12, 129, 231, 171, 194, 209, 232, 135, 233, | 1708 | | 117, 247, 105, 122, 210, 26, 125, 192, 1, 217, 21, 82, | 1709 | | 91, 45, 240, 255, 83, 19, 34, 239, 71, 48, 157, 147, | 1710 | | 152, 105, 18, 53, 108, 163, 214, 68, 231, 62, 153, 150, | 1711 | | 106, 194, 164, 246, 72, 143, 138, 24, 50, 129, 223, 133, | 1712 | | 206, 209, 172, 63, 237, 119, 109] | 1713 | S | [0, 111, 6, 105, 44, 5, 41, 208, 128, 61, 152, 40, 92, | 1714 | | 61, 152, 4, 150, 66, 60, 69, 247, 196, 170, 81, 193, | 1715 | | 199, 78, 59, 194, 169, 16, 124, 9, 143, 42, 142, 131, | 1716 | | 48, 206, 238, 34, 175, 83, 203, 220, 159, 3, 107, 155, | 1717 | | 22, 27, 73, 111, 68, 68, 21, 238, 144, 229, 232, 148, | 1718 | | 188, 222, 59, 242, 103] | 1719 +--------+----------------------------------------------------------+ 1721 The JWS Signature is the value R || S. Encoding the signature as 1722 BASE64URL(JWS Signature) produces this value (with line breaks for 1723 display purposes only): 1725 AdwMgeerwtHoh-l192l60hp9wAHZFVJbLfD_UxMi70cwnZOYaRI1bKPWROc-mZZq 1726 wqT2SI-KGDKB34XO0aw_7XdtAG8GaSwFKdCAPZgoXD2YBJZCPEX3xKpRwcdOO8Kp 1727 EHwJjyqOgzDO7iKvU8vcnwNrmxYbSW9ERBXukOXolLzeO_Jn 1729 Concatenating these values in the order Header.Payload.Signature with 1730 period ('.') characters between the parts yields this complete JWS 1731 representation using the JWS Compact Serialization (with line breaks 1732 for display purposes only): 1734 eyJhbGciOiJFUzUxMiJ9 1735 . 1736 UGF5bG9hZA 1737 . 1738 AdwMgeerwtHoh-l192l60hp9wAHZFVJbLfD_UxMi70cwnZOYaRI1bKPWROc-mZZq 1739 wqT2SI-KGDKB34XO0aw_7XdtAG8GaSwFKdCAPZgoXD2YBJZCPEX3xKpRwcdOO8Kp 1740 EHwJjyqOgzDO7iKvU8vcnwNrmxYbSW9ERBXukOXolLzeO_Jn 1742 A.4.2. Validating 1744 Since the "alg" Header Parameter is "ES512", we validate the ECDSA 1745 P-521 SHA-512 digital signature contained in the JWS Signature. 1747 Validating the JWS Signature is similar to the previous example. We 1748 need to split the 132 member octet sequence of the JWS Signature into 1749 two 66 octet sequences, the first R and the second S. We then pass 1750 (x, y), (R, S) and the JWS Signing Input to an ECDSA signature 1751 verifier that has been configured to use the P-521 curve with the 1752 SHA-512 hash function. 1754 A.5. Example Plaintext JWS 1756 The following example JWS Protected Header declares that the encoded 1757 object is a Plaintext JWS: 1759 {"alg":"none"} 1761 Encoding this JWS Protected Header as BASE64URL(UTF8(JWS Protected 1762 Header)) gives this value: 1764 eyJhbGciOiJub25lIn0 1766 The JWS Payload used in this example, which follows, is the same as 1767 in the previous examples. Since the BASE64URL(JWS Payload) value 1768 will therefore be the same, its computation is not repeated here. 1770 {"iss":"joe", 1771 "exp":1300819380, 1772 "http://example.com/is_root":true} 1774 The JWS Signature is the empty octet string and BASE64URL(JWS 1775 Signature) is the empty string. 1777 Concatenating these parts in the order Header.Payload.Signature with 1778 period ('.') characters between the parts yields this complete JWS 1779 (with line breaks for display purposes only): 1781 eyJhbGciOiJub25lIn0 1782 . 1783 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 1784 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 1785 . 1787 A.6. Example JWS Using JWS JSON Serialization 1789 This section contains an example using the JWS JSON Serialization. 1790 This example demonstrates the capability for conveying multiple 1791 digital signatures and/or MACs for the same payload. 1793 The JWS Payload used in this example is the same as that used in the 1794 examples in Appendix A.2 and Appendix A.3 (with line breaks for 1795 display purposes only): 1797 eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGFt 1798 cGxlLmNvbS9pc19yb290Ijp0cnVlfQ 1800 Two digital signatures are used in this example: the first using 1801 RSASSA-PKCS-v1_5 SHA-256 and the second using ECDSA P-256 SHA-256. 1802 For the first, the JWS Protected Header and key are the same as in 1803 Appendix A.2, resulting in the same JWS Signature value; therefore, 1804 its computation is not repeated here. For the second, the JWS 1805 Protected Header and key are the same as in Appendix A.3, resulting 1806 in the same JWS Signature value; therefore, its computation is not 1807 repeated here. 1809 A.6.1. JWS Per-Signature Protected Headers 1811 The JWS Protected Header value used for the first signature is: 1813 {"alg":"RS256"} 1815 Encoding this JWS Protected Header as BASE64URL(UTF8(JWS Protected 1816 Header)) gives this value: 1818 eyJhbGciOiJSUzI1NiJ9 1820 The JWS Protected Header value used for the second signature is: 1822 {"alg":"ES256"} 1824 Encoding this JWS Protected Header as BASE64URL(UTF8(JWS Protected 1825 Header)) gives this value: 1827 eyJhbGciOiJFUzI1NiJ9 1829 A.6.2. JWS Per-Signature Unprotected Headers 1831 Key ID values are supplied for both keys using per-signature Header 1832 Parameters. The two values used to represent these Key IDs are: 1834 {"kid":"2010-12-29"} 1836 and 1838 {"kid":"e9bc097a-ce51-4036-9562-d2ade882db0d"} 1840 A.6.3. Complete JWS Header Values 1842 Combining the protected and unprotected header values supplied, the 1843 JWS Header values used for the first and second signatures 1844 respectively are: 1846 {"alg":"RS256", 1847 "kid":"2010-12-29"} 1849 and 1851 {"alg":"ES256", 1852 "kid":"e9bc097a-ce51-4036-9562-d2ade882db0d"} 1854 A.6.4. Complete JWS JSON Serialization Representation 1856 The complete JSON Web Signature JSON Serialization for these values 1857 is as follows (with line breaks for display purposes only): 1859 {"payload": 1860 "eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMDA4MTkzODAsDQogImh0dHA6Ly9leGF 1861 tcGxlLmNvbS9pc19yb290Ijp0cnVlfQ", 1862 "signatures":[ 1863 {"protected":"eyJhbGciOiJSUzI1NiJ9", 1864 "header": 1865 {"kid":"2010-12-29"}, 1866 "signature": 1867 "cC4hiUPoj9Eetdgtv3hF80EGrhuB__dzERat0XF9g2VtQgr9PJbu3XOiZj5RZ 1868 mh7AAuHIm4Bh-0Qc_lF5YKt_O8W2Fp5jujGbds9uJdbF9CUAr7t1dnZcAcQjb 1869 KBYNX4BAynRFdiuB--f_nZLgrnbyTyWzO75vRK5h6xBArLIARNPvkSjtQBMHl 1870 b1L07Qe7K0GarZRmB_eSN9383LcOLn6_dO--xi12jzDwusC-eOkHWEsqtFZES 1871 c6BfI7noOPqvhJ1phCnvWh6IeYI2w9QOYEUipUTI8np6LbgGY9Fs98rqVt5AX 1872 LIhWkWywlVmtVrBp0igcN_IoypGlUPQGe77Rw"}, 1873 {"protected":"eyJhbGciOiJFUzI1NiJ9", 1874 "header": 1875 {"kid":"e9bc097a-ce51-4036-9562-d2ade882db0d"}, 1876 "signature": 1877 "DtEhU3ljbEg8L38VWAfUAqOyKAM6-Xx-F4GawxaepmXFCgfTjDxw5djxLa8IS 1878 lSApmWQxfKTUJqPP3-Kg6NU1Q"}] 1879 } 1881 Appendix B. "x5c" (X.509 Certificate Chain) Example 1883 The JSON array below is an example of a certificate chain that could 1884 be used as the value of an "x5c" (X.509 Certificate Chain) Header 1885 Parameter, per Section 4.1.6. Note that since these strings contain 1886 base64 encoded (not base64url encoded) values, they are allowed to 1887 contain white space and line breaks. 1889 ["MIIE3jCCA8agAwIBAgICAwEwDQYJKoZIhvcNAQEFBQAwYzELMAkGA1UEBhMCVVM 1890 xITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR2 1891 8gRGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExM 1892 TYwMTU0MzdaFw0yNjExMTYwMTU0MzdaMIHKMQswCQYDVQQGEwJVUzEQMA4GA1UE 1893 CBMHQXJpem9uYTETMBEGA1UEBxMKU2NvdHRzZGFsZTEaMBgGA1UEChMRR29EYWR 1894 keS5jb20sIEluYy4xMzAxBgNVBAsTKmh0dHA6Ly9jZXJ0aWZpY2F0ZXMuZ29kYW 1895 RkeS5jb20vcmVwb3NpdG9yeTEwMC4GA1UEAxMnR28gRGFkZHkgU2VjdXJlIENlc 1896 nRpZmljYXRpb24gQXV0aG9yaXR5MREwDwYDVQQFEwgwNzk2OTI4NzCCASIwDQYJ 1897 KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMQt1RWMnCZM7DI161+4WQFapmGBWTt 1898 wY6vj3D3HKrjJM9N55DrtPDAjhI6zMBS2sofDPZVUBJ7fmd0LJR4h3mUpfjWoqV 1899 Tr9vcyOdQmVZWt7/v+WIbXnvQAjYwqDL1CBM6nPwT27oDyqu9SoWlm2r4arV3aL 1900 GbqGmu75RpRSgAvSMeYddi5Kcju+GZtCpyz8/x4fKL4o/K1w/O5epHBp+YlLpyo 1901 7RJlbmr2EkRTcDCVw5wrWCs9CHRK8r5RsL+H0EwnWGu1NcWdrxcx+AuP7q2BNgW 1902 JCJjPOq8lh8BJ6qf9Z/dFjpfMFDniNoW1fho3/Rb2cRGadDAW/hOUoz+EDU8CAw 1903 EAAaOCATIwggEuMB0GA1UdDgQWBBT9rGEyk2xF1uLuhV+auud2mWjM5zAfBgNVH 1904 SMEGDAWgBTSxLDSkdRMEXGzYcs9of7dqGrU4zASBgNVHRMBAf8ECDAGAQH/AgEA 1905 MDMGCCsGAQUFBwEBBCcwJTAjBggrBgEFBQcwAYYXaHR0cDovL29jc3AuZ29kYWR 1906 keS5jb20wRgYDVR0fBD8wPTA7oDmgN4Y1aHR0cDovL2NlcnRpZmljYXRlcy5nb2 1907 RhZGR5LmNvbS9yZXBvc2l0b3J5L2dkcm9vdC5jcmwwSwYDVR0gBEQwQjBABgRVH 1908 SAAMDgwNgYIKwYBBQUHAgEWKmh0dHA6Ly9jZXJ0aWZpY2F0ZXMuZ29kYWRkeS5j 1909 b20vcmVwb3NpdG9yeTAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQEFBQADggE 1910 BANKGwOy9+aG2Z+5mC6IGOgRQjhVyrEp0lVPLN8tESe8HkGsz2ZbwlFalEzAFPI 1911 UyIXvJxwqoJKSQ3kbTJSMUA2fCENZvD117esyfxVgqwcSeIaha86ykRvOe5GPLL 1912 5CkKSkB2XIsKd83ASe8T+5o0yGPwLPk9Qnt0hCqU7S+8MxZC9Y7lhyVJEnfzuz9 1913 p0iRFEUOOjZv2kWzRaJBydTXRE4+uXR21aITVSzGh6O1mawGhId/dQb8vxRMDsx 1914 uxN89txJx9OjxUUAiKEngHUuHqDTMBqLdElrRhjZkAzVvb3du6/KFUJheqwNTrZ 1915 EjYx8WnM25sgVjOuH0aBsXBTWVU+4=", 1916 "MIIE+zCCBGSgAwIBAgICAQ0wDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1Z 1917 hbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIE 1918 luYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIgUG9saWN5IFZhbGlkYXRpb 1919 24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8x 1920 IDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTA0MDYyOTE3MDY 1921 yMFoXDTI0MDYyOTE3MDYyMFowYzELMAkGA1UEBhMCVVMxITAfBgNVBAoTGFRoZS 1922 BHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28gRGFkZHkgQ2xhc3MgM 1923 iBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQADggEN 1924 ADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XC 1925 APVYYYwhv2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux 1926 6wwdhFJ2+qN1j3hybX2C32qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLO 1927 tXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6jYGB0xUGlcmIbYsUfb18aQr4CUWWo 1928 riMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmYvLEHZ6IVDd2gWMZ 1929 Eewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjggHhMIIB3TAdBgNVHQ 1930 4EFgQU0sSw0pHUTBFxs2HLPaH+3ahq1OMwgdIGA1UdIwSByjCBx6GBwaSBvjCBu 1931 zEkMCIGA1UEBxMbVmFsaUNlcnQgVmFsaWRhdGlvbiBOZXR3b3JrMRcwFQYDVQQK 1932 Ew5WYWxpQ2VydCwgSW5jLjE1MDMGA1UECxMsVmFsaUNlcnQgQ2xhc3MgMiBQb2x 1933 pY3kgVmFsaWRhdGlvbiBBdXRob3JpdHkxITAfBgNVBAMTGGh0dHA6Ly93d3cudm 1934 FsaWNlcnQuY29tLzEgMB4GCSqGSIb3DQEJARYRaW5mb0B2YWxpY2VydC5jb22CA 1935 QEwDwYDVR0TAQH/BAUwAwEB/zAzBggrBgEFBQcBAQQnMCUwIwYIKwYBBQUHMAGG 1936 F2h0dHA6Ly9vY3NwLmdvZGFkZHkuY29tMEQGA1UdHwQ9MDswOaA3oDWGM2h0dHA 1937 6Ly9jZXJ0aWZpY2F0ZXMuZ29kYWRkeS5jb20vcmVwb3NpdG9yeS9yb290LmNybD 1938 BLBgNVHSAERDBCMEAGBFUdIAAwODA2BggrBgEFBQcCARYqaHR0cDovL2NlcnRpZ 1939 mljYXRlcy5nb2RhZGR5LmNvbS9yZXBvc2l0b3J5MA4GA1UdDwEB/wQEAwIBBjAN 1940 BgkqhkiG9w0BAQUFAAOBgQC1QPmnHfbq/qQaQlpE9xXUhUaJwL6e4+PrxeNYiY+ 1941 Sn1eocSxI0YGyeR+sBjUZsE4OWBsUs5iB0QQeyAfJg594RAoYC5jcdnplDQ1tgM 1942 QLARzLrUc+cb53S8wGd9D0VmsfSxOaFIqII6hR8INMqzW/Rn453HWkrugp++85j 1943 09VZw==", 1944 "MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ 1945 0IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNT 1946 AzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0a 1947 G9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkq 1948 hkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMTk1NFoXDTE 1949 5MDYyNjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTm 1950 V0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZ 1951 XJ0IENsYXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQD 1952 ExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9 1953 AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOOnHK5a 1954 vIWZJV16vYdA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVCCSRrCl6zf 1955 N1SLUzm1NZ9WlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwb 1956 P7RfZHM047QSv4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQU 1957 AA4GBADt/UG9vUJSZSWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQ 1958 C1u+mNr0HZDzTuIYEZoDJJKPTEjlbVUjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMM 1959 j4QssxsodyamEwCW/POuZ6lcg5Ktz885hZo+L7tdEy8W9ViH0Pd"] 1961 Appendix C. Notes on implementing base64url encoding without padding 1963 This appendix describes how to implement base64url encoding and 1964 decoding functions without padding based upon standard base64 1965 encoding and decoding functions that do use padding. 1967 To be concrete, example C# code implementing these functions is shown 1968 below. Similar code could be used in other languages. 1970 static string base64urlencode(byte [] arg) 1971 { 1972 string s = Convert.ToBase64String(arg); // Regular base64 encoder 1973 s = s.Split('=')[0]; // Remove any trailing '='s 1974 s = s.Replace('+', '-'); // 62nd char of encoding 1975 s = s.Replace('/', '_'); // 63rd char of encoding 1976 return s; 1977 } 1979 static byte [] base64urldecode(string arg) 1980 { 1981 string s = arg; 1982 s = s.Replace('-', '+'); // 62nd char of encoding 1983 s = s.Replace('_', '/'); // 63rd char of encoding 1984 switch (s.Length % 4) // Pad with trailing '='s 1985 { 1986 case 0: break; // No pad chars in this case 1987 case 2: s += "=="; break; // Two pad chars 1988 case 3: s += "="; break; // One pad char 1989 default: throw new System.Exception( 1990 "Illegal base64url string!"); 1991 } 1992 return Convert.FromBase64String(s); // Standard base64 decoder 1993 } 1995 As per the example code above, the number of '=' padding characters 1996 that needs to be added to the end of a base64url encoded string 1997 without padding to turn it into one with padding is a deterministic 1998 function of the length of the encoded string. Specifically, if the 1999 length mod 4 is 0, no padding is added; if the length mod 4 is 2, two 2000 '=' padding characters are added; if the length mod 4 is 3, one '=' 2001 padding character is added; if the length mod 4 is 1, the input is 2002 malformed. 2004 An example correspondence between unencoded and encoded values 2005 follows. The octet sequence below encodes into the string below, 2006 which when decoded, reproduces the octet sequence. 2007 3 236 255 224 193 2008 A-z_4ME 2010 Appendix D. Notes on Validation Key Selection 2012 This appendix describes a set of possible algorithms for selecting 2013 the key to be used to validate the digital signature or MAC of a JWS 2014 object. These algorithms are described for illustration purposes 2015 only; specific applications can and are likely to use different 2016 algorithms. This supplements the normative information on key 2017 location in Section 6. 2019 The gist of these algorithms is to collect a set of keys from known 2020 applicable sources of keys and then to use them to attempt to 2021 validate the digital signature or MAC value of a JWS. Potential 2022 sources of keys include: 2024 o Keys supplied by the application protocol being used. 2026 o Keys referenced by the "jku" (JWK Set URL) Header Parameter. 2028 o The key provided by the "jwk" (JSON Web Key) Header Parameter. 2030 o The keys referenced by the "kid" (Key ID) Header Parameter. 2032 o Keys referenced by the "x5u" (X.509 URL) Header Parameter. 2034 o The key provided by the "x5c" (X.509 Certificate Chain) Header 2035 Parameter. 2037 o The key referenced by the "x5t" (X.509 Certificate SHA-1 2038 Thumbprint) Header Parameter. 2040 o Other applicable keys available to the application. 2042 In some cases, the list of collected keys will be ordered in a 2043 particular way. For instance, keys referenced by the "kid" or "x5t" 2044 parameters might be used before other keys. 2046 Finally, signature or MAC validation will be tried with some or all 2047 of the collected and possibly ordered keys. This process will 2048 normally terminate following a successful validation. 2050 This guidance identifies a set of algorithms, rather than a single 2051 algorithm, because in different contexts, not all the sources of keys 2052 will be used, they can be tried in different orders, and sometimes 2053 not all the collected keys will be tried. 2055 Appendix E. Negative Test Case for "crit" Header Parameter 2057 Conforming implementations must reject input containing critical 2058 extensions that are not understood or cannot be processed. The 2059 following JWS must be rejected by all implementations, because it 2060 uses an extension Header Parameter name 2061 "http://example.invalid/UNDEFINED" that they do not understand. Any 2062 other similar input, in which the use of the value 2063 "http://example.invalid/UNDEFINED" is substituted for any other 2064 Header Parameter name not understood by the implementation, must also 2065 be rejected. 2067 The JWS Protected Header value for this JWS is: 2069 {"alg":"none", 2070 "crit":["http://example.invalid/UNDEFINED"], 2071 "http://example.invalid/UNDEFINED":true 2072 } 2074 The complete JWS that must be rejected is as follows (with line 2075 breaks for display purposes only): 2077 eyJhbGciOiJub25lIiwNCiAiY3JpdCI6WyJodHRwOi8vZXhhbXBsZS5jb20vVU5ERU 2078 ZJTkVEIl0sDQogImh0dHA6Ly9leGFtcGxlLmNvbS9VTkRFRklORUQiOnRydWUNCn0. 2079 RkFJTA. 2081 Appendix F. Detached Content 2083 In some contexts, it is useful integrity protect content that is not 2084 itself contained in a JWS object. One way to do this is create a JWS 2085 object in the normal fashion using a representation of the content as 2086 the payload, but then delete the payload representation from the JWS, 2087 and send this modified object to the recipient, rather than the JWS. 2088 When using the JWS Compact Serialization, the deletion is 2089 accomplished by replacing the second field (which contains 2090 BASE64URL(JWS Payload)) value with the empty string; when using the 2091 JWS JSON Serialization, the deletion is accomplished by deleting the 2092 "payload" member. This method assumes that the recipient can 2093 reconstruct the exact payload used in the JWS. To use the modified 2094 object, the recipient reconstructs the JWS by re-inserting the 2095 payload representation into the modified object, and uses the 2096 resulting JWS in the usual manner. Note that this method needs no 2097 support from JWS libraries, as applications can use this method by 2098 modifying the inputs and outputs of standard JWS libraries. 2100 Appendix G. Acknowledgements 2102 Solutions for signing JSON content were previously explored by Magic 2103 Signatures [MagicSignatures], JSON Simple Sign [JSS], and Canvas 2104 Applications [CanvasApp], all of which influenced this draft. 2106 Thanks to Axel Nennker for his early implementation and feedback on 2107 the JWS and JWE specifications. 2109 This specification is the work of the JOSE Working Group, which 2110 includes dozens of active and dedicated participants. In particular, 2111 the following individuals contributed ideas, feedback, and wording 2112 that influenced this specification: 2114 Dirk Balfanz, Richard Barnes, Brian Campbell, Breno de Medeiros, Dick 2115 Hardt, Joe Hildebrand, Jeff Hodges, Edmund Jay, Yaron Y. Goland, Ben 2116 Laurie, James Manger, Matt Miller, Tony Nadalin, Axel Nennker, John 2117 Panzer, Emmanuel Raviart, Eric Rescorla, Jim Schaad, Paul Tarjan, 2118 Hannes Tschofenig, and Sean Turner. 2120 Jim Schaad and Karen O'Donoghue chaired the JOSE working group and 2121 Sean Turner and Stephen Farrell served as Security area directors 2122 during the creation of this specification. 2124 Appendix H. Document History 2126 [[ to be removed by the RFC Editor before publication as an RFC ]] 2128 -19 2130 o Added the appendix "Notes on Validation Key Selection", addressing 2131 issue #93. 2133 o Reordered the key selection parameters. 2135 -18 2137 o Updated the mandatory-to-implement (MTI) language to say that 2138 applications using this specification need to specify what 2139 serialization and serialization features are used for that 2140 application, addressing issue #119. 2142 o Changes to address editorial and minor issues #25, #89, #97, #110, 2143 #114, #115, #116, #117, #120, and #184. 2145 o Added and used Header Parameter Description registry field. 2147 -17 2149 o Refined the "typ" and "cty" definitions to always be MIME Media 2150 Types, with the omission of "application/" prefixes recommended 2151 for brevity, addressing issue #50. 2153 o Updated the mandatory-to-implement (MTI) language to say that 2154 general-purpose implementations must implement the single 2155 signature/MAC value case for both serializations whereas special- 2156 purpose implementations can implement just one serialization if 2157 that meets the needs of the use cases the implementation is 2158 designed for, addressing issue #119. 2160 o Explicitly named all the logical components of a JWS and defined 2161 the processing rules and serializations in terms of those 2162 components, addressing issues #60, #61, and #62. 2164 o Replaced verbose repetitive phases such as "base64url encode the 2165 octets of the UTF-8 representation of X" with mathematical 2166 notation such as "BASE64URL(UTF8(X))". 2168 o Terms used in multiple documents are now defined in one place and 2169 incorporated by reference. Some lightly used or obvious terms 2170 were also removed. This addresses issue #58. 2172 -16 2174 o Changes to address editorial and minor issues #50, #98, #99, #102, 2175 #104, #106, #107, #111, and #112. 2177 -15 2179 o Clarified that it is an application decision which signatures, 2180 MACs, or plaintext values must successfully validate for the JWS 2181 to be accepted, addressing issue #35. 2183 o Corrected editorial error in "ES512" example. 2185 o Changes to address editorial and minor issues #34, #96, #100, 2186 #101, #104, #105, and #106. 2188 -14 2190 o Stated that the "signature" parameter is to be omitted in the JWS 2191 JSON Serialization when its value would be empty (which is only 2192 the case for a Plaintext JWS). 2194 -13 2196 o Made all header parameter values be per-signature/MAC, addressing 2197 issue #24. 2199 -12 2201 o Clarified that the "typ" and "cty" header parameters are used in 2202 an application-specific manner and have no effect upon the JWS 2203 processing. 2205 o Replaced the MIME types "application/jws+json" and 2206 "application/jws" with "application/jose+json" and 2207 "application/jose". 2209 o Stated that recipients MUST either reject JWSs with duplicate 2210 Header Parameter Names or use a JSON parser that returns only the 2211 lexically last duplicate member name. 2213 o Added a Serializations section with parallel treatment of the JWS 2214 Compact Serialization and the JWS JSON Serialization and also 2215 moved the former Implementation Considerations content there. 2217 -11 2219 o Added Key Identification section. 2221 o For the JWS JSON Serialization, enable header parameter values to 2222 be specified in any of three parameters: the "protected" member 2223 that is integrity protected and shared among all recipients, the 2224 "unprotected" member that is not integrity protected and shared 2225 among all recipients, and the "header" member that is not 2226 integrity protected and specific to a particular recipient. (This 2227 does not affect the JWS Compact Serialization, in which all header 2228 parameter values are in a single integrity protected JWE Header 2229 value.) 2231 o Removed suggested compact serialization for multiple digital 2232 signatures and/or MACs. 2234 o Changed the MIME type name "application/jws-js" to 2235 "application/jws+json", addressing issue #22. 2237 o Tightened the description of the "crit" (critical) header 2238 parameter. 2240 o Added a negative test case for the "crit" header parameter 2242 -10 2244 o Added an appendix suggesting a possible compact serialization for 2245 JWSs with multiple digital signatures and/or MACs. 2247 -09 2249 o Added JWS JSON Serialization, as specified by 2250 draft-jones-jose-jws-json-serialization-04. 2252 o Registered "application/jws-js" MIME type and "JWS-JS" typ header 2253 parameter value. 2255 o Defined that the default action for header parameters that are not 2256 understood is to ignore them unless specifically designated as 2257 "MUST be understood" or included in the new "crit" (critical) 2258 header parameter list. This addressed issue #6. 2260 o Changed term "JWS Secured Input" to "JWS Signing Input". 2262 o Changed from using the term "byte" to "octet" when referring to 8 2263 bit values. 2265 o Changed member name from "recipients" to "signatures" in the JWS 2266 JSON Serialization. 2268 o Added complete values using the JWS Compact Serialization for all 2269 examples. 2271 -08 2273 o Applied editorial improvements suggested by Jeff Hodges and Hannes 2274 Tschofenig. Many of these simplified the terminology used. 2276 o Clarified statements of the form "This header parameter is 2277 OPTIONAL" to "Use of this header parameter is OPTIONAL". 2279 o Added a Header Parameter Usage Location(s) field to the IANA JSON 2280 Web Signature and Encryption Header Parameters registry. 2282 o Added seriesInfo information to Internet Draft references. 2284 -07 2285 o Updated references. 2287 -06 2289 o Changed "x5c" (X.509 Certificate Chain) representation from being 2290 a single string to being an array of strings, each containing a 2291 single base64 encoded DER certificate value, representing elements 2292 of the certificate chain. 2294 o Applied changes made by the RFC Editor to RFC 6749's registry 2295 language to this specification. 2297 -05 2299 o Added statement that "StringOrURI values are compared as case- 2300 sensitive strings with no transformations or canonicalizations 2301 applied". 2303 o Indented artwork elements to better distinguish them from the body 2304 text. 2306 -04 2308 o Completed JSON Security Considerations section, including 2309 considerations about rejecting input with duplicate member names. 2311 o Completed security considerations on the use of a SHA-1 hash when 2312 computing "x5t" (x.509 certificate thumbprint) values. 2314 o Refer to the registries as the primary sources of defined values 2315 and then secondarily reference the sections defining the initial 2316 contents of the registries. 2318 o Normatively reference XML DSIG 2.0 [W3C.CR-xmldsig-core2-20120124] 2319 for its security considerations. 2321 o Added this language to Registration Templates: "This name is case 2322 sensitive. Names that match other registered names in a case 2323 insensitive manner SHOULD NOT be accepted." 2325 o Reference draft-jones-jose-jws-json-serialization instead of 2326 draft-jones-json-web-signature-json-serialization. 2328 o Described additional open issues. 2330 o Applied editorial suggestions. 2332 -03 2333 o Added the "cty" (content type) header parameter for declaring type 2334 information about the secured content, as opposed to the "typ" 2335 (type) header parameter, which declares type information about 2336 this object. 2338 o Added "Collision Resistant Namespace" to the terminology section. 2340 o Reference ITU.X690.1994 for DER encoding. 2342 o Added an example JWS using ECDSA P-521 SHA-512. This has 2343 particular illustrative value because of the use of the 521 bit 2344 integers in the key and signature values. This is also an example 2345 in which the payload is not a base64url encoded JSON object. 2347 o Added an example "x5c" value. 2349 o No longer say "the UTF-8 representation of the JWS Secured Input 2350 (which is the same as the ASCII representation)". Just call it 2351 "the ASCII representation of the JWS Secured Input". 2353 o Added Registration Template sections for defined registries. 2355 o Added Registry Contents sections to populate registry values. 2357 o Changed name of the JSON Web Signature and Encryption "typ" Values 2358 registry to be the JSON Web Signature and Encryption Type Values 2359 registry, since it is used for more than just values of the "typ" 2360 parameter. 2362 o Moved registries JSON Web Signature and Encryption Header 2363 Parameters and JSON Web Signature and Encryption Type Values to 2364 the JWS specification. 2366 o Numerous editorial improvements. 2368 -02 2370 o Clarified that it is an error when a "kid" value is included and 2371 no matching key is found. 2373 o Removed assumption that "kid" (key ID) can only refer to an 2374 asymmetric key. 2376 o Clarified that JWSs with duplicate Header Parameter Names MUST be 2377 rejected. 2379 o Clarified the relationship between "typ" header parameter values 2380 and MIME types. 2382 o Registered application/jws MIME type and "JWS" typ header 2383 parameter value. 2385 o Simplified JWK terminology to get replace the "JWK Key Object" and 2386 "JWK Container Object" terms with simply "JSON Web Key (JWK)" and 2387 "JSON Web Key Set (JWK Set)" and to eliminate potential confusion 2388 between single keys and sets of keys. As part of this change, the 2389 Header Parameter Name for a public key value was changed from 2390 "jpk" (JSON Public Key) to "jwk" (JSON Web Key). 2392 o Added suggestion on defining additional header parameters such as 2393 "x5t#S256" in the future for certificate thumbprints using hash 2394 algorithms other than SHA-1. 2396 o Specify RFC 2818 server identity validation, rather than RFC 6125 2397 (paralleling the same decision in the OAuth specs). 2399 o Generalized language to refer to Message Authentication Codes 2400 (MACs) rather than Hash-based Message Authentication Codes (HMACs) 2401 unless in a context specific to HMAC algorithms. 2403 o Reformatted to give each header parameter its own section heading. 2405 -01 2407 o Moved definition of Plaintext JWSs (using "alg":"none") here from 2408 the JWT specification since this functionality is likely to be 2409 useful in more contexts that just for JWTs. 2411 o Added "jpk" and "x5c" header parameters for including JWK public 2412 keys and X.509 certificate chains directly in the header. 2414 o Clarified that this specification is defining the JWS Compact 2415 Serialization. Referenced the new JWS-JS spec, which defines the 2416 JWS JSON Serialization. 2418 o Added text "New header parameters should be introduced sparingly 2419 since an implementation that does not understand a parameter MUST 2420 reject the JWS". 2422 o Clarified that the order of the creation and validation steps is 2423 not significant in cases where there are no dependencies between 2424 the inputs and outputs of the steps. 2426 o Changed "no canonicalization is performed" to "no canonicalization 2427 need be performed". 2429 o Corrected the Magic Signatures reference. 2431 o Made other editorial improvements suggested by JOSE working group 2432 participants. 2434 -00 2436 o Created the initial IETF draft based upon 2437 draft-jones-json-web-signature-04 with no normative changes. 2439 o Changed terminology to no longer call both digital signatures and 2440 HMACs "signatures". 2442 Authors' Addresses 2444 Michael B. Jones 2445 Microsoft 2447 Email: mbj@microsoft.com 2448 URI: http://self-issued.info/ 2450 John Bradley 2451 Ping Identity 2453 Email: ve7jtb@ve7jtb.com 2454 URI: http://www.thread-safe.com/ 2456 Nat Sakimura 2457 Nomura Research Institute 2459 Email: n-sakimura@nri.co.jp 2460 URI: http://nat.sakimura.org/