< draft-ietf-jose-json-web-encryption-01.txt   draft-ietf-jose-json-web-encryption-02.txt >
JOSE Working Group M. Jones JOSE Working Group M. Jones
Internet-Draft Microsoft Internet-Draft Microsoft
Intended status: Standards Track E. Rescorla Intended status: Standards Track E. Rescorla
Expires: September 13, 2012 RTFM, Inc. Expires: November 13, 2012 RTFM
J. Hildebrand J. Hildebrand
Cisco Systems, Inc. Cisco
March 12, 2012 May 12, 2012
JSON Web Encryption (JWE) JSON Web Encryption (JWE)
draft-ietf-jose-json-web-encryption-01 draft-ietf-jose-json-web-encryption-02
Abstract Abstract
JSON Web Encryption (JWE) is a means of representing encrypted JSON Web Encryption (JWE) is a means of representing encrypted
content using JSON data structures. Cryptographic algorithms and content using JSON data structures. Cryptographic algorithms and
identifiers used with this specification are enumerated in the identifiers used with this specification are enumerated in the
separate JSON Web Algorithms (JWA) specification. Related digital separate JSON Web Algorithms (JWA) specification. Related digital
signature and HMAC capabilities are described in the separate JSON signature and MAC capabilities are described in the separate JSON Web
Web Signature (JWS) specification. Signature (JWS) specification.
Requirements Language Requirements Language
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 RFC 2119 [RFC2119]. document are to be interpreted as described in RFC 2119 [RFC2119].
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
skipping to change at page 1, line 44 skipping to change at page 1, line 44
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 September 13, 2012. This Internet-Draft will expire on November 13, 2012.
Copyright Notice Copyright Notice
Copyright (c) 2012 IETF Trust and the persons identified as the Copyright (c) 2012 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
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 4
3. JSON Web Encryption (JWE) Overview . . . . . . . . . . . . . . 4 3. JSON Web Encryption (JWE) Overview . . . . . . . . . . . . . . 6
3.1. Example JWE with an Integrated Integrity Check . . . . . . 5 3.1. Example JWE with an Integrated Integrity Check . . . . . . 6
3.2. Example JWE with a Separate Integrity Check . . . . . . . 6 3.2. Example JWE with a Separate Integrity Check . . . . . . . 7
4. JWE Header . . . . . . . . . . . . . . . . . . . . . . . . . . 7 4. JWE Header . . . . . . . . . . . . . . . . . . . . . . . . . . 8
4.1. Reserved Header Parameter Names . . . . . . . . . . . . . 7 4.1. Reserved Header Parameter Names . . . . . . . . . . . . . 8
4.2. Public Header Parameter Names . . . . . . . . . . . . . . 14 4.1.1. "alg" (Algorithm) Header Parameter . . . . . . . . . . 9
4.3. Private Header Parameter Names . . . . . . . . . . . . . . 14 4.1.2. "enc" (Encryption Method) Header Parameter . . . . . . 9
5. Message Encryption . . . . . . . . . . . . . . . . . . . . . . 14 4.1.3. "int" (Integrity Algorithm) Header Parameter . . . . . 9
6. Message Decryption . . . . . . . . . . . . . . . . . . . . . . 16 4.1.4. "iv" (Initialization Vector) Header Parameter . . . . 10
7. Key Derivation . . . . . . . . . . . . . . . . . . . . . . . . 17 4.1.5. "epk" (Ephemeral Public Key) Header Parameter . . . . 10
8. CMK Encryption . . . . . . . . . . . . . . . . . . . . . . . . 17 4.1.6. "zip" (Compression Algorithm) Header Parameter . . . . 10
8.1. Asymmetric Encryption . . . . . . . . . . . . . . . . . . 17 4.1.7. "jku" (JWK Set URL) Header Parameter . . . . . . . . . 10
8.2. Symmetric Encryption . . . . . . . . . . . . . . . . . . . 18 4.1.8. "jwk" (JSON Web Key) Header Parameter . . . . . . . . 10
9. Integrity Value Calculation . . . . . . . . . . . . . . . . . 18 4.1.9. "x5u" (X.509 URL) Header Parameter . . . . . . . . . . 11
10. Encrypting JWEs with Cryptographic Algorithms . . . . . . . . 18 4.1.10. "x5t" (X.509 Certificate Thumbprint) Header
11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 19 Parameter . . . . . . . . . . . . . . . . . . . . . . 11
4.1.11. "x5c" (X.509 Certificate Chain) Header Parameter . . . 11
4.1.12. "kid" (Key ID) Header Parameter . . . . . . . . . . . 12
4.1.13. "typ" (Type) Header Parameter . . . . . . . . . . . . 12
4.2. Public Header Parameter Names . . . . . . . . . . . . . . 12
4.3. Private Header Parameter Names . . . . . . . . . . . . . . 12
5. Message Encryption . . . . . . . . . . . . . . . . . . . . . . 13
6. Message Decryption . . . . . . . . . . . . . . . . . . . . . . 14
7. Key Derivation . . . . . . . . . . . . . . . . . . . . . . . . 15
8. CMK Encryption . . . . . . . . . . . . . . . . . . . . . . . . 16
8.1. Asymmetric Encryption . . . . . . . . . . . . . . . . . . 16
8.2. Symmetric Encryption . . . . . . . . . . . . . . . . . . . 16
9. Integrity Value Calculation . . . . . . . . . . . . . . . . . 16
10. Encrypting JWEs with Cryptographic Algorithms . . . . . . . . 17
11. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 17
11.1. Registration of application/jwe MIME Media Type . . . . . 17
11.2. Registration of "JWE" Type Value . . . . . . . . . . . . . 18
12. Security Considerations . . . . . . . . . . . . . . . . . . . 19 12. Security Considerations . . . . . . . . . . . . . . . . . . . 19
12.1. Unicode Comparison Security Issues . . . . . . . . . . . . 19 13. Open Issues and Things To Be Done (TBD) . . . . . . . . . . . 19
13. Open Issues and Things To Be Done (TBD) . . . . . . . . . . . 20 14. References . . . . . . . . . . . . . . . . . . . . . . . . . . 19
14. References . . . . . . . . . . . . . . . . . . . . . . . . . . 21 14.1. Normative References . . . . . . . . . . . . . . . . . . . 19
14.1. Normative References . . . . . . . . . . . . . . . . . . . 21 14.2. Informative References . . . . . . . . . . . . . . . . . . 20
14.2. Informative References . . . . . . . . . . . . . . . . . . 22 Appendix A. JWE Examples . . . . . . . . . . . . . . . . . . . . 21
Appendix A. JWE Examples . . . . . . . . . . . . . . . . . . . . 23 A.1. JWE Example using TBD Algorithm . . . . . . . . . . . . . 21
A.1. JWE Example using TBD Algorithm . . . . . . . . . . . . . 23 A.1.1. Encrypting . . . . . . . . . . . . . . . . . . . . . . 21
A.1.1. Encrypting . . . . . . . . . . . . . . . . . . . . . . 23 A.1.2. Decrypting . . . . . . . . . . . . . . . . . . . . . . 21
A.1.2. Decrypting . . . . . . . . . . . . . . . . . . . . . . 23 Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 21
Appendix B. Acknowledgements . . . . . . . . . . . . . . . . . . 23 Appendix C. Document History . . . . . . . . . . . . . . . . . . 22
Appendix C. Document History . . . . . . . . . . . . . . . . . . 23 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 23
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 24
1. Introduction 1. Introduction
JSON Web Encryption (JWE) is a compact encryption format intended for JSON Web Encryption (JWE) is a compact encryption format intended for
space constrained environments such as HTTP Authorization headers and space constrained environments such as HTTP Authorization headers and
URI query parameters. It provides a wrapper for encrypted content URI query parameters. It provides a wrapper for encrypted content
using JSON RFC 4627 [RFC4627] data structures. The JWE encryption using JSON RFC 4627 [RFC4627] data structures. The JWE encryption
mechanisms are independent of the type of content being encrypted. mechanisms are independent of the type of content being encrypted.
Cryptographic algorithms and identifiers used with this specification Cryptographic algorithms and identifiers used with this specification
are enumerated in the separate JSON Web Algorithms (JWA) [JWA] are enumerated in the separate JSON Web Algorithms (JWA) [JWA]
specification. Related digital signature and HMAC capabilities are specification. Related digital signature and MAC capabilities are
described in the separate JSON Web Signature (JWS) [JWS] described in the separate JSON Web Signature (JWS) [JWS]
specification. specification.
2. Terminology 2. Terminology
JSON Web Encryption (JWE) A data structure representing an encrypted JSON Web Encryption (JWE) A data structure representing an encrypted
version of a Plaintext. The structure consists of four parts: the version of a Plaintext. The structure consists of four parts: the
JWE Header, the JWE Encrypted Key, the JWE Ciphertext, and the JWE JWE Header, the JWE Encrypted Key, the JWE Ciphertext, and the JWE
Integrity Value. Integrity Value.
Plaintext The bytes to be encrypted - a.k.a., the message. Plaintext The bytes to be encrypted - a.k.a., the message. The
plaintext can contain an arbitrary sequence of bytes.
Ciphertext The encrypted version of the Plaintext. Ciphertext The encrypted version of the Plaintext.
Content Encryption Key (CEK) A symmetric key used to encrypt the Content Encryption Key (CEK) A symmetric key used to encrypt the
Plaintext for the recipient to produce the Ciphertext. Plaintext for the recipient to produce the Ciphertext.
Content Integrity Key (CIK) A key used with an HMAC function to Content Integrity Key (CIK) A key used with a MAC function to ensure
ensure the integrity of the Ciphertext and the parameters used to the integrity of the Ciphertext and the parameters used to create
create it. it.
Content Master Key (CMK) A randomly generated key from which the CEK Content Master Key (CMK) A key from which the CEK and CIK are
and CIK are derived, which is encrypted to the recipient as the derived. When key wrapping or key encryption are employed, the
JWE Encrypted Key. CMK is randomly generated and encrypted to the recipient as the
JWE Encrypted Key. When key agreement is employed, the CMK is the
result of the key agreement algorithm.
JWE Header A string representing a JSON object that describes the JWE Header A string representing a JSON object that describes the
encryption operations applied to create the JWE Encrypted Key and encryption operations applied to create the JWE Encrypted Key, the
the JWE Ciphertext. JWE Ciphertext, and the JWE Integrity Value.
JWE Encrypted Key The Content Encryption Key (CEK) is encrypted with JWE Encrypted Key When key wrapping or key encryption are employed,
the intended recipient's key and the resulting encrypted content the Content Master Key (CMK) is encrypted with the intended
is recorded as a byte array, which is referred to as the JWE recipient's key and the resulting encrypted content is recorded as
Encrypted Key. a byte array, which is referred to as the JWE Encrypted Key.
Otherwise, when key agreement is employed, the JWE Encrypted Key
is the empty byte array.
JWE Ciphertext A byte array containing the Ciphertext. JWE Ciphertext A byte array containing the Ciphertext.
JWE Integrity Value A byte array containing a HMAC value that JWE Integrity Value A byte array containing a MAC value that ensures
ensures the integrity of the Ciphertext and the parameters used to the integrity of the Ciphertext and the parameters used to create
create it. it.
Encoded JWE Header Base64url encoding of the bytes of the UTF-8 RFC Encoded JWE Header Base64url encoding of the bytes of the UTF-8 RFC
3629 [RFC3629] representation of the JWE Header. 3629 [RFC3629] representation of the JWE Header.
Encoded JWE Encrypted Key Base64url encoding of the JWE Encrypted Encoded JWE Encrypted Key Base64url encoding of the JWE Encrypted
Key. Key.
Encoded JWE Ciphertext Base64url encoding of the JWE Ciphertext. Encoded JWE Ciphertext Base64url encoding of the JWE Ciphertext.
Encoded JWE Integrity Value Base64url encoding of the JWE Integrity Encoded JWE Integrity Value Base64url encoding of the JWE Integrity
skipping to change at page 4, line 46 skipping to change at page 5, line 47
integrated content integrity check. AES Galois/Counter Mode (GCM) integrated content integrity check. AES Galois/Counter Mode (GCM)
is one such algorithm. is one such algorithm.
Base64url Encoding For the purposes of this specification, this term Base64url Encoding For the purposes of this specification, this term
always refers to the URL- and filename-safe Base64 encoding always refers to the URL- and filename-safe Base64 encoding
described in RFC 4648 [RFC4648], Section 5, with the (non URL- described in RFC 4648 [RFC4648], Section 5, with the (non URL-
safe) '=' padding characters omitted, as permitted by Section 3.2. safe) '=' padding characters omitted, as permitted by Section 3.2.
(See Appendix B of [JWS] for notes on implementing base64url (See Appendix B of [JWS] for notes on implementing base64url
encoding without padding.) encoding without padding.)
StringOrURI A JSON string value, with the additional requirement
that while arbitrary string values MAY be used, any value
containing a ":" character MUST be a URI as defined in RFC 3986
[RFC3986].
3. JSON Web Encryption (JWE) Overview 3. JSON Web Encryption (JWE) Overview
JWE represents encrypted content using JSON data structures and JWE represents encrypted content using JSON data structures and
base64url encoding. The representation consists of four parts: the base64url encoding. The representation consists of four parts: the
JWE Header, the JWE Encrypted Key, the JWE Ciphertext, and the JWE JWE Header, the JWE Encrypted Key, the JWE Ciphertext, and the JWE
Integrity Value. In the Compact Serialization, the four parts are Integrity Value. In the Compact Serialization, the four parts are
base64url-encoded for transmission, and represented as the base64url-encoded for transmission, and represented as the
concatenation of the encoded strings in that order, with the four concatenation of the encoded strings in that order, with the four
strings being separated by period ('.') characters. (A JSON strings being separated by period ('.') characters. (A JSON
Serialization for this information is defined in the separate JSON Serialization for this information is defined in the separate JSON
skipping to change at page 5, line 24 skipping to change at page 6, line 31
3.1. Example JWE with an Integrated Integrity Check 3.1. Example JWE with an Integrated Integrity Check
The following example JWE Header declares that: The following example JWE Header declares that:
o the Content Master Key is encrypted to the recipient using the o the Content Master Key is encrypted to the recipient using the
RSA-PKCS1_1.5 algorithm to produce the JWE Encrypted Key, RSA-PKCS1_1.5 algorithm to produce the JWE Encrypted Key,
o the Plaintext is encrypted using the AES-256-GCM algorithm to o the Plaintext is encrypted using the AES-256-GCM algorithm to
produce the JWE Ciphertext, produce the JWE Ciphertext,
o the specified 64-bit Initialization Vector with the base64url o the specified 96 bit Initialization Vector with the base64url
encoding "__79_Pv6-fg" was used, and encoding "__79_Pv6-fj39vX0" was used, and
o a JSON Web Key (JWK) representation of the public key used to o a JSON Web Key Set (JWK Set) representation of the public key used
encrypt the JWE is located at to encrypt the JWE is located at
"https://example.com/public_key.jwk". "https://example.com/public_key.jwk".
{"alg":"RSA1_5", {"alg":"RSA1_5",
"enc":"A256GCM", "enc":"A256GCM",
"iv":"__79_Pv6-fg", "iv":"__79_Pv6-fj39vX0",
"jku":"https://example.com/public_key.jwk"} "jku":"https://example.com/public_key.jwk"}
Base64url encoding the bytes of the UTF-8 representation of the JWE Base64url encoding the bytes of the UTF-8 representation of the JWE
Header yields this Encoded JWE Header value (with line breaks for Header yields this Encoded JWE Header value (with line breaks for
display purposes only): display purposes only):
eyJhbGciOiJSU0ExXzUiLA0KICJlbmMiOiJBMjU2R0NNIiwNCiAiaXYiOiJfXzc5 eyJhbGciOiJSU0ExXzUiLA0KICJlbmMiOiJBMjU2R0NNIiwNCiAiaXYiOiJfXzc5
X1B2Ni1mZyIsDQogImprdSI6Imh0dHBzOi8vZXhhbXBsZS5jb20vcHVibGljX2tl X1B2Ni1mZyIsDQogImprdSI6Imh0dHBzOi8vZXhhbXBsZS5jb20vcHVibGljX2tl
eS5qd2sifQ eS5qd2sifQ
TBD: Finish this example by showing generation of a Content Master TBD: Finish this example by showing generation of a Content Master
Key (CMK), saying that the CMK is used as the CEK and there is no Key (CMK), saying that the CMK is used as the CEK and there is no
separate integrity check since AES GCM is an AEAD algorithm, using separate integrity check since AES GCM is an AEAD algorithm, using
the CEK to encrypt the Plaintext to produce the Ciphertext, using the the recipient's key to encrypt the CMK to produce the JWE Encrypted
recipient's key to encrypt the CMK to produce the JWE Encrypted Key, Key, using the CEK, IV, Encoded JWE Header, and Encoded JWE Encrypted
base64url encoding these values, and assembling the result. Key to encrypt the Plaintext to produce the Ciphertext and
"authentication tag" value, base64url encoding these values, and
assembling the result.
Concatenating these parts in the order Concatenating these parts in the order
Header.EncryptedKey.Ciphertext.IntegrityValue with period characters Header.EncryptedKey.Ciphertext.IntegrityValue with period characters
between the parts yields this complete JWE representation (with line between the parts yields this complete JWE representation (with line
breaks for display purposes only): breaks for display purposes only):
eyJhbGciOiJSU0ExXzUiLA0KICJlbmMiOiJBMjU2R0NNIiwNCiAiaXYiOiJfXzc5 eyJhbGciOiJSU0ExXzUiLA0KICJlbmMiOiJBMjU2R0NNIiwNCiAiaXYiOiJfXzc5
X1B2Ni1mZyIsDQogImprdSI6Imh0dHBzOi8vZXhhbXBsZS5jb20vcHVibGljX2tl X1B2Ni1mZyIsDQogImprdSI6Imh0dHBzOi8vZXhhbXBsZS5jb20vcHVibGljX2tl
eS5qd2sifQ eS5qd2sifQ
. .
TBD_encrypted_key_value_TBD TBD_encrypted_key_value_TBD
. .
TBD_ciphertext_value_TBD TBD_ciphertext_value_TBD
. .
TBD_integrity_value_TBD
3.2. Example JWE with a Separate Integrity Check 3.2. Example JWE with a Separate Integrity Check
The following example JWE Header declares that: The following example JWE Header declares that:
o the Content Master Key is encrypted to the recipient using the o the Content Master Key is encrypted to the recipient using the
RSA-PKCS1_1.5 algorithm to produce the JWE Encrypted Key, RSA-PKCS1_1.5 algorithm to produce the JWE Encrypted Key,
o the Plaintext is encrypted using the AES-256-CBC algorithm to o the Plaintext is encrypted using the AES-256-CBC algorithm to
produce the JWE Ciphertext, produce the JWE Ciphertext,
o the JWE Integrity Value safeguarding the integrity of the o the JWE Integrity Value safeguarding the integrity of the
Ciphertext and the parameters used to create it was computed with Ciphertext and the parameters used to create it was computed with
the HMAC SHA-256 algorithm, the HMAC SHA-256 algorithm,
o the specified 64-bit Initialization Vector with the base64url o the specified 128 bit Initialization Vector with the base64url
encoding "Mz-mW_4JHfg" was used, and encoding "AxY8DCtDaGlsbGljb3RoZQ" was used, and
o the thumbprint of the X.509 certificate that corresponds to the o the thumbprint of the X.509 certificate that corresponds to the
key used to encrypt the JWE has the base64url encoding key used to encrypt the JWE has the base64url encoding
"7noOPq-hJ1_hCnvWh6IeYI2w9Q0". "7noOPq-hJ1_hCnvWh6IeYI2w9Q0".
{"alg":"RSA1_5", {"alg":"RSA1_5",
"enc":"A256CBC", "enc":"A256CBC",
"int":"HS256", "int":"HS256",
"iv":"Mz-mW_4JHfg", "iv":"AxY8DCtDaGlsbGljb3RoZQ",
"x5t":"7noOPq-hJ1_hCnvWh6IeYI2w9Q0"} "x5t":"7noOPq-hJ1_hCnvWh6IeYI2w9Q0"}
Because AES CBC is not an AEAD algorithm (and so provides no Because AES CBC is not an AEAD algorithm (and so provides no
integrated content integrity check), a separate integrity check value integrated content integrity check), a separate integrity check value
is used. is used.
Base64url encoding the bytes of the UTF-8 representation of the JWE Base64url encoding the bytes of the UTF-8 representation of the JWE
Header yields this Encoded JWE Header value (with line breaks for Header yields this Encoded JWE Header value (with line breaks for
display purposes only): display purposes only):
eyJhbGciOiJSU0ExXzUiLA0KICJlbmMiOiJBMjU2Q0JDIiwNCiAiaW50IjoiSFMy eyJhbGciOiJSU0ExXzUiLA0KICJlbmMiOiJBMjU2Q0JDIiwNCiAiaW50IjoiSFMy
skipping to change at page 7, line 4 skipping to change at page 8, line 13
Because AES CBC is not an AEAD algorithm (and so provides no Because AES CBC is not an AEAD algorithm (and so provides no
integrated content integrity check), a separate integrity check value integrated content integrity check), a separate integrity check value
is used. is used.
Base64url encoding the bytes of the UTF-8 representation of the JWE Base64url encoding the bytes of the UTF-8 representation of the JWE
Header yields this Encoded JWE Header value (with line breaks for Header yields this Encoded JWE Header value (with line breaks for
display purposes only): display purposes only):
eyJhbGciOiJSU0ExXzUiLA0KICJlbmMiOiJBMjU2Q0JDIiwNCiAiaW50IjoiSFMy eyJhbGciOiJSU0ExXzUiLA0KICJlbmMiOiJBMjU2Q0JDIiwNCiAiaW50IjoiSFMy
NTYiLA0KICJpdiI6Ik16LW1XXzRKSGZnIiwNCiAieDV0IjoiN25vT1BxLWhKMV9o NTYiLA0KICJpdiI6Ik16LW1XXzRKSGZnIiwNCiAieDV0IjoiN25vT1BxLWhKMV9o
Q252V2g2SWVZSTJ3OVEwIn0 Q252V2g2SWVZSTJ3OVEwIn0
TBD: Finish this example by showing generation of a Content Master TBD: Finish this example by showing generation of a Content Master
Key (CMK), showing the derivation of the CEK and the CEK from the Key (CMK), showing the derivation of the CEK and the CIK from the
CMK, using the CEK to encrypt the Plaintext to produce the CMK, using the recipient's key to encrypt the CMK to produce the JWE
Ciphertext, using the recipient's key to encrypt the CMK to produce Encrypted Key, using the CEK and IV to encrypt the Plaintext to
the JWE Encrypted Key, showing the computation of the JWE Integrity produce the Ciphertext, showing the computation of the JWE Integrity
Value, base64url encoding these values, and assembling the result. Value, base64url encoding these values, and assembling the result.
eyJhbGciOiJSU0ExXzUiLA0KICJlbmMiOiJBMjU2Q0JDIiwNCiAiaW50IjoiSFMy eyJhbGciOiJSU0ExXzUiLA0KICJlbmMiOiJBMjU2Q0JDIiwNCiAiaW50IjoiSFMy
NTYiLA0KICJpdiI6Ik16LW1XXzRKSGZnIiwNCiAieDV0IjoiN25vT1BxLWhKMV9o NTYiLA0KICJpdiI6Ik16LW1XXzRKSGZnIiwNCiAieDV0IjoiN25vT1BxLWhKMV9o
Q252V2g2SWVZSTJ3OVEwIn0 Q252V2g2SWVZSTJ3OVEwIn0
. .
TBD_encrypted_key_value_TBD TBD_encrypted_key_value_TBD
. .
TBD_ciphertext_value_TBD TBD_ciphertext_value_TBD
. .
TBD_integrity_value_TBD TBD_integrity_value_TBD
4. JWE Header 4. JWE Header
The members of the JSON object represented by the JWE Header describe The members of the JSON object represented by the JWE Header describe
the encryption applied to the Plaintext and optionally additional the encryption applied to the Plaintext and optionally additional
properties of the JWE. The Header Parameter Names within this object properties of the JWE. The Header Parameter Names within this object
MUST be unique. Implementations MUST understand the entire contents MUST be unique; JWEs with duplicate Header Parameter Names MUST be
of the header; otherwise, the JWE MUST be rejected. rejected. Implementations MUST understand the entire contents of the
header; otherwise, the JWE MUST be rejected.
There are three classes of Header Parameter Names: Reserved Header
Parameter Names, Public Header Parameter Names, and Private Header
Parameter Names.
4.1. Reserved Header Parameter Names 4.1. Reserved Header Parameter Names
The following header parameter names are reserved. All the names are The following header parameter names are reserved with meanings as
short because a core goal of JWE is for the representations to be defined below. All the names are short because a core goal of JWE is
compact. for the representations to be compact.
+-----------+--------+----------------+-----------------------------+ Additional reserved header parameter names MAY be defined via the
| Header | JSON | Header | Header Parameter Semantics | IANA JSON Web Signature and Encryption Header Parameters registry
| Parameter | Value | Parameter | |
| Name | Type | Syntax | |
+-----------+--------+----------------+-----------------------------+
| alg | string | StringOrURI | The "alg" (algorithm) |
| | | | header parameter identifies |
| | | | the cryptographic algorithm |
| | | | used to secure the JWE |
| | | | Encrypted Key. A list of |
| | | | defined encryption "alg" |
| | | | values is presented in |
| | | | Section 4, Table 2 of the |
| | | | JSON Web Algorithms (JWA) |
| | | | [JWA] specification. The |
| | | | processing of the "alg" |
| | | | (algorithm) header |
| | | | parameter requires that the |
| | | | value MUST be one that is |
| | | | both supported and for |
| | | | which there exists a key |
| | | | for use with that algorithm |
| | | | associated with the |
| | | | intended recipient. The |
| | | | "alg" value is case |
| | | | sensitive. This header |
| | | | parameter is REQUIRED. |
| enc | string | StringOrURI | The "enc" (encryption |
| | | | method) header parameter |
| | | | identifies the symmetric |
| | | | encryption algorithm used |
| | | | to secure the Ciphertext. |
| | | | A list of defined "enc" |
| | | | values is presented in |
| | | | Section 4, Table 3 of the |
| | | | JSON Web Algorithms (JWA) |
| | | | [JWA] specification. The |
| | | | processing of the "enc" |
| | | | (encryption method) header |
| | | | parameter requires that the |
| | | | value MUST be one that is |
| | | | supported. The "enc" value |
| | | | is case sensitive. This |
| | | | header parameter is |
| | | | REQUIRED. |
| int | string | StringOrURI | The "int" (integrity |
| | | | algorithm) header parameter |
| | | | identifies the |
| | | | cryptographic algorithm |
| | | | used to safeguard the |
| | | | integrity of the Ciphertext |
| | | | and the parameters used to |
| | | | create it. The "int" |
| | | | parameter uses the same |
| | | | values as the JWS "alg" |
| | | | parameter; a list of |
| | | | defined JWS "alg" values is |
| | | | presented in Section 3, |
| | | | Table 1 of the JSON Web |
| | | | Algorithms (JWA) [JWA] |
| | | | specification. This header |
| | | | parameter is REQUIRED when |
| | | | an AEAD algorithm is not |
| | | | used to encrypt the |
| | | | Plaintext and MUST NOT be |
| | | | present when an AEAD |
| | | | algorithm is used. |
| iv | string | String | Initialization Vector |
| | | | ("iv") value for algorithms |
| | | | requiring it, represented |
| | | | as a base64url encoded |
| | | | string. This header |
| | | | parameter is OPTIONAL. |
| epk | object | JWK Key Object | Ephemeral Public Key |
| | | | ("epk") value created by |
| | | | the originator for the use |
| | | | in ECDH-ES RFC 6090 |
| | | | [RFC6090] encryption. This |
| | | | key is represented in the |
| | | | same manner as a JSON Web |
| | | | Key [JWK] JWK Key Object |
| | | | value, containing "crv" |
| | | | (curve), "x", and "y" |
| | | | members. The inclusion of |
| | | | the JWK Key Object "alg" |
| | | | (algorithm) member is |
| | | | OPTIONAL. This header |
| | | | parameter is OPTIONAL. |
| zip | string | String | Compression algorithm |
| | | | ("zip") applied to the |
| | | | Plaintext before |
| | | | encryption, if any. This |
| | | | specification defines the |
| | | | value "GZIP" to refer to |
| | | | the encoding format |
| | | | produced by the file |
| | | | compression program "gzip" |
| | | | (GNU zip) as described in |
| | | | [RFC1952]; this format is a |
| | | | Lempel-Ziv coding (LZ77) |
| | | | with a 32 bit CRC. If no |
| | | | "zip" parameter is present, |
| | | | or its value is "none", no |
| | | | compression is applied to |
| | | | the Plaintext before |
| | | | encryption. The "zip" |
| | | | value is case sensitive. |
| | | | This header parameter is |
| | | | OPTIONAL. |
| jku | string | URL | The "jku" (JSON Web Key |
| | | | URL) header parameter is an |
| | | | absolute URL that refers to |
| | | | a resource for a set of |
| | | | JSON-encoded public keys, |
| | | | one of which corresponds to |
| | | | the key that was used to |
| | | | encrypt the JWE. The keys |
| | | | MUST be encoded as |
| | | | described in the JSON Web |
| | | | Key (JWK) [JWK] |
| | | | specification. The |
| | | | protocol used to acquire |
| | | | the resource MUST provide |
| | | | integrity protection. An |
| | | | HTTP GET request to |
| | | | retrieve the certificate |
| | | | MUST use TLS RFC 2818 |
| | | | [RFC2818] RFC 5246 |
| | | | [RFC5246] with server |
| | | | authentication RFC 6125 |
| | | | [RFC6125]. This header |
| | | | parameter is OPTIONAL. |
| kid | string | String | The "kid" (key ID) header |
| | | | parameter is a hint |
| | | | indicating which key was |
| | | | used to encrypt the JWE. |
| | | | This allows originators to |
| | | | explicitly signal a change |
| | | | of key to recipients. The |
| | | | interpretation of the |
| | | | contents of the "kid" |
| | | | parameter is unspecified. |
| | | | This header parameter is |
| | | | OPTIONAL. |
| jpk | object | JWK Key Object | The "jpk" (JSON Public Key) |
| | | | header parameter is a |
| | | | public key that corresponds |
| | | | to the key that was used to |
| | | | encrypt the JWE. This key |
| | | | is represented in the same |
| | | | manner as a JSON Web Key |
| | | | [JWK] JWK Key Object value. |
| | | | This header parameter is |
| | | | OPTIONAL. |
| x5u | string | URL | The "x5u" (X.509 URL) |
| | | | header parameter is an |
| | | | absolute URL that refers to |
| | | | a resource for the X.509 |
| | | | public key certificate or |
| | | | certificate chain |
| | | | corresponding to the key |
| | | | used to encrypt the JWE. |
| | | | The identified resource |
| | | | MUST provide a |
| | | | representation of the |
| | | | certificate or certificate |
| | | | chain that conforms to RFC |
| | | | 5280 [RFC5280] in PEM |
| | | | encoded form RFC 1421 |
| | | | [RFC1421]. The certificate |
| | | | containing the public key |
| | | | of the entity encrypting |
| | | | the JWE MUST be the first |
| | | | certificate. This MAY be |
| | | | followed by additional |
| | | | certificates, with each |
| | | | subsequent certificate |
| | | | being the one used to |
| | | | certify the previous one. |
| | | | The protocol used to |
| | | | acquire the resource MUST |
| | | | provide integrity |
| | | | protection. An HTTP GET |
| | | | request to retrieve the |
| | | | certificate MUST use TLS |
| | | | RFC 2818 [RFC2818] RFC 5246 |
| | | | [RFC5246] with server |
| | | | authentication RFC 6125 |
| | | | [RFC6125]. This header |
| | | | parameter is OPTIONAL. |
| x5t | string | String | The "x5t" (x.509 |
| | | | certificate thumbprint) |
| | | | header parameter provides a |
| | | | base64url encoded SHA-1 |
| | | | thumbprint (a.k.a. digest) |
| | | | of the DER encoding of the |
| | | | X.509 certificate that |
| | | | corresponds to the key that |
| | | | was used to encrypt the |
| | | | JWE. This header parameter |
| | | | is OPTIONAL. |
| x5c | array | ArrayOfStrings | The "x5c" (x.509 |
| | | | certificate chain) header |
| | | | parameter contains the |
| | | | X.509 public key |
| | | | certificate or certificate |
| | | | chain corresponding to the |
| | | | key used to encrypt the |
| | | | JWE. The certificate or |
| | | | certificate chain is |
| | | | represented as an array of |
| | | | certificate values. Each |
| | | | value is a base64-encoded |
| | | | (not base64url encoded) |
| | | | DER/BER PKIX certificate |
| | | | value. The certificate |
| | | | containing the public key |
| | | | of the entity encrypting |
| | | | the JWE MUST be the first |
| | | | certificate. This MAY be |
| | | | followed by additional |
| | | | certificates, with each |
| | | | subsequent certificate |
| | | | being the one used to |
| | | | certify the previous one. |
| | | | The recipient MUST verify |
| | | | the certificate chain |
| | | | according to [RFC5280] and |
| | | | reject the JWE if any |
| | | | validation failure occurs. |
| | | | This header parameter is |
| | | | OPTIONAL. |
| typ | string | String | The "typ" (type) header |
| | | | parameter is used to |
| | | | declare the type of the |
| | | | encrypted content. The |
| | | | "typ" value is case |
| | | | sensitive. This header |
| | | | parameter is OPTIONAL. |
+-----------+--------+----------------+-----------------------------+
Table 1: Reserved Header Parameter Definitions [JWA]. 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.
Additional reserved header parameter names MAY be defined via the 4.1.1. "alg" (Algorithm) Header Parameter
IANA JSON Web Encryption Header Parameters registry, as per
Section 11. The syntax values used above are defined as follows:
+----------------+--------------------------------------------------+ The "alg" (algorithm) header parameter identifies the cryptographic
| Syntax Name | Syntax Definition | algorithm used to secure the JWE Encrypted Key. A list of defined
+----------------+--------------------------------------------------+ "alg" values for use with JWE is presented in Section 4.1 of the JSON
| String | Any string value MAY be used. | Web Algorithms (JWA) [JWA] specification. The processing of the
| StringOrURI | Any string value MAY be used but a value | "alg" header parameter requires that the value MUST be one that is
| | containing a ":" character MUST be a URI as | both supported and for which there exists a key for use with that
| | defined in RFC 3986 [RFC3986]. | algorithm associated with the intended recipient. The "alg" value is
| URL | A URL as defined in RFC 1738 [RFC1738]. | case sensitive. Its value MUST be a string containing a StringOrURI
| ArrayOfStrings | An array of string values. | value. This header parameter is REQUIRED.
+----------------+--------------------------------------------------+
Table 2: Header Parameter Syntax Definitions "alg" values SHOULD either be defined in the IANA JSON Web Signature
and Encryption Algorithms registry [JWA] or be a URI that contains a
collision resistant namespace.
4.1.2. "enc" (Encryption Method) Header Parameter
The "enc" (encryption method) header parameter identifies the
symmetric encryption algorithm used to secure the Ciphertext. A list
of defined "enc" values is presented in Section 4.2 of the JSON Web
Algorithms (JWA) [JWA] specification. The processing of the "enc"
(encryption method) header parameter requires that the value MUST be
one that is supported. The "enc" value is case sensitive. Its value
MUST be a string containing a StringOrURI value. This header
parameter is REQUIRED.
"enc" values SHOULD either be defined in the IANA JSON Web Signature
and Encryption Algorithms registry [JWA] or be a URI that contains a
collision resistant namespace.
4.1.3. "int" (Integrity Algorithm) Header Parameter
The "int" (integrity algorithm) header parameter identifies the
cryptographic algorithm used to safeguard the integrity of the
Ciphertext and the parameters used to create it. A list of defined
"int" values is presented in Section 4.3 of the JSON Web Algorithms
(JWA) [JWA] specification. The "int" parameter uses the MAC subset
of the algorithm values used by the JWS "alg" parameter. The "int"
value is case sensitive. Its value MUST be a string containing a
StringOrURI value. This header parameter is REQUIRED when an AEAD
algorithm is not used to encrypt the Plaintext and MUST NOT be
present when an AEAD algorithm is used.
"int" values SHOULD either be defined in the IANA JSON Web Signature
and Encryption Algorithms registry [JWA] or be a URI that contains a
collision resistant namespace.
4.1.4. "iv" (Initialization Vector) Header Parameter
The "iv" (initialization vector) value for algorithms requiring it,
represented as a base64url encoded string. This header parameter is
OPTIONAL.
4.1.5. "epk" (Ephemeral Public Key) Header Parameter
The "epk" (ephemeral public key) value created by the originator for
the use in ECDH-ES RFC 6090 [RFC6090] encryption. This key is
represented as a JSON Web Key [JWK] value, containing "crv" (curve),
"x", and "y" members. The inclusion of the JWK "alg" (algorithm)
member is OPTIONAL. This header parameter is OPTIONAL.
4.1.6. "zip" (Compression Algorithm) Header Parameter
The "zip" (compression algorithm) applied to the Plaintext before
encryption, if any. If present, the value of the "zip" header
parameter MUST be the case sensitive string "DEF". Compression is
performed with the DEFLATE [RFC1951] algorithm. If no "zip"
parameter is present, no compression is applied to the Plaintext
before encryption. This header parameter is OPTIONAL.
4.1.7. "jku" (JWK Set URL) Header Parameter
The "jku" (JWK Set URL) header parameter is an absolute URL that
refers to a resource for a set of JSON-encoded public keys, one of
which corresponds to the key used to encrypt the JWE. The keys MUST
be encoded as a JSON Web Key Set (JWK Set) as defined in the JSON Web
Key (JWK) [JWK] specification. The protocol used to acquire the
resource MUST provide integrity protection; an HTTP GET request to
retrieve the certificate MUST use TLS RFC 2818 [RFC2818] RFC 5246
[RFC5246]; the identity of the server MUST be validated, as per
Section 3.1 of HTTP Over TLS [RFC2818]. This header parameter is
OPTIONAL.
4.1.8. "jwk" (JSON Web Key) Header Parameter
The "jwk" (JSON Web Key) header parameter is a public key that
corresponds to the key used to encrypt the JWE. This key is
represented as a JSON Web Key [JWK]. This header parameter is
OPTIONAL.
4.1.9. "x5u" (X.509 URL) Header Parameter
The "x5u" (X.509 URL) header parameter is an absolute URL that refers
to a resource for the X.509 public key certificate or certificate
chain corresponding to the key used to encrypt the JWE. The
identified resource MUST provide a representation of the certificate
or certificate chain that conforms to RFC 5280 [RFC5280] in PEM
encoded form RFC 1421 [RFC1421]. The certificate containing the
public key of the entity that encrypted the JWE MUST be the first
certificate. This MAY be followed by additional certificates, with
each subsequent certificate being the one used to certify the
previous one. The protocol used to acquire the resource MUST provide
integrity protection; an HTTP GET request to retrieve the certificate
MUST use TLS RFC 2818 [RFC2818] RFC 5246 [RFC5246]; the identity of
the server MUST be validated, as per Section 3.1 of HTTP Over TLS
[RFC2818]. This header parameter is OPTIONAL.
4.1.10. "x5t" (X.509 Certificate Thumbprint) Header Parameter
The "x5t" (X.509 Certificate Thumbprint) header parameter provides a
base64url encoded SHA-1 thumbprint (a.k.a. digest) of the DER
encoding of the X.509 certificate corresponding to the key used to
encrypt the JWE. This header parameter is OPTIONAL.
If, in the future, certificate thumbprints need to be computed using
hash functions other than SHA-1, it is suggested that additional
related header parameters be defined for that purpose. For example,
it is suggested that a new "x5t#S256" (X.509 Certificate Thumbprint
using SHA-256) header parameter could be defined by registering it in
the IANA JSON Web Signature and Encryption Header Parameters registry
[JWA].
4.1.11. "x5c" (X.509 Certificate Chain) Header Parameter
The "x5c" (X.509 Certificate Chain) header parameter contains the
X.509 public key certificate or certificate chain corresponding to
the key used to encrypt the JWE. The certificate or certificate
chain is represented as an array of certificate values. Each value
is a base64-encoded (not base64url encoded) DER/BER PKIX certificate
value. The certificate containing the public key of the entity that
encrypted the JWE MUST be the first certificate. This MAY be
followed by additional certificates, with each subsequent certificate
being the one used to certify the previous one. The recipient MUST
verify the certificate chain according to [RFC5280] and reject the
JWE if any validation failure occurs. This header parameter is
OPTIONAL.
4.1.12. "kid" (Key ID) Header Parameter
The "kid" (key ID) header parameter is a hint indicating which key
was used to encrypt the JWE. This allows originators to explicitly
signal a change of key to recipients. Should the recipient be unable
to locate a key corresponding to the "kid" value, they SHOULD treat
that condition as an error. The interpretation of the contents of
the "kid" parameter is unspecified. Its value MUST be a string.
This header parameter is OPTIONAL.
4.1.13. "typ" (Type) Header Parameter
The "typ" (type) header parameter is used to declare the type of the
encrypted content. The type value "JWE" MAY be used to indicate that
the encrypted content is a JWE. The "typ" value is case sensitive.
Its value MUST be a string. This header parameter is OPTIONAL.
MIME Media Type RFC 2045 [RFC2045] values MAY be used as "typ"
values.
"typ" values SHOULD either be defined in the IANA JSON Web Signature
and Encryption "typ" Values registry [JWA] or be a URI that contains
a collision resistant namespace.
4.2. Public Header Parameter Names 4.2. Public Header Parameter Names
Additional header parameter names can be defined by those using JWE. Additional header parameter names can be defined by those using JWEs.
However, in order to prevent collisions, any new header parameter However, in order to prevent collisions, any new header parameter
name or algorithm value SHOULD either be defined in the IANA JSON Web name SHOULD either be defined in the IANA JSON Web Signature and
Encryption Header Parameters registry or be defined as a URI that Encryption Header Parameters registry [JWA] or be a URI that contains
contains a collision resistant namespace. In each case, the definer a collision resistant namespace. In each case, the definer of the
of the name or value needs to take reasonable precautions to make name or value needs to take reasonable precautions to make sure they
sure they are in control of the part of the namespace they use to are in control of the part of the namespace they use to define the
define the header parameter name. header parameter name.
New header parameters should be introduced sparingly since an New header parameters should be introduced sparingly, as they can
implementation that does not understand a parameter MUST reject the result in non-interoperable JWEs.
JWE.
4.3. Private Header Parameter Names 4.3. Private Header Parameter Names
A producer and consumer of a JWE may agree to any header parameter A producer and consumer of a JWE may agree to any header parameter
name that is not a Reserved Name Section 4.1 or a Public Name name that is not a Reserved Name Section 4.1 or a Public Name
Section 4.2. Unlike Public Names, these private names are subject to Section 4.2. Unlike Public Names, these private names are subject to
collision and should be used with caution. collision and should be used with caution.
New header parameters should be introduced sparingly, as they can
result in non-interoperable JWEs.
5. Message Encryption 5. Message Encryption
The message encryption process is as follows. The order of the steps The message encryption process is as follows. The order of the steps
is not significant in cases where there are no dependencies between is not significant in cases where there are no dependencies between
the inputs and outputs of the steps. the inputs and outputs of the steps.
1. Generate a random Content Master Key (CMK). The CMK MUST have a 1. When key wrapping or key encryption are employed, generate a
length at least equal to that of the larger of the required random Content Master Key (CMK). See RFC 4086 [RFC4086] for
encryption or integrity keys and MUST be generated randomly. considerations on generating random values. Otherwise, when key
agreement is employed, use the key agreement algorithm to
See RFC 4086 [RFC4086] for considerations on generating random compute the value of the Content Master Key (CMK). The CMK MUST
values. have a length equal to that of the larger of the required
encryption and integrity keys.
2. Encrypt the CMK for the recipient (see Section 8) and let the 2. When key wrapping or key encryption are employed, encrypt the
result be the JWE Encrypted Key. CMK for the recipient (see Section 8) and let the result be the
JWE Encrypted Key. Otherwise, when key agreement is employed,
let the JWE Encrypted Key be an empty byte array.
3. Base64url encode the JWE Encrypted Key to create the Encoded JWE 3. Base64url encode the JWE Encrypted Key to create the Encoded JWE
Encrypted Key. Encrypted Key.
4. Generate a random Initialization Vector (IV) (if required for 4. Generate a random Initialization Vector (IV) of the correct size
the algorithm). for the algorithm (if required for the algorithm).
5. If not using an AEAD algorithm, run the key derivation algorithm 5. If not using an AEAD algorithm, run the key derivation algorithm
(see Section 7) to generate the Content Encryption Key (CEK) and (see Section 7) to generate the Content Encryption Key (CEK) and
the Content Integrity Key (CIK); otherwise (when using an AEAD the Content Integrity Key (CIK); otherwise (when using an AEAD
algorithm), set the CEK to be the CMK. algorithm), set the CEK to be the CMK.
6. Compress the Plaintext if a "zip" parameter was included. 6. Compress the Plaintext if a "zip" parameter was included.
7. Serialize the (compressed) Plaintext into a bitstring M. 7. Serialize the (compressed) Plaintext into a byte sequence M.
8. Encrypt M using the CEK and IV to form the bitstring C. 8. Encrypt M using the CEK and IV to form the byte sequence C. If
an AEAD algorithm is used, use the concatenation of the Encoded
JWE Header, a period ('.') character, and the Encoded JWE
Encrypted Key as the "additional authenticated data" parameter
value for the encryption.
9. Base64url encode C to create the Encoded JWE Ciphertext. 9. Base64url encode C to create the Encoded JWE Ciphertext.
10. Create a JWE Header containing the encryption parameters used. 10. Create a JWE Header containing the encryption parameters used.
Note that white space is explicitly allowed in the Note that white space is explicitly allowed in the
representation and no canonicalization need be performed before representation and no canonicalization need be performed before
encoding. encoding.
11. Base64url encode the bytes of the UTF-8 representation of the 11. Base64url encode the bytes of the UTF-8 representation of the
JWE Header to create the Encoded JWE Header. JWE Header to create the Encoded JWE Header.
12. If not using an AEAD algorithm, run the integrity algorithm (see 12. If not using an AEAD algorithm, run the integrity algorithm (see
Section 9) using the CIK to compute the JWE Integrity Value; Section 9) using the CIK to compute the JWE Integrity Value;
otherwise (when using an AEAD algorithm), set the JWE Integrity otherwise (when using an AEAD algorithm), set the JWE Integrity
Value to be the empty byte string. Value to be the "authentication tag" value produced by the AEAD
algorithm.
13. Base64url encode the JWE Integrity Value to create the Encoded 13. Base64url encode the JWE Integrity Value to create the Encoded
JWE Integrity Value. JWE Integrity Value.
14. The four encoded parts, taken together, are the result. The 14. The four encoded parts, taken together, are the result. The
Compact Serialization of this result is the concatenation of the Compact Serialization of this result is the concatenation of the
Encoded JWE Header, the Encoded JWE Encrypted Key, the Encoded Encoded JWE Header, the Encoded JWE Encrypted Key, the Encoded
JWE Ciphertext, and the Encoded JWE Integrity Value in that JWE Ciphertext, and the Encoded JWE Integrity Value in that
order, with the four strings being separated by period ('.') order, with the four strings being separated by period ('.')
characters. characters.
skipping to change at page 16, line 32 skipping to change at page 15, line 5
3. The resulting JWE Header MUST be completely valid JSON syntax 3. The resulting JWE Header MUST be completely valid JSON syntax
conforming to RFC 4627 [RFC4627]. conforming to RFC 4627 [RFC4627].
4. The resulting JWE Header MUST be validated to only include 4. The resulting JWE Header MUST be validated to only include
parameters and values whose syntax and semantics are both parameters and values whose syntax and semantics are both
understood and supported. understood and supported.
5. Verify that the JWE Header references a key known to the 5. Verify that the JWE Header references a key known to the
recipient. recipient.
6. Decrypt the JWE Encrypted Key to produce the Content Master Key 6. When key wrapping or key encryption are employed, decrypt the
(CMK). JWE Encrypted Key to produce the Content Master Key (CMK).
Otherwise, when key agreement is employed, use the key agreement
algorithm to compute the value of the Content Master Key (CMK).
The CMK MUST have a length equal to that of the larger of the
required encryption and integrity keys.
7. If not using an AEAD algorithm, run the key derivation algorithm 7. If not using an AEAD algorithm, run the key derivation algorithm
(see Section 7) to generate the Content Encryption Key (CEK) and (see Section 7) to generate the Content Encryption Key (CEK) and
the Content Integrity Key (CIK); otherwise (when using an AEAD the Content Integrity Key (CIK); otherwise (when using an AEAD
algorithm), set the CEK to be the CMK. algorithm), set the CEK to be the CMK.
8. If not using an AEAD algorithm, run the integrity algorithm (see 8. Decrypt the binary representation of the JWE Ciphertext using
the CEK and IV. If an AEAD algorithm is used, use the
concatenation of the Encoded JWE Header, a period ('.')
character, and the Encoded JWE Encrypted Key as the "additional
authenticated data" parameter value for the decryption.
9. If not using an AEAD algorithm, run the integrity algorithm (see
Section 9) using the CIK to compute an integrity value for the Section 9) using the CIK to compute an integrity value for the
input received. This computed value MUST match the received JWE input received. This computed value MUST match the received JWE
Integrity Value; otherwise (when using an AEAD algorithm), the Integrity Value; otherwise (when using an AEAD algorithm), the
received JWE Integrity Value MUST be empty. received JWE Integrity Value MUST match the "authentication tag"
value produced by the AEAD algorithm.
9. Decrypt the binary representation of the JWE Ciphertext using
the CEK.
10. Remove the Initialization Vector (IV) value from the decrypted
result (if an IV was used).
11. Uncompress the result of the previous step, if a "zip" parameter 10. Uncompress the result of the previous step, if a "zip" parameter
was included. was included.
12. Output the resulting Plaintext. 11. Output the resulting Plaintext.
7. Key Derivation 7. Key Derivation
The key derivation process converts the CMK into a CEK and a CIK. It The key derivation process converts the CMK into a CEK and a CIK. It
assumes as a primitive a Key Derivation Function (KDF) which assumes as a primitive a Key Derivation Function (KDF) which
notionally takes three arguments: notionally takes three arguments:
MasterKey: The master key used to compute the individual use keys MasterKey: The master key used to compute the individual use keys
Label: The use key label, used to differentiate individual use keys Label: The use key label, used to differentiate individual use keys
Length: The length of the desired use key Length: The desired length of the use key
The only KDF used in this document is the Concat KDF, as defined in The only KDF used in this document is the Concat KDF, as defined in
[NIST-800-56A], where the Digest Method is SHA-256, the SuppPubInfo Section 5.8.1 of [NIST.800-56A], where the Digest Method is SHA-256,
parameter is the Label, and the remaining OtherInfo parameters are the SuppPubInfo parameter is the Label, and the remaining OtherInfo
the empty bit string. parameters are the empty bit string.
To compute the CEK from the CMK, the ASCII label "Encryption" is
used.
To compute the CIK from the CMK, the ASCII label "Integrity" is used. To compute the CEK from the CMK, the ASCII label "Encryption" ([69,
110, 99, 114, 121, 112, 116, 105, 111, 110]) is used. Use the key
size for the "enc" algorithm as the CEK desired key length.
When AEAD algorithms are used the KDF element MUST NOT be present. To compute the CIK from the CMK, the ASCII label "Integrity" ([73,
When they are not used, it MUST be present. 110, 116, 101, 103, 114, 105, 116, 121]) is used. Use the minimum
key size for the "int" algorithm (for instance, 256 bits for "HS256")
as the CIK desired key length.
8. CMK Encryption 8. CMK Encryption
JWE supports two forms of CMK encryption: JWE supports two forms of CMK encryption:
o Asymmetric encryption under the recipient's public key. o Asymmetric encryption under the recipient's public key.
o Symmetric encryption under a shared key. o Symmetric encryption under a shared key.
8.1. Asymmetric Encryption 8.1. Asymmetric Encryption
In the asymmetric encryption mode, the CMK is encrypted under the In the asymmetric encryption mode, the CMK is encrypted under the
recipient's public key. The asymmetric encryption modes defined for recipient's public key. The asymmetric encryption modes defined for
use with this in this specification are listed in Section 4, Table 2 use with this in this specification are listed in Section 4.1 of the
of the JSON Web Algorithms (JWA) [JWA] specification. JSON Web Algorithms (JWA) [JWA] specification.
8.2. Symmetric Encryption 8.2. Symmetric Encryption
In the symmetric encryption mode, the CMK is encrypted under a In the symmetric encryption mode, the CMK is encrypted under a
symmetric key shared between the sender and receiver. The symmetric symmetric key shared between the sender and receiver. The symmetric
encryption modes defined for use with this in this specification are encryption modes defined for use with this in this specification are
listed in Section 4, Table 2 of the JSON Web Algorithms (JWA) [JWA] listed in Section 4.1 of the JSON Web Algorithms (JWA) [JWA]
specification. For GCM, the random 64-bit IV is prepended to the specification.
ciphertext.
9. Integrity Value Calculation 9. Integrity Value Calculation
When a non-AEAD algorithm is used (an algorithm without an integrated When a non-AEAD algorithm is used (an algorithm without an integrated
content check), JWE adds an explicit integrity check value to the content check), JWE adds an explicit integrity check value to the
representation. This value is computed in the manner described in representation. This value is computed in the manner described in
the JSON Web Signature (JWS) [JWS] specification, with these the JSON Web Signature (JWS) [JWS] specification, with these
modifications: modifications:
o The algorithm used is taken from the "int" (integrity algorithm) o The algorithm used is taken from the "int" (integrity algorithm)
header parameter rather than the "alg" header parameter. header parameter rather than the "alg" header parameter.
o The algorithm MUST be an HMAC algorithm (normally HMAC SHA-256). o The algorithm MUST be a MAC algorithm (normally HMAC SHA-256).
o The JWS Secured Input used is the concatenation of the Encoded JWE o The JWS Secured Input used is the concatenation of the Encoded JWE
Header, a period ('.') character, the Encoded JWE Encrypted Key, a Header, a period ('.') character, the Encoded JWE Encrypted Key, a
period ('.') character, and the Encoded JWE Ciphertext. period ('.') character, and the Encoded JWE Ciphertext.
o The CIK is used as the HMAC key. o The CIK is used as the MAC key.
The computed JWS Signature value is the resulting integrity value. The computed JWS Signature value is the resulting integrity value.
10. Encrypting JWEs with Cryptographic Algorithms 10. Encrypting JWEs with Cryptographic Algorithms
JWE uses cryptographic algorithms to encrypt the Content Encryption JWE uses cryptographic algorithms to encrypt the Plaintext and the
Key (CMK) and the Plaintext. The JSON Web Algorithms (JWA) [JWA] Content Encryption Key (CMK) and to provide integrity protection for
specification enumerates a set of cryptographic algorithms and the JWE Header, JWE Encrypted Key, and JWE Ciphertext. The JSON Web
identifiers to be used with this specification. Specifically, Algorithms (JWA) [JWA] specification enumerates a set of
Section 4, Table 2 enumerates a set of "alg" (algorithm) header cryptographic algorithms and identifiers to be used with this
parameter values and Section 4, Table 3 enumerates a set of "enc" specification. Specifically, Section 4.1 enumerates a set of "alg"
(encryption method) header parameter values intended for use this (algorithm) header parameter values, Section 4.2 enumerates a set of
specification. It also describes the semantics and operations that "enc" (encryption method) header parameter values, and Section 4.3
are specific to these algorithms and algorithm families. enumerates a set of "int" (integrity algorithm) header parameter
values intended for use this specification. It also describes the
semantics and operations that are specific to these algorithms and
algorithm families.
Public keys employed for encryption can be identified using the Public keys employed for encryption can be identified using the
Header Parameter methods described in Section 4.1 or can be Header Parameter methods described in Section 4.1 or can be
distributed using methods that are outside the scope of this distributed using methods that are outside the scope of this
specification. specification.
11. IANA Considerations 11. IANA Considerations
This specification calls for: 11.1. Registration of application/jwe MIME Media Type
o A new IANA registry entitled "JSON Web Encryption Header This specification registers the "application/jwe" MIME Media Type
Parameters" for reserved header parameter names is defined in RFC 2045 [RFC2045].
Section 4.1. Inclusion in the registry is RFC Required in the RFC
5226 [RFC5226] sense for reserved JWE header parameter names that
are intended to be interoperable between implementations. The
registry will just record the reserved header parameter name and a
pointer to the RFC that defines it. This specification defines
inclusion of the header parameter names defined in Table 1.
12. Security Considerations Type name:
application
TBD: Lots of work to do here. We need to remember to look into any Subtype name:
issues relating to security and JSON parsing. One wonders just how jwe
secure most JSON parsing libraries are. Were they ever hardened for
security scenarios? If not, what kind of holes does that open up?
Also, we need to walk through the JSON standard and see what kind of
issues we have especially around comparison of names. For instance,
comparisons of header parameter names and other parameters must occur
after they are unescaped. Need to also put in text about: Importance
of keeping secrets secret. Rotating keys. Strengths and weaknesses
of the different algorithms.
TBD: Need to put in text about why strict JSON validation is Required parameters:
necessary. Basically, that if malformed JSON is received then the n/a
intent of the sender is impossible to reliably discern. One example
of malformed JSON that MUST be rejected is an object in which the
same member name occurs multiple times.
TBD: We need a section on generating randomness in browsers - it's Optional parameters:
easy to screw up. n/a
When utilizing TLS to retrieve information, the authority providing Encoding considerations:
the resource MUST be authenticated and the information retrieved MUST n/a
be free from modification.
12.1. Unicode Comparison Security Issues Security considerations:
See the Security Considerations section of this document
Header parameter names in JWEs are Unicode strings. For security Interoperability considerations:
reasons, the representations of these names must be compared verbatim n/a
after performing any escape processing (as per RFC 4627 [RFC4627],
Section 2.5).
This means, for instance, that these JSON strings must compare as Published specification:
being equal ("enc", "\u0065nc"), whereas these must all compare as [[ this document ]]
being not equal to the first set or to each other ("ENC", "Enc",
"en\u0043").
JSON strings MAY contain characters outside the Unicode Basic Applications that use this media type:
Multilingual Plane. For instance, the G clef character (U+1D11E) may OpenID Connect
be represented in a JSON string as "\uD834\uDD1E". Ideally, JWE
implementations SHOULD ensure that characters outside the Basic
Multilingual Plane are preserved and compared correctly;
alternatively, if this is not possible due to these characters
exercising limitations present in the underlying JSON implementation,
then input containing them MUST be rejected.
13. Open Issues and Things To Be Done (TBD) Additional information:
Magic number(s): n/a
File extension(s): n/a
Macintosh file type code(s): n/a
The following items remain to be done in this draft: Person & email address to contact for further information:
Michael B. Jones
mbj@microsoft.com
o EDITORIAL: Give each header parameter definition its own section. Intended usage:
This will let them appear in the index, will give space for COMMON
examples when needed, and will get rid of the way-too-cramped
tables.
o Consider adding the DEFLATE compression algorithm (which omits the Restrictions on usage:
ZLIB header and checksum fields) and so produces smaller results none
than "GZIP".
o Provide a more robust description of the use of the Initialization Author:
Vector (IV), including listing which algorithms require an IV. Michael B. Jones
(This list may belong in the JWA spec.) The current statement mbj@microsoft.com
"For GCM, the random 64-bit IV is prepended to the ciphertext" in
the Symmetric Encryption section is almost certainly out of place
and insufficiently general.
o Finish the Security Considerations section. Change controller:
IETF
o Consider which of the open issues from the JWS and JWT specs also 11.2. Registration of "JWE" Type Value
apply here.
o Should the JWE Encrypted Key be moved to the header (which would This specification registers the following "typ" header parameter
add about 20 bytes to every JWE) or left in a separate period- value in the JSON Web Signature and Encryption "typ" Values registry
separated segment to prevent double base64 encoding? established by the JSON Web Algorithms (JWA) [JWA] specification:
"typ" header parameter value:
"JWE"
Abbreviation for MIME type:
application/jwe
Change controller:
IETF
Description:
[[ this document ]]
12. Security Considerations
All the security considerations in the JWS specification also apply
to this specification, other than those that are signature specific.
Likewise, all the security considerations in XML Encryption 1.1
[W3C.CR-xmlenc-core1-20120313] also apply to JWE, other than those
that are XML specific.
13. Open Issues and Things To Be Done (TBD)
The following items remain to be done in this draft:
o Add examples, including a KDF and a key agreement example.
14. References 14. References
14.1. Normative References 14.1. Normative References
[JWA] Jones, M., "JSON Web Algorithms (JWA)", January 2012. [JWA] Jones, M., "JSON Web Algorithms (JWA)", May 2012.
[JWK] Jones, M., "JSON Web Key (JWK)", March 2012. [JWK] Jones, M., "JSON Web Key (JWK)", May 2012.
[JWS] Jones, M., Bradley, J., and N. Sakimura, "JSON Web [JWS] Jones, M., Bradley, J., and N. Sakimura, "JSON Web
Signature (JWS)", January 2012. Signature (JWS)", May 2012.
[NIST-800-38D]
National Institute of Standards and Technology (NIST),
"Recommendation for Block Cipher Modes of Operation:
Galois/Counter Mode (GCM) and GMAC", NIST PUB 800-38D,
December 2001.
[NIST-800-56A] [NIST.800-56A]
National Institute of Standards and Technology (NIST), National Institute of Standards and Technology (NIST),
"Recommendation for Pair-Wise Key Establishment Schemes "Recommendation for Pair-Wise Key Establishment Schemes
Using Discrete Logarithm Cryptography (Revised)", NIST PUB Using Discrete Logarithm Cryptography (Revised)", NIST PUB
800-56A, March 2007. 800-56A, March 2007.
[RFC1421] Linn, J., "Privacy Enhancement for Internet Electronic [RFC1421] Linn, J., "Privacy Enhancement for Internet Electronic
Mail: Part I: Message Encryption and Authentication Mail: Part I: Message Encryption and Authentication
Procedures", RFC 1421, February 1993. Procedures", RFC 1421, February 1993.
[RFC1738] Berners-Lee, T., Masinter, L., and M. McCahill, "Uniform [RFC1951] Deutsch, P., "DEFLATE Compressed Data Format Specification
Resource Locators (URL)", RFC 1738, December 1994. version 1.3", RFC 1951, May 1996.
[RFC1952] Deutsch, P., Gailly, J-L., Adler, M., Deutsch, L., and G. [RFC2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail
Randers-Pehrson, "GZIP file format specification version Extensions (MIME) Part One: Format of Internet Message
4.3", RFC 1952, May 1996. Bodies", RFC 2045, November 1996.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997. Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000. [RFC2818] Rescorla, E., "HTTP Over TLS", RFC 2818, May 2000.
[RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO
10646", STD 63, RFC 3629, November 2003. 10646", STD 63, RFC 3629, November 2003.
[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
skipping to change at page 22, line 12 skipping to change at page 20, line 37
[RFC4627] Crockford, D., "The application/json Media Type for [RFC4627] Crockford, D., "The application/json Media Type for
JavaScript Object Notation (JSON)", RFC 4627, July 2006. JavaScript Object Notation (JSON)", RFC 4627, July 2006.
[RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data
Encodings", RFC 4648, October 2006. Encodings", RFC 4648, October 2006.
[RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated [RFC5116] McGrew, D., "An Interface and Algorithms for Authenticated
Encryption", RFC 5116, January 2008. Encryption", RFC 5116, January 2008.
[RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an
IANA Considerations Section in RFCs", BCP 26, RFC 5226,
May 2008.
[RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security
(TLS) Protocol Version 1.2", RFC 5246, August 2008. (TLS) Protocol Version 1.2", RFC 5246, August 2008.
[RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S., [RFC5280] Cooper, D., Santesson, S., Farrell, S., Boeyen, S.,
Housley, R., and W. Polk, "Internet X.509 Public Key Housley, R., and W. Polk, "Internet X.509 Public Key
Infrastructure Certificate and Certificate Revocation List Infrastructure Certificate and Certificate Revocation List
(CRL) Profile", RFC 5280, May 2008. (CRL) Profile", RFC 5280, May 2008.
[RFC6090] McGrew, D., Igoe, K., and M. Salter, "Fundamental Elliptic [RFC6090] McGrew, D., Igoe, K., and M. Salter, "Fundamental Elliptic
Curve Cryptography Algorithms", RFC 6090, February 2011. Curve Cryptography Algorithms", RFC 6090, February 2011.
[RFC6125] Saint-Andre, P. and J. Hodges, "Representation and
Verification of Domain-Based Application Service Identity
within Internet Public Key Infrastructure Using X.509
(PKIX) Certificates in the Context of Transport Layer
Security (TLS)", RFC 6125, March 2011.
14.2. Informative References 14.2. Informative References
[I-D.rescorla-jsms] [I-D.rescorla-jsms]
Rescorla, E. and J. Hildebrand, "JavaScript Message Rescorla, E. and J. Hildebrand, "JavaScript Message
Security Format", draft-rescorla-jsms-00 (work in Security Format", draft-rescorla-jsms-00 (work in
progress), March 2011. progress), March 2011.
[JSE] Bradley, J. and N. Sakimura (editor), "JSON Simple [JSE] Bradley, J. and N. Sakimura (editor), "JSON Simple
Encryption", September 2010. Encryption", September 2010.
[JWE-JS] Jones, M., "JSON Web Encryption JSON Serialization [JWE-JS] Jones, M., "JSON Web Encryption JSON Serialization
(JWE-JS)", March 2012. (JWE-JS)", March 2012.
[RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70, [RFC5652] Housley, R., "Cryptographic Message Syntax (CMS)", STD 70,
RFC 5652, September 2009. RFC 5652, September 2009.
[W3C.CR-xmlenc-core1-20110303] [W3C.CR-xmlenc-core1-20120313]
Hirsch, F., Roessler, T., Reagle, J., and D. Eastlake, Eastlake, D., Reagle, J., Roessler, T., and F. Hirsch,
"XML Encryption Syntax and Processing Version 1.1", World "XML Encryption Syntax and Processing Version 1.1", World
Wide Web Consortium CR CR-xmlenc-core1-20110303, Wide Web Consortium CR CR-xmlenc-core1-20120313,
March 2011, March 2012,
<http://www.w3.org/TR/2011/CR-xmlenc-core1-20110303>. <http://www.w3.org/TR/2012/CR-xmlenc-core1-20120313>.
Appendix A. JWE Examples Appendix A. JWE Examples
This section provides several examples of JWEs. This section provides several examples of JWEs.
A.1. JWE Example using TBD Algorithm A.1. JWE Example using TBD Algorithm
A.1.1. Encrypting A.1.1. Encrypting
TBD: Demonstrate encryption steps with this algorithm TBD: Demonstrate encryption steps with this algorithm
skipping to change at page 23, line 29 skipping to change at page 21, line 44
TBD: Demonstrate decryption steps with this algorithm TBD: Demonstrate decryption steps with this algorithm
Appendix B. Acknowledgements Appendix B. Acknowledgements
Solutions for encrypting JSON content were also explored by JSON Solutions for encrypting JSON content were also explored by JSON
Simple Encryption [JSE] and JavaScript Message Security Format Simple Encryption [JSE] and JavaScript Message Security Format
[I-D.rescorla-jsms], both of which significantly influenced this [I-D.rescorla-jsms], both of which significantly influenced this
draft. This draft attempts to explicitly reuse as many of the draft. This draft attempts to explicitly reuse as many of the
relevant concepts from XML Encryption 1.1 relevant concepts from XML Encryption 1.1
[W3C.CR-xmlenc-core1-20110303] and RFC 5652 [RFC5652] as possible, [W3C.CR-xmlenc-core1-20120313] and RFC 5652 [RFC5652] as possible,
while utilizing simple compact JSON-based data structures. while utilizing simple compact JSON-based data structures.
Special thanks are due to John Bradley and Nat Sakimura for the Special thanks are due to John Bradley and Nat Sakimura for the
discussions that helped inform the content of this specification and discussions that helped inform the content of this specification and
to Eric Rescorla and Joe Hildebrand for allowing the reuse of text to Eric Rescorla and Joe Hildebrand for allowing the reuse of text
from [I-D.rescorla-jsms] in this document. from [I-D.rescorla-jsms] in this document.
Appendix C. Document History Appendix C. Document History
-02
o When using AEAD algorithms (such as AES GCM), use the "additional
authenticated data" parameter to provide integrity for the header,
encrypted key, and ciphertext and use the resulting
"authentication tag" value as the JWE Integrity Value.
o Defined KDF output key sizes.
o Generalized text to allow key agreement to be employed as an
alternative to key wrapping or key encryption.
o Changed compression algorithm from gzip to DEFLATE.
o Clarified that it is an error when a "kid" value is included and
no matching key is found.
o Clarified that JWEs with duplicate Header Parameter Names MUST be
rejected.
o Clarified the relationship between "typ" header parameter values
and MIME types.
o Registered application/jwe MIME type and "JWE" typ header
parameter value.
o Simplified JWK terminology to get replace the "JWK Key Object" and
"JWK Container Object" terms with simply "JSON Web Key (JWK)" and
"JSON Web Key Set (JWK Set)" and to eliminate potential confusion
between single keys and sets of keys. As part of this change, the
header parameter name for a public key value was changed from
"jpk" (JSON Public Key) to "jwk" (JSON Web Key).
o Added suggestion on defining additional header parameters such as
"x5t#S256" in the future for certificate thumbprints using hash
algorithms other than SHA-1.
o Specify RFC 2818 server identity validation, rather than RFC 6125
(paralleling the same decision in the OAuth specs).
o Generalized language to refer to Message Authentication Codes
(MACs) rather than Hash-based Message Authentication Codes (HMACs)
unless in a context specific to HMAC algorithms.
o Reformatted to give each header parameter its own section heading.
-01 -01
o Added an integrity check for non-AEAD algorithms. o Added an integrity check for non-AEAD algorithms.
o Added "jpk" and "x5c" header parameters for including JWK public o Added "jpk" and "x5c" header parameters for including JWK public
keys and X.509 certificate chains directly in the header. keys and X.509 certificate chains directly in the header.
o Clarified that this specification is defining the JWE Compact o Clarified that this specification is defining the JWE Compact
Serialization. Referenced the new JWE-JS spec, which defines the Serialization. Referenced the new JWE-JS spec, which defines the
JWE JSON Serialization. JWE JSON Serialization.
 End of changes. 87 change blocks. 
492 lines changed or deleted 478 lines changed or added

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