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