draft-ietf-jose-json-web-algorithms-14.txt   draft-ietf-jose-json-web-algorithms-15.txt 
JOSE Working Group M. Jones JOSE Working Group M. Jones
Internet-Draft Microsoft Internet-Draft Microsoft
Intended status: Standards Track July 29, 2013 Intended status: Standards Track September 3, 2013
Expires: January 30, 2014 Expires: March 7, 2014
JSON Web Algorithms (JWA) JSON Web Algorithms (JWA)
draft-ietf-jose-json-web-algorithms-14 draft-ietf-jose-json-web-algorithms-15
Abstract Abstract
The JSON Web Algorithms (JWA) specification enumerates cryptographic The JSON Web Algorithms (JWA) specification registers cryptographic
algorithms and identifiers to be used with the JSON Web Signature algorithms and identifiers to be used with the JSON Web Signature
(JWS), JSON Web Encryption (JWE), and JSON Web Key (JWK) (JWS), JSON Web Encryption (JWE), and JSON Web Key (JWK)
specifications. specifications. It defines several IANA registries for these
identifiers.
Status of this Memo Status of this Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on January 30, 2014. This Internet-Draft will expire on March 7, 2014.
Copyright Notice Copyright Notice
Copyright (c) 2013 IETF Trust and the persons identified as the Copyright (c) 2013 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 2, line 16 skipping to change at page 2, line 16
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 5 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.1. Notational Conventions . . . . . . . . . . . . . . . . . . 5 1.1. Notational Conventions . . . . . . . . . . . . . . . . . . 5
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.1. Terms Incorporated from the JWS Specification . . . . . . 5 2.1. Terms Incorporated from the JWS Specification . . . . . . 5
2.2. Terms Incorporated from the JWE Specification . . . . . . 6 2.2. Terms Incorporated from the JWE Specification . . . . . . 6
2.3. Terms Incorporated from the JWK Specification . . . . . . 9 2.3. Terms Incorporated from the JWK Specification . . . . . . 9
2.4. Defined Terms . . . . . . . . . . . . . . . . . . . . . . 9 2.4. Defined Terms . . . . . . . . . . . . . . . . . . . . . . 9
3. Cryptographic Algorithms for JWS . . . . . . . . . . . . . . . 9 3. Cryptographic Algorithms for JWS . . . . . . . . . . . . . . . 9
3.1. "alg" (Algorithm) Header Parameter Values for JWS . . . . 9 3.1. "alg" (Algorithm) Header Parameter Values for JWS . . . . 9
3.2. MAC with HMAC SHA-2 Functions . . . . . . . . . . . . . . 11 3.2. HMAC with SHA-2 Functions . . . . . . . . . . . . . . . . 10
3.3. Digital Signature with RSASSA-PKCS1-V1_5 . . . . . . . . . 12 3.3. Digital Signature with RSASSA-PKCS1-V1_5 . . . . . . . . . 11
3.4. Digital Signature with ECDSA . . . . . . . . . . . . . . . 13 3.4. Digital Signature with ECDSA . . . . . . . . . . . . . . . 12
3.5. Digital Signature with RSASSA-PSS . . . . . . . . . . . . 14 3.5. Digital Signature with RSASSA-PSS . . . . . . . . . . . . 14
3.6. Using the Algorithm "none" . . . . . . . . . . . . . . . . 15 3.6. Using the Algorithm "none" . . . . . . . . . . . . . . . . 15
3.7. Additional Digital Signature/MAC Algorithms and 4. Cryptographic Algorithms for JWE . . . . . . . . . . . . . . . 15
Parameters . . . . . . . . . . . . . . . . . . . . . . . . 15 4.1. "alg" (Algorithm) Header Parameter Values for JWE . . . . 15
4. Cryptographic Algorithms for JWE . . . . . . . . . . . . . . . 16
4.1. "alg" (Algorithm) Header Parameter Values for JWE . . . . 16
4.2. "enc" (Encryption Method) Header Parameter Values for 4.2. "enc" (Encryption Method) Header Parameter Values for
JWE . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 JWE . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.3. Key Encryption with RSAES-PKCS1-V1_5 . . . . . . . . . . . 22 4.3. Key Encryption with RSAES-PKCS1-V1_5 . . . . . . . . . . . 21
4.4. Key Encryption with RSAES OAEP . . . . . . . . . . . . . . 22 4.4. Key Encryption with RSAES OAEP . . . . . . . . . . . . . . 21
4.5. Key Wrapping with AES Key Wrap . . . . . . . . . . . . . . 22 4.5. Key Wrapping with AES Key Wrap . . . . . . . . . . . . . . 21
4.6. Direct Encryption with a Shared Symmetric Key . . . . . . 22 4.6. Direct Encryption with a Shared Symmetric Key . . . . . . 21
4.7. Key Agreement with Elliptic Curve Diffie-Hellman 4.7. Key Agreement with Elliptic Curve Diffie-Hellman
Ephemeral Static (ECDH-ES) . . . . . . . . . . . . . . . . 22 Ephemeral Static (ECDH-ES) . . . . . . . . . . . . . . . . 21
4.7.1. Header Parameters Used for ECDH Key Agreement . . . . 23 4.7.1. Header Parameters Used for ECDH Key Agreement . . . . 22
4.7.1.1. "epk" (Ephemeral Public Key) Header Parameter . . 23 4.7.1.1. "epk" (Ephemeral Public Key) Header Parameter . . 22
4.7.1.2. "apu" (Agreement PartyUInfo) Header Parameter . . 23 4.7.1.2. "apu" (Agreement PartyUInfo) Header Parameter . . 22
4.7.1.3. "apv" (Agreement PartyVInfo) Header Parameter . . 24 4.7.1.3. "apv" (Agreement PartyVInfo) Header Parameter . . 23
4.7.2. Key Derivation for ECDH Key Agreement . . . . . . . . 24 4.7.2. Key Derivation for ECDH Key Agreement . . . . . . . . 23
4.8. Key Encryption with AES GCM . . . . . . . . . . . . . . . 25 4.8. Key Encryption with AES GCM . . . . . . . . . . . . . . . 24
4.8.1. Header Parameters Used for AES GCM Key Encryption . . 26 4.8.1. Header Parameters Used for AES GCM Key Encryption . . 25
4.8.1.1. "iv" (Initialization Vector) Header Parameter . . 26 4.8.1.1. "iv" (Initialization Vector) Header Parameter . . 25
4.8.1.2. "tag" (Authentication Tag) Header Parameter . . . 26 4.8.1.2. "tag" (Authentication Tag) Header Parameter . . . 25
4.9. Key Encryption with PBES2 . . . . . . . . . . . . . . . . 26 4.9. Key Encryption with PBES2 . . . . . . . . . . . . . . . . 25
4.9.1. Header Parameters Used for PBES2 Key Encryption . . . 26 4.9.1. Header Parameters Used for PBES2 Key Encryption . . . 25
4.9.1.1. "p2s" (PBES2 salt) Parameter . . . . . . . . . . . 26 4.9.1.1. "p2s" (PBES2 salt) Parameter . . . . . . . . . . . 25
4.9.1.2. "p2c" (PBES2 count) Parameter . . . . . . . . . . 27 4.9.1.2. "p2c" (PBES2 count) Parameter . . . . . . . . . . 26
4.10. AES_CBC_HMAC_SHA2 Algorithms . . . . . . . . . . . . . . . 27 4.10. AES_CBC_HMAC_SHA2 Algorithms . . . . . . . . . . . . . . . 26
4.10.1. Conventions Used in Defining AES_CBC_HMAC_SHA2 . . . . 27 4.10.1. Conventions Used in Defining AES_CBC_HMAC_SHA2 . . . . 26
4.10.2. Generic AES_CBC_HMAC_SHA2 Algorithm . . . . . . . . . 28 4.10.2. Generic AES_CBC_HMAC_SHA2 Algorithm . . . . . . . . . 27
4.10.2.1. AES_CBC_HMAC_SHA2 Encryption . . . . . . . . . . . 28 4.10.2.1. AES_CBC_HMAC_SHA2 Encryption . . . . . . . . . . . 27
4.10.2.2. AES_CBC_HMAC_SHA2 Decryption . . . . . . . . . . . 30 4.10.2.2. AES_CBC_HMAC_SHA2 Decryption . . . . . . . . . . . 28
4.10.3. AES_128_CBC_HMAC_SHA_256 . . . . . . . . . . . . . . . 30 4.10.3. AES_128_CBC_HMAC_SHA_256 . . . . . . . . . . . . . . . 29
4.10.4. AES_192_CBC_HMAC_SHA_384 . . . . . . . . . . . . . . . 31 4.10.4. AES_192_CBC_HMAC_SHA_384 . . . . . . . . . . . . . . . 29
4.10.5. AES_256_CBC_HMAC_SHA_512 . . . . . . . . . . . . . . . 31 4.10.5. AES_256_CBC_HMAC_SHA_512 . . . . . . . . . . . . . . . 30
4.10.6. Plaintext Encryption with AES_CBC_HMAC_SHA2 . . . . . 31 4.10.6. Plaintext Encryption with AES_CBC_HMAC_SHA2 . . . . . 30
4.11. Plaintext Encryption with AES GCM . . . . . . . . . . . . 32
4.12. Additional Encryption Algorithms and Parameters . . . . . 32
5. Cryptographic Algorithms for JWK . . . . . . . . . . . . . . . 33
5.1. "kty" (Key Type) Parameter Values for JWK . . . . . . . . 33
5.2. JWK Parameters for Elliptic Curve Keys . . . . . . . . . . 33
5.2.1. JWK Parameters for Elliptic Curve Public Keys . . . . 33
5.2.1.1. "crv" (Curve) Parameter . . . . . . . . . . . . . 34
5.2.1.2. "x" (X Coordinate) Parameter . . . . . . . . . . . 34
5.2.1.3. "y" (Y Coordinate) Parameter . . . . . . . . . . . 34
5.2.2. JWK Parameters for Elliptic Curve Private Keys . . . . 34
5.2.2.1. "d" (ECC Private Key) Parameter . . . . . . . . . 34
5.3. JWK Parameters for RSA Keys . . . . . . . . . . . . . . . 35
5.3.1. JWK Parameters for RSA Public Keys . . . . . . . . . . 35
5.3.1.1. "n" (Modulus) Parameter . . . . . . . . . . . . . 35
5.3.1.2. "e" (Exponent) Parameter . . . . . . . . . . . . . 35
5.3.2. JWK Parameters for RSA Private Keys . . . . . . . . . 35
5.3.2.1. "d" (Private Exponent) Parameter . . . . . . . . . 35
5.3.2.2. "p" (First Prime Factor) Parameter . . . . . . . . 36
5.3.2.3. "q" (Second Prime Factor) Parameter . . . . . . . 36
5.3.2.4. "dp" (First Factor CRT Exponent) Parameter . . . . 36
5.3.2.5. "dq" (Second Factor CRT Exponent) Parameter . . . 36
5.3.2.6. "qi" (First CRT Coefficient) Parameter . . . . . . 36
5.3.2.7. "oth" (Other Primes Info) Parameter . . . . . . . 36
5.3.3. JWK Parameters for Symmetric Keys . . . . . . . . . . 37
5.3.3.1. "k" (Key Value) Parameter . . . . . . . . . . . . 37
5.4. Additional Key Types and Parameters . . . . . . . . . . . 37
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 38
6.1. JSON Web Signature and Encryption Algorithms Registry . . 38
6.1.1. Template . . . . . . . . . . . . . . . . . . . . . . . 38
6.1.2. Initial Registry Contents . . . . . . . . . . . . . . 39
6.2. JSON Web Key Types Registry . . . . . . . . . . . . . . . 44
6.2.1. Registration Template . . . . . . . . . . . . . . . . 44
6.2.2. Initial Registry Contents . . . . . . . . . . . . . . 45
6.3. JSON Web Key Parameters Registration . . . . . . . . . . . 45
6.3.1. Registry Contents . . . . . . . . . . . . . . . . . . 45
6.4. Registration of JWE Header Parameter Names . . . . . . . . 47
6.4.1. Registry Contents . . . . . . . . . . . . . . . . . . 47
7. Security Considerations . . . . . . . . . . . . . . . . . . . 48
7.1. Reusing Key Material when Encrypting Keys . . . . . . . . 49
7.2. Password Considerations . . . . . . . . . . . . . . . . . 49
8. Internationalization Considerations . . . . . . . . . . . . . 50
9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 50
9.1. Normative References . . . . . . . . . . . . . . . . . . . 50
9.2. Informative References . . . . . . . . . . . . . . . . . . 52
Appendix A. Digital Signature/MAC Algorithm Identifier
Cross-Reference . . . . . . . . . . . . . . . . . . . 53
Appendix B. Encryption Algorithm Identifier Cross-Reference . . . 56 4.11. Plaintext Encryption with AES GCM . . . . . . . . . . . . 30
Appendix C. Test Cases for AES_CBC_HMAC_SHA2 Algorithms . . . . . 59 5. Cryptographic Algorithms for JWK . . . . . . . . . . . . . . . 31
C.1. Test Cases for AES_128_CBC_HMAC_SHA_256 . . . . . . . . . 60 5.1. "kty" (Key Type) Parameter Values . . . . . . . . . . . . 31
C.2. Test Cases for AES_192_CBC_HMAC_SHA_384 . . . . . . . . . 61 5.2. JWK Parameters for Elliptic Curve Keys . . . . . . . . . . 32
C.3. Test Cases for AES_256_CBC_HMAC_SHA_512 . . . . . . . . . 62 5.2.1. JWK Parameters for Elliptic Curve Public Keys . . . . 32
Appendix D. Example ECDH-ES Key Agreement Computation . . . . . . 63 5.2.1.1. "crv" (Curve) Parameter . . . . . . . . . . . . . 32
Appendix E. Acknowledgements . . . . . . . . . . . . . . . . . . 65 5.2.1.2. "x" (X Coordinate) Parameter . . . . . . . . . . . 32
Appendix F. Document History . . . . . . . . . . . . . . . . . . 65 5.2.1.3. "y" (Y Coordinate) Parameter . . . . . . . . . . . 32
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 72 5.2.2. JWK Parameters for Elliptic Curve Private Keys . . . . 32
5.2.2.1. "d" (ECC Private Key) Parameter . . . . . . . . . 33
5.3. JWK Parameters for RSA Keys . . . . . . . . . . . . . . . 33
5.3.1. JWK Parameters for RSA Public Keys . . . . . . . . . . 33
5.3.1.1. "n" (Modulus) Parameter . . . . . . . . . . . . . 33
5.3.1.2. "e" (Exponent) Parameter . . . . . . . . . . . . . 33
5.3.2. JWK Parameters for RSA Private Keys . . . . . . . . . 33
5.3.2.1. "d" (Private Exponent) Parameter . . . . . . . . . 34
5.3.2.2. "p" (First Prime Factor) Parameter . . . . . . . . 34
5.3.2.3. "q" (Second Prime Factor) Parameter . . . . . . . 34
5.3.2.4. "dp" (First Factor CRT Exponent) Parameter . . . . 34
5.3.2.5. "dq" (Second Factor CRT Exponent) Parameter . . . 34
5.3.2.6. "qi" (First CRT Coefficient) Parameter . . . . . . 34
5.3.2.7. "oth" (Other Primes Info) Parameter . . . . . . . 35
5.4. JWK Parameters for Symmetric Keys . . . . . . . . . . . . 35
5.4.1. "k" (Key Value) Parameter . . . . . . . . . . . . . . 35
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 35
6.1. JSON Web Signature and Encryption Algorithms Registry . . 36
6.1.1. Template . . . . . . . . . . . . . . . . . . . . . . . 36
6.1.2. Initial Registry Contents . . . . . . . . . . . . . . 37
6.2. JSON Web Key Types Registry . . . . . . . . . . . . . . . 42
6.2.1. Registration Template . . . . . . . . . . . . . . . . 42
6.2.2. Initial Registry Contents . . . . . . . . . . . . . . 43
6.3. JSON Web Key Parameters Registration . . . . . . . . . . . 43
6.3.1. Registry Contents . . . . . . . . . . . . . . . . . . 43
6.4. Registration of JWE Header Parameter Names . . . . . . . . 45
6.4.1. Registry Contents . . . . . . . . . . . . . . . . . . 45
7. Security Considerations . . . . . . . . . . . . . . . . . . . 46
7.1. Reusing Key Material when Encrypting Keys . . . . . . . . 47
7.2. Password Considerations . . . . . . . . . . . . . . . . . 47
8. Internationalization Considerations . . . . . . . . . . . . . 48
9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 48
9.1. Normative References . . . . . . . . . . . . . . . . . . . 48
9.2. Informative References . . . . . . . . . . . . . . . . . . 50
Appendix A. Digital Signature/MAC Algorithm Identifier
Cross-Reference . . . . . . . . . . . . . . . . . . . 51
Appendix B. Encryption Algorithm Identifier Cross-Reference . . . 54
Appendix C. Test Cases for AES_CBC_HMAC_SHA2 Algorithms . . . . . 57
C.1. Test Cases for AES_128_CBC_HMAC_SHA_256 . . . . . . . . . 58
C.2. Test Cases for AES_192_CBC_HMAC_SHA_384 . . . . . . . . . 59
C.3. Test Cases for AES_256_CBC_HMAC_SHA_512 . . . . . . . . . 60
Appendix D. Example ECDH-ES Key Agreement Computation . . . . . . 61
Appendix E. Acknowledgements . . . . . . . . . . . . . . . . . . 63
Appendix F. Document History . . . . . . . . . . . . . . . . . . 64
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 70
1. Introduction 1. Introduction
The JSON Web Algorithms (JWA) specification enumerates cryptographic The JSON Web Algorithms (JWA) specification registers cryptographic
algorithms and identifiers to be used with the JSON Web Signature algorithms and identifiers to be used with the JSON Web Signature
(JWS) [JWS], JSON Web Encryption (JWE) [JWE], and JSON Web Key (JWK) (JWS) [JWS], JSON Web Encryption (JWE) [JWE], and JSON Web Key (JWK)
[JWK] specifications. All these specifications utilize JavaScript [JWK] specifications. It defines several IANA registries for these
Object Notation (JSON) [RFC4627] based data structures. This identifiers. All these specifications utilize JavaScript Object
specification also describes the semantics and operations that are Notation (JSON) [RFC4627] based data structures. This specification
specific to these algorithms and key types. also describes the semantics and operations that are specific to
these algorithms and key types.
Enumerating the algorithms and identifiers for them in this Registering the algorithms and identifiers here, rather than in the
specification, rather than in the JWS, JWE, and JWK specifications, JWS, JWE, and JWK specifications, is intended to allow them to remain
is intended to allow them to remain unchanged in the face of changes unchanged in the face of changes in the set of Required, Recommended,
in the set of required, recommended, optional, and deprecated Optional, and Deprecated algorithms over time. This also allows
algorithms over time. changes to the JWS, JWE, and JWK specifications without changing this
document.
Names defined by this specification are short because a core goal is
for the resulting representations to be compact.
1.1. Notational Conventions 1.1. Notational Conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in Key words for use in document are to be interpreted as described in Key words for use in
RFCs to Indicate Requirement Levels [RFC2119]. RFCs to Indicate Requirement Levels [RFC2119].
2. Terminology 2. Terminology
skipping to change at page 6, line 16 skipping to change at page 6, line 19
material that ensures the integrity of the JWS Protected Header material that ensures the integrity of the JWS Protected Header
and the JWS Payload. The JWS Signature value is a digital and the JWS Payload. The JWS Signature value is a digital
signature or MAC value calculated over the JWS Signing Input using signature or MAC value calculated over the JWS Signing Input using
the parameters specified in the JWS Header. the parameters specified in the JWS Header.
JWS Protected Header A JSON Text Object that contains the portion of JWS Protected Header A JSON Text Object that contains the portion of
the JWS Header that is integrity protected. For the JWS Compact the JWS Header that is integrity protected. For the JWS Compact
Serialization, this comprises the entire JWS Header. For the JWS Serialization, this comprises the entire JWS Header. For the JWS
JSON Serialization, this is one component of the JWS Header. JSON Serialization, this is one component of the JWS Header.
Base64url Encoding The URL- and filename-safe Base64 encoding Base64url Encoding Base64 encoding using the URL- and filename-safe
described in RFC 4648 [RFC4648], Section 5, with the (non URL- character set defined in Section 5 of RFC 4648 [RFC4648], with all
safe) '=' padding characters omitted, as permitted by Section 3.2. trailing '=' characters omitted (as permitted by Section 3.2).
(See Appendix C of [JWS] for notes on implementing base64url (See Appendix C of [JWS] for notes on implementing base64url
encoding without padding.) encoding without padding.)
Encoded JWS Header Base64url encoding of the JWS Protected Header. Encoded JWS Header Base64url encoding of the JWS Protected Header.
Encoded JWS Payload Base64url encoding of the JWS Payload. Encoded JWS Payload Base64url encoding of the JWS Payload.
Encoded JWS Signature Base64url encoding of the JWS Signature. Encoded JWS Signature Base64url encoding of the JWS Signature.
JWS Signing Input The concatenation of the Encoded JWS Header, a JWS Signing Input The concatenation of the Encoded JWS Header, a
period ('.') character, and the Encoded JWS Payload. period ('.') character, and the Encoded JWS Payload.
Collision Resistant Namespace A namespace that allows names to be Collision Resistant Namespace A namespace that allows names to be
allocated in a manner such that they are highly unlikely to allocated in a manner such that they are highly unlikely to
collide with other names. For instance, collision resistance can collide with other names. Examples of Collision Resistant
be achieved through administrative delegation of portions of the Namespaces include: Domain Names, Object Identifiers (OIDs) as
namespace or through use of collision-resistant name allocation defined in the ITU-T X.660 and X.670 Recommendation series, and
functions. Examples of Collision Resistant Namespaces include: Universally Unique IDentifiers (UUIDs) [RFC4122]. When using an
Domain Names, Object Identifiers (OIDs) as defined in the ITU-T administratively delegated namespace, the definer of a name needs
X.660 and X.670 Recommendation series, and Universally Unique to take reasonable precautions to ensure they are in control of
IDentifiers (UUIDs) [RFC4122]. When using an administratively the portion of the namespace they use to define the name.
delegated namespace, the definer of a name needs to take
reasonable precautions to ensure they are in control of the
portion of the namespace they use to define the name.
2.2. Terms Incorporated from the JWE Specification 2.2. Terms Incorporated from the JWE Specification
These terms defined by the JSON Web Encryption (JWE) [JWE] These terms defined by the JSON Web Encryption (JWE) [JWE]
specification are incorporated into this specification: specification are incorporated into this specification:
JSON Web Encryption (JWE) A data structure representing an encrypted JSON Web Encryption (JWE) A data structure representing an encrypted
message. The structure represents five values: the JWE Header, message. The structure represents five values: the JWE Header,
the JWE Encrypted Key, the JWE Initialization Vector, the JWE the JWE Encrypted Key, the JWE Initialization Vector, the JWE
Ciphertext, and the JWE Authentication Tag. Ciphertext, and the JWE Authentication Tag.
skipping to change at page 9, line 37 skipping to change at page 9, line 37
Header Parameter Name The name of a member of a JSON object Header Parameter Name The name of a member of a JSON object
representing a JWS Header or JWE Header. representing a JWS Header or JWE Header.
Header Parameter Value The value of a member of a JSON object Header Parameter Value The value of a member of a JSON object
representing a JWS Header or JWE Header. representing a JWS Header or JWE Header.
3. Cryptographic Algorithms for JWS 3. Cryptographic Algorithms for JWS
JWS uses cryptographic algorithms to digitally sign or create a JWS uses cryptographic algorithms to digitally sign or create a
Message Authentication Codes (MAC) of the contents of the JWS Header Message Authentication Codes (MAC) of the contents of the JWS Header
and the JWS Payload. The use of the following algorithms for and the JWS Payload.
producing JWSs is defined in this section.
3.1. "alg" (Algorithm) Header Parameter Values for JWS 3.1. "alg" (Algorithm) Header Parameter Values for JWS
The table below is the set of "alg" (algorithm) header parameter The table below is the set of "alg" (algorithm) header parameter
values defined by this specification for use with JWS, each of which values defined by this specification for use with JWS, each of which
is explained in more detail in the following sections: is explained in more detail in the following sections:
+-----------+--------------------------------------+----------------+ +-----------+--------------------------------------+----------------+
| alg | Digital Signature or MAC Algorithm | Implementation | | alg | Digital Signature or MAC Algorithm | Implementation |
| Parameter | | Requirements | | Parameter | | Requirements |
| Value | | | | Value | | |
+-----------+--------------------------------------+----------------+ +-----------+--------------------------------------+----------------+
| HS256 | HMAC using SHA-256 hash algorithm | REQUIRED | | HS256 | HMAC using SHA-256 hash algorithm | Required |
| HS384 | HMAC using SHA-384 hash algorithm | OPTIONAL | | HS384 | HMAC using SHA-384 hash algorithm | Optional |
| HS512 | HMAC using SHA-512 hash algorithm | OPTIONAL | | HS512 | HMAC using SHA-512 hash algorithm | Optional |
| RS256 | RSASSA-PKCS-v1_5 using SHA-256 hash | RECOMMENDED | | RS256 | RSASSA-PKCS-v1_5 using SHA-256 hash | Recommended |
| | algorithm | | | | algorithm | |
| RS384 | RSASSA-PKCS-v1_5 using SHA-384 hash | OPTIONAL | | RS384 | RSASSA-PKCS-v1_5 using SHA-384 hash | Optional |
| | algorithm | | | | algorithm | |
| RS512 | RSASSA-PKCS-v1_5 using SHA-512 hash | OPTIONAL | | RS512 | RSASSA-PKCS-v1_5 using SHA-512 hash | Optional |
| | algorithm | | | | algorithm | |
| ES256 | ECDSA using P-256 curve and SHA-256 | RECOMMENDED+ | | ES256 | ECDSA using P-256 curve and SHA-256 | Recommended+ |
| | hash algorithm | | | | hash algorithm | |
| ES384 | ECDSA using P-384 curve and SHA-384 | OPTIONAL | | ES384 | ECDSA using P-384 curve and SHA-384 | Optional |
| | hash algorithm | | | | hash algorithm | |
| ES512 | ECDSA using P-521 curve and SHA-512 | OPTIONAL | | ES512 | ECDSA using P-521 curve and SHA-512 | Optional |
| | hash algorithm | | | | hash algorithm | |
| PS256 | RSASSA-PSS using SHA-256 hash | OPTIONAL | | PS256 | RSASSA-PSS using SHA-256 hash | Optional |
| | algorithm and MGF1 mask generation | | | | algorithm and MGF1 mask generation | |
| | function with SHA-256 | | | | function with SHA-256 | |
| PS384 | RSASSA-PSS using SHA-384 hash | OPTIONAL | | PS384 | RSASSA-PSS using SHA-384 hash | Optional |
| | algorithm and MGF1 mask generation | | | | algorithm and MGF1 mask generation | |
| | function with SHA-384 | | | | function with SHA-384 | |
| PS512 | RSASSA-PSS using SHA-512 hash | OPTIONAL | | PS512 | RSASSA-PSS using SHA-512 hash | Optional |
| | algorithm and MGF1 mask generation | | | | algorithm and MGF1 mask generation | |
| | function with SHA-512 | | | | function with SHA-512 | |
| none | No digital signature or MAC value | REQUIRED | | none | No digital signature or MAC value | Required |
| | included | | | | included | |
+-----------+--------------------------------------+----------------+ +-----------+--------------------------------------+----------------+
All the names are short because a core goal of JWS is for the
representations to be compact. However, there is no a priori length
restriction on "alg" values.
The use of "+" in the Implementation Requirements indicates that the The use of "+" in the Implementation Requirements indicates that the
requirement strength is likely to be increased in a future version of requirement strength is likely to be increased in a future version of
the specification. the specification.
See Appendix A for a table cross-referencing the digital signature See Appendix A for a table cross-referencing the digital signature
and MAC "alg" (algorithm) values used in this specification with the and MAC "alg" (algorithm) values used in this specification with the
equivalent identifiers used by other standards and software packages. equivalent identifiers used by other standards and software packages.
3.2. MAC with HMAC SHA-2 Functions 3.2. HMAC with SHA-2 Functions
Hash-based Message Authentication Codes (HMACs) enable one to use a Hash-based Message Authentication Codes (HMACs) enable one to use a
secret plus a cryptographic hash function to generate a Message secret plus a cryptographic hash function to generate a Message
Authentication Code (MAC). This can be used to demonstrate that the Authentication Code (MAC). This can be used to demonstrate that
MAC matches the hashed content, in this case the JWS Signing Input, whoever generated the MAC was in possession of the MAC key.
which therefore demonstrates that whoever generated the MAC was in
possession of the secret. The means of exchanging the shared key is
outside the scope of this specification.
The algorithm for implementing and validating HMACs is provided in The algorithm for implementing and validating HMACs is provided in
RFC 2104 [RFC2104]. This section defines the use of the HMAC SHA- RFC 2104 [RFC2104]. This section defines the use of the HMAC SHA-
256, HMAC SHA-384, and HMAC SHA-512 functions [SHS]. The "alg" 256, HMAC SHA-384, and HMAC SHA-512 functions [SHS]. The "alg"
(algorithm) header parameter values "HS256", "HS384", and "HS512" are (algorithm) header parameter values "HS256", "HS384", and "HS512" are
used in the JWS Header to indicate that the Encoded JWS Signature used in the JWS Header to indicate that the Encoded JWS Signature
contains a base64url encoded HMAC value using the respective hash contains a base64url encoded HMAC value using the respective hash
function. function.
A key of the same size as the hash output (for instance, 256 bits for A key of the same size as the hash output (for instance, 256 bits for
skipping to change at page 11, line 42 skipping to change at page 11, line 32
The HMAC SHA-256 MAC for a JWS is validated by computing an HMAC The HMAC SHA-256 MAC for a JWS is validated by computing an HMAC
value per RFC 2104, using SHA-256 as the hash algorithm "H", using value per RFC 2104, using SHA-256 as the hash algorithm "H", using
the octets of the ASCII representation of the received JWS Signing the octets of the ASCII representation of the received JWS Signing
Input as the "text" value, and using the shared key. This computed Input as the "text" value, and using the shared key. This computed
HMAC value is then compared to the result of base64url decoding the HMAC value is then compared to the result of base64url decoding the
received Encoded JWS signature. Alternatively, the computed HMAC received Encoded JWS signature. Alternatively, the computed HMAC
value can be base64url encoded and compared to the received Encoded value can be base64url encoded and compared to the received Encoded
JWS Signature, as this comparison produces the same result as JWS Signature, as this comparison produces the same result as
comparing the unencoded values. In either case, if the values match, comparing the unencoded values. In either case, if the values match,
the HMAC has been validated. If the validation fails, the JWS MUST the HMAC has been validated.
be rejected.
Securing content with the HMAC SHA-384 and HMAC SHA-512 algorithms is Securing content with the HMAC SHA-384 and HMAC SHA-512 algorithms is
performed identically to the procedure for HMAC SHA-256 - just using performed identically to the procedure for HMAC SHA-256 - just using
the corresponding hash algorithm with correspondingly larger minimum the corresponding hash algorithms with correspondingly larger minimum
key sizes and result values: 384 bits each for HMAC SHA-384 and 512 key sizes and result values: 384 bits each for HMAC SHA-384 and 512
bits each for HMAC SHA-512. bits each for HMAC SHA-512.
An example using this algorithm is shown in Appendix A.1 of [JWS]. An example using this algorithm is shown in Appendix A.1 of [JWS].
3.3. Digital Signature with RSASSA-PKCS1-V1_5 3.3. Digital Signature with RSASSA-PKCS1-V1_5
This section defines the use of the RSASSA-PKCS1-V1_5 digital This section defines the use of the RSASSA-PKCS1-V1_5 digital
signature algorithm as defined in Section 8.2 of RFC 3447 [RFC3447] signature algorithm as defined in Section 8.2 of RFC 3447 [RFC3447]
(commonly known as PKCS #1), using SHA-256, SHA-384, or SHA-512 [SHS] (commonly known as PKCS #1), using SHA-256, SHA-384, or SHA-512 [SHS]
skipping to change at page 12, line 33 skipping to change at page 12, line 21
The output will be an octet sequence. The output will be an octet sequence.
2. Base64url encode the resulting octet sequence. 2. Base64url encode the resulting octet sequence.
The output is the Encoded JWS Signature for that JWS. The output is the Encoded JWS Signature for that JWS.
The RSASSA-PKCS1-V1_5 SHA-256 digital signature for a JWS is The RSASSA-PKCS1-V1_5 SHA-256 digital signature for a JWS is
validated as follows: validated as follows:
1. Take the Encoded JWS Signature and base64url decode it into an 1. Take the Encoded JWS Signature and base64url decode it into an
octet sequence. If decoding fails, the JWS MUST be rejected. octet sequence. If decoding fails, the validation has failed.
2. Submit the octets of the ASCII representation of the JWS Signing 2. Submit the octets of the ASCII representation of the JWS Signing
Input and the public key corresponding to the private key used by Input and the public key corresponding to the private key used by
the signer to the RSASSA-PKCS1-V1_5-VERIFY algorithm using SHA- the signer to the RSASSA-PKCS1-V1_5-VERIFY algorithm using SHA-
256 as the hash function. 256 as the hash function.
3. If the validation fails, the JWS MUST be rejected.
Signing with the RSASSA-PKCS1-V1_5 SHA-384 and RSASSA-PKCS1-V1_5 SHA- Signing with the RSASSA-PKCS1-V1_5 SHA-384 and RSASSA-PKCS1-V1_5 SHA-
512 algorithms is performed identically to the procedure for RSASSA- 512 algorithms is performed identically to the procedure for RSASSA-
PKCS1-V1_5 SHA-256 - just using the corresponding hash algorithm with PKCS1-V1_5 SHA-256 - just using the corresponding hash algorithms
correspondingly larger result values: 384 bits for RSASSA-PKCS1-V1_5 instead of SHA-256.
SHA-384 and 512 bits for RSASSA-PKCS1-V1_5 SHA-512.
An example using this algorithm is shown in Appendix A.2 of [JWS]. An example using this algorithm is shown in Appendix A.2 of [JWS].
3.4. Digital Signature with ECDSA 3.4. Digital Signature with ECDSA
The Elliptic Curve Digital Signature Algorithm (ECDSA) [DSS] provides The Elliptic Curve Digital Signature Algorithm (ECDSA) [DSS] provides
for the use of Elliptic Curve cryptography, which is able to provide for the use of Elliptic Curve cryptography, which is able to provide
equivalent security to RSA cryptography but using shorter key sizes equivalent security to RSA cryptography but using shorter key sizes
and with greater processing speed. This means that ECDSA digital and with greater processing speed. This means that ECDSA digital
signatures will be substantially smaller in terms of length than signatures will be substantially smaller in terms of length than
skipping to change at page 13, line 48 skipping to change at page 13, line 29
concatenation as their output.) concatenation as their output.)
4. Base64url encode the resulting 64 octet sequence. 4. Base64url encode the resulting 64 octet sequence.
The output is the Encoded JWS Signature for the JWS. The output is the Encoded JWS Signature for the JWS.
The ECDSA P-256 SHA-256 digital signature for a JWS is validated as The ECDSA P-256 SHA-256 digital signature for a JWS is validated as
follows: follows:
1. Take the Encoded JWS Signature and base64url decode it into an 1. Take the Encoded JWS Signature and base64url decode it into an
octet sequence. If decoding fails, the JWS MUST be rejected. octet sequence. If decoding fails, the validation has failed.
2. The output of the base64url decoding MUST be a 64 octet sequence. 2. The output of the base64url decoding MUST be a 64 octet sequence.
If decoding does not result in a 64 octet sequence, the JWS MUST If decoding does not result in a 64 octet sequence, the
be rejected. validation has failed.
3. Split the 64 octet sequence into two 32 octet sequences. The 3. Split the 64 octet sequence into two 32 octet sequences. The
first array will be R and the second S (with both being in big first array will be R and the second S (with both being in big
endian octet order). endian octet order).
4. Submit the octets of the ASCII representation of the JWS Signing 4. Submit the octets of the ASCII representation of the JWS Signing
Input R, S and the public key (x, y) to the ECDSA P-256 SHA-256 Input R, S and the public key (x, y) to the ECDSA P-256 SHA-256
validator. validator.
5. If the validation fails, the JWS MUST be rejected.
Note that ECDSA digital signature contains a value referred to as K,
which is a random number generated for each digital signature
instance. This means that two ECDSA digital signatures using exactly
the same input parameters will output different signature values
because their K values will be different. A consequence of this is
that one cannot validate an ECDSA signature by recomputing the
signature and comparing the results.
Signing with the ECDSA P-384 SHA-384 and ECDSA P-521 SHA-512 Signing with the ECDSA P-384 SHA-384 and ECDSA P-521 SHA-512
algorithms is performed identically to the procedure for ECDSA P-256 algorithms is performed identically to the procedure for ECDSA P-256
SHA-256 - just using the corresponding hash algorithm with SHA-256 - just using the corresponding hash algorithms with
correspondingly larger result values. For ECDSA P-384 SHA-384, R and correspondingly larger result values. For ECDSA P-384 SHA-384, R and
S will be 384 bits each, resulting in a 96 octet sequence. For ECDSA S will be 384 bits each, resulting in a 96 octet sequence. For ECDSA
P-521 SHA-512, R and S will be 521 bits each, resulting in a 132 P-521 SHA-512, R and S will be 521 bits each, resulting in a 132
octet sequence. octet sequence.
Examples using these algorithms are shown in Appendices A.3 and A.4 Examples using these algorithms are shown in Appendices A.3 and A.4
of [JWS]. of [JWS].
3.5. Digital Signature with RSASSA-PSS 3.5. Digital Signature with RSASSA-PSS
This section defines the use of the RSASSA-PSS digital signature This section defines the use of the RSASSA-PSS digital signature
algorithm as defined in Section 8.1 of RFC 3447 [RFC3447] with the algorithm as defined in Section 8.1 of RFC 3447 [RFC3447] with the
MGF1 mask generation function, always using the same hash function MGF1 mask generation function, always using the same hash function
for both the RSASSA-PSS hash function and the MGF1 hash function. for both the RSASSA-PSS hash function and the MGF1 hash function.
Use of SHA-256, SHA-384, and SHA-512 as these hash functions is Use of SHA-256, SHA-384, and SHA-512 as these hash functions is
defined. All other algorithm parameters use the defaults specified defined. The size of the salt value is the same size as the hash
in Section A.2.3 of RFC 3447. The "alg" (algorithm) header parameter function output. All other algorithm parameters use the defaults
values "PS256", "PS384", and "PS512" are used in the JWS Header to specified in Section A.2.3 of RFC 3447. The "alg" (algorithm) header
indicate that the Encoded JWS Signature contains a base64url encoded parameter values "PS256", "PS384", and "PS512" are used in the JWS
RSASSA-PSS digital signature using the respective hash function in Header to indicate that the Encoded JWS Signature contains a
both roles. base64url encoded RSASSA-PSS digital signature using the respective
hash function in both roles.
A key of size 2048 bits or larger MUST be used with this algorithm. A key of size 2048 bits or larger MUST be used with this algorithm.
The RSASSA-PSS SHA-256 digital signature is generated as follows: The RSASSA-PSS SHA-256 digital signature is generated as follows:
1. Generate a digital signature of the octets of the ASCII 1. Generate a digital signature of the octets of the ASCII
representation of the JWS Signing Input using RSASSA-PSS-SIGN, representation of the JWS Signing Input using RSASSA-PSS-SIGN,
the SHA-256 hash function, and the MGF1 mask generation function the SHA-256 hash function, and the MGF1 mask generation function
with SHA-256 with the desired private key. The output will be an with SHA-256 with the desired private key. The output will be an
octet sequence. octet sequence.
2. Base64url encode the resulting octet sequence. 2. Base64url encode the resulting octet sequence.
The output is the Encoded JWS Signature for that JWS. The output is the Encoded JWS Signature for that JWS.
The RSASSA-PSS SHA-256 digital signature for a JWS is validated as The RSASSA-PSS SHA-256 digital signature for a JWS is validated as
follows: follows:
1. Take the Encoded JWS Signature and base64url decode it into an 1. Take the Encoded JWS Signature and base64url decode it into an
octet sequence. If decoding fails, the JWS MUST be rejected. octet sequence. If decoding fails, the validation has failed.
2. Submit the octets of the ASCII representation of the JWS Signing 2. Submit the octets of the ASCII representation of the JWS Signing
Input and the public key corresponding to the private key used by Input and the public key corresponding to the private key used by
the signer to the RSASSA-PSS-VERIFY algorithm using SHA-256 as the signer to the RSASSA-PSS-VERIFY algorithm using SHA-256 as
the hash function and using MGF1 as the mask generation function the hash function and using MGF1 as the mask generation function
with SHA-256. with SHA-256.
3. If the validation fails, the JWS MUST be rejected.
Signing with the RSASSA-PSS SHA-384 and RSASSA-PSS SHA-512 algorithms Signing with the RSASSA-PSS SHA-384 and RSASSA-PSS SHA-512 algorithms
is performed identically to the procedure for RSASSA-PSS SHA-256 - is performed identically to the procedure for RSASSA-PSS SHA-256 -
just using the alternative hash algorithm in both roles. just using the alternative hash algorithm in both roles.
3.6. Using the Algorithm "none" 3.6. Using the Algorithm "none"
JWSs MAY also be created that do not provide integrity protection. JWSs MAY also be created that do not provide integrity protection.
Such a JWS is called a "Plaintext JWS". Plaintext JWSs MUST use the Such a JWS is called a "Plaintext JWS". Plaintext JWSs MUST use the
"alg" value "none", and are formatted identically to other JWSs, but "alg" value "none", and are formatted identically to other JWSs, but
with the empty string for its JWS Signature value. with the empty string for its JWS Signature value.
3.7. Additional Digital Signature/MAC Algorithms and Parameters
Additional algorithms MAY be used to protect JWSs with corresponding
"alg" (algorithm) header parameter values being defined to refer to
them. New "alg" header parameter values SHOULD either be registered
in the IANA JSON Web Signature and Encryption Algorithms registry
Section 6.1 or be a value that contains a Collision Resistant
Namespace. In particular, it is permissible to use the algorithm
identifiers defined in XML DSIG [RFC3275], XML DSIG 2.0
[W3C.CR-xmldsig-core2-20120124], and related specifications as "alg"
values.
As indicated by the common registry, JWSs and JWEs share a common
"alg" value space. The values used by the two specifications MUST be
distinct, as the "alg" value can be used to determine whether the
object is a JWS or JWE.
Likewise, additional reserved Header Parameter Names can be defined
via the IANA JSON Web Signature and Encryption Header Parameters
registry [JWS]. As indicated by the common registry, JWSs and JWEs
share a common header parameter space; when a parameter is used by
both specifications, its usage must be compatible between the
specifications.
4. Cryptographic Algorithms for JWE 4. Cryptographic Algorithms for JWE
JWE uses cryptographic algorithms to encrypt the Content Encryption JWE uses cryptographic algorithms to encrypt the Content Encryption
Key (CEK) and the Plaintext. This section specifies a set of Key (CEK) and the Plaintext.
specific algorithms for these purposes.
4.1. "alg" (Algorithm) Header Parameter Values for JWE 4.1. "alg" (Algorithm) Header Parameter Values for JWE
The table below is the set of "alg" (algorithm) header parameter The table below is the set of "alg" (algorithm) header parameter
values that are defined by this specification for use with JWE. values that are defined by this specification for use with JWE.
These algorithms are used to encrypt the CEK, producing the JWE These algorithms are used to encrypt the CEK, producing the JWE
Encrypted Key, or to use key agreement to agree upon the CEK. Encrypted Key, or to use key agreement to agree upon the CEK.
+-------------------+-----------------+------------+----------------+ +-------------------+-----------------+------------+----------------+
| alg Parameter | Key Management | Additional | Implementation | | alg Parameter | Key Management | Additional | Implementation |
| Value | Algorithm | Header | Requirements | | Value | Algorithm | Header | Requirements |
| | | Parameters | | | | | Parameters | |
+-------------------+-----------------+------------+----------------+ +-------------------+-----------------+------------+----------------+
| RSA1_5 | RSAES-PKCS1-V1_ | (none) | REQUIRED | | RSA1_5 | RSAES-PKCS1-V1_ | (none) | Required |
| | 5[RFC3447] | | | | | 5[RFC3447] | | |
| RSA-OAEP | RSAES using | (none) | OPTIONAL | | RSA-OAEP | RSAES using | (none) | Optional |
| | Optimal | | | | | Optimal | | |
| | Asymmetric | | | | | Asymmetric | | |
| | Encryption | | | | | Encryption | | |
| | Padding (OAEP) | | | | | Padding (OAEP) | | |
| | [RFC3447], with | | | | | [RFC3447], with | | |
| | the default | | | | | the default | | |
| | parameters | | | | | parameters | | |
| | specified by | | | | | specified by | | |
| | RFC 3447 in | | | | | RFC 3447 in | | |
| | Section A.2.1 | | | | | Section A.2.1 | | |
| A128KW | Advanced | (none) | RECOMMENDED | | A128KW | Advanced | (none) | Recommended |
| | Encryption | | | | | Encryption | | |
| | Standard (AES) | | | | | Standard (AES) | | |
| | Key Wrap | | | | | Key Wrap | | |
| | Algorithm | | | | | Algorithm | | |
| | [RFC3394] using | | | | | [RFC3394] using | | |
| | the default | | | | | the default | | |
| | initial value | | | | | initial value | | |
| | specified in | | | | | specified in | | |
| | Section 2.2.3.1 | | | | | Section 2.2.3.1 | | |
| | and using 128 | | | | | and using 128 | | |
| | bit keys | | | | | bit keys | | |
| A192KW | AES Key Wrap | (none) | OPTIONAL | | A192KW | AES Key Wrap | (none) | Optional |
| | Algorithm using | | | | | Algorithm using | | |
| | the default | | | | | the default | | |
| | initial value | | | | | initial value | | |
| | specified in | | | | | specified in | | |
| | Section 2.2.3.1 | | | | | Section 2.2.3.1 | | |
| | and using 192 | | | | | and using 192 | | |
| | bit keys | | | | | bit keys | | |
| A256KW | AES Key Wrap | (none) | RECOMMENDED | | A256KW | AES Key Wrap | (none) | Recommended |
| | Algorithm using | | | | | Algorithm using | | |
| | the default | | | | | the default | | |
| | initial value | | | | | initial value | | |
| | specified in | | | | | specified in | | |
| | Section 2.2.3.1 | | | | | Section 2.2.3.1 | | |
| | and using 256 | | | | | and using 256 | | |
| | bit keys | | | | | bit keys | | |
| dir | Direct use of a | (none) | RECOMMENDED | | dir | Direct use of a | (none) | Recommended |
| | shared | | | | | shared | | |
| | symmetric key | | | | | symmetric key | | |
| | as the Content | | | | | as the Content | | |
| | Encryption Key | | | | | Encryption Key | | |
| | (CEK) for the | | | | | (CEK) for the | | |
| | content | | | | | content | | |
| | encryption step | | | | | encryption step | | |
| | (rather than | | | | | (rather than | | |
| | using the | | | | | using the | | |
| | symmetric key | | | | | symmetric key | | |
| | to wrap the | | | | | to wrap the | | |
| | CEK) | | | | | CEK) | | |
| ECDH-ES | Elliptic Curve | "epk", | RECOMMENDED+ | | ECDH-ES | Elliptic Curve | "epk", | Recommended+ |
| | Diffie-Hellman | "apu", | | | | Diffie-Hellman | "apu", | |
| | Ephemeral | "apv" | | | | Ephemeral | "apv" | |
| | Static | | | | | Static | | |
| | [RFC6090] key | | | | | [RFC6090] key | | |
| | agreement using | | | | | agreement using | | |
| | the Concat KDF, | | | | | the Concat KDF, | | |
| | as defined in | | | | | as defined in | | |
| | Section 5.8.1 | | | | | Section 5.8.1 | | |
| | of | | | | | of | | |
| | [NIST.800-56A], | | | | | [NIST.800-56A], | | |
skipping to change at page 18, line 27 skipping to change at page 17, line 27
| | being used | | | | | being used | | |
| | directly as the | | | | | directly as the | | |
| | Content | | | | | Content | | |
| | Encryption Key | | | | | Encryption Key | | |
| | (CEK) (rather | | | | | (CEK) (rather | | |
| | than being used | | | | | than being used | | |
| | to wrap the | | | | | to wrap the | | |
| | CEK), as | | | | | CEK), as | | |
| | specified in | | | | | specified in | | |
| | Section 4.7 | | | | | Section 4.7 | | |
| ECDH-ES+A128KW | Elliptic Curve | "epk", | RECOMMENDED | | ECDH-ES+A128KW | Elliptic Curve | "epk", | Recommended |
| | Diffie-Hellman | "apu", | | | | Diffie-Hellman | "apu", | |
| | Ephemeral | "apv" | | | | Ephemeral | "apv" | |
| | Static key | | | | | Static key | | |
| | agreement per | | | | | agreement per | | |
| | "ECDH-ES" and | | | | | "ECDH-ES" and | | |
| | Section 4.7, | | | | | Section 4.7, | | |
| | where the | | | | | where the | | |
| | agreed-upon key | | | | | agreed-upon key | | |
| | is used to wrap | | | | | is used to wrap | | |
| | the Content | | | | | the Content | | |
| | Encryption Key | | | | | Encryption Key | | |
| | (CEK) with the | | | | | (CEK) with the | | |
| | "A128KW" | | | | | "A128KW" | | |
| | function | | | | | function | | |
| | (rather than | | | | | (rather than | | |
| | being used | | | | | being used | | |
| | directly as the | | | | | directly as the | | |
| | CEK) | | | | | CEK) | | |
| ECDH-ES+A192KW | Elliptic Curve | "epk", | OPTIONAL | | ECDH-ES+A192KW | Elliptic Curve | "epk", | Optional |
| | Diffie-Hellman | "apu", | | | | Diffie-Hellman | "apu", | |
| | Ephemeral | "apv" | | | | Ephemeral | "apv" | |
| | Static key | | | | | Static key | | |
| | agreement, | | | | | agreement, | | |
| | where the | | | | | where the | | |
| | agreed-upon key | | | | | agreed-upon key | | |
| | is used to wrap | | | | | is used to wrap | | |
| | the Content | | | | | the Content | | |
| | Encryption Key | | | | | Encryption Key | | |
| | (CEK) with the | | | | | (CEK) with the | | |
| | "A192KW" | | | | | "A192KW" | | |
| | function | | | | | function | | |
| | (rather than | | | | | (rather than | | |
| | being used | | | | | being used | | |
| | directly as the | | | | | directly as the | | |
| | CEK) | | | | | CEK) | | |
| ECDH-ES+A256KW | Elliptic Curve | "epk", | RECOMMENDED | | ECDH-ES+A256KW | Elliptic Curve | "epk", | Recommended |
| | Diffie-Hellman | "apu", | | | | Diffie-Hellman | "apu", | |
| | Ephemeral | "apv" | | | | Ephemeral | "apv" | |
| | Static key | | | | | Static key | | |
| | agreement, | | | | | agreement, | | |
| | where the | | | | | where the | | |
| | agreed-upon key | | | | | agreed-upon key | | |
| | is used to wrap | | | | | is used to wrap | | |
| | the Content | | | | | the Content | | |
| | Encryption Key | | | | | Encryption Key | | |
| | (CEK) with the | | | | | (CEK) with the | | |
| | "A256KW" | | | | | "A256KW" | | |
| | function | | | | | function | | |
| | (rather than | | | | | (rather than | | |
| | being used | | | | | being used | | |
| | directly as the | | | | | directly as the | | |
| | CEK) | | | | | CEK) | | |
| A128GCMKW | AES in | "iv", | OPTIONAL | | A128GCMKW | AES in | "iv", | Optional |
| | Galois/Counter | "tag" | | | | Galois/Counter | "tag" | |
| | Mode (GCM) | | | | | Mode (GCM) | | |
| | [AES] | | | | | [AES] | | |
| | [NIST.800-38D] | | | | | [NIST.800-38D] | | |
| | using 128 bit | | | | | using 128 bit | | |
| | keys | | | | | keys | | |
| A192GCMKW | AES GCM using | "iv", | OPTIONAL | | A192GCMKW | AES GCM using | "iv", | Optional |
| | 192 bit keys | "tag" | | | | 192 bit keys | "tag" | |
| A256GCMKW | AES GCM using | "iv", | OPTIONAL | | A256GCMKW | AES GCM using | "iv", | Optional |
| | 256 bit keys | "tag" | | | | 256 bit keys | "tag" | |
| PBES2-HS256+A128K | PBES2 [RFC2898] | "p2s", | OPTIONAL | | PBES2-HS256+A128K | PBES2 [RFC2898] | "p2s", | Optional |
| W | with HMAC | "p2c" | | | W | with HMAC | "p2c" | |
| | SHA-256 as the | | | | | SHA-256 as the | | |
| | PRF and AES Key | | | | | PRF and AES Key | | |
| | Wrap [RFC3394] | | | | | Wrap [RFC3394] | | |
| | using 128 bit | | | | | using 128 bit | | |
| | keys for the | | | | | keys for the | | |
| | encryption | | | | | encryption | | |
| | scheme | | | | | scheme | | |
| PBES2-HS256+A192K | PBES2 with HMAC | "p2s", | OPTIONAL | | PBES2-HS384+A192K | PBES2 with HMAC | "p2s", | Optional |
| W | SHA-256 as the | "p2c" | | | W | SHA-256 as the | "p2c" | |
| | PRF and AES Key | | | | | PRF and AES Key | | |
| | Wrap using 192 | | | | | Wrap using 192 | | |
| | bit keys for | | | | | bit keys for | | |
| | the encryption | | | | | the encryption | | |
| | scheme | | | | | scheme | | |
| PBES2-HS256+A256K | PBES2 with HMAC | "p2s", | OPTIONAL | | PBES2-HS512+A256K | PBES2 with HMAC | "p2s", | Optional |
| W | SHA-256 as the | "p2c" | | | W | SHA-256 as the | "p2c" | |
| | PRF and AES Key | | | | | PRF and AES Key | | |
| | Wrap using 256 | | | | | Wrap using 256 | | |
| | bit keys for | | | | | bit keys for | | |
| | the encryption | | | | | the encryption | | |
| | scheme | | | | | scheme | | |
+-------------------+-----------------+------------+----------------+ +-------------------+-----------------+------------+----------------+
All the names are short because a core goal of JWE is for the
representations to be compact. However, there is no a priori length
restriction on "alg" values.
The Additional Header Parameters column indicates what additional The Additional Header Parameters column indicates what additional
Header Parameters are used by the algorithm, beyond "alg", which all Header Parameters are used by the algorithm, beyond "alg", which all
use. All but "dir" and "ECDH-ES" also produce a JWE Encrypted Key use. All but "dir" and "ECDH-ES" also produce a JWE Encrypted Key
value. value.
The use of "+" in the Implementation Requirements indicates that the The use of "+" in the Implementation Requirements indicates that the
requirement strength is likely to be increased in a future version of requirement strength is likely to be increased in a future version of
the specification. the specification.
4.2. "enc" (Encryption Method) Header Parameter Values for JWE 4.2. "enc" (Encryption Method) Header Parameter Values for JWE
skipping to change at page 21, line 10 skipping to change at page 20, line 10
The table below is the set of "enc" (encryption method) header The table below is the set of "enc" (encryption method) header
parameter values that are defined by this specification for use with parameter values that are defined by this specification for use with
JWE. These algorithms are used to encrypt the Plaintext, which JWE. These algorithms are used to encrypt the Plaintext, which
produces the Ciphertext. produces the Ciphertext.
+-------------+------------------------+------------+---------------+ +-------------+------------------------+------------+---------------+
| enc | Content Encryption | Additional | Implementatio | | enc | Content Encryption | Additional | Implementatio |
| Parameter | Algorithm | Header | nRequirements | | Parameter | Algorithm | Header | nRequirements |
| Value | | Parameters | | | Value | | Parameters | |
+-------------+------------------------+------------+---------------+ +-------------+------------------------+------------+---------------+
| A128CBC-HS2 | The | (none) | REQUIRED | | A128CBC-HS2 | The | (none) | Required |
| 56 | AES_128_CBC_HMAC_SHA_2 | | | | 56 | AES_128_CBC_HMAC_SHA_2 | | |
| | 56 authenticated | | | | | 56 authenticated | | |
| | encryption algorithm, | | | | | encryption algorithm, | | |
| | as defined in | | | | | as defined in | | |
| | Section 4.10.3. This | | | | | Section 4.10.3. This | | |
| | algorithm uses a 256 | | | | | algorithm uses a 256 | | |
| | bit key. | | | | | bit key. | | |
| A192CBC-HS3 | The | (none) | OPTIONAL | | A192CBC-HS3 | The | (none) | Optional |
| 84 | AES_192_CBC_HMAC_SHA_3 | | | | 84 | AES_192_CBC_HMAC_SHA_3 | | |
| | 84 authenticated | | | | | 84 authenticated | | |
| | encryption algorithm, | | | | | encryption algorithm, | | |
| | as defined in | | | | | as defined in | | |
| | Section 4.10.4. This | | | | | Section 4.10.4. This | | |
| | algorithm uses a 384 | | | | | algorithm uses a 384 | | |
| | bit key. | | | | | bit key. | | |
| A256CBC-HS5 | The | (none) | REQUIRED | | A256CBC-HS5 | The | (none) | Required |
| 12 | AES_256_CBC_HMAC_SHA_5 | | | | 12 | AES_256_CBC_HMAC_SHA_5 | | |
| | 12 authenticated | | | | | 12 authenticated | | |
| | encryption algorithm, | | | | | encryption algorithm, | | |
| | as defined in | | | | | as defined in | | |
| | Section 4.10.5. This | | | | | Section 4.10.5. This | | |
| | algorithm uses a 512 | | | | | algorithm uses a 512 | | |
| | bit key. | | | | | bit key. | | |
| A128GCM | AES in Galois/Counter | (none) | RECOMMENDED | | A128GCM | AES in Galois/Counter | (none) | Recommended |
| | Mode (GCM) [AES] | | | | | Mode (GCM) [AES] | | |
| | [NIST.800-38D] using | | | | | [NIST.800-38D] using | | |
| | 128 bit keys | | | | | 128 bit keys | | |
| A192GCM | AES GCM using 192 bit | (none) | OPTIONAL | | A192GCM | AES GCM using 192 bit | (none) | Optional |
| | keys | | | | | keys | | |
| A256GCM | AES GCM using 256 bit | (none) | RECOMMENDED | | A256GCM | AES GCM using 256 bit | (none) | Recommended |
| | keys | | | | | keys | | |
+-------------+------------------------+------------+---------------+ +-------------+------------------------+------------+---------------+
The Additional Header Parameters column indicates what additional The Additional Header Parameters column indicates what additional
Header Parameters are used by the algorithm, beyond "enc", which all Header Parameters are used by the algorithm, beyond "enc", which all
use. All also use a JWE Initialization Vector value and produce JWE use. All also use a JWE Initialization Vector value and produce JWE
Ciphertext and JWE Authentication Tag values. Ciphertext and JWE Authentication Tag values.
See Appendix B for a table cross-referencing the encryption "alg" See Appendix B for a table cross-referencing the encryption "alg"
(algorithm) and "enc" (encryption method) values used in this (algorithm) and "enc" (encryption method) values used in this
skipping to change at page 22, line 49 skipping to change at page 21, line 49
key encryption without performing a key wrapping step. In this case, key encryption without performing a key wrapping step. In this case,
the shared symmetric key is used directly as the Content Encryption the shared symmetric key is used directly as the Content Encryption
Key (CEK) value for the "enc" algorithm. An empty octet sequence is Key (CEK) value for the "enc" algorithm. An empty octet sequence is
used as the JWE Encrypted Key value. The "alg" header parameter used as the JWE Encrypted Key value. The "alg" header parameter
value "dir" is used in this case. value "dir" is used in this case.
4.7. Key Agreement with Elliptic Curve Diffie-Hellman Ephemeral Static 4.7. Key Agreement with Elliptic Curve Diffie-Hellman Ephemeral Static
(ECDH-ES) (ECDH-ES)
This section defines the specifics of key agreement with Elliptic This section defines the specifics of key agreement with Elliptic
Curve Diffie-Hellman Ephemeral Static [RFC6090], and using the Concat Curve Diffie-Hellman Ephemeral Static [RFC6090], in combination with
KDF, as defined in Section 5.8.1 of [NIST.800-56A]. The key the Concat KDF, as defined in Section 5.8.1 of [NIST.800-56A]. The
agreement result can be used in one of two ways: key agreement result can be used in one of two ways:
1. directly as the Content Encryption Key (CEK) for the "enc" 1. directly as the Content Encryption Key (CEK) for the "enc"
algorithm, in the Direct Key Agreement mode, or algorithm, in the Direct Key Agreement mode, or
2. as a symmetric key used to wrap the CEK with either the "A128KW", 2. as a symmetric key used to wrap the CEK with the "A128KW",
"A192KW", or "A256KW" algorithms, in the Key Agreement with Key "A192KW", or "A256KW" algorithms, in the Key Agreement with Key
Wrapping mode. Wrapping mode.
The "alg" header parameter value "ECDH-ES" is used in the Direct Key The "alg" header parameter value "ECDH-ES" is used in the Direct Key
Agreement mode and the values "ECDH-ES+A128KW", "ECDH-ES+A192KW", or Agreement mode and the values "ECDH-ES+A128KW", "ECDH-ES+A192KW", or
"ECDH-ES+A256KW" are used in the Key Agreement with Key Wrapping "ECDH-ES+A256KW" are used in the Key Agreement with Key Wrapping
mode. mode.
In the Direct Key Agreement case, the output of the Concat KDF MUST In the Direct Key Agreement case, the output of the Concat KDF MUST
be a key of the same length as that used by the "enc" algorithm; in be a key of the same length as that used by the "enc" algorithm; in
this case, the empty octet sequence is used as the JWE Encrypted Key this case, the empty octet sequence is used as the JWE Encrypted Key
value. In the Key Agreement with Key Wrapping case, the output of value. In the Key Agreement with Key Wrapping case, the output of
the Concat KDF MUST be a key of the length needed for the specified the Concat KDF MUST be a key of the length needed for the specified
key wrapping algorithm, one of 128, 192, or 256 bits respectively. key wrapping algorithm, one of 128, 192, or 256 bits respectively.
A new ephemeral public key value MUST be generated for each key A new ephemeral public key value MUST be generated for each key
agreement transaction. agreement operation.
4.7.1. Header Parameters Used for ECDH Key Agreement 4.7.1. Header Parameters Used for ECDH Key Agreement
The following Header Parameter Names are reserved and are used for The following Header Parameter Names are reserved and are used for
key agreement as defined below. They MAY also be used for other key agreement as defined below.
algorithms if so specified by those algorithm parameter definitions.
4.7.1.1. "epk" (Ephemeral Public Key) Header Parameter 4.7.1.1. "epk" (Ephemeral Public Key) Header Parameter
The "epk" (ephemeral public key) value created by the originator for The "epk" (ephemeral public key) value created by the originator for
the use in key agreement algorithms. This key is represented as a the use in key agreement algorithms. This key is represented as a
JSON Web Key [JWK] bare public key value. This Header Parameter is JSON Web Key [JWK] public key value. It MUST contain only public key
REQUIRED and MUST be understood and processed by implementations when parameters and SHOULD contain only the minimum JWK parameters
these algorithms are used. necessary to represent the key; other JWK parameters included can be
checked for consistency and honored or can be ignored. This Header
Parameter is REQUIRED and MUST be understood and processed by
implementations when these algorithms are used.
4.7.1.2. "apu" (Agreement PartyUInfo) Header Parameter 4.7.1.2. "apu" (Agreement PartyUInfo) Header Parameter
The "apu" (agreement PartyUInfo) value for key agreement algorithms The "apu" (agreement PartyUInfo) value for key agreement algorithms
using it (such as "ECDH-ES"), represented as a base64url encoded using it (such as "ECDH-ES"), represented as a base64url encoded
string. When used, the PartyUInfo value contains information about string. When used, the PartyUInfo value contains information about
the sender. Use of this Header Parameter is OPTIONAL. This Header the sender. Use of this Header Parameter is OPTIONAL. This Header
Parameter MUST be understood and processed by implementations when Parameter MUST be understood and processed by implementations when
these algorithms are used. these algorithms are used.
skipping to change at page 26, line 8 skipping to change at page 25, line 8
regardless of the key size. regardless of the key size.
The JWE Encrypted Key value is the Ciphertext output. The JWE Encrypted Key value is the Ciphertext output.
The Authentication Tag output is represented in base64url encoded The Authentication Tag output is represented in base64url encoded
form as the "tag" (authentication tag) header parameter value. form as the "tag" (authentication tag) header parameter value.
4.8.1. Header Parameters Used for AES GCM Key Encryption 4.8.1. Header Parameters Used for AES GCM Key Encryption
The following Header Parameters are used for AES GCM key encryption. The following Header Parameters are used for AES GCM key encryption.
They MAY also be used by other algorithms if so specified by those
algorithm parameter definitions.
4.8.1.1. "iv" (Initialization Vector) Header Parameter 4.8.1.1. "iv" (Initialization Vector) Header Parameter
The "iv" (initialization vector) header parameter value is the The "iv" (initialization vector) header parameter value is the
base64url encoded representation of the Initialization Vector value base64url encoded representation of the Initialization Vector value
used for the key encryption operation. This Header Parameter is used for the key encryption operation. This Header Parameter is
REQUIRED and MUST be understood and processed by implementations when REQUIRED and MUST be understood and processed by implementations when
these algorithms are used. these algorithms are used.
4.8.1.2. "tag" (Authentication Tag) Header Parameter 4.8.1.2. "tag" (Authentication Tag) Header Parameter
The "tag" (authentication tag) header parameter value is the The "tag" (authentication tag) header parameter value is the
base64url encoded representation of the Authentication Tag value base64url encoded representation of the Authentication Tag value
resulting from the key encryption operation. This Header Parameter resulting from the key encryption operation. This Header Parameter
is REQUIRED and MUST be understood and processed by implementations is REQUIRED and MUST be understood and processed by implementations
when these algorithms are used. when these algorithms are used.
4.9. Key Encryption with PBES2 4.9. Key Encryption with PBES2
The "PBES2-HS256+A128KW", "PBES2-HS256+A192KW", and The "PBES2-HS256+A128KW", "PBES2-HS384+A192KW", and
"PBES2-HS256+A256KW" algorithms are used to encrypt a JWE Content "PBES2-HS512+A256KW" composite algorithms are used to perform
Master Key using a user-supplied password to derive the key password-based encryption of a JWE CEK, by first deriving a key
encryption key. With these algorithms, the derived key is used to encryption key from a user-supplied password, then encrypting the JWE
encrypt the JWE Content Master Key. These algorithms combine a key CEK using the derived key. These algorithms are PBES2 schemes as
derivation function with an encryption scheme to encrypt the JWE specified in Section 6.2 of [RFC2898].
Content Master Key according to PBES2 from Section 6.2 of [RFC2898].
These algorithms use HMAC SHA-256 as the Pseudo-Random Function (PRF) These algorithms use HMAC SHA-2 algorithms as the Pseudo-Random
and AES Key Wrap [RFC3394] for the encryption scheme. The salt (s) Function (PRF) for the PBKDF2 key derivation and AES Key Wrap
and iteration count (c) parameters MUST be provided as the "p2s" and [RFC3394] for the encryption scheme. The salt MUST be provided as
"p2c" header parameter values. The algorithms respectively use 128, the "p2s" header parameter value, and MUST be base64url decoded to
obtain the value. The iteration count parameter MUST be provided as
the "p2c" header parameter value. The algorithms respectively use
HMAC SHA-256, HMAC SHA-384, and HMAC SHA-512 as the PRF and use 128,
192, and 256 bit AES Key Wrap keys. Their derived-key lengths 192, and 256 bit AES Key Wrap keys. Their derived-key lengths
(dkLen) respectively are 16, 24, and 32 octets. (dkLen) respectively are 16, 24, and 32 octets.
4.9.1. Header Parameters Used for PBES2 Key Encryption 4.9.1. Header Parameters Used for PBES2 Key Encryption
The following Header Parameters are used for Key Encryption with The following Header Parameters are used for Key Encryption with
PBES2. PBES2.
4.9.1.1. "p2s" (PBES2 salt) Parameter 4.9.1.1. "p2s" (PBES2 salt) Parameter
The "p2s" (PBES2 salt) header parameter contains the PBKDF2 salt The "p2s" (PBES2 salt) header parameter contains the PBKDF2 salt
value (s) as a base64url encoded string. This value MUST NOT be the value, encoded using base64url. This Header Parameter is REQUIRED
empty string. This Header Parameter is REQUIRED and MUST be and MUST be understood and processed by implementations when these
understood and processed by implementations when these algorithms are algorithms are used.
used.
The salt expands the possible keys that can be derived from a given The salt expands the possible keys that can be derived from a given
password. [RFC2898] originally recommended a minimum salt length of password. A salt value containing 8 or more octets MUST be used. A
8 octets (since there is no concern here of a derived key being re- new salt value MUST be generated randomly for every encryption
used for different purposes). The salt MUST be generated randomly; operation; see [RFC4086] for considerations on generating random
see [RFC4086] for considerations on generating random values. values.
4.9.1.2. "p2c" (PBES2 count) Parameter 4.9.1.2. "p2c" (PBES2 count) Parameter
The "p2c" (PBES2 count) header parameter contains the PBKDF2 The "p2c" (PBES2 count) header parameter contains the PBKDF2
iteration count (c), as an integer. This value MUST NOT be less than iteration count, represented as a positive integer. This Header
1, as per [RFC2898]. This Header Parameter is REQUIRED and MUST be Parameter is REQUIRED and MUST be understood and processed by
understood and processed by implementations when these algorithms are implementations when these algorithms are used.
used.
The iteration count adds computational expense, ideally compounded by The iteration count adds computational expense, ideally compounded by
the possible range of keys introduced by the salt. [RFC2898] the possible range of keys introduced by the salt. A minimum
originally recommended a minimum iteration count of 1000. iteration count of 1000 is RECOMMENDED.
4.10. AES_CBC_HMAC_SHA2 Algorithms 4.10. AES_CBC_HMAC_SHA2 Algorithms
This section defines a family of authenticated encryption algorithms This section defines a family of authenticated encryption algorithms
built using a composition of Advanced Encryption Standard (AES) in built using a composition of Advanced Encryption Standard (AES) in
Cipher Block Chaining (CBC) mode with PKCS #5 padding [AES] Cipher Block Chaining (CBC) mode with PKCS #5 padding [AES]
[NIST.800-38A] operations and HMAC [RFC2104] [SHS] operations. This [NIST.800-38A] operations and HMAC [RFC2104] [SHS] operations. This
algorithm family is called AES_CBC_HMAC_SHA2. It also defines three algorithm family is called AES_CBC_HMAC_SHA2. It also defines three
instances of this family, the first using 128 bit CBC keys and HMAC instances of this family, the first using 128 bit CBC keys and HMAC
SHA-256, the second using 192 bit CBC keys and HMAC SHA-384, and the SHA-256, the second using 192 bit CBC keys and HMAC SHA-384, and the
skipping to change at page 32, line 30 skipping to change at page 31, line 22
The requested size of the Authentication Tag output MUST be 128 bits, The requested size of the Authentication Tag output MUST be 128 bits,
regardless of the key size. regardless of the key size.
The JWE Authentication Tag is set to be the Authentication Tag value The JWE Authentication Tag is set to be the Authentication Tag value
produced by the encryption. During decryption, the received JWE produced by the encryption. During decryption, the received JWE
Authentication Tag is used as the Authentication Tag value. Authentication Tag is used as the Authentication Tag value.
An example using this algorithm is shown in Appendix A.1 of [JWE]. An example using this algorithm is shown in Appendix A.1 of [JWE].
4.12. Additional Encryption Algorithms and Parameters
Additional algorithms MAY be used to protect JWEs with corresponding
"alg" (algorithm) and "enc" (encryption method) header parameter
values being defined to refer to them. New "alg" and "enc" header
parameter values SHOULD either be registered in the IANA JSON Web
Signature and Encryption Algorithms registry Section 6.1 or be a
value that contains a Collision Resistant Namespace. In particular,
it is permissible to use the algorithm identifiers defined in XML
Encryption [W3C.REC-xmlenc-core-20021210], XML Encryption 1.1
[W3C.CR-xmlenc-core1-20120313], and related specifications as "alg"
and "enc" values.
As indicated by the common registry, JWSs and JWEs share a common
"alg" value space. The values used by the two specifications MUST be
distinct, as the "alg" value can be used to determine whether the
object is a JWS or JWE.
Likewise, additional reserved Header Parameter Names can be defined
via the IANA JSON Web Signature and Encryption Header Parameters
registry [JWS]. As indicated by the common registry, JWSs and JWEs
share a common header parameter space; when a parameter is used by
both specifications, its usage must be compatible between the
specifications.
5. Cryptographic Algorithms for JWK 5. Cryptographic Algorithms for JWK
A JSON Web Key (JWK) [JWK] is a JavaScript Object Notation (JSON) A JSON Web Key (JWK) [JWK] is a JSON data structure that represents a
[RFC4627] data structure that represents a cryptographic key. A JSON cryptographic key. These keys can be either asymmetric or symmetric.
Web Key Set (JWK Set) is a JSON data structure for representing a set They can hold both public and private information about the key.
of JWKs. This section specifies a set of key types to be used for This section defines the parameters for keys using the algorithms
those keys and the key type specific parameters for representing specified by this document.
those keys. Parameters are defined for public, private, and
symmetric keys.
5.1. "kty" (Key Type) Parameter Values for JWK 5.1. "kty" (Key Type) Parameter Values
The table below is the set of "kty" (key type) parameter values that The table below is the set of "kty" (key type) parameter values that
are defined by this specification for use in JWKs. are defined by this specification for use in JWKs.
+-------------+----------------------------------+------------------+ +--------------+--------------------------------+-------------------+
| kty | Key Type | Implementation | | kty | Key Type | Implementation |
| Parameter | | Requirements | | Parameter | | Requirements |
| Value | | | | Value | | |
+-------------+----------------------------------+------------------+ +--------------+--------------------------------+-------------------+
| EC | Elliptic Curve [DSS] key type | RECOMMENDED+ | | EC | Elliptic Curve [DSS] | Recommended+ |
| RSA | RSA [RFC3447] key type | REQUIRED | | RSA | RSA [RFC3447] | Required |
| oct | Octet sequence key type (used to | RECOMMENDED+ | | oct | Octet sequence (used to | Required |
| | represent symmetric keys) | | | | represent symmetric keys) | |
+-------------+----------------------------------+------------------+ +--------------+--------------------------------+-------------------+
All the names are short because a core goal of JWK is for the
representations to be compact. However, there is no a priori length
restriction on "kty" values.
The use of "+" in the Implementation Requirements indicates that the The use of "+" in the Implementation Requirements indicates that the
requirement strength is likely to be increased in a future version of requirement strength is likely to be increased in a future version of
the specification. the specification.
5.2. JWK Parameters for Elliptic Curve Keys 5.2. JWK Parameters for Elliptic Curve Keys
JWKs can represent Elliptic Curve [DSS] keys. In this case, the JWKs can represent Elliptic Curve [DSS] keys. In this case, the
"kty" member value MUST be "EC". "kty" member value MUST be "EC".
5.2.1. JWK Parameters for Elliptic Curve Public Keys 5.2.1. JWK Parameters for Elliptic Curve Public Keys
These members MUST be present for Elliptic Curve public keys: The following members MUST be present for Elliptic Curve public keys.
5.2.1.1. "crv" (Curve) Parameter 5.2.1.1. "crv" (Curve) Parameter
The "crv" (curve) member identifies the cryptographic curve used with The "crv" (curve) member identifies the cryptographic curve used with
the key. Curve values from [DSS] used by this specification are: the key. Curve values from [DSS] used by this specification are:
o "P-256" o "P-256"
o "P-384" o "P-384"
skipping to change at page 34, line 44 skipping to change at page 33, line 4
the coordinate's big endian representation as an octet sequence. The the coordinate's big endian representation as an octet sequence. The
array representation MUST NOT be shortened to omit any leading zero array representation MUST NOT be shortened to omit any leading zero
octets contained in the value. For instance, when representing 521 octets contained in the value. For instance, when representing 521
bit integers, the octet sequence to be base64url encoded MUST contain bit integers, the octet sequence to be base64url encoded MUST contain
66 octets, including any leading zero octets. 66 octets, including any leading zero octets.
5.2.2. JWK Parameters for Elliptic Curve Private Keys 5.2.2. JWK Parameters for Elliptic Curve Private Keys
In addition to the members used to represent Elliptic Curve public In addition to the members used to represent Elliptic Curve public
keys, the following member MUST be present to represent Elliptic keys, the following member MUST be present to represent Elliptic
Curve private keys: Curve private keys.
5.2.2.1. "d" (ECC Private Key) Parameter 5.2.2.1. "d" (ECC Private Key) Parameter
The "d" (ECC private key) member contains the Elliptic Curve private The "d" (ECC private key) member contains the Elliptic Curve private
key value. It is represented as the base64url encoding of the key value. It is represented as the base64url encoding of the
value's unsigned big endian representation as an octet sequence. The value's unsigned big endian representation as an octet sequence. The
array representation MUST NOT be shortened to omit any leading zero array representation MUST NOT be shortened to omit any leading zero
octets. For instance, when representing 521 bit integers, the octet octets. For instance, when representing 521 bit integers, the octet
sequence to be base64url encoded MUST contain 66 octets, including sequence to be base64url encoded MUST contain 66 octets, including
any leading zero octets. any leading zero octets.
5.3. JWK Parameters for RSA Keys 5.3. JWK Parameters for RSA Keys
JWKs can represent RSA [RFC3447] keys. In this case, the "kty" JWKs can represent RSA [RFC3447] keys. In this case, the "kty"
member value MUST be "RSA". member value MUST be "RSA".
5.3.1. JWK Parameters for RSA Public Keys 5.3.1. JWK Parameters for RSA Public Keys
These members MUST be present for RSA public keys: The following members MUST be present for RSA public keys.
5.3.1.1. "n" (Modulus) Parameter 5.3.1.1. "n" (Modulus) Parameter
The "n" (modulus) member contains the modulus value for the RSA The "n" (modulus) member contains the modulus value for the RSA
public key. It is represented as the base64url encoding of the public key. It is represented as the base64url encoding of the
value's unsigned big endian representation as an octet sequence. The value's unsigned big endian representation as an octet sequence. The
array representation MUST NOT be shortened to omit any leading zero array representation MUST NOT be shortened to omit any leading zero
octets. For instance, when representing 2048 bit integers, the octet octets. For instance, when representing 2048 bit integers, the octet
sequence to be base64url encoded MUST contain 256 octets, including sequence to be base64url encoded MUST contain 256 octets, including
any leading zero octets. any leading zero octets.
skipping to change at page 37, line 27 skipping to change at page 35, line 36
value's unsigned big endian representation as an octet sequence. value's unsigned big endian representation as an octet sequence.
5.3.2.7.3. "t" (Factor CRT Coefficient) 5.3.2.7.3. "t" (Factor CRT Coefficient)
The "t" (factor CRT coefficient) parameter within an "oth" array The "t" (factor CRT coefficient) parameter within an "oth" array
member represents the CRT coefficient of the corresponding prime member represents the CRT coefficient of the corresponding prime
factor, a positive integer. It is represented as the base64url factor, a positive integer. It is represented as the base64url
encoding of the value's unsigned big endian representation as an encoding of the value's unsigned big endian representation as an
octet sequence. octet sequence.
5.3.3. JWK Parameters for Symmetric Keys 5.4. JWK Parameters for Symmetric Keys
When the JWK "kty" member value is "oct" (octet sequence), the When the JWK "kty" member value is "oct" (octet sequence), the
following member is used to represent a symmetric key (or another key following member is used to represent a symmetric key (or another key
whose value is a single octet sequence): whose value is a single octet sequence):
5.3.3.1. "k" (Key Value) Parameter 5.4.1. "k" (Key Value) Parameter
The "k" (key value) member contains the value of the symmetric (or The "k" (key value) member contains the value of the symmetric (or
other single-valued) key. It is represented as the base64url other single-valued) key. It is represented as the base64url
encoding of the octet sequence containing the key value. encoding of the octet sequence containing the key value.
5.4. Additional Key Types and Parameters
Keys using additional key types can be represented using JWK data
structures with corresponding "kty" (key type) parameter values being
defined to refer to them. New "kty" parameter values SHOULD either
be registered in the IANA JSON Web Key Types registry Section 6.2 or
be a value that contains a Collision Resistant Namespace.
Likewise, parameters for representing keys for additional key types
or additional key properties SHOULD either be registered in the IANA
JSON Web Key Parameters registry [JWK] or be a value that contains a
Collision Resistant Namespace.
6. IANA Considerations 6. IANA Considerations
The following registration procedure is used for all the registries The following registration procedure is used for all the registries
established by this specification. established by this specification.
Values are registered with a Specification Required [RFC5226] after a Values are registered with a Specification Required [RFC5226] after a
two-week review period on the [TBD]@ietf.org mailing list, on the two-week review period on the [TBD]@ietf.org mailing list, on the
advice of one or more Designated Experts. However, to allow for the advice of one or more Designated Experts. However, to allow for the
allocation of values prior to publication, the Designated Expert(s) allocation of values prior to publication, the Designated Expert(s)
may approve registration once they are satisfied that such a may approve registration once they are satisfied that such a
skipping to change at page 38, line 42 skipping to change at page 36, line 37
6.1. JSON Web Signature and Encryption Algorithms Registry 6.1. JSON Web Signature and Encryption Algorithms Registry
This specification establishes the IANA JSON Web Signature and This specification establishes the IANA JSON Web Signature and
Encryption Algorithms registry for values of the JWS and JWE "alg" Encryption Algorithms registry for values of the JWS and JWE "alg"
(algorithm) and "enc" (encryption method) header parameters. The (algorithm) and "enc" (encryption method) header parameters. The
registry records the algorithm name, the algorithm usage locations registry records the algorithm name, the algorithm usage locations
from the set "alg" and "enc", implementation requirements, and a from the set "alg" and "enc", implementation requirements, and a
reference to the specification that defines it. The same algorithm reference to the specification that defines it. The same algorithm
name MAY be registered multiple times, provided that the sets of name MAY be registered multiple times, provided that the sets of
usage locations are disjoint. The implementation requirements of an usage locations are disjoint.
algorithm MAY be changed over time by the Designated Experts(s) as
the cryptographic landscape evolves, for instance, to change the The implementation requirements of an algorithm MAY be changed over
status of an algorithm to DEPRECATED, or to change the status of an time by the Designated Experts(s) as the cryptographic landscape
algorithm from OPTIONAL to RECOMMENDED or REQUIRED. evolves, for instance, to change the status of an algorithm to
Deprecated, or to change the status of an algorithm from Optional to
Recommended+ or Required. Changes of implementation requirements are
only permitted on a Specification Required basis, with the new
specification defining the revised implementation requirements level.
6.1.1. Template 6.1.1. Template
Algorithm Name: Algorithm Name:
The name requested (e.g., "example"). This name is case The name requested (e.g., "example"). This name is case
sensitive. Names that match other registered names in a case sensitive. Names that match other registered names in a case
insensitive manner SHOULD NOT be accepted. insensitive manner SHOULD NOT be accepted.
Algorithm Usage Location(s): Algorithm Usage Location(s):
The algorithm usage, which must be one or more of the values "alg" The algorithm usage, which must be one or more of the values "alg"
or "enc". or "enc".
Implementation Requirements: Implementation Requirements:
The algorithm implementation requirements, which must be one the The algorithm implementation requirements, which must be one the
words REQUIRED, RECOMMENDED, OPTIONAL, or DEPRECATED. Optionally, words Required, Recommended, Optional, or Deprecated. Optionally,
the word can be followed by a "+" or "-". The use of "+" the word can be followed by a "+" or "-". The use of "+"
indicates that the requirement strength is likely to be increased indicates that the requirement strength is likely to be increased
in a future version of the specification. The use of "-" in a future version of the specification. The use of "-"
indicates that the requirement strength is likely to be decreased indicates that the requirement strength is likely to be decreased
in a future version of the specification. in a future version of the specification.
Change Controller: Change Controller:
For Standards Track RFCs, state "IETF". For others, give the name For Standards Track RFCs, state "IETF". For others, give the name
of the responsible party. Other details (e.g., postal address, of the responsible party. Other details (e.g., postal address,
email address, home page URI) may also be included. email address, home page URI) may also be included.
skipping to change at page 39, line 37 skipping to change at page 37, line 37
Specification Document(s): Specification Document(s):
Reference to the document(s) that specify the parameter, Reference to the document(s) that specify the parameter,
preferably including URI(s) that can be used to retrieve copies of preferably including URI(s) that can be used to retrieve copies of
the document(s). An indication of the relevant sections may also the document(s). An indication of the relevant sections may also
be included but is not required. be included but is not required.
6.1.2. Initial Registry Contents 6.1.2. Initial Registry Contents
o Algorithm Name: "HS256" o Algorithm Name: "HS256"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: REQUIRED o Implementation Requirements: Required
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 3.1 of [[ this document ]] o Specification Document(s): Section 3.1 of [[ this document ]]
o Algorithm Name: "HS384" o Algorithm Name: "HS384"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: OPTIONAL o Implementation Requirements: Optional
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 3.1 of [[ this document ]] o Specification Document(s): Section 3.1 of [[ this document ]]
o Algorithm Name: "HS512" o Algorithm Name: "HS512"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: OPTIONAL o Implementation Requirements: Optional
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 3.1 of [[ this document ]] o Specification Document(s): Section 3.1 of [[ this document ]]
o Algorithm Name: "RS256" o Algorithm Name: "RS256"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: RECOMMENDED o Implementation Requirements: Recommended
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 3.1 of [[ this document ]] o Specification Document(s): Section 3.1 of [[ this document ]]
o Algorithm Name: "RS384" o Algorithm Name: "RS384"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: OPTIONAL o Implementation Requirements: Optional
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 3.1 of [[ this document ]] o Specification Document(s): Section 3.1 of [[ this document ]]
o Algorithm Name: "RS512" o Algorithm Name: "RS512"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: OPTIONAL o Implementation Requirements: Optional
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 3.1 of [[ this document ]] o Specification Document(s): Section 3.1 of [[ this document ]]
o Algorithm Name: "ES256" o Algorithm Name: "ES256"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: RECOMMENDED+ o Implementation Requirements: Recommended+
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 3.1 of [[ this document ]] o Specification Document(s): Section 3.1 of [[ this document ]]
o Algorithm Name: "ES384" o Algorithm Name: "ES384"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: OPTIONAL o Implementation Requirements: Optional
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 3.1 of [[ this document ]] o Specification Document(s): Section 3.1 of [[ this document ]]
o Algorithm Name: "ES512" o Algorithm Name: "ES512"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: OPTIONAL o Implementation Requirements: Optional
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 3.1 of [[ this document ]] o Specification Document(s): Section 3.1 of [[ this document ]]
o Algorithm Name: "PS256" o Algorithm Name: "PS256"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: OPTIONAL o Implementation Requirements: Optional
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 3.1 of [[ this document ]] o Specification Document(s): Section 3.1 of [[ this document ]]
o Algorithm Name: "PS384" o Algorithm Name: "PS384"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: OPTIONAL o Implementation Requirements: Optional
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 3.1 of [[ this document ]] o Specification Document(s): Section 3.1 of [[ this document ]]
o Algorithm Name: "PS512" o Algorithm Name: "PS512"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: OPTIONAL o Implementation Requirements: Optional
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 3.1 of [[ this document ]] o Specification Document(s): Section 3.1 of [[ this document ]]
o Algorithm Name: "none" o Algorithm Name: "none"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: REQUIRED o Implementation Requirements: Required
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 3.1 of [[ this document ]] o Specification Document(s): Section 3.1 of [[ this document ]]
o Algorithm Name: "RSA1_5" o Algorithm Name: "RSA1_5"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: REQUIRED o Implementation Requirements: Required
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.1 of [[ this document ]] o Specification Document(s): Section 4.1 of [[ this document ]]
o Algorithm Name: "RSA-OAEP" o Algorithm Name: "RSA-OAEP"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: OPTIONAL o Implementation Requirements: Optional
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.1 of [[ this document ]] o Specification Document(s): Section 4.1 of [[ this document ]]
o Algorithm Name: "A128KW" o Algorithm Name: "A128KW"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: RECOMMENDED o Implementation Requirements: Recommended
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.1 of [[ this document ]] o Specification Document(s): Section 4.1 of [[ this document ]]
o Algorithm Name: "A192KW" o Algorithm Name: "A192KW"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: OPTIONAL o Implementation Requirements: Optional
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.1 of [[ this document ]] o Specification Document(s): Section 4.1 of [[ this document ]]
o Algorithm Name: "A256KW" o Algorithm Name: "A256KW"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: RECOMMENDED o Implementation Requirements: Recommended
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.1 of [[ this document ]] o Specification Document(s): Section 4.1 of [[ this document ]]
o Algorithm Name: "dir" o Algorithm Name: "dir"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: RECOMMENDED o Implementation Requirements: Recommended
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.1 of [[ this document ]] o Specification Document(s): Section 4.1 of [[ this document ]]
o Algorithm Name: "ECDH-ES" o Algorithm Name: "ECDH-ES"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: RECOMMENDED+ o Implementation Requirements: Recommended+
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.1 of [[ this document ]] o Specification Document(s): Section 4.1 of [[ this document ]]
o Algorithm Name: "ECDH-ES+A128KW" o Algorithm Name: "ECDH-ES+A128KW"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: RECOMMENDED o Implementation Requirements: Recommended
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.1 of [[ this document ]] o Specification Document(s): Section 4.1 of [[ this document ]]
o Algorithm Name: "ECDH-ES+A192KW" o Algorithm Name: "ECDH-ES+A192KW"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: OPTIONAL o Implementation Requirements: Optional
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.1 of [[ this document ]] o Specification Document(s): Section 4.1 of [[ this document ]]
o Algorithm Name: "ECDH-ES+A256KW" o Algorithm Name: "ECDH-ES+A256KW"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: RECOMMENDED o Implementation Requirements: Recommended
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.1 of [[ this document ]] o Specification Document(s): Section 4.1 of [[ this document ]]
o Algorithm Name: "A128GCMKW" o Algorithm Name: "A128GCMKW"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: OPTIONAL o Implementation Requirements: Optional
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.8 of [[ this document ]] o Specification Document(s): Section 4.8 of [[ this document ]]
o Algorithm Name: "A192GCMKW" o Algorithm Name: "A192GCMKW"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: OPTIONAL o Implementation Requirements: Optional
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.8 of [[ this document ]] o Specification Document(s): Section 4.8 of [[ this document ]]
o Algorithm Name: "A256GCMKW" o Algorithm Name: "A256GCMKW"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: OPTIONAL o Implementation Requirements: Optional
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.8 of [[ this document ]] o Specification Document(s): Section 4.8 of [[ this document ]]
o Algorithm Name: "PBES2-HS256+A128KW" o Algorithm Name: "PBES2-HS256+A128KW"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: OPTIONAL o Implementation Requirements: Optional
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.9 of [[ this document ]] o Specification Document(s): Section 4.9 of [[ this document ]]
o Algorithm Name: "PBES2-HS256+A192KW" o Algorithm Name: "PBES2-HS384+A192KW"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: OPTIONAL o Implementation Requirements: Optional
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.9 of [[ this document ]] o Specification Document(s): Section 4.9 of [[ this document ]]
o Algorithm Name: "PBES2-HS256+A256KW" o Algorithm Name: "PBES2-HS512+A256KW"
o Algorithm Usage Location(s): "alg" o Algorithm Usage Location(s): "alg"
o Implementation Requirements: OPTIONAL o Implementation Requirements: Optional
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.9 of [[ this document ]] o Specification Document(s): Section 4.9 of [[ this document ]]
o Algorithm Name: "A128CBC-HS256" o Algorithm Name: "A128CBC-HS256"
o Algorithm Usage Location(s): "enc" o Algorithm Usage Location(s): "enc"
o Implementation Requirements: REQUIRED o Implementation Requirements: Required
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.2 of [[ this document ]] o Specification Document(s): Section 4.2 of [[ this document ]]
o Algorithm Name: "A192CBC-HS384" o Algorithm Name: "A192CBC-HS384"
o Algorithm Usage Location(s): "enc" o Algorithm Usage Location(s): "enc"
o Implementation Requirements: OPTIONAL o Implementation Requirements: Optional
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.2 of [[ this document ]] o Specification Document(s): Section 4.2 of [[ this document ]]
o Algorithm Name: "A256CBC-HS512" o Algorithm Name: "A256CBC-HS512"
o Algorithm Usage Location(s): "enc" o Algorithm Usage Location(s): "enc"
o Implementation Requirements: REQUIRED o Implementation Requirements: Required
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.2 of [[ this document ]] o Specification Document(s): Section 4.2 of [[ this document ]]
o Algorithm Name: "A128GCM" o Algorithm Name: "A128GCM"
o Algorithm Usage Location(s): "enc" o Algorithm Usage Location(s): "enc"
o Implementation Requirements: RECOMMENDED o Implementation Requirements: Recommended
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.2 of [[ this document ]] o Specification Document(s): Section 4.2 of [[ this document ]]
o Algorithm Name: "A192GCM" o Algorithm Name: "A192GCM"
o Algorithm Usage Location(s): "enc" o Algorithm Usage Location(s): "enc"
o Implementation Requirements: OPTIONAL o Implementation Requirements: Optional
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.2 of [[ this document ]] o Specification Document(s): Section 4.2 of [[ this document ]]
o Algorithm Name: "A256GCM" o Algorithm Name: "A256GCM"
o Algorithm Usage Location(s): "enc" o Algorithm Usage Location(s): "enc"
o Implementation Requirements: RECOMMENDED o Implementation Requirements: Recommended
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 4.2 of [[ this document ]] o Specification Document(s): Section 4.2 of [[ this document ]]
6.2. JSON Web Key Types Registry 6.2. JSON Web Key Types Registry
This specification establishes the IANA JSON Web Key Types registry This specification establishes the IANA JSON Web Key Types registry
for values of the JWK "kty" (key type) parameter. The registry for values of the JWK "kty" (key type) parameter. The registry
records the "kty" value and a reference to the specification that records the "kty" value, implementation requirements, and a reference
defines it. This specification registers the values defined in to the specification that defines it.
Section 5.1.
The implementation requirements of a key type MAY be changed over
time by the Designated Experts(s) as the cryptographic landscape
evolves, for instance, to change the status of a key type to
Deprecated, or to change the status of a key type from Optional to
Recommended+ or Required. Changes of implementation requirements are
only permitted on a Specification Required basis, with the new
specification defining the revised implementation requirements level.
6.2.1. Registration Template 6.2.1. Registration Template
"kty" Parameter Value: "kty" Parameter Value:
The name requested (e.g., "example"). This name is case The name requested (e.g., "example"). This name is case
sensitive. Names that match other registered names in a case sensitive. Names that match other registered names in a case
insensitive manner SHOULD NOT be accepted. insensitive manner SHOULD NOT be accepted.
Change Controller: Change Controller:
For Standards Track RFCs, state "IETF". For others, give the name For Standards Track RFCs, state "IETF". For others, give the name
of the responsible party. Other details (e.g., postal address, of the responsible party. Other details (e.g., postal address,
email address, home page URI) may also be included. email address, home page URI) may also be included.
Implementation Requirements: Implementation Requirements:
The algorithm implementation requirements, which must be one the The key type implementation requirements, which must be one the
words REQUIRED, RECOMMENDED, OPTIONAL, or DEPRECATED. Optionally, words Required, Recommended, Optional, or Deprecated. Optionally,
the word can be followed by a "+" or "-". The use of "+" the word can be followed by a "+" or "-". The use of "+"
indicates that the requirement strength is likely to be increased indicates that the requirement strength is likely to be increased
in a future version of the specification. The use of "-" in a future version of the specification. The use of "-"
indicates that the requirement strength is likely to be decreased indicates that the requirement strength is likely to be decreased
in a future version of the specification. in a future version of the specification.
Specification Document(s): Specification Document(s):
Reference to the document(s) that specify the parameter, Reference to the document(s) that specify the parameter,
preferably including URI(s) that can be used to retrieve copies of preferably including URI(s) that can be used to retrieve copies of
the document(s). An indication of the relevant sections may also the document(s). An indication of the relevant sections may also
be included but is not required. be included but is not required.
6.2.2. Initial Registry Contents 6.2.2. Initial Registry Contents
This specification registers the values defined in Section 5.1.
o "kty" Parameter Value: "EC" o "kty" Parameter Value: "EC"
o Implementation Requirements: RECOMMENDED+ o Implementation Requirements: Recommended+
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 5.2 of [[ this document ]] o Specification Document(s): Section 5.2 of [[ this document ]]
o "kty" Parameter Value: "RSA" o "kty" Parameter Value: "RSA"
o Implementation Requirements: REQUIRED o Implementation Requirements: Required
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 5.3 of [[ this document ]] o Specification Document(s): Section 5.3 of [[ this document ]]
o "kty" Parameter Value: "oct" o "kty" Parameter Value: "oct"
o Implementation Requirements: RECOMMENDED+ o Implementation Requirements: Required
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 5.3.3 of [[ this document ]] o Specification Document(s): Section 5.4 of [[ this document ]]
6.3. JSON Web Key Parameters Registration 6.3. JSON Web Key Parameters Registration
This specification registers the parameter names defined in Sections This specification registers the parameter names defined in Sections
5.2, 5.3, and 5.3.3 in the IANA JSON Web Key Parameters registry 5.2, 5.3, and 5.4 in the IANA JSON Web Key Parameters registry [JWK].
[JWK].
6.3.1. Registry Contents 6.3.1. Registry Contents
o Parameter Name: "crv" o Parameter Name: "crv"
o Parameter Information Class: Public o Parameter Information Class: Public
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 5.2.1.1 of [[ this document ]] o Specification Document(s): Section 5.2.1.1 of [[ this document ]]
o Parameter Name: "x" o Parameter Name: "x"
o Parameter Information Class: Public o Parameter Information Class: Public
skipping to change at page 47, line 5 skipping to change at page 45, line 11
o Specification Document(s): Section 5.3.2.6 of [[ this document ]] o Specification Document(s): Section 5.3.2.6 of [[ this document ]]
o Parameter Name: "oth" o Parameter Name: "oth"
o Parameter Information Class: Private o Parameter Information Class: Private
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 5.3.2.7 of [[ this document ]] o Specification Document(s): Section 5.3.2.7 of [[ this document ]]
o Parameter Name: "k" o Parameter Name: "k"
o Parameter Information Class: Private o Parameter Information Class: Private
o Change Controller: IETF o Change Controller: IETF
o Specification Document(s): Section 5.3.3.1 of [[ this document ]] o Specification Document(s): Section 5.4.1 of [[ this document ]]
6.4. Registration of JWE Header Parameter Names 6.4. Registration of JWE Header Parameter Names
This specification registers the Header Parameter Names defined in This specification registers the Header Parameter Names defined in
Section 4.7.1, Section 4.8.1, and Section 4.9.1 in the IANA JSON Web Section 4.7.1, Section 4.8.1, and Section 4.9.1 in the IANA JSON Web
Signature and Encryption Header Parameters registry [JWS]. Signature and Encryption Header Parameters registry [JWS].
6.4.1. Registry Contents 6.4.1. Registry Contents
o Header Parameter Name: "epk" o Header Parameter Name: "epk"
skipping to change at page 49, line 24 skipping to change at page 47, line 29
send certificates with keys that would result in excessive send certificates with keys that would result in excessive
cryptographic processing, for example, keys larger than those cryptographic processing, for example, keys larger than those
mandated in this specification, which could swamp the processing mandated in this specification, which could swamp the processing
element. Agents that use such keys without first validating the element. Agents that use such keys without first validating the
certificate to a trust anchor are advised to have some sort of certificate to a trust anchor are advised to have some sort of
cryptographic resource management system to prevent such attacks. cryptographic resource management system to prevent such attacks.
7.1. Reusing Key Material when Encrypting Keys 7.1. Reusing Key Material when Encrypting Keys
It is NOT RECOMMENDED to reuse the same key material (Key Encryption It is NOT RECOMMENDED to reuse the same key material (Key Encryption
Key, Content Master Key, Initialization Vector, etc.) to encrypt Key, Content Encryption Key, Initialization Vector, etc.) to encrypt
multiple JWK or JWK Set objects, or to encrypt the same JWK or JWK multiple JWK or JWK Set objects, or to encrypt the same JWK or JWK
Set object multiple times. One suggestion for preventing re-use is Set object multiple times. One suggestion for preventing re-use is
to always generate a new set key material for each encryption to always generate a new set key material for each encryption
operation, based on the considerations noted in this document as well operation, based on the considerations noted in this document as well
as from [RFC4086]. as from [RFC4086].
7.2. Password Considerations 7.2. Password Considerations
While convenient for end users, passwords are vulnerable to a number While convenient for end users, passwords are vulnerable to a number
of attacks. To help mitigate some of these limitations, this of attacks. To help mitigate some of these limitations, this
skipping to change at page 49, line 48 skipping to change at page 48, line 5
However, the strength of the password still has a significant impact. However, the strength of the password still has a significant impact.
A high-entry password has greater resistance to dictionary attacks. A high-entry password has greater resistance to dictionary attacks.
[NIST-800-63-1] contains guidelines for estimating password entropy, [NIST-800-63-1] contains guidelines for estimating password entropy,
which can help applications and users generate stronger passwords. which can help applications and users generate stronger passwords.
An ideal password is one that is as large (or larger) than the An ideal password is one that is as large (or larger) than the
derived key length but less than the PRF's block size. Passwords derived key length but less than the PRF's block size. Passwords
larger than the PRF's block size are first hashed, which reduces an larger than the PRF's block size are first hashed, which reduces an
attacker's effective search space to the length of the hash algorithm attacker's effective search space to the length of the hash algorithm
(32 octets for HMAC SHA-256). It is RECOMMENDED that the password be (32 octets for HMAC SHA-256). It is RECOMMENDED that the password be
no longer than 64 octets long for "PBES2-HS256+A256KW". no longer than 64 octets long for "PBES2-HS512+A256KW".
Still, care needs to be taken in where and how password-based Still, care needs to be taken in where and how password-based
encryption is used. Such algorithms MUST NOT be used where the encryption is used. Such algorithms MUST NOT be used where the
attacker can make an indefinite number of attempts to circumvent the attacker can make an indefinite number of attempts to circumvent the
protection. protection.
8. Internationalization Considerations 8. Internationalization Considerations
Passwords obtained from users are likely to require preparation and Passwords obtained from users are likely to require preparation and
normalization to account for differences of octet sequences generated normalization to account for differences of octet sequences generated
skipping to change at page 50, line 24 skipping to change at page 48, line 30
9. References 9. References
9.1. Normative References 9.1. Normative References
[AES] National Institute of Standards and Technology (NIST), [AES] National Institute of Standards and Technology (NIST),
"Advanced Encryption Standard (AES)", FIPS PUB 197, "Advanced Encryption Standard (AES)", FIPS PUB 197,
November 2001. November 2001.
[DSS] National Institute of Standards and Technology, "Digital [DSS] National Institute of Standards and Technology, "Digital
Signature Standard (DSS)", FIPS PUB 186-3, June 2009. Signature Standard (DSS)", FIPS PUB 186-4, July 2013.
[I-D.melnikov-precis-saslprepbis] [I-D.melnikov-precis-saslprepbis]
Saint-Andre, P. and A. Melnikov, "Preparation and Saint-Andre, P. and A. Melnikov, "Preparation and
Comparison of Internationalized Strings Representing Comparison of Internationalized Strings Representing
Simple User Names and Passwords", Simple User Names and Passwords",
draft-melnikov-precis-saslprepbis-04 (work in progress), draft-melnikov-precis-saslprepbis-04 (work in progress),
September 2012. September 2012.
[JWE] Jones, M., Rescorla, E., and J. Hildebrand, "JSON Web [JWE] Jones, M., Rescorla, E., and J. Hildebrand, "JSON Web
Encryption (JWE)", draft-ietf-jose-json-web-encryption Encryption (JWE)", draft-ietf-jose-json-web-encryption
(work in progress), July 2013. (work in progress), September 2013.
[JWK] Jones, M., "JSON Web Key (JWK)", [JWK] Jones, M., "JSON Web Key (JWK)",
draft-ietf-jose-json-web-key (work in progress), draft-ietf-jose-json-web-key (work in progress),
July 2013. September 2013.
[JWS] Jones, M., Bradley, J., and N. Sakimura, "JSON Web [JWS] Jones, M., Bradley, J., and N. Sakimura, "JSON Web
Signature (JWS)", draft-ietf-jose-json-web-signature (work Signature (JWS)", draft-ietf-jose-json-web-signature (work
in progress), July 2013. in progress), September 2013.
[NIST.800-38A] [NIST.800-38A]
National Institute of Standards and Technology (NIST), National Institute of Standards and Technology (NIST),
"Recommendation for Block Cipher Modes of Operation", "Recommendation for Block Cipher Modes of Operation",
NIST PUB 800-38A, December 2001. NIST PUB 800-38A, December 2001.
[NIST.800-38D] [NIST.800-38D]
National Institute of Standards and Technology (NIST), National Institute of Standards and Technology (NIST),
"Recommendation for Block Cipher Modes of Operation: "Recommendation for Block Cipher Modes of Operation:
Galois/Counter Mode (GCM) and GMAC", NIST PUB 800-38D, Galois/Counter Mode (GCM) and GMAC", NIST PUB 800-38D,
skipping to change at page 64, line 21 skipping to change at page 62, line 21
"crv":"P-256", "crv":"P-256",
"x":"gI0GAILBdu7T53akrFmMyGcsF3n5dO7MmwNBHKW5SV0", "x":"gI0GAILBdu7T53akrFmMyGcsF3n5dO7MmwNBHKW5SV0",
"y":"SLW_xSffzlPWrHEVI30DHM_4egVwt3NQqeUD7nMFpps" "y":"SLW_xSffzlPWrHEVI30DHM_4egVwt3NQqeUD7nMFpps"
} }
} }
The resulting Concat KDF [NIST.800-56A] parameter values are: The resulting Concat KDF [NIST.800-56A] parameter values are:
Z This is set to the ECDH-ES key agreement output. (This value is Z This is set to the ECDH-ES key agreement output. (This value is
often not directly exposed by libraries, due to NIST security often not directly exposed by libraries, due to NIST security
requirements, and only serves as an input to a KDF.) requirements, and only serves as an input to a KDF.) In this
example, Z is the octet sequence:
[158, 86, 217, 29, 129, 113, 53, 211, 114, 131, 66, 131, 191, 132,
38, 156, 251, 49, 110, 163, 218, 128, 106, 72, 246, 218, 167, 121,
140, 254, 144, 196].
keydatalen This value is 128 - the number of bits in the desired keydatalen This value is 128 - the number of bits in the desired
output key (because "A128GCM" uses a 128 bit key). output key (because "A128GCM" uses a 128 bit key).
AlgorithmID This is set to the octets representing the UTF-8 string AlgorithmID This is set to the octets representing the UTF-8 string
"A128GCM" - [65, 49, 50, 56, 71, 67, 77]. "A128GCM" - [65, 49, 50, 56, 71, 67, 77].
PartyUInfo This is set to the octets representing the 32 bit big PartyUInfo This is set to the octets representing the 32 bit big
endian value 5 - [0, 0, 0, 5] - the number of octets in the endian value 5 - [0, 0, 0, 5] - the number of octets in the
PartyUInfo content "Alice", followed, by the octets representing PartyUInfo content "Alice", followed, by the octets representing
skipping to change at page 64, line 44 skipping to change at page 62, line 48
PartyVInfo This is set to the octets representing the 32 bit big PartyVInfo This is set to the octets representing the 32 bit big
endian value 3 - [0, 0, 0, 3] - the number of octets in the endian value 3 - [0, 0, 0, 3] - the number of octets in the
PartyUInfo content "Bob", followed, by the octets representing the PartyUInfo content "Bob", followed, by the octets representing the
UTF-8 string "Bob" - [66, 111, 98]. UTF-8 string "Bob" - [66, 111, 98].
SuppPubInfo This is set to the octets representing the 32 bit big SuppPubInfo This is set to the octets representing the 32 bit big
endian value 128 - [0, 0, 0, 128] - the keydatalen value. endian value 128 - [0, 0, 0, 128] - the keydatalen value.
SuppPrivInfo This is set to the empty octet sequence. SuppPrivInfo This is set to the empty octet sequence.
The resulting derived key, represented as a base64url encoded value Concatenating the parameters AlgorithmID through SuppPubInfo results
is: in an otherInfo value of:
[65, 49, 50, 56, 71, 67, 77, 0, 0, 0, 5, 65, 108, 105, 99, 101, 0, 0,
0, 3, 66, 111, 98, 0, 0, 0, 128]
Concatenating the round number 1 ([0, 0, 0, 1]), Z, and the otherInfo
value results in the Concat KDF round 1 hash input of:
[0, 0, 0, 1,
158, 86, 217, 29, 129, 113, 53, 211, 114, 131, 66, 131, 191, 132, 38,
156, 251, 49, 110, 163, 218, 128, 106, 72, 246, 218, 167, 121, 140,
254, 144, 196,
65, 49, 50, 56, 71, 67, 77, 0, 0, 0, 5, 65, 108, 105, 99, 101, 0, 0,
0, 3, 66, 111, 98, 0, 0, 0, 128]
jSNmj9QK9ZGQJ2xg5_TJpA The resulting derived key, which is the first 128 bits of the round 1
hash output is:
[186, 193, 41, 192, 82, 2, 254, 170, 230, 4, 76, 103, 180, 92, 49,
48]
The base64url encoded representation of this derived key is:
usEpwFIC_qrmBExntFwxMA
Appendix E. Acknowledgements Appendix E. Acknowledgements
Solutions for signing and encrypting JSON content were previously Solutions for signing and encrypting JSON content were previously
explored by Magic Signatures [MagicSignatures], JSON Simple Sign explored by Magic Signatures [MagicSignatures], JSON Simple Sign
[JSS], Canvas Applications [CanvasApp], JSON Simple Encryption [JSE], [JSS], Canvas Applications [CanvasApp], JSON Simple Encryption [JSE],
and JavaScript Message Security Format [I-D.rescorla-jsms], all of and JavaScript Message Security Format [I-D.rescorla-jsms], all of
which influenced this draft. which influenced this draft.
The Authenticated Encryption with AES-CBC and HMAC-SHA The Authenticated Encryption with AES-CBC and HMAC-SHA
skipping to change at page 65, line 44 skipping to change at page 64, line 14
Sean Turner. Sean Turner.
Jim Schaad and Karen O'Donoghue chaired the JOSE working group and Jim Schaad and Karen O'Donoghue chaired the JOSE working group and
Sean Turner and Stephen Farrell served as Security area directors Sean Turner and Stephen Farrell served as Security area directors
during the creation of this specification. during the creation of this specification.
Appendix F. Document History Appendix F. Document History
[[ to be removed by the RFC editor before publication as an RFC ]] [[ to be removed by the RFC editor before publication as an RFC ]]
-15
o Changed statements about rejecting JWSs to statements about
validation failing, addressing issue #35.
o Stated that changes of implementation requirements are only
permitted on a Specification Required basis, addressing issue #38.
o Made "oct" a required key type, addressing issue #40.
o Updated the example ECDH-ES key agreement values.
o Changes to address editorial and minor issues #34, #37, #49, #123,
#124, #125, #130, #132, #133, #138, #139, #140, #142, #143, #144,
#145, #148, #149, #150, and #162.
-14 -14
o Removed "PBKDF2" key type and added "p2s" and "p2c" header o Removed "PBKDF2" key type and added "p2s" and "p2c" header
parameters for use with the PBES2 algorithms. parameters for use with the PBES2 algorithms.
o Made the RSA private key parameters that are there to enable o Made the RSA private key parameters that are there to enable
optimizations be RECOMMENDED rather than REQUIRED. optimizations be RECOMMENDED rather than REQUIRED.
o Added algorithm identifiers for AES algorithms using 192 bit keys o Added algorithm identifiers for AES algorithms using 192 bit keys
and for RSASSA-PSS using HMAC SHA-384. and for RSASSA-PSS using HMAC SHA-384.
 End of changes. 146 change blocks. 
395 lines changed or deleted 347 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/