<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en"><head><title>JSON Web Encryption (JWE)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="JSON Web Encryption (JWE)">
<meta name="keywords" content="RFC, Request for Comments, I-D, Internet-Draft, JavaScript Object Notation, JSON, JSON Web Token, JWT, JSON Web Signature, JWS, JSON Web Encryption, JWE, JSON Web Key, JWK, JSON Web Algorithms, JWA">
<meta name="generator" content="xml2rfc v1.36 (http://xml.resource.org/)">
<style type='text/css'><!--
body {
font-family: verdana, charcoal, helvetica, arial, sans-serif;
font-size: small; color: #000; background-color: #FFF;
margin: 2em;
}
h1, h2, h3, h4, h5, h6 {
font-family: helvetica, monaco, "MS Sans Serif", arial, sans-serif;
font-weight: bold; font-style: normal;
}
h1 { color: #900; background-color: transparent; text-align: right; }
h3 { color: #333; background-color: transparent; }
td.RFCbug {
font-size: x-small; text-decoration: none;
width: 30px; height: 30px; padding-top: 2px;
text-align: justify; vertical-align: middle;
background-color: #000;
}
td.RFCbug span.RFC {
font-family: monaco, charcoal, geneva, "MS Sans Serif", helvetica, verdana, sans-serif;
font-weight: bold; color: #666;
}
td.RFCbug span.hotText {
font-family: charcoal, monaco, geneva, "MS Sans Serif", helvetica, verdana, sans-serif;
font-weight: normal; text-align: center; color: #FFF;
}
table.TOCbug { width: 30px; height: 15px; }
td.TOCbug {
text-align: center; width: 30px; height: 15px;
color: #FFF; background-color: #900;
}
td.TOCbug a {
font-family: monaco, charcoal, geneva, "MS Sans Serif", helvetica, sans-serif;
font-weight: bold; font-size: x-small; text-decoration: none;
color: #FFF; background-color: transparent;
}
td.header {
font-family: arial, helvetica, sans-serif; font-size: x-small;
vertical-align: top; width: 33%;
color: #FFF; background-color: #666;
}
td.author { font-weight: bold; font-size: x-small; margin-left: 4em; }
td.author-text { font-size: x-small; }
/* info code from SantaKlauss at http://www.madaboutstyle.com/tooltip2.html */
a.info {
/* This is the key. */
position: relative;
z-index: 24;
text-decoration: none;
}
a.info:hover {
z-index: 25;
color: #FFF; background-color: #900;
}
a.info span { display: none; }
a.info:hover span.info {
/* The span will display just on :hover state. */
display: block;
position: absolute;
font-size: smaller;
top: 2em; left: -5em; width: 15em;
padding: 2px; border: 1px solid #333;
color: #900; background-color: #EEE;
text-align: left;
}
a { font-weight: bold; }
a:link { color: #900; background-color: transparent; }
a:visited { color: #633; background-color: transparent; }
a:active { color: #633; background-color: transparent; }
p { margin-left: 2em; margin-right: 2em; }
p.copyright { font-size: x-small; }
p.toc { font-size: small; font-weight: bold; margin-left: 3em; }
table.toc { margin: 0 0 0 3em; padding: 0; border: 0; vertical-align: text-top; }
td.toc { font-size: small; font-weight: bold; vertical-align: text-top; }
ol.text { margin-left: 2em; margin-right: 2em; }
ul.text { margin-left: 2em; margin-right: 2em; }
li { margin-left: 3em; }
/* RFC-2629 <spanx>s and <artwork>s. */
em { font-style: italic; }
strong { font-weight: bold; }
dfn { font-weight: bold; font-style: normal; }
cite { font-weight: normal; font-style: normal; }
tt { color: #036; }
tt, pre, pre dfn, pre em, pre cite, pre span {
font-family: "Courier New", Courier, monospace; font-size: small;
}
pre {
text-align: left; padding: 4px;
color: #000; background-color: #CCC;
}
pre dfn { color: #900; }
pre em { color: #66F; background-color: #FFC; font-weight: normal; }
pre .key { color: #33C; font-weight: bold; }
pre .id { color: #900; }
pre .str { color: #000; background-color: #CFF; }
pre .val { color: #066; }
pre .rep { color: #909; }
pre .oth { color: #000; background-color: #FCF; }
pre .err { background-color: #FCC; }
/* RFC-2629 <texttable>s. */
table.all, table.full, table.headers, table.none {
font-size: small; text-align: center; border-width: 2px;
vertical-align: top; border-collapse: collapse;
}
table.all, table.full { border-style: solid; border-color: black; }
table.headers, table.none { border-style: none; }
th {
font-weight: bold; border-color: black;
border-width: 2px 2px 3px 2px;
}
table.all th, table.full th { border-style: solid; }
table.headers th { border-style: none none solid none; }
table.none th { border-style: none; }
table.all td {
border-style: solid; border-color: #333;
border-width: 1px 2px;
}
table.full td, table.headers td, table.none td { border-style: none; }
hr { height: 1px; }
hr.insert {
width: 80%; border-style: none; border-width: 0;
color: #CCC; background-color: #CCC;
}
--></style>
</head>
<body>
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<table summary="layout" width="66%" border="0" cellpadding="0" cellspacing="0"><tr><td><table summary="layout" width="100%" border="0" cellpadding="2" cellspacing="1">
<tr><td class="header">JOSE Working Group</td><td class="header">M. Jones</td></tr>
<tr><td class="header">Internet-Draft</td><td class="header">Microsoft</td></tr>
<tr><td class="header">Intended status: Standards Track</td><td class="header">E. Rescorla</td></tr>
<tr><td class="header">Expires: April 17, 2013</td><td class="header">RTFM</td></tr>
<tr><td class="header"> </td><td class="header">J. Hildebrand</td></tr>
<tr><td class="header"> </td><td class="header">Cisco</td></tr>
<tr><td class="header"> </td><td class="header">October 14, 2012</td></tr>
</table></td></tr></table>
<h1><br />JSON Web Encryption (JWE)<br />draft-ietf-jose-json-web-encryption-06</h1>
<h3>Abstract</h3>
<p>
JSON Web Encryption (JWE) is a means of representing encrypted
content using JavaScript Object Notation (JSON) data structures.
Cryptographic algorithms and identifiers for use with this
specification are described in the separate
JSON Web Algorithms (JWA) specification.
Related digital signature and MAC capabilities are described
in the separate JSON Web Signature (JWS) specification.
</p>
<h3>Status of this Memo</h3>
<p>
This Internet-Draft is submitted in full
conformance with the provisions of BCP 78 and BCP 79.</p>
<p>
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current
Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.</p>
<p>
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any time.
It is inappropriate to use Internet-Drafts as reference material or to cite
them other than as “work in progress.”</p>
<p>
This Internet-Draft will expire on April 17, 2013.</p>
<h3>Copyright Notice</h3>
<p>
Copyright (c) 2012 IETF Trust and the persons identified as the
document authors. All rights reserved.</p>
<p>
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.</p>
<a name="toc"></a><br /><hr />
<h3>Table of Contents</h3>
<p class="toc">
<a href="#anchor1">1.</a>
Introduction<br />
<a href="#anchor2">1.1.</a>
Notational Conventions<br />
<a href="#anchor3">2.</a>
Terminology<br />
<a href="#anchor4">3.</a>
JSON Web Encryption (JWE) Overview<br />
<a href="#ExampleAEADJWE">3.1.</a>
Example JWE with an Integrated Integrity Check<br />
<a href="#ExampleNonAEADJWE">3.2.</a>
Example JWE with a Separate Integrity Check<br />
<a href="#anchor5">4.</a>
JWE Header<br />
<a href="#ReservedHeaderParameterName">4.1.</a>
Reserved Header Parameter Names<br />
<a href="#algDef">4.1.1.</a>
"alg" (Algorithm) Header Parameter<br />
<a href="#encDef">4.1.2.</a>
"enc" (Encryption Method) Header Parameter<br />
<a href="#epkDef">4.1.3.</a>
"epk" (Ephemeral Public Key) Header Parameter<br />
<a href="#zipDef">4.1.4.</a>
"zip" (Compression Algorithm) Header Parameter<br />
<a href="#jkuDef">4.1.5.</a>
"jku" (JWK Set URL) Header Parameter<br />
<a href="#jwkDef">4.1.6.</a>
"jwk" (JSON Web Key) Header Parameter<br />
<a href="#x5uDef">4.1.7.</a>
"x5u" (X.509 URL) Header Parameter<br />
<a href="#x5tDef">4.1.8.</a>
"x5t" (X.509 Certificate Thumbprint) Header Parameter<br />
<a href="#x5cDef">4.1.9.</a>
"x5c" (X.509 Certificate Chain) Header Parameter<br />
<a href="#kidDef">4.1.10.</a>
"kid" (Key ID) Header Parameter<br />
<a href="#typDef">4.1.11.</a>
"typ" (Type) Header Parameter<br />
<a href="#ctyDef">4.1.12.</a>
"cty" (Content Type) Header Parameter<br />
<a href="#apuDef">4.1.13.</a>
"apu" (Agreement PartyUInfo) Header Parameter<br />
<a href="#apvDef">4.1.14.</a>
"apv" (Agreement PartyVInfo) Header Parameter<br />
<a href="#epuDef">4.1.15.</a>
"epu" (Encryption PartyUInfo) Header Parameter<br />
<a href="#epvDef">4.1.16.</a>
"epv" (Encryption PartyVInfo) Header Parameter<br />
<a href="#PublicHeaderParameterName">4.2.</a>
Public Header Parameter Names<br />
<a href="#PrivateHeaderParameterName">4.3.</a>
Private Header Parameter Names<br />
<a href="#sec.encryption">5.</a>
Message Encryption<br />
<a href="#sec.decryption">6.</a>
Message Decryption<br />
<a href="#sec.encrypt_cmk">7.</a>
CMK Encryption<br />
<a href="#Encrypting">8.</a>
Encrypting JWEs with Cryptographic Algorithms<br />
<a href="#IANA">9.</a>
IANA Considerations<br />
<a href="#HeaderParamReg">9.1.</a>
Registration of JWE Header Parameter Names<br />
<a href="#anchor6">9.1.1.</a>
Registry Contents<br />
<a href="#anchor7">9.2.</a>
JSON Web Signature and Encryption Type Values Registration<br />
<a href="#anchor8">9.2.1.</a>
Registry Contents<br />
<a href="#anchor9">9.3.</a>
Media Type Registration<br />
<a href="#anchor10">9.3.1.</a>
Registry Contents<br />
<a href="#Security">10.</a>
Security Considerations<br />
<a href="#rfc.references1">11.</a>
References<br />
<a href="#rfc.references1">11.1.</a>
Normative References<br />
<a href="#rfc.references2">11.2.</a>
Informative References<br />
<a href="#JWEExamples">Appendix A.</a>
JWE Examples<br />
<a href="#OAEPGCMExample">A.1.</a>
Example JWE using RSAES OAEP and AES GCM<br />
<a href="#anchor13">A.1.1.</a>
JWE Header<br />
<a href="#anchor14">A.1.2.</a>
Encoded JWE Header<br />
<a href="#anchor15">A.1.3.</a>
Content Master Key (CMK)<br />
<a href="#anchor16">A.1.4.</a>
Key Encryption<br />
<a href="#anchor17">A.1.5.</a>
Encoded JWE Encrypted Key<br />
<a href="#anchor18">A.1.6.</a>
Initialization Vector<br />
<a href="#anchor19">A.1.7.</a>
"Additional Authenticated Data" Parameter<br />
<a href="#anchor20">A.1.8.</a>
Plaintext Encryption<br />
<a href="#anchor21">A.1.9.</a>
Encoded JWE Ciphertext<br />
<a href="#anchor22">A.1.10.</a>
Encoded JWE Integrity Value<br />
<a href="#anchor23">A.1.11.</a>
Complete Representation<br />
<a href="#anchor24">A.1.12.</a>
Validation<br />
<a href="#RSACBCExample">A.2.</a>
Example JWE using RSAES-PKCS1-V1_5 and AES CBC<br />
<a href="#anchor25">A.2.1.</a>
JWE Header<br />
<a href="#anchor26">A.2.2.</a>
Encoded JWE Header<br />
<a href="#anchor27">A.2.3.</a>
Content Master Key (CMK)<br />
<a href="#anchor28">A.2.4.</a>
Key Encryption<br />
<a href="#anchor29">A.2.5.</a>
Encoded JWE Encrypted Key<br />
<a href="#anchor30">A.2.6.</a>
Key Derivation<br />
<a href="#anchor31">A.2.7.</a>
Initialization Vector<br />
<a href="#anchor32">A.2.8.</a>
Plaintext Encryption<br />
<a href="#anchor33">A.2.9.</a>
Encoded JWE Ciphertext<br />
<a href="#anchor34">A.2.10.</a>
Secured Input Value<br />
<a href="#anchor35">A.2.11.</a>
JWE Integrity Value<br />
<a href="#anchor36">A.2.12.</a>
Encoded JWE Integrity Value<br />
<a href="#anchor37">A.2.13.</a>
Complete Representation<br />
<a href="#anchor38">A.2.14.</a>
Validation<br />
<a href="#KeyWrapExample">A.3.</a>
Example JWE using AES Key Wrap and AES GCM<br />
<a href="#anchor39">A.3.1.</a>
JWE Header<br />
<a href="#anchor40">A.3.2.</a>
Encoded JWE Header<br />
<a href="#anchor41">A.3.3.</a>
Content Master Key (CMK)<br />
<a href="#anchor42">A.3.4.</a>
Key Encryption<br />
<a href="#anchor43">A.3.5.</a>
Encoded JWE Encrypted Key<br />
<a href="#anchor44">A.3.6.</a>
Initialization Vector<br />
<a href="#anchor45">A.3.7.</a>
"Additional Authenticated Data" Parameter<br />
<a href="#anchor46">A.3.8.</a>
Plaintext Encryption<br />
<a href="#anchor47">A.3.9.</a>
Encoded JWE Ciphertext<br />
<a href="#anchor48">A.3.10.</a>
Encoded JWE Integrity Value<br />
<a href="#anchor49">A.3.11.</a>
Complete Representation<br />
<a href="#anchor50">A.3.12.</a>
Validation<br />
<a href="#KeyDeriv1">A.4.</a>
Example Key Derivation for "enc" value "A128CBC+HS256"<br />
<a href="#anchor51">A.4.1.</a>
CEK Generation<br />
<a href="#anchor52">A.4.2.</a>
CIK Generation<br />
<a href="#KeyDeriv512">A.5.</a>
Example Key Derivation for "enc" value "A256CBC+HS512"<br />
<a href="#anchor53">A.5.1.</a>
CEK Generation<br />
<a href="#anchor54">A.5.2.</a>
CIK Generation<br />
<a href="#Acknowledgements">Appendix B.</a>
Acknowledgements<br />
<a href="#TBD">Appendix C.</a>
Open Issues<br />
<a href="#anchor55">Appendix D.</a>
Document History<br />
<a href="#rfc.authors">§</a>
Authors' Addresses<br />
</p>
<br clear="all" />
<a name="anchor1"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.1"></a><h3>1.
Introduction</h3>
<p>
JSON Web Encryption (JWE) is a compact encryption format
intended for space constrained environments such as HTTP
Authorization headers and URI query parameters.
It represents this content using JavaScript Object Notation (JSON)
<a class='info' href='#RFC4627'>[RFC4627]<span> (</span><span class='info'>Crockford, D., “The application/json Media Type for JavaScript Object Notation (JSON),” July 2006.</span><span>)</span></a> based data structures.
The JWE cryptographic mechanisms encrypt and provide integrity protection for
arbitrary sequences of bytes.
</p>
<p>
Cryptographic algorithms and identifiers for use with this
specification are described in the separate
JSON Web Algorithms (JWA) <a class='info' href='#JWA'>[JWA]<span> (</span><span class='info'>Jones, M., “JSON Web Algorithms (JWA),” October 2012.</span><span>)</span></a> specification.
Related digital signature and MAC capabilities are described
in the separate JSON Web Signature (JWS) <a class='info' href='#JWS'>[JWS]<span> (</span><span class='info'>Jones, M., Bradley, J., and N. Sakimura, “JSON Web Signature (JWS),” October 2012.</span><span>)</span></a>
specification.
</p>
<a name="anchor2"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.1.1"></a><h3>1.1.
Notational Conventions</h3>
<p>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL",
"SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY",
and "OPTIONAL" in this document are to be interpreted as
described in
Key words for use in RFCs to Indicate Requirement Levels <a class='info' href='#RFC2119'>[RFC2119]<span> (</span><span class='info'>Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” March 1997.</span><span>)</span></a>.
</p>
<a name="anchor3"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.2"></a><h3>2.
Terminology</h3>
<p>
</p>
<blockquote class="text"><dl>
<dt>JSON Web Encryption (JWE)</dt>
<dd>
A data structure representing an encrypted message.
The structure consists of five parts:
the JWE Header, the JWE Encrypted Key,
the JWE Initialization Vector, the JWE Ciphertext, and
the JWE Integrity Value.
</dd>
<dt>Plaintext</dt>
<dd>
The bytes to be encrypted - a.k.a., the message.
The plaintext can contain an arbitrary sequence of bytes.
</dd>
<dt>Ciphertext</dt>
<dd>
An encrypted representation of the Plaintext.
</dd>
<dt>Content Encryption Key (CEK)</dt>
<dd>
A symmetric key used to encrypt the Plaintext for the
recipient to produce the Ciphertext.
</dd>
<dt>Content Integrity Key (CIK)</dt>
<dd>
A key used with a MAC function to ensure the integrity
of the Ciphertext and the parameters used to create it.
</dd>
<dt>Content Master Key (CMK)</dt>
<dd>
A key from which the CEK and CIK are derived.
When key wrapping or key encryption are employed, the CMK
is randomly generated and encrypted to the recipient as
the JWE Encrypted Key.
When direct encryption with a shared symmetric key is employed,
the CMK is the shared key.
When key agreement without key wrapping is employed,
the CMK is the result of the key agreement algorithm.
</dd>
<dt>JWE Header</dt>
<dd>
A string representing a JSON object that describes the
encryption operations applied to create the JWE Encrypted
Key, the JWE Ciphertext, and the JWE Integrity Value.
</dd>
<dt>JWE Encrypted Key</dt>
<dd>
When key wrapping or key encryption are employed,
the Content Master Key (CMK) is encrypted with the
intended recipient's key and the resulting encrypted
content is recorded as a byte array, which is referred to
as the JWE Encrypted Key.
Otherwise, when direct encryption with a shared or
agreed upon symmetric key is employed,
the JWE Encrypted Key is the empty byte array.
</dd>
<dt>JWE Initialization Vector</dt>
<dd>
A byte array containing the Initialization Vector used
when encrypting the Plaintext.
</dd>
<dt>JWE Ciphertext</dt>
<dd>
A byte array containing the Ciphertext.
</dd>
<dt>JWE Integrity Value</dt>
<dd>
A byte array containing a MAC value that ensures the
integrity of the Ciphertext and the parameters used to
create it.
</dd>
<dt>Base64url Encoding</dt>
<dd>
The URL- and filename-safe Base64 encoding
described in <a class='info' href='#RFC4648'>RFC 4648<span> (</span><span class='info'>Josefsson, S., “The Base16, Base32, and Base64 Data Encodings,” October 2006.</span><span>)</span></a> [RFC4648],
Section 5, with the (non URL-safe) '=' padding characters
omitted, as permitted by Section 3.2. (See Appendix C of
<a class='info' href='#JWS'>[JWS]<span> (</span><span class='info'>Jones, M., Bradley, J., and N. Sakimura, “JSON Web Signature (JWS),” October 2012.</span><span>)</span></a> for notes on implementing base64url
encoding without padding.)
</dd>
<dt>Encoded JWE Header</dt>
<dd>
Base64url encoding of the bytes of the
UTF-8 <a class='info' href='#RFC3629'>[RFC3629]<span> (</span><span class='info'>Yergeau, F., “UTF-8, a transformation format of ISO 10646,” November 2003.</span><span>)</span></a>
representation of the JWE Header.
</dd>
<dt>Encoded JWE Encrypted Key</dt>
<dd>
Base64url encoding of the JWE Encrypted Key.
</dd>
<dt>Encoded JWE Initialization Vector</dt>
<dd>
Base64url encoding of the JWE Initialization Vector.
</dd>
<dt>Encoded JWE Ciphertext</dt>
<dd>
Base64url encoding of the JWE Ciphertext.
</dd>
<dt>Encoded JWE Integrity Value</dt>
<dd>
Base64url encoding of the JWE Integrity Value.
</dd>
<dt>Header Parameter Name</dt>
<dd>
The name of a member of the JSON object representing a
JWE Header.
</dd>
<dt>Header Parameter Value</dt>
<dd>
The value of a member of the JSON object representing a
JWE Header.
</dd>
<dt>JWE Compact Serialization</dt>
<dd>
A representation of the JWE as the concatenation of
the Encoded JWE Header,
the Encoded JWE Encrypted Key,
the Encoded JWE Initialization Vector,
the Encoded JWE Ciphertext, and
the Encoded JWE Integrity Value
in that order, with the five strings being separated
by four period ('.') characters.
</dd>
<dt>AEAD Algorithm</dt>
<dd>
An Authenticated Encryption with Associated Data (AEAD)
<a class='info' href='#RFC5116'>[RFC5116]<span> (</span><span class='info'>McGrew, D., “An Interface and Algorithms for Authenticated Encryption,” January 2008.</span><span>)</span></a> encryption algorithm is one that
provides an integrated content integrity check. AES
Galois/Counter Mode (GCM) is one such algorithm.
</dd>
<dt>Collision Resistant Namespace</dt>
<dd>
A namespace that allows names to be allocated in a manner
such that they are highly unlikely to collide with other names.
For instance, collision resistance can be achieved through
administrative delegation of portions of the namespace or
through use of collision-resistant name allocation functions.
Examples of Collision Resistant Namespaces include:
Domain Names,
Object Identifiers (OIDs) as defined in the ITU-T X.660
and X.670 Recommendation series, and
Universally Unique IDentifiers (UUIDs)
<a class='info' href='#RFC4122'>[RFC4122]<span> (</span><span class='info'>Leach, P., Mealling, M., and R. Salz, “A Universally Unique IDentifier (UUID) URN Namespace,” July 2005.</span><span>)</span></a>.
When using an administratively 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.
</dd>
<dt>StringOrURI</dt>
<dd>
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
<a class='info' href='#RFC3986'>[RFC3986]<span> (</span><span class='info'>Berners-Lee, T., Fielding, R., and L. Masinter, “Uniform Resource Identifier (URI): Generic Syntax,” January 2005.</span><span>)</span></a>.
StringOrURI values are compared as case-sensitive strings
with no transformations or canonicalizations applied.
</dd>
</dl></blockquote><p>
</p>
<a name="anchor4"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.3"></a><h3>3.
JSON Web Encryption (JWE) Overview</h3>
<p>
JWE represents encrypted content using JSON data
structures and base64url encoding. The representation
consists of five parts:
the JWE Header,
the JWE Encrypted Key,
the JWE Initialization Vector,
the JWE Ciphertext, and
the JWE Integrity Value.
In the Compact Serialization, the five parts are
base64url-encoded for transmission, and represented
as the concatenation of the encoded strings in that order,
with the five strings being separated by four period ('.') characters.
(A JSON Serialization for this information is defined in the separate
JSON Web Encryption JSON Serialization (JWE-JS) <a class='info' href='#JWE-JS'>[JWE‑JS]<span> (</span><span class='info'>Jones, M., “JSON Web Encryption JSON Serialization (JWE-JS),” October 2012.</span><span>)</span></a>
specification.)
</p>
<p>
JWE utilizes encryption to ensure the confidentiality
of the Plaintext. JWE adds a content
integrity check if not provided by the underlying encryption
algorithm.
</p>
<a name="ExampleAEADJWE"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.3.1"></a><h3>3.1.
Example JWE with an Integrated Integrity Check</h3>
<p>
This example encrypts the plaintext
"Live long and prosper."
to the recipient using RSAES OAEP and AES GCM.
The AES GCM algorithm has an integrated integrity check.
</p>
<p>
The following example JWE Header declares that:
</p>
<ul class="text">
<li>
the Content Master Key is encrypted to the recipient
using the RSAES OAEP algorithm to produce the JWE
Encrypted Key and
</li>
<li>
the Plaintext is encrypted using the AES GCM
algorithm with a 256 bit key to produce the Ciphertext.
</li>
</ul><p>
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
{"alg":"RSA-OAEP","enc":"A256GCM"}
</pre></div>
<p>
Base64url encoding the bytes of the UTF-8 representation of
the JWE Header yields this Encoded JWE Header value:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ
</pre></div>
<p>
The remaining steps to finish creating this JWE are:
</p>
<ul class="text">
<li>
Generate a random Content Master Key (CMK)
</li>
<li>
Encrypt the CMK with the recipient's public key using the RSAES OAEP
algorithm to produce the JWE Encrypted Key
</li>
<li>
Base64url encode the JWE Encrypted Key to produce the Encoded JWE Encrypted Key
</li>
<li>
Generate a random JWE Initialization Vector
</li>
<li>
Base64url encode the JWE Initialization Vector to produce the Encoded JWE Initialization Vector
</li>
<li>
Concatenate
the Encoded JWE Header value, a period character ('.'),
the Encoded JWE Encrypted Key, a second period character ('.'), and
the Encoded JWE Initialization Vector
to create the "additional authenticated data"
parameter for the AES GCM algorithm
</li>
<li>
Encrypt the Plaintext with AES GCM, using the CMK as the encryption key,
the JWE Initialization Vector,
and the "additional authenticated data" value above,
requesting a 128 bit "authentication tag" output
</li>
<li>
Base64url encode the resulting Ciphertext to create the Encoded JWE Ciphertext
</li>
<li>
Base64url encode the resulting "authentication tag" to create the Encoded JWE Integrity Value
</li>
<li>
Assemble the final representation:
The Compact Serialization of this result is the
concatenation of
the Encoded JWE Header,
the Encoded JWE Encrypted Key,
the Encoded JWE Initialization Vector,
the Encoded JWE Ciphertext, and
the Encoded JWE Integrity Value
in that order, with the five strings
being separated by four period ('.') characters.
</li>
</ul><p>
The final result in this example
(with line breaks for display purposes only) is:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ.
M2XxpbORKezKSzzQL_95-GjiudRBTqn_omS8z9xgoRb7L0Jw5UsEbxmtyHn2T71m
rZLkjg4Mp8gbhYoltPkEOHvAopz25-vZ8C2e1cOaAo5WPcbSIuFcB4DjBOM3t0UA
O6JHkWLuAEYoe58lcxIQneyKdaYSLbV9cKqoUoFQpvKWYRHZbfszIyfsa18rmgTj
zrtLDTPnc09DSJE24aQ8w3i8RXEDthW9T1J6LsTH_vwHdwUgkI-tC2PNeGrnM-dN
SfzF3Y7-lwcGy0FsdXkPXytvDV7y4pZeeUiQ-0VdibIN2AjjfW60nfrPuOjepMFG
6BBBbR37pHcyzext9epOAQ.
48V1_ALb6US04U3b.
_e21tGGhac_peEFkLXr2dMPUZiUkrw.
7V5ZDko0v_mf2PAc4JMiUg
</pre></div>
<p>
See <a class='info' href='#OAEPGCMExample'>Appendix A.1<span> (</span><span class='info'>Example JWE using RSAES OAEP and AES GCM</span><span>)</span></a> for the complete details of computing this JWE.
</p>
<a name="ExampleNonAEADJWE"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.3.2"></a><h3>3.2.
Example JWE with a Separate Integrity Check</h3>
<p>
This example encrypts the plaintext
"No matter where you go, there you are."
to the recipient using RSAES-PKCS1-V1_5 and AES CBC.
AES CBC does not have an integrated integrity check,
so a separate integrity check calculation is performed using HMAC SHA-256,
with separate encryption and integrity keys being derived from a master key
using the Concat KDF with the SHA-256 digest function.
</p>
<p>
The following example JWE Header (with line breaks for display purposes only) declares that:
</p>
<ul class="text">
<li>
the Content Master Key is encrypted to the recipient
using the RSAES-PKCS1-V1_5 algorithm to produce the JWE
Encrypted Key and
</li>
<li>
the Plaintext is encrypted using the AES CBC
algorithm with a 128 bit key to produce the Ciphertext,
with the integrity of the
Ciphertext and the parameters used to create it being
secured using the HMAC SHA-256 algorithm.
</li>
</ul><p>
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
{"alg":"RSA1_5","enc":"A128CBC+HS256"}
</pre></div>
<p>
Base64url encoding the bytes of the UTF-8 representation of
the JWE Header yields this Encoded JWE Header value:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
eyJhbGciOiJSU0ExXzUiLCJlbmMiOiJBMTI4Q0JDK0hTMjU2In0
</pre></div>
<p>
The remaining steps to finish creating this JWE are like the previous example,
but with an additional step to compute the separate integrity value:
</p>
<ul class="text">
<li>
Generate a random Content Master Key (CMK)
</li>
<li>
Encrypt the CMK with the recipient's public key using the RSAES-PKCS1-V1_5
algorithm to produce the JWE Encrypted Key
</li>
<li>
Base64url encode the JWE Encrypted Key to produce the Encoded JWE Encrypted Key
</li>
<li>
Generate a random JWE Initialization Vector
</li>
<li>
Base64url encode the JWE Initialization Vector to produce the Encoded JWE Initialization Vector
</li>
<li>
Use the Concat key derivation function
to derive Content Encryption Key (CEK)
and Content Integrity Key (CIK) values from the CMK
</li>
<li>
Encrypt the Plaintext with AES CBC using
the CEK and JWE Initialization Vector to produce the Ciphertext
</li>
<li>
Base64url encode the resulting Ciphertext to create the Encoded JWE Ciphertext
</li>
<li>
Concatenate
the Encoded JWE Header value, a period character ('.'),
the Encoded JWE Encrypted Key, a second period character ('.'),
the Encoded JWE Initialization Vector, a third period ('.') character, and
the Encoded JWE Ciphertext
to create the value to integrity protect
</li>
<li>
Compute the HMAC SHA-256 of this value using the CIK to create the JWE Integrity Value
</li>
<li>
Base64url encode the resulting JWE Integrity Value to create the Encoded JWE Integrity Value
</li>
<li>
Assemble the final representation:
The Compact Serialization of this result is the
concatenation of
the Encoded JWE Header,
the Encoded JWE Encrypted Key,
the Encoded JWE Initialization Vector,
the Encoded JWE Ciphertext, and
the Encoded JWE Integrity Value
in that order, with the five strings
being separated by four period ('.') characters.
</li>
</ul><p>
The final result in this example
(with line breaks for display purposes only) is:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
eyJhbGciOiJSU0ExXzUiLCJlbmMiOiJBMTI4Q0JDK0hTMjU2In0.
O6AqXqgVlJJ4c4lp5sXZd7bpGHAw6ARkHUeXQxD1cAW4-X1x0qtj_AN0mukqEOl4
Y6UOwJXIJY9-G1ELK-RQWrKH_StR-AM9H7GpKmSEji8QYOcMOjr-u9H1Lt_pBEie
G802SxWz0rbFTXRcj4BWLxcpCtjUZ31AP-sc-L_eCZ5UNl0aSRNqFskuPkzRsFZR
DJqSSJeVOyJ7pZCQ83fli19Vgi_3R7XMUqluQuuc7ZHOWixi47jXlBTlWRZ5iFxa
S8G6J8wUrd4BKggAw3qX5XoIfXQVlQZE0Vmkq_zQSIo5LnFKyowooRcdsEuNh9B9
Mkyt0ZQElG-jGdtHWjZSOA.
AxY8DCtDaGlsbGljb3RoZQ.
1eBWFgcrz40wC88cgv8rPgu3EfmC1p4zT0kIxxfSF2zDJcQ-iEHk1jQM95xAdr5Z.
RBGhYzE8_cZLHjJqqHuLhzbgWgL_wV3LDSUrcbkOiIA
</pre></div>
<p>
See <a class='info' href='#RSACBCExample'>Appendix A.2<span> (</span><span class='info'>Example JWE using RSAES-PKCS1-V1_5 and AES CBC</span><span>)</span></a> for the complete details of computing this JWE.
</p>
<a name="anchor5"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4"></a><h3>4.
JWE Header</h3>
<p>
The members of the JSON object represented by the JWE Header
describe the encryption applied to the Plaintext and optionally
additional properties of the JWE.
The Header Parameter Names within this object MUST be unique;
JWEs with duplicate Header Parameter Names MUST be rejected.
Implementations MUST understand the entire contents of the
header; otherwise, the JWE MUST be rejected.
</p>
<p>
There are two ways of distinguishing whether a header is a
JWS Header or a JWE Header.
The first is by examining the <tt>alg</tt>
(algorithm) header value.
If the value represents a digital signature or MAC algorithm,
or is the value <tt>none</tt>, it is for a JWS;
if it represents an encryption or key agreement algorithm, it is for a JWE.
A second method is determining whether an
<tt>enc</tt> (encryption method) member exists.
If the <tt>enc</tt> member exists, it is a JWE;
otherwise, it is a JWS.
Both methods will yield the same result for all legal input values.
</p>
<p>
There are three classes of Header Parameter Names:
Reserved Header Parameter Names, Public Header Parameter Names,
and Private Header Parameter Names.
</p>
<a name="ReservedHeaderParameterName"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1"></a><h3>4.1.
Reserved Header Parameter Names</h3>
<p>
The following header parameter names are reserved
with meanings as defined below. All the
names are short because a core goal of JWE is for the
representations to be compact.
</p>
<p>
Additional reserved header parameter names MAY be defined
via the IANA
JSON Web Signature and Encryption Header Parameters registry
<a class='info' href='#JWS'>[JWS]<span> (</span><span class='info'>Jones, M., Bradley, J., and N. Sakimura, “JSON Web Signature (JWS),” October 2012.</span><span>)</span></a>.
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.
</p>
<a name="algDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.1"></a><h3>4.1.1.
"alg" (Algorithm) Header Parameter</h3>
<p>
The <tt>alg</tt> (algorithm) header
parameter identifies the cryptographic algorithm used to
encrypt or determine the value of the Content Master Key (CMK).
The algorithm specified by the <tt>alg</tt> value
MUST be supported by the implementation
and there MUST be a key for use with that algorithm associated with the
intended recipient
or the JWE MUST be rejected.
<tt>alg</tt> values SHOULD either be
registered in the IANA
JSON Web Signature and Encryption Algorithms registry
<a class='info' href='#JWA'>[JWA]<span> (</span><span class='info'>Jones, M., “JSON Web Algorithms (JWA),” October 2012.</span><span>)</span></a> or be
a URI that contains a Collision Resistant Namespace.
The <tt>alg</tt> value is a case sensitive string
containing a StringOrURI value.
This header parameter is REQUIRED.
</p>
<p>
A list of defined <tt>alg</tt> values can be found
in the IANA JSON Web Signature and Encryption Algorithms registry
<a class='info' href='#JWA'>[JWA]<span> (</span><span class='info'>Jones, M., “JSON Web Algorithms (JWA),” October 2012.</span><span>)</span></a>;
the initial contents of this registry is the values defined in
Section 4.1 of the
JSON Web Algorithms (JWA) <a class='info' href='#JWA'>[JWA]<span> (</span><span class='info'>Jones, M., “JSON Web Algorithms (JWA),” October 2012.</span><span>)</span></a> specification.
</p>
<a name="encDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.2"></a><h3>4.1.2.
"enc" (Encryption Method) Header Parameter</h3>
<p>
The <tt>enc</tt> (encryption method)
header parameter identifies the symmetric
encryption algorithm used to encrypt the Plaintext to produce the Ciphertext.
The algorithm specified by the <tt>enc</tt> value
MUST be supported by the implementation
or the JWE MUST be rejected.
<tt>enc</tt> values SHOULD either be
registered in the IANA
JSON Web Signature and Encryption Algorithms registry
<a class='info' href='#JWA'>[JWA]<span> (</span><span class='info'>Jones, M., “JSON Web Algorithms (JWA),” October 2012.</span><span>)</span></a> or be
a URI that contains a Collision Resistant Namespace.
The <tt>enc</tt> value is a case sensitive string
containing a StringOrURI value.
This header parameter is REQUIRED.
</p>
<p>
A list of defined <tt>enc</tt> values can be found
in the IANA JSON Web Signature and Encryption Algorithms registry
<a class='info' href='#JWA'>[JWA]<span> (</span><span class='info'>Jones, M., “JSON Web Algorithms (JWA),” October 2012.</span><span>)</span></a>;
the initial contents of this registry is the values defined in
Section 4.2 of the
JSON Web Algorithms (JWA) <a class='info' href='#JWA'>[JWA]<span> (</span><span class='info'>Jones, M., “JSON Web Algorithms (JWA),” October 2012.</span><span>)</span></a> specification.
</p>
<a name="epkDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.3"></a><h3>4.1.3.
"epk" (Ephemeral Public Key) Header Parameter</h3>
<p>
The <tt>epk</tt> (ephemeral public key)
value created by the originator for the use in key agreement algorithms.
This key is represented as a JSON Web Key <a class='info' href='#JWK'>[JWK]<span> (</span><span class='info'>Jones, M., “JSON Web Key (JWK),” October 2012.</span><span>)</span></a> value.
This header parameter is OPTIONAL, although its use is
REQUIRED with some <tt>alg</tt> algorithms.
</p>
<a name="zipDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.4"></a><h3>4.1.4.
"zip" (Compression Algorithm) Header Parameter</h3>
<p>
The <tt>zip</tt> (compression algorithm)
applied to the Plaintext before encryption, if any.
If present, the value of the <tt>zip</tt>
header parameter MUST be the case sensitive string "DEF".
Compression is performed with the
DEFLATE <a class='info' href='#RFC1951'>[RFC1951]<span> (</span><span class='info'>Deutsch, P., “DEFLATE Compressed Data Format Specification version 1.3,” May 1996.</span><span>)</span></a> algorithm.
If no <tt>zip</tt> parameter is present,
no compression is applied to the Plaintext before encryption.
This header parameter is OPTIONAL.
</p>
<a name="jkuDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.5"></a><h3>4.1.5.
"jku" (JWK Set URL) Header Parameter</h3>
<p>
The <tt>jku</tt> (JWK Set URL)
header parameter is a URI <a class='info' href='#RFC3986'>[RFC3986]<span> (</span><span class='info'>Berners-Lee, T., Fielding, R., and L. Masinter, “Uniform Resource Identifier (URI): Generic Syntax,” January 2005.</span><span>)</span></a> 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; this can be used to determine the private key needed to decrypt the JWE.
The keys MUST be encoded as a JSON Web Key Set (JWK Set) <a class='info' href='#JWK'>[JWK]<span> (</span><span class='info'>Jones, M., “JSON Web Key (JWK),” October 2012.</span><span>)</span></a>.
The protocol used to acquire the resource MUST provide
integrity protection; an HTTP GET request to retrieve the
certificate MUST use TLS <a class='info' href='#RFC2818'>[RFC2818]<span> (</span><span class='info'>Rescorla, E., “HTTP Over TLS,” May 2000.</span><span>)</span></a> <a class='info' href='#RFC5246'>[RFC5246]<span> (</span><span class='info'>Dierks, T. and E. Rescorla, “The Transport Layer Security (TLS) Protocol Version 1.2,” August 2008.</span><span>)</span></a>;
the identity of the server MUST be validated, as per
Section 3.1 of HTTP Over TLS <a class='info' href='#RFC2818'>[RFC2818]<span> (</span><span class='info'>Rescorla, E., “HTTP Over TLS,” May 2000.</span><span>)</span></a>.
This header parameter is OPTIONAL.
</p>
<a name="jwkDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.6"></a><h3>4.1.6.
"jwk" (JSON Web Key) Header Parameter</h3>
<p>
The <tt>jwk</tt> (JSON Web Key)
header parameter is a public key that corresponds to the key used to
encrypt the JWE; this can be used to determine the private key needed to decrypt the JWE.
This key is represented as a JSON Web Key <a class='info' href='#JWK'>[JWK]<span> (</span><span class='info'>Jones, M., “JSON Web Key (JWK),” October 2012.</span><span>)</span></a>.
This header parameter is OPTIONAL.
</p>
<a name="x5uDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.7"></a><h3>4.1.7.
"x5u" (X.509 URL) Header Parameter</h3>
<p>
The <tt>x5u</tt> (X.509 URL) header
parameter is a URI <a class='info' href='#RFC3986'>[RFC3986]<span> (</span><span class='info'>Berners-Lee, T., Fielding, R., and L. Masinter, “Uniform Resource Identifier (URI): Generic Syntax,” January 2005.</span><span>)</span></a> that refers to a resource for
the X.509 public key certificate or certificate chain <a class='info' href='#RFC5280'>[RFC5280]<span> (</span><span class='info'>Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, “Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile,” May 2008.</span><span>)</span></a>
corresponding to the key used to
encrypt the JWE; this can be used to determine the private key needed to decrypt the JWE.
The identified resource MUST provide a representation of
the certificate or certificate chain that conforms to
<a class='info' href='#RFC5280'>RFC 5280<span> (</span><span class='info'>Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, “Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile,” May 2008.</span><span>)</span></a> [RFC5280] in PEM encoded form
<a class='info' href='#RFC1421'>[RFC1421]<span> (</span><span class='info'>Linn, J., “Privacy Enhancement for Internet Electronic Mail: Part I: Message Encryption and Authentication Procedures,” February 1993.</span><span>)</span></a>.
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 <a class='info' href='#RFC2818'>[RFC2818]<span> (</span><span class='info'>Rescorla, E., “HTTP Over TLS,” May 2000.</span><span>)</span></a> <a class='info' href='#RFC5246'>[RFC5246]<span> (</span><span class='info'>Dierks, T. and E. Rescorla, “The Transport Layer Security (TLS) Protocol Version 1.2,” August 2008.</span><span>)</span></a>;
the identity of the server MUST be validated, as per
Section 3.1 of HTTP Over TLS <a class='info' href='#RFC2818'>[RFC2818]<span> (</span><span class='info'>Rescorla, E., “HTTP Over TLS,” May 2000.</span><span>)</span></a>.
This header parameter is OPTIONAL.
</p>
<a name="x5tDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.8"></a><h3>4.1.8.
"x5t" (X.509 Certificate Thumbprint) Header Parameter</h3>
<p>
The <tt>x5t</tt> (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 <a class='info' href='#RFC5280'>[RFC5280]<span> (</span><span class='info'>Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, “Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile,” May 2008.</span><span>)</span></a> corresponding to the key used to
encrypt the JWE; this can be used to determine the private key needed to decrypt the JWE.
This header parameter is OPTIONAL.
</p>
<p>
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 <tt>x5t#S256</tt> (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 <a class='info' href='#JWS'>[JWS]<span> (</span><span class='info'>Jones, M., Bradley, J., and N. Sakimura, “JSON Web Signature (JWS),” October 2012.</span><span>)</span></a>.
</p>
<a name="x5cDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.9"></a><h3>4.1.9.
"x5c" (X.509 Certificate Chain) Header Parameter</h3>
<p>
The <tt>x5c</tt> (X.509 Certificate Chain)
header parameter contains the X.509 public key
certificate or certificate chain <a class='info' href='#RFC5280'>[RFC5280]<span> (</span><span class='info'>Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, “Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile,” May 2008.</span><span>)</span></a>
corresponding to the key used to
encrypt the JWE; this can be used to determine the private key needed to decrypt the JWE.
The certificate or certificate chain is represented as an
array of certificate value strings. Each string is a
base64 encoded (<a class='info' href='#RFC4648'>[RFC4648]<span> (</span><span class='info'>Josefsson, S., “The Base16, Base32, and Base64 Data Encodings,” October 2006.</span><span>)</span></a> Section 4 - not base64url encoded)
DER <a class='info' href='#ITU.X690.1994'>[ITU.X690.1994]<span> (</span><span class='info'>International Telecommunications Union, “Information Technology - ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER),” 1994.</span><span>)</span></a> 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 <a class='info' href='#RFC5280'>[RFC5280]<span> (</span><span class='info'>Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, “Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile,” May 2008.</span><span>)</span></a> and reject the JWE if any
validation failure occurs.
This header parameter is OPTIONAL.
</p>
<p>
See Appendix B of <a class='info' href='#JWS'>[JWS]<span> (</span><span class='info'>Jones, M., Bradley, J., and N. Sakimura, “JSON Web Signature (JWS),” October 2012.</span><span>)</span></a> for an example
<tt>x5c</tt> value.
</p>
<a name="kidDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.10"></a><h3>4.1.10.
"kid" (Key ID) Header Parameter</h3>
<p>
The <tt>kid</tt> (key ID) header
parameter is a hint indicating which key was used to
encrypt the JWE; this can be used to determine the private key needed to decrypt the JWE.
This parameter allows originators to explicitly signal a change of
key to recipients.
Should the recipient be unable to locate a key
corresponding to the <tt>kid</tt>
value, they SHOULD treat that condition as an error.
The interpretation of the
<tt>kid</tt> value is unspecified.
Its value MUST be a string.
This header parameter is OPTIONAL.
</p>
<p>
When used with a JWK, the <tt>kid</tt>
value MAY be used to match a JWK <tt>kid</tt>
parameter value.
</p>
<a name="typDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.11"></a><h3>4.1.11.
"typ" (Type) Header Parameter</h3>
<p>
The <tt>typ</tt> (type) header
parameter is used to declare the type of this object.
The type value <tt>JWE</tt> MAY be used
to indicate that this object is a JWE.
The <tt>typ</tt> value is a case sensitive string.
This header parameter is OPTIONAL.
</p>
<p>
MIME Media Type <a class='info' href='#RFC2046'>[RFC2046]<span> (</span><span class='info'>Freed, N. and N. Borenstein, “Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types,” November 1996.</span><span>)</span></a>
values MAY be used as <tt>typ</tt> values.
</p>
<p>
<tt>typ</tt> values SHOULD either be
registered in the IANA
JSON Web Signature and Encryption Type Values registry
<a class='info' href='#JWS'>[JWS]<span> (</span><span class='info'>Jones, M., Bradley, J., and N. Sakimura, “JSON Web Signature (JWS),” October 2012.</span><span>)</span></a> or be
a URI that contains a Collision Resistant Namespace.
</p>
<a name="ctyDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.12"></a><h3>4.1.12.
"cty" (Content Type) Header Parameter</h3>
<p>
The <tt>cty</tt> (content type) header
parameter is used to declare the type of the encrypted
content (the Plaintext).
The <tt>cty</tt> value is a case sensitive string.
This header parameter is OPTIONAL.
</p>
<p>
The values used for the <tt>cty</tt>
header parameter come from the same value space as the
<tt>typ</tt> header parameter,
with the same rules applying.
</p>
<a name="apuDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.13"></a><h3>4.1.13.
"apu" (Agreement PartyUInfo) Header Parameter</h3>
<p>
The <tt>apu</tt> (agreement PartyUInfo)
value for key agreement algorithms using it
(such as <tt>ECDH-ES</tt>),
represented as a base64url encoded string.
This header parameter is OPTIONAL.
</p>
<a name="apvDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.14"></a><h3>4.1.14.
"apv" (Agreement PartyVInfo) Header Parameter</h3>
<p>
The <tt>apv</tt> (agreement PartyVInfo)
value for key agreement algorithms using it
(such as <tt>ECDH-ES</tt>),
represented as a base64url encoded string.
This header parameter is OPTIONAL.
</p>
<a name="epuDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.15"></a><h3>4.1.15.
"epu" (Encryption PartyUInfo) Header Parameter</h3>
<p>
The <tt>epu</tt> (encryption PartyUInfo)
value for plaintext encryption algorithms using it
(such as <tt>A128CBC+HS256</tt>),
represented as a base64url encoded string.
This header parameter is OPTIONAL.
</p>
<a name="epvDef"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.1.16"></a><h3>4.1.16.
"epv" (Encryption PartyVInfo) Header Parameter</h3>
<p>
The <tt>epv</tt> (encryption PartyVInfo)
value for plaintext encryption algorithms using it
(such as <tt>A128CBC+HS256</tt>),
represented as a base64url encoded string.
This header parameter is OPTIONAL.
</p>
<a name="PublicHeaderParameterName"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.2"></a><h3>4.2.
Public Header Parameter Names</h3>
<p>
Additional header parameter names can be defined by those
using JWEs. However, in order to prevent collisions, any new
header parameter name SHOULD either be registered in the IANA
JSON Web Signature and Encryption Header Parameters registry
<a class='info' href='#JWS'>[JWS]<span> (</span><span class='info'>Jones, M., Bradley, J., and N. Sakimura, “JSON Web Signature (JWS),” October 2012.</span><span>)</span></a> or be
a URI that contains a Collision Resistant Namespace.
In each case, the definer of the name
or value needs to take reasonable precautions to make sure they
are in control of the part of the namespace they use to
define the header parameter name.
</p>
<p>
New header parameters should be introduced sparingly, as
they can result in non-interoperable JWEs.
</p>
<a name="PrivateHeaderParameterName"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.4.3"></a><h3>4.3.
Private Header Parameter Names</h3>
<p>
A producer and consumer of a JWE may agree to any header
parameter name that is not a Reserved Name <a class='info' href='#ReservedHeaderParameterName'>Section 4.1<span> (</span><span class='info'>Reserved Header Parameter Names</span><span>)</span></a> or a Public
Name <a class='info' href='#PublicHeaderParameterName'>Section 4.2<span> (</span><span class='info'>Public Header Parameter Names</span><span>)</span></a>. Unlike Public
Names, these private names are subject to collision and
should be used with caution.
</p>
<a name="sec.encryption"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.5"></a><h3>5.
Message Encryption</h3>
<p>
The message encryption process is as follows. The order of
the steps is not significant in cases where there are no
dependencies between the inputs and outputs of the steps.
</p>
<p></p>
<ol class="text">
<li>
When key wrapping, key encryption,
or key agreement with key wrapping are employed,
generate a random Content Master Key (CMK).
See <a class='info' href='#RFC4086'>RFC 4086<span> (</span><span class='info'>Eastlake, D., Schiller, J., and S. Crocker, “Randomness Requirements for Security,” June 2005.</span><span>)</span></a> [RFC4086] for
considerations on generating random values.
The CMK MUST have a length equal to that
required for the block encryption algorithm.
</li>
<li>
When key agreement is employed, use the key agreement algorithm
to compute the value of the agreed upon key.
When key agreement without key wrapping is employed,
let the Content Master Key (CMK) be the agreed upon key.
When key agreement with key wrapping is employed,
the agreed upon key will be used to wrap the CMK.
</li>
<li>
When key wrapping, key encryption,
or key agreement with key wrapping are employed,
encrypt the CMK for the recipient (see <a class='info' href='#sec.encrypt_cmk'>Section 7<span> (</span><span class='info'>CMK Encryption</span><span>)</span></a>) and let the result be the
JWE Encrypted Key.
Otherwise, when direct encryption with a shared or
agreed upon symmetric key is employed,
let the JWE Encrypted Key be the empty byte array.
</li>
<li>
When direct encryption with a shared symmetric key is employed,
let the Content Master Key (CMK) be the shared key.
</li>
<li>
Base64url encode the JWE Encrypted Key to create the
Encoded JWE Encrypted Key.
</li>
<li>
Generate a random JWE Initialization Vector of the correct size
for the block encryption algorithm (if required for the algorithm);
otherwise, let the JWE Initialization Vector be the empty byte string.
</li>
<li>
Base64url encode the JWE Initialization Vector to create the
Encoded JWE Initialization Vector.
</li>
<li>
Compress the Plaintext if a <tt>zip</tt> parameter was included.
</li>
<li>
Serialize the (compressed) Plaintext into a byte sequence M.
</li>
<li>
Create a JWE Header containing the encryption
parameters used.
Note that white space is explicitly allowed
in the representation and no canonicalization need be performed
before encoding.
</li>
<li>
Base64url encode the bytes of the UTF-8 representation of
the JWE Header to create the Encoded JWE Header.
</li>
<li>
Encrypt M using the CMK, the JWE Initialization Vector, and
the other parameters required for the specified block encryption algorithm
to create the JWE Ciphertext value and the JWE Integrity Value.
</li>
<li>
Base64url encode the JWE Ciphertext to create the Encoded JWE Ciphertext.
</li>
<li>
Base64url encode the JWE Integrity Value to create the
Encoded JWE Integrity Value.
</li>
<li>
The five encoded parts, taken together, are the result.
</li>
<li>
The Compact Serialization of this result is the
concatenation of
the Encoded JWE Header,
the Encoded JWE Encrypted Key,
the Encoded JWE Initialization Vector,
the Encoded JWE Ciphertext, and
the Encoded JWE Integrity Value
in that order, with the five strings
being separated by four period ('.') characters.
</li>
</ol>
<a name="sec.decryption"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.6"></a><h3>6.
Message Decryption</h3>
<p>
The message decryption process is the reverse of the
encryption process. The order of the steps is not significant
in cases where there are no dependencies between the inputs
and outputs of the steps. If any of these steps fails, the
JWE MUST be rejected.
</p>
<p>
</p>
<ol class="text">
<li>
Determine
the Encoded JWE Header,
the Encoded JWE Encrypted Key,
the Encoded JWE Initialization Vector,
the Encoded JWE Ciphertext, and
the Encoded JWE Integrity Value
values contained in the JWE.
When using the Compact Serialization, these five values are
represented in that order, separated by four period ('.') characters.
</li>
<li>
The Encoded JWE Header,
the Encoded JWE Encrypted Key,
the Encoded JWE Initialization Vector,
the Encoded JWE Ciphertext, and
the Encoded JWE Integrity Value
MUST be successfully base64url decoded following the
restriction that no padding characters have been used.
</li>
<li>
The resulting JWE Header MUST be completely valid
JSON syntax conforming to <a class='info' href='#RFC4627'>RFC 4627<span> (</span><span class='info'>Crockford, D., “The application/json Media Type for JavaScript Object Notation (JSON),” July 2006.</span><span>)</span></a> [RFC4627].
</li>
<li>
The resulting JWE Header MUST be validated to only include
parameters and values whose syntax and semantics are both
understood and supported.
</li>
<li>
Verify that the JWE uses a key known to the recipient.
</li>
<li>
When key agreement is employed, use the key agreement algorithm
to compute the value of the agreed upon key.
When key agreement without key wrapping is employed,
let the Content Master Key (CMK) be the agreed upon key.
When key agreement with key wrapping is employed,
the agreed upon key will be used to decrypt the JWE Encrypted Key.
</li>
<li>
When key wrapping, key encryption,
or key agreement with key wrapping are employed,
decrypt the JWE Encrypted Key to produce the Content
Master Key (CMK).
The CMK MUST have a length equal to that
required for the block encryption algorithm.
</li>
<li>
When direct encryption with a shared symmetric key is employed,
let the Content Master Key (CMK) be the shared key.
</li>
<li>
Decrypt the JWE Ciphertext using the CMK, the JWE Initialization Vector, and
the other parameters required for the specified block encryption algorithm,
returning the decrypted plaintext and verifying the JWE Integrity Value
in the manner specified for the algorithm.
</li>
<li>
Uncompress the decrypted plaintext
if a <tt>zip</tt> parameter was included.
</li>
<li>
Output the resulting Plaintext.
</li>
</ol><p>
</p>
<a name="sec.encrypt_cmk"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.7"></a><h3>7.
CMK Encryption</h3>
<p>
JWE supports three forms of Content Master Key (CMK) encryption:
</p>
<ul class="text">
<li>
Asymmetric encryption under the recipient's public key.
</li>
<li>
Symmetric encryption under a key shared between the sender and receiver.
</li>
<li>
Symmetric encryption under a key agreed upon between the sender and receiver.
</li>
</ul><p>
See the algorithms registered for <tt>enc</tt> usage in the IANA
JSON Web Signature and Encryption Algorithms registry <a class='info' href='#JWA'>[JWA]<span> (</span><span class='info'>Jones, M., “JSON Web Algorithms (JWA),” October 2012.</span><span>)</span></a>
and Section 4.1 of the
JSON Web Algorithms (JWA) <a class='info' href='#JWA'>[JWA]<span> (</span><span class='info'>Jones, M., “JSON Web Algorithms (JWA),” October 2012.</span><span>)</span></a> specification
for lists of encryption algorithms that can be used for CMK encryption.
</p>
<a name="Encrypting"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.8"></a><h3>8.
Encrypting JWEs with Cryptographic Algorithms</h3>
<p>
JWE uses cryptographic algorithms to encrypt the Plaintext
and the Content Encryption Key (CMK) and to provide integrity
protection for the JWE Header, JWE Encrypted Key, and JWE Ciphertext.
The JSON Web Algorithms (JWA) <a class='info' href='#JWA'>[JWA]<span> (</span><span class='info'>Jones, M., “JSON Web Algorithms (JWA),” October 2012.</span><span>)</span></a>
specification specifies a set of cryptographic algorithms and
identifiers to be used with this specification
and defines registries for additional such algorithms.
Specifically, Section 4.1 specifies a set of
<tt>alg</tt> (algorithm) header parameter values and
Section 4.2 specifies a set of
<tt>enc</tt> (encryption method) header parameter values
intended for use this specification.
It also describes the semantics and operations that are
specific to these algorithms and algorithm families.
</p>
<p>
Public keys employed for encryption can be identified using the
Header Parameter methods described in <a class='info' href='#ReservedHeaderParameterName'>Section 4.1<span> (</span><span class='info'>Reserved Header Parameter Names</span><span>)</span></a> or can be distributed
using methods that are outside the scope of this
specification.
</p>
<a name="IANA"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.9"></a><h3>9.
IANA Considerations</h3>
<a name="HeaderParamReg"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.9.1"></a><h3>9.1.
Registration of JWE Header Parameter Names</h3>
<p>
This specification registers the Header Parameter Names defined in
<a class='info' href='#ReservedHeaderParameterName'>Section 4.1<span> (</span><span class='info'>Reserved Header Parameter Names</span><span>)</span></a> in the IANA
JSON Web Signature and Encryption Header Parameters registry
<a class='info' href='#JWS'>[JWS]<span> (</span><span class='info'>Jones, M., Bradley, J., and N. Sakimura, “JSON Web Signature (JWS),” October 2012.</span><span>)</span></a>.
</p>
<a name="anchor6"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.9.1.1"></a><h3>9.1.1.
Registry Contents</h3>
<p>
</p>
<ul class="text">
<li>
Header Parameter Name: <tt>alg</tt>
</li>
<li>
Change Controller: IETF
</li>
<li>
Specification Document(s): <a class='info' href='#algDef'>Section 4.1.1<span> (</span><span class='info'>"alg" (Algorithm) Header Parameter</span><span>)</span></a> of [[ this document ]]
</li>
</ul><p>
</p>
<ul class="text">
<li>
Header Parameter Name: <tt>enc</tt>
</li>
<li>
Change Controller: IETF
</li>
<li>
Specification Document(s): <a class='info' href='#encDef'>Section 4.1.2<span> (</span><span class='info'>"enc" (Encryption Method) Header Parameter</span><span>)</span></a> of [[ this document ]]
</li>
</ul><p>
</p>
<ul class="text">
<li>
Header Parameter Name: <tt>epk</tt>
</li>
<li>
Change Controller: IETF
</li>
<li>
Specification Document(s): <a class='info' href='#epkDef'>Section 4.1.3<span> (</span><span class='info'>"epk" (Ephemeral Public Key) Header Parameter</span><span>)</span></a> of [[ this document ]]
</li>
</ul><p>
</p>
<ul class="text">
<li>
Header Parameter Name: <tt>zip</tt>
</li>
<li>
Change Controller: IETF
</li>
<li>
Specification Document(s): <a class='info' href='#zipDef'>Section 4.1.4<span> (</span><span class='info'>"zip" (Compression Algorithm) Header Parameter</span><span>)</span></a> of [[ this document ]]
</li>
</ul><p>
</p>
<ul class="text">
<li>
Header Parameter Name: <tt>jku</tt>
</li>
<li>
Change Controller: IETF
</li>
<li>
Specification Document(s): <a class='info' href='#jkuDef'>Section 4.1.5<span> (</span><span class='info'>"jku" (JWK Set URL) Header Parameter</span><span>)</span></a> of [[ this document ]]
</li>
</ul><p>
</p>
<ul class="text">
<li>
Header Parameter Name: <tt>jwk</tt>
</li>
<li>
Change Controller: IETF
</li>
<li>
Specification document(s): <a class='info' href='#jwkDef'>Section 4.1.6<span> (</span><span class='info'>"jwk" (JSON Web Key) Header Parameter</span><span>)</span></a> of [[ this document ]]
</li>
</ul><p>
</p>
<ul class="text">
<li>
Header Parameter Name: <tt>x5u</tt>
</li>
<li>
Change Controller: IETF
</li>
<li>
Specification Document(s): <a class='info' href='#x5uDef'>Section 4.1.7<span> (</span><span class='info'>"x5u" (X.509 URL) Header Parameter</span><span>)</span></a> of [[ this document ]]
</li>
</ul><p>
</p>
<ul class="text">
<li>
Header Parameter Name: <tt>x5t</tt>
</li>
<li>
Change Controller: IETF
</li>
<li>
Specification Document(s): <a class='info' href='#x5tDef'>Section 4.1.8<span> (</span><span class='info'>"x5t" (X.509 Certificate Thumbprint) Header Parameter</span><span>)</span></a> of [[ this document ]]
</li>
</ul><p>
</p>
<ul class="text">
<li>
Header Parameter Name: <tt>x5c</tt>
</li>
<li>
Change Controller: IETF
</li>
<li>
Specification Document(s): <a class='info' href='#x5cDef'>Section 4.1.9<span> (</span><span class='info'>"x5c" (X.509 Certificate Chain) Header Parameter</span><span>)</span></a> of [[ this document ]]
</li>
</ul><p>
</p>
<ul class="text">
<li>
Header Parameter Name: <tt>kid</tt>
</li>
<li>
Change Controller: IETF
</li>
<li>
Specification Document(s): <a class='info' href='#kidDef'>Section 4.1.10<span> (</span><span class='info'>"kid" (Key ID) Header Parameter</span><span>)</span></a> of [[ this document ]]
</li>
</ul><p>
</p>
<ul class="text">
<li>
Header Parameter Name: <tt>typ</tt>
</li>
<li>
Change Controller: IETF
</li>
<li>
Specification Document(s): <a class='info' href='#typDef'>Section 4.1.11<span> (</span><span class='info'>"typ" (Type) Header Parameter</span><span>)</span></a> of [[ this document ]]
</li>
</ul><p>
</p>
<ul class="text">
<li>
Header Parameter Name: <tt>cty</tt>
</li>
<li>
Change Controller: IETF
</li>
<li>
Specification Document(s): <a class='info' href='#ctyDef'>Section 4.1.12<span> (</span><span class='info'>"cty" (Content Type) Header Parameter</span><span>)</span></a> of [[ this document ]]
</li>
</ul><p>
</p>
<ul class="text">
<li>
Header Parameter Name: <tt>apu</tt>
</li>
<li>
Change Controller: IETF
</li>
<li>
Specification Document(s): <a class='info' href='#apuDef'>Section 4.1.13<span> (</span><span class='info'>"apu" (Agreement PartyUInfo) Header Parameter</span><span>)</span></a> of [[ this document ]]
</li>
</ul><p>
</p>
<ul class="text">
<li>
Header Parameter Name: <tt>apv</tt>
</li>
<li>
Change Controller: IETF
</li>
<li>
Specification Document(s): <a class='info' href='#apvDef'>Section 4.1.14<span> (</span><span class='info'>"apv" (Agreement PartyVInfo) Header Parameter</span><span>)</span></a> of [[ this document ]]
</li>
</ul><p>
</p>
<ul class="text">
<li>
Header Parameter Name: <tt>epu</tt>
</li>
<li>
Change Controller: IETF
</li>
<li>
Specification Document(s): <a class='info' href='#epuDef'>Section 4.1.15<span> (</span><span class='info'>"epu" (Encryption PartyUInfo) Header Parameter</span><span>)</span></a> of [[ this document ]]
</li>
</ul><p>
</p>
<ul class="text">
<li>
Header Parameter Name: <tt>epv</tt>
</li>
<li>
Change Controller: IETF
</li>
<li>
Specification Document(s): <a class='info' href='#epvDef'>Section 4.1.16<span> (</span><span class='info'>"epv" (Encryption PartyVInfo) Header Parameter</span><span>)</span></a> of [[ this document ]]
</li>
</ul><p>
</p>
<a name="anchor7"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.9.2"></a><h3>9.2.
JSON Web Signature and Encryption Type Values Registration</h3>
<a name="anchor8"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.9.2.1"></a><h3>9.2.1.
Registry Contents</h3>
<p>
This specification registers the <tt>JWE</tt>
type value in the
IANA JSON Web Signature and Encryption Type Values registry <a class='info' href='#JWS'>[JWS]<span> (</span><span class='info'>Jones, M., Bradley, J., and N. Sakimura, “JSON Web Signature (JWS),” October 2012.</span><span>)</span></a>:
</p>
<ul class="text">
<li>
"typ" Header Parameter Value: <tt>JWE</tt>
</li>
<li>
Abbreviation for MIME Type: application/jwe
</li>
<li>
Change Controller: IETF
</li>
<li>
Specification Document(s): <a class='info' href='#typDef'>Section 4.1.11<span> (</span><span class='info'>"typ" (Type) Header Parameter</span><span>)</span></a> of [[ this document ]]
</li>
</ul><p>
</p>
<a name="anchor9"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.9.3"></a><h3>9.3.
Media Type Registration</h3>
<a name="anchor10"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.9.3.1"></a><h3>9.3.1.
Registry Contents</h3>
<p>
This specification registers the <tt>application/jwe</tt> Media Type <a class='info' href='#RFC2046'>[RFC2046]<span> (</span><span class='info'>Freed, N. and N. Borenstein, “Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types,” November 1996.</span><span>)</span></a>
in the MIME Media Type registry <a class='info' href='#RFC4288'>[RFC4288]<span> (</span><span class='info'>Freed, N. and J. Klensin, “Media Type Specifications and Registration Procedures,” December 2005.</span><span>)</span></a>
to indicate that the content is a JWE using the Compact Serialization.
</p>
<ul class="text">
<li>
Type Name: application
</li>
<li>
Subtype Name: jwe
</li>
<li>
Required Parameters: n/a
</li>
<li>
Optional Parameters: n/a
</li>
<li>
Encoding considerations: JWE values are encoded as a
series of base64url encoded values (some of which may be the
empty string) separated by period ('.') characters
</li>
<li>
Security Considerations: See the Security Considerations section of this document
</li>
<li>
Interoperability Considerations: n/a
</li>
<li>
Published Specification: [[ this document ]]
</li>
<li>
Applications that use this media type:
OpenID Connect and other applications using encrypted JWTs
</li>
<li>
Additional Information: Magic number(s): n/a,
File extension(s): n/a,
Macintosh file type code(s): n/a
</li>
<li>
Person & email address to contact for further information: Michael B. Jones, mbj@microsoft.com
</li>
<li>
Intended Usage: COMMON
</li>
<li>
Restrictions on Usage: none
</li>
<li>
Author: Michael B. Jones, mbj@microsoft.com
</li>
<li>
Change Controller: IETF
</li>
</ul><p>
</p>
<a name="Security"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.10"></a><h3>10.
Security Considerations</h3>
<p>
All of the security issues faced by any cryptographic application
must be faced by a JWS/JWE/JWK agent. Among these issues are protecting
the user's private key, preventing various attacks, and helping the
user avoid mistakes such as inadvertently encrypting a message for
the wrong recipient. The entire list of security considerations is
beyond the scope of this document, but some significant concerns are
listed here.
</p>
<p>
All the security considerations in the JWS specification
also apply to this specification.
Likewise, all the security considerations in
<a class='info' href='#W3C.CR-xmlenc-core1-20120313'>XML Encryption 1.1<span> (</span><span class='info'>Eastlake, D., Reagle, J., Hirsch, F., and T. Roessler, “XML Encryption Syntax and Processing Version 1.1,” March 2012.</span><span>)</span></a> [W3C.CR‑xmlenc‑core1‑20120313]
also apply to JWE, other than those that are XML specific.
</p>
<a name="rfc.references"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.11"></a><h3>11.
References</h3>
<a name="rfc.references1"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<h3>11.1. Normative References</h3>
<table width="99%" border="0">
<tr><td class="author-text" valign="top"><a name="ITU.X690.1994">[ITU.X690.1994]</a></td>
<td class="author-text">International Telecommunications Union, “Information Technology - ASN.1 encoding rules: Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER),” ITU-T Recommendation X.690, 1994.</td></tr>
<tr><td class="author-text" valign="top"><a name="JWA">[JWA]</a></td>
<td class="author-text"><a href="mailto:mbj@microsoft.com">Jones, M.</a>, “<a href="http://tools.ietf.org/html/draft-ietf-jose-json-web-algorithms">JSON Web Algorithms (JWA)</a>,” October 2012.</td></tr>
<tr><td class="author-text" valign="top"><a name="JWK">[JWK]</a></td>
<td class="author-text"><a href="mailto:mbj@microsoft.com">Jones, M.</a>, “<a href="http://tools.ietf.org/html/draft-ietf-jose-json-web-key">JSON Web Key (JWK)</a>,” October 2012.</td></tr>
<tr><td class="author-text" valign="top"><a name="JWS">[JWS]</a></td>
<td class="author-text"><a href="mailto:mbj@microsoft.com">Jones, M.</a>, <a href="mailto:ve7jtb@ve7jtb.com">Bradley, J.</a>, and <a href="mailto:n-sakimura@nri.co.jp">N. Sakimura</a>, “<a href="http://tools.ietf.org/html/draft-ietf-jose-json-web-signature">JSON Web Signature (JWS)</a>,” October 2012.</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC1421">[RFC1421]</a></td>
<td class="author-text"><a href="mailto:104-8456@mcimail.com">Linn, J.</a>, “<a href="http://tools.ietf.org/html/rfc1421">Privacy Enhancement for Internet Electronic Mail: Part I: Message Encryption and Authentication Procedures</a>,” RFC 1421, February 1993 (<a href="http://www.rfc-editor.org/rfc/rfc1421.txt">TXT</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC1951">[RFC1951]</a></td>
<td class="author-text"><a href="mailto:ghost@aladdin.com">Deutsch, P.</a>, “<a href="http://tools.ietf.org/html/rfc1951">DEFLATE Compressed Data Format Specification version 1.3</a>,” RFC 1951, May 1996 (<a href="http://www.rfc-editor.org/rfc/rfc1951.txt">TXT</a>, <a href="http://www.rfc-editor.org/rfc/rfc1951.ps">PS</a>, <a href="http://www.rfc-editor.org/rfc/rfc1951.pdf">PDF</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC2046">[RFC2046]</a></td>
<td class="author-text"><a href="mailto:ned@innosoft.com">Freed, N.</a> and <a href="mailto:nsb@nsb.fv.com">N. Borenstein</a>, “<a href="http://tools.ietf.org/html/rfc2046">Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types</a>,” RFC 2046, November 1996 (<a href="http://www.rfc-editor.org/rfc/rfc2046.txt">TXT</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC2119">[RFC2119]</a></td>
<td class="author-text"><a href="mailto:sob@harvard.edu">Bradner, S.</a>, “<a href="http://tools.ietf.org/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>,” BCP 14, RFC 2119, March 1997 (<a href="http://www.rfc-editor.org/rfc/rfc2119.txt">TXT</a>, <a href="http://xml.resource.org/public/rfc/html/rfc2119.html">HTML</a>, <a href="http://xml.resource.org/public/rfc/xml/rfc2119.xml">XML</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC2818">[RFC2818]</a></td>
<td class="author-text">Rescorla, E., “<a href="http://tools.ietf.org/html/rfc2818">HTTP Over TLS</a>,” RFC 2818, May 2000 (<a href="http://www.rfc-editor.org/rfc/rfc2818.txt">TXT</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC3629">[RFC3629]</a></td>
<td class="author-text">Yergeau, F., “<a href="http://tools.ietf.org/html/rfc3629">UTF-8, a transformation format of ISO 10646</a>,” STD 63, RFC 3629, November 2003 (<a href="http://www.rfc-editor.org/rfc/rfc3629.txt">TXT</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC3986">[RFC3986]</a></td>
<td class="author-text"><a href="mailto:timbl@w3.org">Berners-Lee, T.</a>, <a href="mailto:fielding@gbiv.com">Fielding, R.</a>, and <a href="mailto:LMM@acm.org">L. Masinter</a>, “<a href="http://tools.ietf.org/html/rfc3986">Uniform Resource Identifier (URI): Generic Syntax</a>,” STD 66, RFC 3986, January 2005 (<a href="http://www.rfc-editor.org/rfc/rfc3986.txt">TXT</a>, <a href="http://xml.resource.org/public/rfc/html/rfc3986.html">HTML</a>, <a href="http://xml.resource.org/public/rfc/xml/rfc3986.xml">XML</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC4086">[RFC4086]</a></td>
<td class="author-text">Eastlake, D., Schiller, J., and S. Crocker, “<a href="http://tools.ietf.org/html/rfc4086">Randomness Requirements for Security</a>,” BCP 106, RFC 4086, June 2005 (<a href="http://www.rfc-editor.org/rfc/rfc4086.txt">TXT</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC4288">[RFC4288]</a></td>
<td class="author-text">Freed, N. and J. Klensin, “<a href="http://tools.ietf.org/html/rfc4288">Media Type Specifications and Registration Procedures</a>,” BCP 13, RFC 4288, December 2005 (<a href="http://www.rfc-editor.org/rfc/rfc4288.txt">TXT</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC4627">[RFC4627]</a></td>
<td class="author-text">Crockford, D., “<a href="http://tools.ietf.org/html/rfc4627">The application/json Media Type for JavaScript Object Notation (JSON)</a>,” RFC 4627, July 2006 (<a href="http://www.rfc-editor.org/rfc/rfc4627.txt">TXT</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC4648">[RFC4648]</a></td>
<td class="author-text">Josefsson, S., “<a href="http://tools.ietf.org/html/rfc4648">The Base16, Base32, and Base64 Data Encodings</a>,” RFC 4648, October 2006 (<a href="http://www.rfc-editor.org/rfc/rfc4648.txt">TXT</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC5116">[RFC5116]</a></td>
<td class="author-text">McGrew, D., “<a href="http://tools.ietf.org/html/rfc5116">An Interface and Algorithms for Authenticated Encryption</a>,” RFC 5116, January 2008 (<a href="http://www.rfc-editor.org/rfc/rfc5116.txt">TXT</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC5246">[RFC5246]</a></td>
<td class="author-text">Dierks, T. and E. Rescorla, “<a href="http://tools.ietf.org/html/rfc5246">The Transport Layer Security (TLS) Protocol Version 1.2</a>,” RFC 5246, August 2008 (<a href="http://www.rfc-editor.org/rfc/rfc5246.txt">TXT</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC5280">[RFC5280]</a></td>
<td class="author-text">Cooper, D., Santesson, S., Farrell, S., Boeyen, S., Housley, R., and W. Polk, “<a href="http://tools.ietf.org/html/rfc5280">Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile</a>,” RFC 5280, May 2008 (<a href="http://www.rfc-editor.org/rfc/rfc5280.txt">TXT</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="W3C.CR-xmlenc-core1-20120313">[W3C.CR-xmlenc-core1-20120313]</a></td>
<td class="author-text">Eastlake, D., Reagle, J., Hirsch, F., and T. Roessler, “<a href="http://www.w3.org/TR/2012/CR-xmlenc-core1-20120313">XML Encryption Syntax and Processing Version 1.1</a>,” World Wide Web Consortium CR CR-xmlenc-core1-20120313, March 2012 (<a href="http://www.w3.org/TR/2012/CR-xmlenc-core1-20120313">HTML</a>).</td></tr>
</table>
<a name="rfc.references2"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<h3>11.2. Informative References</h3>
<table width="99%" border="0">
<tr><td class="author-text" valign="top"><a name="I-D.rescorla-jsms">[I-D.rescorla-jsms]</a></td>
<td class="author-text">Rescorla, E. and J. Hildebrand, “<a href="http://tools.ietf.org/html/draft-rescorla-jsms-00">JavaScript Message Security Format</a>,” draft-rescorla-jsms-00 (work in progress), March 2011 (<a href="http://www.ietf.org/internet-drafts/draft-rescorla-jsms-00.txt">TXT</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="JSE">[JSE]</a></td>
<td class="author-text">Bradley, J. and N. Sakimura (editor), “<a href="http://jsonenc.info/enc/1.0/">JSON Simple Encryption</a>,” September 2010.</td></tr>
<tr><td class="author-text" valign="top"><a name="JWE-JS">[JWE-JS]</a></td>
<td class="author-text"><a href="mailto:mbj@microsoft.com">Jones, M.</a>, “<a href="http://tools.ietf.org/html/draft-jones-jose-jwe-json-serialization">JSON Web Encryption JSON Serialization (JWE-JS)</a>,” October 2012.</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC4122">[RFC4122]</a></td>
<td class="author-text"><a href="mailto:paulle@microsoft.com">Leach, P.</a>, <a href="mailto:michael@refactored-networks.com">Mealling, M.</a>, and <a href="mailto:rsalz@datapower.com">R. Salz</a>, “<a href="http://tools.ietf.org/html/rfc4122">A Universally Unique IDentifier (UUID) URN Namespace</a>,” RFC 4122, July 2005 (<a href="http://www.rfc-editor.org/rfc/rfc4122.txt">TXT</a>, <a href="http://xml.resource.org/public/rfc/html/rfc4122.html">HTML</a>, <a href="http://xml.resource.org/public/rfc/xml/rfc4122.xml">XML</a>).</td></tr>
<tr><td class="author-text" valign="top"><a name="RFC5652">[RFC5652]</a></td>
<td class="author-text">Housley, R., “<a href="http://tools.ietf.org/html/rfc5652">Cryptographic Message Syntax (CMS)</a>,” STD 70, RFC 5652, September 2009 (<a href="http://www.rfc-editor.org/rfc/rfc5652.txt">TXT</a>).</td></tr>
</table>
<a name="JWEExamples"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A"></a><h3>Appendix A.
JWE Examples</h3>
<p>
This section provides examples of JWE computations.
</p>
<a name="OAEPGCMExample"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.1"></a><h3>A.1.
Example JWE using RSAES OAEP and AES GCM</h3>
<p>
This example encrypts the plaintext
"Live long and prosper."
to the recipient using RSAES OAEP and AES GCM.
The AES GCM algorithm has an integrated integrity check.
The representation of this plaintext is:
</p>
<p>
[76, 105, 118, 101, 32, 108, 111, 110, 103, 32, 97, 110, 100, 32, 112, 114,
111, 115, 112, 101, 114, 46]
</p>
<a name="anchor13"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.1.1"></a><h3>A.1.1.
JWE Header</h3>
<p>
The following example JWE Header declares that:
</p>
<ul class="text">
<li>
the Content Master Key is encrypted to the recipient
using the RSAES OAEP algorithm to produce the JWE
Encrypted Key and
</li>
<li>
the Plaintext is encrypted using the AES GCM
algorithm with a 256 bit key to produce the Ciphertext.
</li>
</ul><p>
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
{"alg":"RSA-OAEP","enc":"A256GCM"}
</pre></div>
<a name="anchor14"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.1.2"></a><h3>A.1.2.
Encoded JWE Header</h3>
<p>
Base64url encoding the bytes of the UTF-8 representation of
the JWE Header yields this Encoded JWE Header value:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ
</pre></div>
<a name="anchor15"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.1.3"></a><h3>A.1.3.
Content Master Key (CMK)</h3>
<p>
Generate a 256 bit random Content Master Key (CMK).
In this example, the value is:
</p>
<p>
[177, 161, 244, 128, 84, 143, 225, 115, 63, 180, 3, 255, 107, 154, 212, 246,
138, 7, 110, 91, 112, 46, 34, 105, 47, 130, 203, 46, 122, 234, 64, 252]
</p>
<a name="anchor16"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.1.4"></a><h3>A.1.4.
Key Encryption</h3>
<p>
Encrypt the CMK with the recipient's public key using the RSAES OAEP
algorithm to produce the JWE Encrypted Key.
In this example, the RSA key parameters are:
</p><table class="full" align="center" border="0" cellpadding="2" cellspacing="2">
<col align="left"><col align="left">
<tr><th align="left">Parameter Name</th><th align="left">Value</th></tr>
<tr>
<td align="left">Modulus</td>
<td align="left">
[161, 168, 84, 34, 133, 176, 208, 173, 46, 176, 163, 110, 57, 30, 135, 227,
9, 31, 226, 128, 84, 92, 116, 241, 70, 248, 27, 227, 193, 62, 5, 91,
241, 145, 224, 205, 141, 176, 184, 133, 239, 43, 81, 103, 9, 161, 153, 157,
179, 104, 123, 51, 189, 34, 152, 69, 97, 69, 78, 93, 140, 131, 87, 182,
169, 101, 92, 142, 3, 22, 167, 8, 212, 56, 35, 79, 210, 222, 192, 208,
252, 49, 109, 138, 173, 253, 210, 166, 201, 63, 102, 74, 5, 158, 41, 90,
144, 108, 160, 79, 10, 89, 222, 231, 172, 31, 227, 197, 0, 19, 72, 81,
138, 78, 136, 221, 121, 118, 196, 17, 146, 10, 244, 188, 72, 113, 55, 221,
162, 217, 171, 27, 57, 233, 210, 101, 236, 154, 199, 56, 138, 239, 101, 48,
198, 186, 202, 160, 76, 111, 234, 71, 57, 183, 5, 211, 171, 136, 126, 64,
40, 75, 58, 89, 244, 254, 107, 84, 103, 7, 236, 69, 163, 18, 180, 251,
58, 153, 46, 151, 174, 12, 103, 197, 181, 161, 162, 55, 250, 235, 123, 110,
17, 11, 158, 24, 47, 133, 8, 199, 235, 107, 126, 130, 246, 73, 195, 20,
108, 202, 176, 214, 187, 45, 146, 182, 118, 54, 32, 200, 61, 201, 71, 243,
1, 255, 131, 84, 37, 111, 211, 168, 228, 45, 192, 118, 27, 197, 235, 232,
36, 10, 230, 248, 190, 82, 182, 140, 35, 204, 108, 190, 253, 186, 186, 27]
</td>
</tr>
<tr>
<td align="left">Exponent</td>
<td align="left">
[1, 0, 1]
</td>
</tr>
<tr>
<td align="left">Private Exponent</td>
<td align="left">
[144, 183, 109, 34, 62, 134, 108, 57, 44, 252, 10, 66, 73, 54, 16, 181,
233, 92, 54, 219, 101, 42, 35, 178, 63, 51, 43, 92, 119, 136, 251, 41,
53, 23, 191, 164, 164, 60, 88, 227, 229, 152, 228, 213, 149, 228, 169, 237,
104, 71, 151, 75, 88, 252, 216, 77, 251, 231, 28, 97, 88, 193, 215, 202,
248, 216, 121, 195, 211, 245, 250, 112, 71, 243, 61, 129, 95, 39, 244, 122,
225, 217, 169, 211, 165, 48, 253, 220, 59, 122, 219, 42, 86, 223, 32, 236,
39, 48, 103, 78, 122, 216, 187, 88, 176, 89, 24, 1, 42, 177, 24, 99,
142, 170, 1, 146, 43, 3, 108, 64, 194, 121, 182, 95, 187, 134, 71, 88,
96, 134, 74, 131, 167, 69, 106, 143, 121, 27, 72, 44, 245, 95, 39, 194,
179, 175, 203, 122, 16, 112, 183, 17, 200, 202, 31, 17, 138, 156, 184, 210,
157, 184, 154, 131, 128, 110, 12, 85, 195, 122, 241, 79, 251, 229, 183, 117,
21, 123, 133, 142, 220, 153, 9, 59, 57, 105, 81, 255, 138, 77, 82, 54,
62, 216, 38, 249, 208, 17, 197, 49, 45, 19, 232, 157, 251, 131, 137, 175,
72, 126, 43, 229, 69, 179, 117, 82, 157, 213, 83, 35, 57, 210, 197, 252,
171, 143, 194, 11, 47, 163, 6, 253, 75, 252, 96, 11, 187, 84, 130, 210,
7, 121, 78, 91, 79, 57, 251, 138, 132, 220, 60, 224, 173, 56, 224, 201]
</td>
</tr>
</table>
<br clear="all" />
<p>
The resulting JWE Encrypted Key value is:
</p>
<p>
[51, 101, 241, 165, 179, 145, 41, 236, 202, 75, 60, 208, 47, 255, 121, 248,
104, 226, 185, 212, 65, 78, 169, 255, 162, 100, 188, 207, 220, 96, 161, 22,
251, 47, 66, 112, 229, 75, 4, 111, 25, 173, 200, 121, 246, 79, 189, 102,
173, 146, 228, 142, 14, 12, 167, 200, 27, 133, 138, 37, 180, 249, 4, 56,
123, 192, 162, 156, 246, 231, 235, 217, 240, 45, 158, 213, 195, 154, 2, 142,
86, 61, 198, 210, 34, 225, 92, 7, 128, 227, 4, 227, 55, 183, 69, 0,
59, 162, 71, 145, 98, 238, 0, 70, 40, 123, 159, 37, 115, 18, 16, 157,
236, 138, 117, 166, 18, 45, 181, 125, 112, 170, 168, 82, 129, 80, 166, 242,
150, 97, 17, 217, 109, 251, 51, 35, 39, 236, 107, 95, 43, 154, 4, 227,
206, 187, 75, 13, 51, 231, 115, 79, 67, 72, 145, 54, 225, 164, 60, 195,
120, 188, 69, 113, 3, 182, 21, 189, 79, 82, 122, 46, 196, 199, 254, 252,
7, 119, 5, 32, 144, 143, 173, 11, 99, 205, 120, 106, 231, 51, 231, 77,
73, 252, 197, 221, 142, 254, 151, 7, 6, 203, 65, 108, 117, 121, 15, 95,
43, 111, 13, 94, 242, 226, 150, 94, 121, 72, 144, 251, 69, 93, 137, 178,
13, 216, 8, 227, 125, 110, 180, 157, 250, 207, 184, 232, 222, 164, 193, 70,
232, 16, 65, 109, 29, 251, 164, 119, 50, 205, 236, 109, 245, 234, 78, 1]
</p>
<a name="anchor17"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.1.5"></a><h3>A.1.5.
Encoded JWE Encrypted Key</h3>
<p>
Base64url encode the JWE Encrypted Key to produce the Encoded JWE Encrypted Key.
This result (with line breaks for display purposes only) is:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
M2XxpbORKezKSzzQL_95-GjiudRBTqn_omS8z9xgoRb7L0Jw5UsEbxmtyHn2T71m
rZLkjg4Mp8gbhYoltPkEOHvAopz25-vZ8C2e1cOaAo5WPcbSIuFcB4DjBOM3t0UA
O6JHkWLuAEYoe58lcxIQneyKdaYSLbV9cKqoUoFQpvKWYRHZbfszIyfsa18rmgTj
zrtLDTPnc09DSJE24aQ8w3i8RXEDthW9T1J6LsTH_vwHdwUgkI-tC2PNeGrnM-dN
SfzF3Y7-lwcGy0FsdXkPXytvDV7y4pZeeUiQ-0VdibIN2AjjfW60nfrPuOjepMFG
6BBBbR37pHcyzext9epOAQ
</pre></div>
<a name="anchor18"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.1.6"></a><h3>A.1.6.
Initialization Vector</h3>
<p>
Generate a random 96 bit JWE Initialization Vector.
In this example, the value is:
</p>
<p>
[227, 197, 117, 252, 2, 219, 233, 68, 180, 225, 77, 219]
</p>
<p>
Base64url encoding this value yields the Encoded JWE Initialization Vector value:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
48V1_ALb6US04U3b
</pre></div>
<a name="anchor19"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.1.7"></a><h3>A.1.7.
"Additional Authenticated Data" Parameter</h3>
<p>
Concatenate
the Encoded JWE Header value, a period character ('.'),
the Encoded JWE Encrypted Key, a second period character ('.'), and
the Encoded JWE Initialization Vector
to create the "additional authenticated data"
parameter for the AES GCM algorithm.
This result (with line breaks for display purposes only) is:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ.
M2XxpbORKezKSzzQL_95-GjiudRBTqn_omS8z9xgoRb7L0Jw5UsEbxmtyHn2T71m
rZLkjg4Mp8gbhYoltPkEOHvAopz25-vZ8C2e1cOaAo5WPcbSIuFcB4DjBOM3t0UA
O6JHkWLuAEYoe58lcxIQneyKdaYSLbV9cKqoUoFQpvKWYRHZbfszIyfsa18rmgTj
zrtLDTPnc09DSJE24aQ8w3i8RXEDthW9T1J6LsTH_vwHdwUgkI-tC2PNeGrnM-dN
SfzF3Y7-lwcGy0FsdXkPXytvDV7y4pZeeUiQ-0VdibIN2AjjfW60nfrPuOjepMFG
6BBBbR37pHcyzext9epOAQ.
48V1_ALb6US04U3b
</pre></div>
<p>
The representation of this value is:
</p>
<p>
[101, 121, 74, 104, 98, 71, 99, 105, 79, 105, 74, 83, 85, 48, 69, 116,
84, 48, 70, 70, 85, 67, 73, 115, 73, 109, 86, 117, 89, 121, 73, 54,
73, 107, 69, 121, 78, 84, 90, 72, 81, 48, 48, 105, 102, 81, 46, 77,
50, 88, 120, 112, 98, 79, 82, 75, 101, 122, 75, 83, 122, 122, 81, 76,
95, 57, 53, 45, 71, 106, 105, 117, 100, 82, 66, 84, 113, 110, 95, 111,
109, 83, 56, 122, 57, 120, 103, 111, 82, 98, 55, 76, 48, 74, 119, 53,
85, 115, 69, 98, 120, 109, 116, 121, 72, 110, 50, 84, 55, 49, 109, 114,
90, 76, 107, 106, 103, 52, 77, 112, 56, 103, 98, 104, 89, 111, 108, 116,
80, 107, 69, 79, 72, 118, 65, 111, 112, 122, 50, 53, 45, 118, 90, 56,
67, 50, 101, 49, 99, 79, 97, 65, 111, 53, 87, 80, 99, 98, 83, 73,
117, 70, 99, 66, 52, 68, 106, 66, 79, 77, 51, 116, 48, 85, 65, 79,
54, 74, 72, 107, 87, 76, 117, 65, 69, 89, 111, 101, 53, 56, 108, 99,
120, 73, 81, 110, 101, 121, 75, 100, 97, 89, 83, 76, 98, 86, 57, 99,
75, 113, 111, 85, 111, 70, 81, 112, 118, 75, 87, 89, 82, 72, 90, 98,
102, 115, 122, 73, 121, 102, 115, 97, 49, 56, 114, 109, 103, 84, 106, 122,
114, 116, 76, 68, 84, 80, 110, 99, 48, 57, 68, 83, 74, 69, 50, 52,
97, 81, 56, 119, 51, 105, 56, 82, 88, 69, 68, 116, 104, 87, 57, 84,
49, 74, 54, 76, 115, 84, 72, 95, 118, 119, 72, 100, 119, 85, 103, 107,
73, 45, 116, 67, 50, 80, 78, 101, 71, 114, 110, 77, 45, 100, 78, 83,
102, 122, 70, 51, 89, 55, 45, 108, 119, 99, 71, 121, 48, 70, 115, 100,
88, 107, 80, 88, 121, 116, 118, 68, 86, 55, 121, 52, 112, 90, 101, 101,
85, 105, 81, 45, 48, 86, 100, 105, 98, 73, 78, 50, 65, 106, 106, 102,
87, 54, 48, 110, 102, 114, 80, 117, 79, 106, 101, 112, 77, 70, 71, 54,
66, 66, 66, 98, 82, 51, 55, 112, 72, 99, 121, 122, 101, 120, 116, 57,
101, 112, 79, 65, 81, 46, 52, 56, 86, 49, 95, 65, 76, 98, 54, 85,
83, 48, 52, 85, 51, 98]
</p>
<a name="anchor20"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.1.8"></a><h3>A.1.8.
Plaintext Encryption</h3>
<p>
Encrypt the Plaintext with AES GCM using the CMK as the encryption key,
the JWE Initialization Vector,
and the "additional authenticated data" value above,
requesting a 128 bit "authentication tag" output.
The resulting Ciphertext is:
</p>
<p>
[253, 237, 181, 180, 97, 161, 105, 207, 233, 120, 65, 100, 45, 122, 246, 116,
195, 212, 102, 37, 36, 175]
</p>
<p>
The resulting "authentication tag" value is:
</p>
<p>
[237, 94, 89, 14, 74, 52, 191, 249, 159, 216, 240, 28, 224, 147, 34, 82]
</p>
<a name="anchor21"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.1.9"></a><h3>A.1.9.
Encoded JWE Ciphertext</h3>
<p>
Base64url encode the resulting Ciphertext to create the Encoded JWE Ciphertext.
This result is:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
_e21tGGhac_peEFkLXr2dMPUZiUkrw
</pre></div>
<a name="anchor22"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.1.10"></a><h3>A.1.10.
Encoded JWE Integrity Value</h3>
<p>
Base64url encode the resulting "authentication tag" to create the Encoded JWE Integrity Value.
This result is:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
7V5ZDko0v_mf2PAc4JMiUg
</pre></div>
<a name="anchor23"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.1.11"></a><h3>A.1.11.
Complete Representation</h3>
<p>
Assemble the final representation:
The Compact Serialization of this result is the
concatenation of
the Encoded JWE Header,
the Encoded JWE Encrypted Key,
the Encoded JWE Initialization Vector,
the Encoded JWE Ciphertext, and
the Encoded JWE Integrity Value
in that order, with the five strings
being separated by four period ('.') characters.
</p>
<p>
The final result in this example
(with line breaks for display purposes only) is:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00ifQ.
M2XxpbORKezKSzzQL_95-GjiudRBTqn_omS8z9xgoRb7L0Jw5UsEbxmtyHn2T71m
rZLkjg4Mp8gbhYoltPkEOHvAopz25-vZ8C2e1cOaAo5WPcbSIuFcB4DjBOM3t0UA
O6JHkWLuAEYoe58lcxIQneyKdaYSLbV9cKqoUoFQpvKWYRHZbfszIyfsa18rmgTj
zrtLDTPnc09DSJE24aQ8w3i8RXEDthW9T1J6LsTH_vwHdwUgkI-tC2PNeGrnM-dN
SfzF3Y7-lwcGy0FsdXkPXytvDV7y4pZeeUiQ-0VdibIN2AjjfW60nfrPuOjepMFG
6BBBbR37pHcyzext9epOAQ.
48V1_ALb6US04U3b.
_e21tGGhac_peEFkLXr2dMPUZiUkrw.
7V5ZDko0v_mf2PAc4JMiUg
</pre></div>
<a name="anchor24"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.1.12"></a><h3>A.1.12.
Validation</h3>
<p>
This example illustrates the process of creating a JWE with an AEAD algorithm.
These results can be used to validate JWE decryption implementations for these algorithms.
Note that since the RSAES OAEP computation includes random values,
the encryption results above will not be completely reproducible.
However, since the AES GCM computation is deterministic, the JWE Encrypted Ciphertext
values will be the same for all encryptions performed using these inputs.
</p>
<a name="RSACBCExample"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.2"></a><h3>A.2.
Example JWE using RSAES-PKCS1-V1_5 and AES CBC</h3>
<p>
This example encrypts the plaintext
"No matter where you go, there you are."
to the recipient using RSAES-PKCS1-V1_5 and AES CBC.
AES CBC does not have an integrated integrity check,
so a separate integrity check calculation is performed using HMAC SHA-256,
with separate encryption and integrity keys being derived from a master key
using the Concat KDF with the SHA-256 digest function.
The representation of this plaintext is:
</p>
<p>
[78, 111, 32, 109, 97, 116, 116, 101, 114, 32, 119, 104, 101, 114, 101, 32,
121, 111, 117, 32, 103, 111, 44, 32, 116, 104, 101, 114, 101, 32, 121, 111,
117, 32, 97, 114, 101, 46]
</p>
<a name="anchor25"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.2.1"></a><h3>A.2.1.
JWE Header</h3>
<p>
The following example JWE Header (with line breaks for display purposes only) declares that:
</p>
<ul class="text">
<li>
the Content Master Key is encrypted to the recipient
using the RSAES-PKCS1-V1_5 algorithm to produce the JWE
Encrypted Key and
</li>
<li>
the Plaintext is encrypted using the AES CBC
algorithm with a 128 bit key to produce the Ciphertext,
with the integrity of the
Ciphertext and the parameters used to create it being
secured with the HMAC SHA-256 algorithm.
</li>
</ul><p>
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
{"alg":"RSA1_5","enc":"A128CBC+HS256"}
</pre></div>
<a name="anchor26"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.2.2"></a><h3>A.2.2.
Encoded JWE Header</h3>
<p>
Base64url encoding the bytes of the UTF-8 representation of
the JWE Header yields this Encoded JWE Header value:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
eyJhbGciOiJSU0ExXzUiLCJlbmMiOiJBMTI4Q0JDK0hTMjU2In0
</pre></div>
<a name="anchor27"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.2.3"></a><h3>A.2.3.
Content Master Key (CMK)</h3>
<p>
Generate a 256 bit random Content Master Key (CMK).
In this example, the key value is:
</p>
<p>
[4, 211, 31, 197, 84, 157, 252, 254, 11, 100, 157, 250, 63, 170, 106, 206,
107, 124, 212, 45, 111, 107, 9, 219, 200, 177, 0, 240, 143, 156, 44, 207]
</p>
<a name="anchor28"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.2.4"></a><h3>A.2.4.
Key Encryption</h3>
<p>
Encrypt the CMK with the recipient's public key using the RSAES-PKCS1-V1_5
algorithm to produce the JWE Encrypted Key.
In this example, the RSA key parameters are:
</p><table class="full" align="center" border="0" cellpadding="2" cellspacing="2">
<col align="left"><col align="left">
<tr><th align="left">Parameter Name</th><th align="left">Value</th></tr>
<tr>
<td align="left">Modulus</td>
<td align="left">
[177, 119, 33, 13, 164, 30, 108, 121, 207, 136, 107, 242, 12, 224, 19, 226,
198, 134, 17, 71, 173, 75, 42, 61, 48, 162, 206, 161, 97, 108, 185, 234,
226, 219, 118, 206, 118, 5, 169, 224, 60, 181, 90, 85, 51, 123, 6, 224,
4, 122, 29, 230, 151, 12, 244, 127, 121, 25, 4, 85, 220, 144, 215, 110,
130, 17, 68, 228, 129, 138, 7, 130, 231, 40, 212, 214, 17, 179, 28, 124,
151, 178, 207, 20, 14, 154, 222, 113, 176, 24, 198, 73, 211, 113, 9, 33,
178, 80, 13, 25, 21, 25, 153, 212, 206, 67, 154, 147, 70, 194, 192, 183,
160, 83, 98, 236, 175, 85, 23, 97, 75, 199, 177, 73, 145, 50, 253, 206,
32, 179, 254, 236, 190, 82, 73, 67, 129, 253, 252, 220, 108, 136, 138, 11,
192, 1, 36, 239, 228, 55, 81, 113, 17, 25, 140, 63, 239, 146, 3, 172,
96, 60, 227, 233, 64, 255, 224, 173, 225, 228, 229, 92, 112, 72, 99, 97,
26, 87, 187, 123, 46, 50, 90, 202, 117, 73, 10, 153, 47, 224, 178, 163,
77, 48, 46, 154, 33, 148, 34, 228, 33, 172, 216, 89, 46, 225, 127, 68,
146, 234, 30, 147, 54, 146, 5, 133, 45, 78, 254, 85, 55, 75, 213, 86,
194, 218, 215, 163, 189, 194, 54, 6, 83, 36, 18, 153, 53, 7, 48, 89,
35, 66, 144, 7, 65, 154, 13, 97, 75, 55, 230, 132, 3, 13, 239, 71]
</td>
</tr>
<tr>
<td align="left">Exponent</td>
<td align="left">
[1, 0, 1]
</td>
</tr>
<tr>
<td align="left">Private Exponent</td>
<td align="left">
[84, 80, 150, 58, 165, 235, 242, 123, 217, 55, 38, 154, 36, 181, 221, 156,
211, 215, 100, 164, 90, 88, 40, 228, 83, 148, 54, 122, 4, 16, 165, 48,
76, 194, 26, 107, 51, 53, 179, 165, 31, 18, 198, 173, 78, 61, 56, 97,
252, 158, 140, 80, 63, 25, 223, 156, 36, 203, 214, 252, 120, 67, 180, 167,
3, 82, 243, 25, 97, 214, 83, 133, 69, 16, 104, 54, 160, 200, 41, 83,
164, 187, 70, 153, 111, 234, 242, 158, 175, 28, 198, 48, 211, 45, 148, 58,
23, 62, 227, 74, 52, 117, 42, 90, 41, 249, 130, 154, 80, 119, 61, 26,
193, 40, 125, 10, 152, 174, 227, 225, 205, 32, 62, 66, 6, 163, 100, 99,
219, 19, 253, 25, 105, 80, 201, 29, 252, 157, 237, 69, 1, 80, 171, 167,
20, 196, 156, 109, 249, 88, 0, 3, 152, 38, 165, 72, 87, 6, 152, 71,
156, 214, 16, 71, 30, 82, 51, 103, 76, 218, 63, 9, 84, 163, 249, 91,
215, 44, 238, 85, 101, 240, 148, 1, 82, 224, 91, 135, 105, 127, 84, 171,
181, 152, 210, 183, 126, 24, 46, 196, 90, 173, 38, 245, 219, 186, 222, 27,
240, 212, 194, 15, 66, 135, 226, 178, 190, 52, 245, 74, 65, 224, 81, 100,
85, 25, 204, 165, 203, 187, 175, 84, 100, 82, 15, 11, 23, 202, 151, 107,
54, 41, 207, 3, 136, 229, 134, 131, 93, 139, 50, 182, 204, 93, 130, 89]
</td>
</tr>
</table>
<br clear="all" />
<p>
The resulting JWE Encrypted Key value is:
</p>
<p>
[59, 160, 42, 94, 168, 21, 148, 146, 120, 115, 137, 105, 230, 197, 217, 119,
182, 233, 24, 112, 48, 232, 4, 100, 29, 71, 151, 67, 16, 245, 112, 5,
184, 249, 125, 113, 210, 171, 99, 252, 3, 116, 154, 233, 42, 16, 233, 120,
99, 165, 14, 192, 149, 200, 37, 143, 126, 27, 81, 11, 43, 228, 80, 90,
178, 135, 253, 43, 81, 248, 3, 61, 31, 177, 169, 42, 100, 132, 142, 47,
16, 96, 231, 12, 58, 58, 254, 187, 209, 245, 46, 223, 233, 4, 72, 158,
27, 205, 54, 75, 21, 179, 210, 182, 197, 77, 116, 92, 143, 128, 86, 47,
23, 41, 10, 216, 212, 103, 125, 64, 63, 235, 28, 248, 191, 222, 9, 158,
84, 54, 93, 26, 73, 19, 106, 22, 201, 46, 62, 76, 209, 176, 86, 81,
12, 154, 146, 72, 151, 149, 59, 34, 123, 165, 144, 144, 243, 119, 229, 139,
95, 85, 130, 47, 247, 71, 181, 204, 82, 169, 110, 66, 235, 156, 237, 145,
206, 90, 44, 98, 227, 184, 215, 148, 20, 229, 89, 22, 121, 136, 92, 90,
75, 193, 186, 39, 204, 20, 173, 222, 1, 42, 8, 0, 195, 122, 151, 229,
122, 8, 125, 116, 21, 149, 6, 68, 209, 89, 164, 171, 252, 208, 72, 138,
57, 46, 113, 74, 202, 140, 40, 161, 23, 29, 176, 75, 141, 135, 208, 125,
50, 76, 173, 209, 148, 4, 148, 111, 163, 25, 219, 71, 90, 54, 82, 56]
</p>
<a name="anchor29"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.2.5"></a><h3>A.2.5.
Encoded JWE Encrypted Key</h3>
<p>
Base64url encode the JWE Encrypted Key to produce the Encoded JWE Encrypted Key.
This result (with line breaks for display purposes only) is:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
O6AqXqgVlJJ4c4lp5sXZd7bpGHAw6ARkHUeXQxD1cAW4-X1x0qtj_AN0mukqEOl4
Y6UOwJXIJY9-G1ELK-RQWrKH_StR-AM9H7GpKmSEji8QYOcMOjr-u9H1Lt_pBEie
G802SxWz0rbFTXRcj4BWLxcpCtjUZ31AP-sc-L_eCZ5UNl0aSRNqFskuPkzRsFZR
DJqSSJeVOyJ7pZCQ83fli19Vgi_3R7XMUqluQuuc7ZHOWixi47jXlBTlWRZ5iFxa
S8G6J8wUrd4BKggAw3qX5XoIfXQVlQZE0Vmkq_zQSIo5LnFKyowooRcdsEuNh9B9
Mkyt0ZQElG-jGdtHWjZSOA
</pre></div>
<a name="anchor30"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.2.6"></a><h3>A.2.6.
Key Derivation</h3>
<p>
Use the Concat key derivation function
to derive Content Encryption Key (CEK)
and Content Integrity Key (CIK) values from the CMK.
The details of this derivation are shown in <a class='info' href='#KeyDeriv1'>Appendix A.4<span> (</span><span class='info'>Example Key Derivation for "enc" value "A128CBC+HS256"</span><span>)</span></a>.
The resulting CEK value is:
</p>
<p>
[37, 245, 125, 247, 113, 155, 238, 98, 228, 206, 62, 65, 81, 153, 79, 91]
</p>
<p>
The resulting CIK value is:
</p>
<p>
[203, 194, 197, 180, 120, 46, 123, 202, 78, 12, 33, 116, 214, 247, 128, 41,
175, 53, 181, 164, 224, 223, 56, 146, 179, 193, 18, 223, 146, 85, 244, 127]
</p>
<a name="anchor31"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.2.7"></a><h3>A.2.7.
Initialization Vector</h3>
<p>
Generate a random 128 bit JWE Initialization Vector.
In this example, the value is:
</p>
<p>
[3, 22, 60, 12, 43, 67, 104, 105, 108, 108, 105, 99, 111, 116, 104, 101]
</p>
<p>
Base64url encoding this value yields the Encoded JWE Initialization Vector value:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
AxY8DCtDaGlsbGljb3RoZQ
</pre></div>
<a name="anchor32"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.2.8"></a><h3>A.2.8.
Plaintext Encryption</h3>
<p>
Encrypt the Plaintext with AES CBC using
the CEK and the JWE Initialization Vector to produce the Ciphertext.
The resulting Ciphertext is:
</p>
<p>
[213, 224, 86, 22, 7, 43, 207, 141, 48, 11, 207, 28, 130, 255, 43, 62,
11, 183, 17, 249, 130, 214, 158, 51, 79, 73, 8, 199, 23, 210, 23, 108,
195, 37, 196, 62, 136, 65, 228, 214, 52, 12, 247, 156, 64, 118, 190, 89]
</p>
<a name="anchor33"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.2.9"></a><h3>A.2.9.
Encoded JWE Ciphertext</h3>
<p>
Base64url encode the resulting Ciphertext to create the Encoded JWE Ciphertext.
This result is:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
1eBWFgcrz40wC88cgv8rPgu3EfmC1p4zT0kIxxfSF2zDJcQ-iEHk1jQM95xAdr5Z
</pre></div>
<a name="anchor34"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.2.10"></a><h3>A.2.10.
Secured Input Value</h3>
<p>
Concatenate
the Encoded JWE Header value, a period character ('.'),
the Encoded JWE Encrypted Key, a second period character,
the Encoded JWE Initialization Vector, a third period ('.') character, and
the Encoded JWE Ciphertext
to create the value to integrity protect.
This result (with line breaks for display purposes only) is:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
eyJhbGciOiJSU0ExXzUiLCJlbmMiOiJBMTI4Q0JDK0hTMjU2In0.
O6AqXqgVlJJ4c4lp5sXZd7bpGHAw6ARkHUeXQxD1cAW4-X1x0qtj_AN0mukqEOl4
Y6UOwJXIJY9-G1ELK-RQWrKH_StR-AM9H7GpKmSEji8QYOcMOjr-u9H1Lt_pBEie
G802SxWz0rbFTXRcj4BWLxcpCtjUZ31AP-sc-L_eCZ5UNl0aSRNqFskuPkzRsFZR
DJqSSJeVOyJ7pZCQ83fli19Vgi_3R7XMUqluQuuc7ZHOWixi47jXlBTlWRZ5iFxa
S8G6J8wUrd4BKggAw3qX5XoIfXQVlQZE0Vmkq_zQSIo5LnFKyowooRcdsEuNh9B9
Mkyt0ZQElG-jGdtHWjZSOA.
AxY8DCtDaGlsbGljb3RoZQ.
1eBWFgcrz40wC88cgv8rPgu3EfmC1p4zT0kIxxfSF2zDJcQ-iEHk1jQM95xAdr5Z
</pre></div>
<p>
The representation of this value is:
</p>
<p>
[101, 121, 74, 104, 98, 71, 99, 105, 79, 105, 74, 83, 85, 48, 69, 120,
88, 122, 85, 105, 76, 67, 74, 108, 98, 109, 77, 105, 79, 105, 74, 66,
77, 84, 73, 52, 81, 48, 74, 68, 75, 48, 104, 84, 77, 106, 85, 50,
73, 110, 48, 46, 79, 54, 65, 113, 88, 113, 103, 86, 108, 74, 74, 52,
99, 52, 108, 112, 53, 115, 88, 90, 100, 55, 98, 112, 71, 72, 65, 119,
54, 65, 82, 107, 72, 85, 101, 88, 81, 120, 68, 49, 99, 65, 87, 52,
45, 88, 49, 120, 48, 113, 116, 106, 95, 65, 78, 48, 109, 117, 107, 113,
69, 79, 108, 52, 89, 54, 85, 79, 119, 74, 88, 73, 74, 89, 57, 45,
71, 49, 69, 76, 75, 45, 82, 81, 87, 114, 75, 72, 95, 83, 116, 82,
45, 65, 77, 57, 72, 55, 71, 112, 75, 109, 83, 69, 106, 105, 56, 81,
89, 79, 99, 77, 79, 106, 114, 45, 117, 57, 72, 49, 76, 116, 95, 112,
66, 69, 105, 101, 71, 56, 48, 50, 83, 120, 87, 122, 48, 114, 98, 70,
84, 88, 82, 99, 106, 52, 66, 87, 76, 120, 99, 112, 67, 116, 106, 85,
90, 51, 49, 65, 80, 45, 115, 99, 45, 76, 95, 101, 67, 90, 53, 85,
78, 108, 48, 97, 83, 82, 78, 113, 70, 115, 107, 117, 80, 107, 122, 82,
115, 70, 90, 82, 68, 74, 113, 83, 83, 74, 101, 86, 79, 121, 74, 55,
112, 90, 67, 81, 56, 51, 102, 108, 105, 49, 57, 86, 103, 105, 95, 51,
82, 55, 88, 77, 85, 113, 108, 117, 81, 117, 117, 99, 55, 90, 72, 79,
87, 105, 120, 105, 52, 55, 106, 88, 108, 66, 84, 108, 87, 82, 90, 53,
105, 70, 120, 97, 83, 56, 71, 54, 74, 56, 119, 85, 114, 100, 52, 66,
75, 103, 103, 65, 119, 51, 113, 88, 53, 88, 111, 73, 102, 88, 81, 86,
108, 81, 90, 69, 48, 86, 109, 107, 113, 95, 122, 81, 83, 73, 111, 53,
76, 110, 70, 75, 121, 111, 119, 111, 111, 82, 99, 100, 115, 69, 117, 78,
104, 57, 66, 57, 77, 107, 121, 116, 48, 90, 81, 69, 108, 71, 45, 106,
71, 100, 116, 72, 87, 106, 90, 83, 79, 65, 46, 65, 120, 89, 56, 68,
67, 116, 68, 97, 71, 108, 115, 98, 71, 108, 106, 98, 51, 82, 111, 90,
81, 46, 49, 101, 66, 87, 70, 103, 99, 114, 122, 52, 48, 119, 67, 56,
56, 99, 103, 118, 56, 114, 80, 103, 117, 51, 69, 102, 109, 67, 49, 112,
52, 122, 84, 48, 107, 73, 120, 120, 102, 83, 70, 50, 122, 68, 74, 99,
81, 45, 105, 69, 72, 107, 49, 106, 81, 77, 57, 53, 120, 65, 100, 114,
53, 90]
</p>
<a name="anchor35"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.2.11"></a><h3>A.2.11.
JWE Integrity Value</h3>
<p>
Compute the HMAC SHA-256 of this value using the CIK to create the JWE Integrity Value.
This result is:
</p>
<p>
[68, 17, 161, 99, 49, 60, 253, 198, 75, 30, 50, 106, 168, 123, 139, 135,
54, 224, 90, 2, 255, 193, 93, 203, 13, 37, 43, 113, 185, 14, 136, 128]
</p>
<a name="anchor36"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.2.12"></a><h3>A.2.12.
Encoded JWE Integrity Value</h3>
<p>
Base64url encode the resulting JWE Integrity Value to create the Encoded JWE Integrity Value.
This result is:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
RBGhYzE8_cZLHjJqqHuLhzbgWgL_wV3LDSUrcbkOiIA
</pre></div>
<a name="anchor37"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.2.13"></a><h3>A.2.13.
Complete Representation</h3>
<p>
Assemble the final representation:
The Compact Serialization of this result is the
concatenation of
the Encoded JWE Header,
the Encoded JWE Encrypted Key,
the Encoded JWE Initialization Vector,
the Encoded JWE Ciphertext, and
the Encoded JWE Integrity Value
in that order, with the five strings
being separated by four period ('.') characters.
</p>
<p>
The final result in this example
(with line breaks for display purposes only) is:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
eyJhbGciOiJSU0ExXzUiLCJlbmMiOiJBMTI4Q0JDK0hTMjU2In0.
O6AqXqgVlJJ4c4lp5sXZd7bpGHAw6ARkHUeXQxD1cAW4-X1x0qtj_AN0mukqEOl4
Y6UOwJXIJY9-G1ELK-RQWrKH_StR-AM9H7GpKmSEji8QYOcMOjr-u9H1Lt_pBEie
G802SxWz0rbFTXRcj4BWLxcpCtjUZ31AP-sc-L_eCZ5UNl0aSRNqFskuPkzRsFZR
DJqSSJeVOyJ7pZCQ83fli19Vgi_3R7XMUqluQuuc7ZHOWixi47jXlBTlWRZ5iFxa
S8G6J8wUrd4BKggAw3qX5XoIfXQVlQZE0Vmkq_zQSIo5LnFKyowooRcdsEuNh9B9
Mkyt0ZQElG-jGdtHWjZSOA.
AxY8DCtDaGlsbGljb3RoZQ.
1eBWFgcrz40wC88cgv8rPgu3EfmC1p4zT0kIxxfSF2zDJcQ-iEHk1jQM95xAdr5Z.
RBGhYzE8_cZLHjJqqHuLhzbgWgL_wV3LDSUrcbkOiIA
</pre></div>
<a name="anchor38"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.2.14"></a><h3>A.2.14.
Validation</h3>
<p>
This example illustrates the process of creating a JWE with a
composite AEAD algorithm created from a non-AEAD algorithm by
adding a separate integrity check calculation.
These results can be used to validate JWE decryption implementations for these algorithms.
Note that since the RSAES-PKCS1-V1_5 computation includes random values,
the encryption results above will not be completely reproducible.
However, since the AES CBC computation is deterministic, the JWE Encrypted Ciphertext
values will be the same for all encryptions performed using these inputs.
</p>
<a name="KeyWrapExample"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.3"></a><h3>A.3.
Example JWE using AES Key Wrap and AES GCM</h3>
<p>
This example encrypts the plaintext
"The true sign of intelligence is not knowledge but imagination."
to the recipient using AES Key Wrap and AES GCM.
The representation of this plaintext is:
</p>
<p>
[84, 104, 101, 32, 116, 114, 117, 101, 32, 115, 105, 103, 110, 32, 111, 102,
32, 105, 110, 116, 101, 108, 108, 105, 103, 101, 110, 99, 101, 32, 105, 115,
32, 110, 111, 116, 32, 107, 110, 111, 119, 108, 101, 100, 103, 101, 32, 98,
117, 116, 32, 105, 109, 97, 103, 105, 110, 97, 116, 105, 111, 110, 46]
</p>
<a name="anchor39"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.3.1"></a><h3>A.3.1.
JWE Header</h3>
<p>
The following example JWE Header declares that:
</p>
<ul class="text">
<li>
the Content Master Key is encrypted to the recipient
using the AES Key Wrap algorithm with a 128 bit key to produce the JWE
Encrypted Key and
</li>
<li>
the Plaintext is encrypted using the AES GCM
algorithm with a 128 bit key to produce the Ciphertext.
</li>
</ul><p>
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
{"alg":"A128KW","enc":"A128GCM"}
</pre></div>
<a name="anchor40"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.3.2"></a><h3>A.3.2.
Encoded JWE Header</h3>
<p>
Base64url encoding the bytes of the UTF-8 representation of
the JWE Header yields this Encoded JWE Header value:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
eyJhbGciOiJBMTI4S1ciLCJlbmMiOiJBMTI4R0NNIn0
</pre></div>
<a name="anchor41"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.3.3"></a><h3>A.3.3.
Content Master Key (CMK)</h3>
<p>
Generate a 128 bit random Content Master Key (CMK).
In this example, the value is:
</p>
<p>
[64, 154, 239, 170, 64, 40, 195, 99, 19, 84, 192, 142, 192, 238, 207, 217]
</p>
<a name="anchor42"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.3.4"></a><h3>A.3.4.
Key Encryption</h3>
<p>
Encrypt the CMK with the shared symmetric key using the AES Key Wrap
algorithm to produce the JWE Encrypted Key.
In this example, the shared symmetric key value is:
</p>
<p>
[25, 172, 32, 130, 225, 114, 26, 181, 138, 106, 254, 192, 95, 133, 74, 82]
</p>
<p>
The resulting JWE Encrypted Key value is:
</p>
<p>
[164, 255, 251, 1, 64, 200, 65, 200, 34, 197, 81, 143, 43, 211, 240, 38,
191, 161, 181, 117, 119, 68, 44, 80]
</p>
<a name="anchor43"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.3.5"></a><h3>A.3.5.
Encoded JWE Encrypted Key</h3>
<p>
Base64url encode the JWE Encrypted Key to produce the Encoded JWE Encrypted Key.
This result is:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
pP_7AUDIQcgixVGPK9PwJr-htXV3RCxQ
</pre></div>
<a name="anchor44"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.3.6"></a><h3>A.3.6.
Initialization Vector</h3>
<p>
Generate a random 96 bit JWE Initialization Vector.
In this example, the value is:
</p>
<p>
[253, 220, 80, 25, 166, 152, 178, 168, 97, 99, 67, 89]
</p>
<p>
Base64url encoding this value yields the Encoded JWE Initialization Vector value:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
_dxQGaaYsqhhY0NZ
</pre></div>
<a name="anchor45"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.3.7"></a><h3>A.3.7.
"Additional Authenticated Data" Parameter</h3>
<p>
Concatenate
the Encoded JWE Header value, a period character ('.'),
the Encoded JWE Encrypted Key, a second period character ('.'), and
the Encoded JWE Initialization Vector
to create the "additional authenticated data"
parameter for the AES GCM algorithm.
This result (with line breaks for display purposes only) is:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
eyJhbGciOiJBMTI4S1ciLCJlbmMiOiJBMTI4R0NNIn0.
pP_7AUDIQcgixVGPK9PwJr-htXV3RCxQ.
_dxQGaaYsqhhY0NZ
</pre></div>
<p>
The representation of this value is:
</p>
<p>
[101, 121, 74, 104, 98, 71, 99, 105, 79, 105, 74, 66, 77, 84, 73, 52,
83, 49, 99, 105, 76, 67, 74, 108, 98, 109, 77, 105, 79, 105, 74, 66,
77, 84, 73, 52, 82, 48, 78, 78, 73, 110, 48, 46, 112, 80, 95, 55,
65, 85, 68, 73, 81, 99, 103, 105, 120, 86, 71, 80, 75, 57, 80, 119,
74, 114, 45, 104, 116, 88, 86, 51, 82, 67, 120, 81, 46, 95, 100, 120,
81, 71, 97, 97, 89, 115, 113, 104, 104, 89, 48, 78, 90]
</p>
<a name="anchor46"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.3.8"></a><h3>A.3.8.
Plaintext Encryption</h3>
<p>
Encrypt the Plaintext with AES GCM using the CMK as the encryption key,
the JWE Initialization Vector,
and the "additional authenticated data" value above,
requesting a 128 bit "authentication tag" output.
The resulting Ciphertext is:
</p>
<p>
[227, 12, 89, 132, 185, 16, 248, 93, 145, 87, 53, 130, 95, 115, 62, 104,
138, 96, 109, 71, 124, 211, 165, 103, 202, 99, 21, 193, 4, 226, 84, 229,
254, 106, 144, 241, 39, 86, 148, 132, 160, 104, 88, 232, 228, 109, 85, 7,
86, 80, 134, 106, 166, 24, 92, 199, 210, 188, 153, 187, 218, 69, 227]
</p>
<p>
The resulting "authentication tag" value is:
</p>
<p>
[154, 35, 80, 107, 37, 148, 81, 6, 103, 4, 60, 206, 171, 165, 113, 67]
</p>
<a name="anchor47"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.3.9"></a><h3>A.3.9.
Encoded JWE Ciphertext</h3>
<p>
Base64url encode the resulting Ciphertext to create the Encoded JWE Ciphertext.
This result (with line breaks for display purposes only) is:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
4wxZhLkQ-F2RVzWCX3M-aIpgbUd806VnymMVwQTiVOX-apDxJ1aUhKBoWOjkbVUH
VlCGaqYYXMfSvJm72kXj
</pre></div>
<a name="anchor48"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.3.10"></a><h3>A.3.10.
Encoded JWE Integrity Value</h3>
<p>
Base64url encode the resulting "authentication tag" to create the Encoded JWE Integrity Value.
This result is:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
miNQayWUUQZnBDzOq6VxQw
</pre></div>
<a name="anchor49"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.3.11"></a><h3>A.3.11.
Complete Representation</h3>
<p>
Assemble the final representation:
The Compact Serialization of this result is the
concatenation of
the Encoded JWE Header,
the Encoded JWE Encrypted Key,
the Encoded JWE Initialization Vector,
the Encoded JWE Ciphertext, and
the Encoded JWE Integrity Value
in that order, with the five strings
being separated by four period ('.') characters.
</p>
<p>
The final result in this example
(with line breaks for display purposes only) is:
</p><div style='display: table; width: 0; margin-left: 3em; margin-right: auto'><pre>
eyJhbGciOiJBMTI4S1ciLCJlbmMiOiJBMTI4R0NNIn0.
pP_7AUDIQcgixVGPK9PwJr-htXV3RCxQ.
_dxQGaaYsqhhY0NZ.
4wxZhLkQ-F2RVzWCX3M-aIpgbUd806VnymMVwQTiVOX-apDxJ1aUhKBoWOjkbVUH
VlCGaqYYXMfSvJm72kXj.
miNQayWUUQZnBDzOq6VxQw
</pre></div>
<a name="anchor50"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.3.12"></a><h3>A.3.12.
Validation</h3>
<p>
This example illustrates the process of creating a JWE with
symmetric key wrap and an AEAD algorithm.
These results can be used to validate JWE decryption implementations for these algorithms.
Also, since both the AES Key Wrap and AES GCM computations are deterministic,
the resulting JWE value will be the same for all encryptions performed using these inputs.
Since the computation is reproducible, these results can also be used to validate
JWE encryption implementations for these algorithms.
</p>
<a name="KeyDeriv1"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.4"></a><h3>A.4.
Example Key Derivation for "enc" value "A128CBC+HS256"</h3>
<p>
This example uses the Concat KDF to derive the
Content Encryption Key (CEK) and Content Integrity Key (CIK)
from the Content Master Key (CMK) in the manner described in
Section 4.12 of <a class='info' href='#JWA'>[JWA]<span> (</span><span class='info'>Jones, M., “JSON Web Algorithms (JWA),” October 2012.</span><span>)</span></a>.
In this example,
a 256 bit CMK is used to derive a 128 bit CEK and a 256 bit CIK.
</p>
<p>
The CMK value used is:
</p>
<p>
[4, 211, 31, 197, 84, 157, 252, 254, 11, 100, 157, 250, 63, 170, 106, 206,
107, 124, 212, 45, 111, 107, 9, 219, 200, 177, 0, 240, 143, 156, 44, 207]
</p>
<a name="anchor51"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.4.1"></a><h3>A.4.1.
CEK Generation</h3>
<p>
These values are concatenated to produce the round 1 hash input:
</p>
<ul class="text">
<li>
the round number 1 as a 32 bit big endian integer ([0, 0, 0, 1]),
</li>
<li>
the CMK value (as above),
</li>
<li>
the output bit size 128 as a 32 bit big endian number ([0, 0, 0, 128]),
</li>
<li>
the bytes of the UTF-8 representation of the <tt>enc</tt> value
<tt>A128CBC+HS256</tt> --
[65, 49, 50, 56, 67, 66, 67, 43, 72, 83, 50, 53, 54],
</li>
<li>
(no bytes are included for the
<tt>epu</tt> (encryption PartyUInfo) and
<tt>epv</tt> (encryption PartyVInfo)
parameters because they are absent, but if present,
the base64url decoded values of them would have been included here),
</li>
<li>
the bytes of the ASCII representation of the label "Encryption" --
[69, 110, 99, 114, 121, 112, 116, 105, 111, 110].
</li>
</ul><p>
Thus the round 1 hash input is:
</p>
<p>
[0, 0, 0, 1,
4, 211, 31, 197, 84, 157, 252, 254, 11, 100, 157, 250, 63, 170, 106, 206,
107, 124, 212, 45, 111, 107, 9, 219, 200, 177, 0, 240, 143, 156, 44, 207,
0, 0, 0, 128,
65, 49, 50, 56, 67, 66, 67, 43, 72, 83, 50, 53, 54,
69, 110, 99, 114, 121, 112, 116, 105, 111, 110]
</p>
<p>
The SHA-256 hash of this value, which is the round 1 hash output, is:
</p>
<p>
[37, 245, 125, 247, 113, 155, 238, 98, 228, 206, 62, 65, 81, 153, 79, 91,
225, 37, 250, 101, 198, 63, 51, 182, 5, 242, 241, 169, 162, 232, 103, 155]
</p>
<p>
Given that 128 bits are needed for the CEK and the hash has produced 256 bits,
the CEK value is the first 128 bits of that value:
</p>
<p>
[37, 245, 125, 247, 113, 155, 238, 98, 228, 206, 62, 65, 81, 153, 79, 91]
</p>
<a name="anchor52"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.4.2"></a><h3>A.4.2.
CIK Generation</h3>
<p>
These values are concatenated to produce the round 1 hash input:
</p>
<ul class="text">
<li>
the round number 1 as a 32 bit big endian integer ([0, 0, 0, 1]),
</li>
<li>
the CMK value (as above),
</li>
<li>
the output bit size 256 as a 32 bit big endian number ([0, 0, 1, 0]),
</li>
<li>
the bytes of the UTF-8 representation of the <tt>enc</tt> value
<tt>A128CBC+HS256</tt> --
[65, 49, 50, 56, 67, 66, 67, 43, 72, 83, 50, 53, 54],
</li>
<li>
(no bytes are included for the
<tt>epu</tt> (encryption PartyUInfo) and
<tt>epv</tt> (encryption PartyVInfo)
parameters because they are absent, but if present,
the base64url decoded values of them would have been included here),
</li>
<li>
the bytes of the ASCII representation of the label "Integrity" --
[73, 110, 116, 101, 103, 114, 105, 116, 121].
</li>
</ul><p>
Thus the round 1 hash input is:
</p>
<p>
[0, 0, 0, 1,
4, 211, 31, 197, 84, 157, 252, 254, 11, 100, 157, 250, 63, 170, 106, 206,
107, 124, 212, 45, 111, 107, 9, 219, 200, 177, 0, 240, 143, 156, 44, 207,
0, 0, 1, 0,
65, 49, 50, 56, 67, 66, 67, 43, 72, 83, 50, 53, 54,
73, 110, 116, 101, 103, 114, 105, 116, 121]
</p>
<p>
The SHA-256 hash of this value, which is the round 1 hash output, is:
</p>
<p>
[203, 194, 197, 180, 120, 46, 123, 202, 78, 12, 33, 116, 214, 247, 128, 41,
175, 53, 181, 164, 224, 223, 56, 146, 179, 193, 18, 223, 146, 85, 244, 127]
</p>
<p>
Given that 256 bits are needed for the CIK and the hash has produced 256 bits,
the CIK value is that same value:
</p>
<p>
[203, 194, 197, 180, 120, 46, 123, 202, 78, 12, 33, 116, 214, 247, 128, 41,
175, 53, 181, 164, 224, 223, 56, 146, 179, 193, 18, 223, 146, 85, 244, 127]
</p>
<a name="KeyDeriv512"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.5"></a><h3>A.5.
Example Key Derivation for "enc" value "A256CBC+HS512"</h3>
<p>
This example uses the Concat KDF to derive the
Content Encryption Key (CEK) and Content Integrity Key (CIK)
from the Content Master Key (CMK) in the manner described in
Section 4.12 of <a class='info' href='#JWA'>[JWA]<span> (</span><span class='info'>Jones, M., “JSON Web Algorithms (JWA),” October 2012.</span><span>)</span></a>.
In this example,
a 512 bit CMK is used to derive a 256 bit CEK and a 512 bit CIK.
</p>
<p>
The CMK value used is:
</p>
<p>
[148, 116, 199, 126, 2, 117, 233, 76, 150, 149, 89, 193, 61, 34, 239, 226,
109, 71, 59, 160, 192, 140, 150, 235, 106, 204, 49, 176, 68, 119, 13, 34,
49, 19, 41, 69, 5, 20, 252, 145, 104, 129, 137, 138, 67, 23, 153, 83,
81, 234, 82, 247, 48, 211, 41, 130, 35, 124, 45, 156, 249, 7, 225, 168]
</p>
<a name="anchor53"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.5.1"></a><h3>A.5.1.
CEK Generation</h3>
<p>
These values are concatenated to produce the round 1 hash input:
</p>
<ul class="text">
<li>
the round number 1 as a 32 bit big endian integer ([0, 0, 0, 1]),
</li>
<li>
the CMK value (as above),
</li>
<li>
the output bit size 256 as a 32 bit big endian number ([0, 0, 1, 0]),
</li>
<li>
the bytes of the UTF-8 representation of the <tt>enc</tt> value
<tt>A256CBC+HS512</tt> --
[65, 50, 53, 54, 67, 66, 67, 43, 72, 83, 53, 49, 50],
</li>
<li>
(no bytes are included for the
<tt>epu</tt> (encryption PartyUInfo) and
<tt>epv</tt> (encryption PartyVInfo)
parameters because they are absent, but if present,
the base64url decoded values of them would have been included here),
</li>
<li>
the bytes of the ASCII representation of the label "Encryption" --
[69, 110, 99, 114, 121, 112, 116, 105, 111, 110].
</li>
</ul><p>
Thus the round 1 hash input is:
</p>
<p>
[0, 0, 0, 1,
148, 116, 199, 126, 2, 117, 233, 76, 150, 149, 89, 193, 61, 34, 239, 226,
109, 71, 59, 160, 192, 140, 150, 235, 106, 204, 49, 176, 68, 119, 13, 34,
49, 19, 41, 69, 5, 20, 252, 145, 104, 129, 137, 138, 67, 23, 153, 83,
81, 234, 82, 247, 48, 211, 41, 130, 35, 124, 45, 156, 249, 7, 225, 168,
0, 0, 1, 0,
65, 50, 53, 54, 67, 66, 67, 43, 72, 83, 53, 49, 50,
69, 110, 99, 114, 121, 112, 116, 105, 111, 110]
</p>
<p>
The SHA-512 hash of this value, which is the round 1 hash output, is:
</p>
<p>
[95, 112, 19, 252, 0, 97, 200, 188, 108, 84, 27, 116, 192, 169, 42, 165,
25, 246, 115, 235, 226, 198, 148, 211, 94, 143, 240, 226, 89, 226, 79, 13,
178, 80, 124, 251, 55, 114, 30, 115, 179, 64, 107, 213, 222, 225, 12, 169,
245, 116, 231, 83, 227, 233, 20, 164, 249, 148, 62, 92, 43, 5, 1, 97]
</p>
<p>
Given that 256 bits are needed for the CEK and the hash has produced 512 bits,
the CEK value is the first 256 bits of that value:
</p>
<p>
[95, 112, 19, 252, 0, 97, 200, 188, 108, 84, 27, 116, 192, 169, 42, 165,
25, 246, 115, 235, 226, 198, 148, 211, 94, 143, 240, 226, 89, 226, 79, 13]
</p>
<a name="anchor54"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.A.5.2"></a><h3>A.5.2.
CIK Generation</h3>
<p>
These values are concatenated to produce the round 1 hash input:
</p>
<ul class="text">
<li>
the round number 1 as a 32 bit big endian integer ([0, 0, 0, 1]),
</li>
<li>
the CMK value (as above),
</li>
<li>
the output bit size 512 as a 32 bit big endian number ([0, 0, 2, 0]),
</li>
<li>
the bytes of the UTF-8 representation of the <tt>enc</tt> value
<tt>A256CBC+HS512</tt> --
[65, 50, 53, 54, 67, 66, 67, 43, 72, 83, 53, 49, 50],
</li>
<li>
(no bytes are included for the
<tt>epu</tt> (encryption PartyUInfo) and
<tt>epv</tt> (encryption PartyVInfo)
parameters because they are absent, but if present,
the base64url decoded values of them would have been included here),
</li>
<li>
the bytes of the ASCII representation of the label "Integrity" --
[73, 110, 116, 101, 103, 114, 105, 116, 121].
</li>
</ul><p>
Thus the round 1 hash input is:
</p>
<p>
[0, 0, 0, 1,
148, 116, 199, 126, 2, 117, 233, 76, 150, 149, 89, 193, 61, 34, 239, 226,
109, 71, 59, 160, 192, 140, 150, 235, 106, 204, 49, 176, 68, 119, 13, 34,
49, 19, 41, 69, 5, 20, 252, 145, 104, 129, 137, 138, 67, 23, 153, 83,
81, 234, 82, 247, 48, 211, 41, 130, 35, 124, 45, 156, 249, 7, 225, 168,
0, 0, 2, 0,
65, 50, 53, 54, 67, 66, 67, 43, 72, 83, 53, 49, 50,
73, 110, 116, 101, 103, 114, 105, 116, 121]
</p>
<p>
The SHA-512 hash of this value, which is the round 1 hash output, is:
</p>
<p>
[203, 188, 104, 71, 177, 60, 21, 10, 255, 157, 56, 214, 254, 87, 32, 115,
194, 36, 117, 162, 226, 93, 50, 220, 191, 219, 41, 56, 80, 197, 18, 173,
250, 145, 215, 178, 235, 51, 251, 122, 212, 193, 48, 227, 126, 89, 253, 101,
143, 252, 124, 157, 147, 200, 175, 164, 253, 92, 204, 122, 218, 77, 105, 146]
</p>
<p>
Given that 512 bits are needed for the CIK and the hash has produced 512 bits,
the CIK value is that same value:
</p>
<p>
[203, 188, 104, 71, 177, 60, 21, 10, 255, 157, 56, 214, 254, 87, 32, 115,
194, 36, 117, 162, 226, 93, 50, 220, 191, 219, 41, 56, 80, 197, 18, 173,
250, 145, 215, 178, 235, 51, 251, 122, 212, 193, 48, 227, 126, 89, 253, 101,
143, 252, 124, 157, 147, 200, 175, 164, 253, 92, 204, 122, 218, 77, 105, 146]
</p>
<a name="Acknowledgements"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.B"></a><h3>Appendix B.
Acknowledgements</h3>
<p>
Solutions for encrypting JSON content were also explored by
<a class='info' href='#JSE'>JSON Simple Encryption<span> (</span><span class='info'>Bradley, J. and N. Sakimura (editor), “JSON Simple Encryption,” September 2010.</span><span>)</span></a> [JSE] and
<a class='info' href='#I-D.rescorla-jsms'>JavaScript Message Security
Format<span> (</span><span class='info'>Rescorla, E. and J. Hildebrand, “JavaScript Message Security Format,” March 2011.</span><span>)</span></a> [I‑D.rescorla‑jsms], both of which significantly influenced this draft.
This draft attempts to explicitly reuse as many of the relevant concepts from
<a class='info' href='#W3C.CR-xmlenc-core1-20120313'>XML Encryption 1.1<span> (</span><span class='info'>Eastlake, D., Reagle, J., Hirsch, F., and T. Roessler, “XML Encryption Syntax and Processing Version 1.1,” March 2012.</span><span>)</span></a> [W3C.CR‑xmlenc‑core1‑20120313]
and <a class='info' href='#RFC5652'>RFC 5652<span> (</span><span class='info'>Housley, R., “Cryptographic Message Syntax (CMS),” September 2009.</span><span>)</span></a> [RFC5652] as possible,
while utilizing simple compact JSON-based data structures.
</p>
<p>
Special thanks are due to John Bradley and Nat Sakimura for
the discussions that helped inform the content of this
specification and to Eric Rescorla and Joe Hildebrand for
allowing the reuse of text from <a class='info' href='#I-D.rescorla-jsms'>[I‑D.rescorla‑jsms]<span> (</span><span class='info'>Rescorla, E. and J. Hildebrand, “JavaScript Message Security Format,” March 2011.</span><span>)</span></a> in this document.
</p>
<p>
Thanks to Axel Nennker, Emmanuel Raviart, Brian Campbell, and Edmund Jay
for validating the examples in this specification.
</p>
<p>
Jim Schaad and Karen O'Donoghue chaired the JOSE working group and
Sean Turner and Stephen Farrell served as Security area directors
during the creation of this specification.
</p>
<a name="TBD"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.C"></a><h3>Appendix C.
Open Issues</h3>
<p>
[[ to be removed by the RFC editor before publication as an RFC ]]
</p>
<p>
The following items remain to be considered or done in this draft:
</p>
<ul class="text">
<li>
Should we define optional nonce, timestamp, and/or
uninterpreted string header parameter(s)?
</li>
</ul><p>
</p>
<a name="anchor55"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<a name="rfc.section.D"></a><h3>Appendix D.
Document History</h3>
<p>
[[ to be removed by the RFC editor before publication as an RFC ]]
</p>
<p>
-06
</p>
<ul class="text">
<li>
Removed the <tt>int</tt> and
<tt>kdf</tt> parameters and defined the new composite
AEAD algorithms <tt>A128CBC+HS256</tt> and
<tt>A256CBC+HS512</tt> to replace the former
uses of AES CBC, which required the use of separate integrity
and key derivation functions.
</li>
<li>
Included additional values in the Concat KDF calculation -- the
desired output size and the algorithm value,
and optionally PartyUInfo and PartyVInfo values.
Added the optional header parameters
<tt>apu</tt> (agreement PartyUInfo),
<tt>apv</tt> (agreement PartyVInfo),
<tt>epu</tt> (encryption PartyUInfo), and
<tt>epv</tt> (encryption PartyVInfo).
Updated the KDF examples accordingly.
</li>
<li>
Promoted Initialization Vector from being a header parameter to being
a top-level JWE element.
This saves approximately 16 bytes in the compact serialization,
which is a significant savings for some use cases.
Promoting the Initialization Vector out of the header also avoids repeating
this shared value in the JSON serialization.
</li>
<li>
Changed <tt>x5c</tt> (X.509 Certificate Chain)
representation from being a single string to being an array of strings,
each containing a single base64 encoded DER certificate value,
representing elements of the certificate chain.
</li>
<li>
Added an AES Key Wrap example.
</li>
<li>
Reordered the encryption steps so CMK creation is first, when required.
</li>
<li>
Correct statements in examples about which algorithms produce
reproducible results.
</li>
</ul><p>
</p>
<p>
-05
</p>
<ul class="text">
<li>
Support both direct encryption using a
shared or agreed upon symmetric key, and the use of a
shared or agreed upon symmetric key to key wrap the CMK.
</li>
<li>
Added statement that
"StringOrURI values are compared as case-sensitive strings
with no transformations or canonicalizations applied".
</li>
<li>
Updated open issues.
</li>
<li>
Indented artwork elements to better distinguish them from the body text.
</li>
</ul><p>
</p>
<p>
-04
</p>
<ul class="text">
<li>
Refer to the registries as the primary sources of defined
values and then secondarily reference the sections
defining the initial contents of the registries.
</li>
<li>
Normatively reference
<a class='info' href='#W3C.CR-xmlenc-core1-20120313'>XML Encryption 1.1<span> (</span><span class='info'>Eastlake, D., Reagle, J., Hirsch, F., and T. Roessler, “XML Encryption Syntax and Processing Version 1.1,” March 2012.</span><span>)</span></a> [W3C.CR‑xmlenc‑core1‑20120313]
for its security considerations.
</li>
<li>
Reference draft-jones-jose-jwe-json-serialization
instead of draft-jones-json-web-encryption-json-serialization.
</li>
<li>
Described additional open issues.
</li>
<li>
Applied editorial suggestions.
</li>
</ul><p>
</p>
<p>
-03
</p>
<ul class="text">
<li>
Added the <tt>kdf</tt> (key derivation function) header parameter
to provide crypto agility for key derivation.
The default KDF remains the Concat KDF with the SHA-256 digest function.
</li>
<li>
Reordered encryption steps so that the Encoded JWE Header
is always created before it is needed as an input to the AEAD
"additional authenticated data" parameter.
</li>
<li>
Added the <tt>cty</tt> (content type) header parameter
for declaring type information about the secured content,
as opposed to the <tt>typ</tt> (type) header parameter,
which declares type information about this object.
</li>
<li>
Moved description of how to determine whether a header is
for a JWS or a JWE from the JWT spec to the JWE spec.
</li>
<li>
Added complete encryption examples for both AEAD and non-AEAD algorithms.
</li>
<li>
Added complete key derivation examples.
</li>
<li>
Added "Collision Resistant Namespace" to the terminology section.
</li>
<li>
Reference ITU.X690.1994 for DER encoding.
</li>
<li>
Added Registry Contents sections to populate registry values.
</li>
<li>
Numerous editorial improvements.
</li>
</ul><p>
</p>
<p>
-02
</p>
<ul class="text">
<li>
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.
</li>
<li>
Defined KDF output key sizes.
</li>
<li>
Generalized text to allow key agreement to be employed
as an alternative to key wrapping or key encryption.
</li>
<li>
Changed compression algorithm from gzip to DEFLATE.
</li>
<li>
Clarified that it is an error when a <tt>kid</tt>
value is included and no matching key is found.
</li>
<li>
Clarified that JWEs with duplicate Header Parameter Names
MUST be rejected.
</li>
<li>
Clarified the relationship between
<tt>typ</tt> header parameter values
and MIME types.
</li>
<li>
Registered application/jwe MIME type and "JWE" typ header parameter value.
</li>
<li>
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
<tt>jpk</tt> (JSON Public Key) to
<tt>jwk</tt> (JSON Web Key).
</li>
<li>
Added suggestion on defining additional header parameters
such as <tt>x5t#S256</tt> in the future
for certificate thumbprints using hash algorithms other
than SHA-1.
</li>
<li>
Specify RFC 2818 server identity validation, rather than
RFC 6125 (paralleling the same decision in the OAuth specs).
</li>
<li>
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.
</li>
<li>
Reformatted to give each header parameter its own section heading.
</li>
</ul><p>
</p>
<p>
-01
</p>
<ul class="text">
<li>
Added an integrity check for non-AEAD algorithms.
</li>
<li>
Added <tt>jpk</tt> and <tt>x5c</tt> header parameters for including
JWK public keys and X.509 certificate chains directly in
the header.
</li>
<li>
Clarified that this specification is defining the JWE
Compact Serialization. Referenced the new JWE-JS spec,
which defines the JWE JSON Serialization.
</li>
<li>
Added text "New header parameters should be introduced
sparingly since an implementation that does not understand
a parameter MUST reject the JWE".
</li>
<li>
Clarified that the order of the encryption and decryption
steps is not significant in cases where there are no
dependencies between the inputs and outputs of the steps.
</li>
<li>
Made other editorial improvements suggested by JOSE
working group participants.
</li>
</ul><p>
</p>
<p>
-00
</p>
<ul class="text">
<li>
Created the initial IETF draft based upon
draft-jones-json-web-encryption-02 with no normative
changes.
</li>
<li>
Changed terminology to no longer call both digital
signatures and HMACs "signatures".
</li>
</ul><p>
</p>
<a name="rfc.authors"></a><br /><hr />
<table summary="layout" cellpadding="0" cellspacing="2" class="TOCbug" align="right"><tr><td class="TOCbug"><a href="#toc"> TOC </a></td></tr></table>
<h3>Authors' Addresses</h3>
<table width="99%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="author-text"> </td>
<td class="author-text">Michael B. Jones</td></tr>
<tr><td class="author-text"> </td>
<td class="author-text">Microsoft</td></tr>
<tr><td class="author" align="right">Email: </td>
<td class="author-text"><a href="mailto:mbj@microsoft.com">mbj@microsoft.com</a></td></tr>
<tr><td class="author" align="right">URI: </td>
<td class="author-text"><a href="http://self-issued.info/">http://self-issued.info/</a></td></tr>
<tr cellpadding="3"><td> </td><td> </td></tr>
<tr><td class="author-text"> </td>
<td class="author-text">Eric Rescorla</td></tr>
<tr><td class="author-text"> </td>
<td class="author-text">RTFM, Inc.</td></tr>
<tr><td class="author" align="right">Email: </td>
<td class="author-text"><a href="mailto:ekr@rtfm.com">ekr@rtfm.com</a></td></tr>
<tr cellpadding="3"><td> </td><td> </td></tr>
<tr><td class="author-text"> </td>
<td class="author-text">Joe Hildebrand</td></tr>
<tr><td class="author-text"> </td>
<td class="author-text">Cisco Systems, Inc.</td></tr>
<tr><td class="author" align="right">Email: </td>
<td class="author-text"><a href="mailto:jhildebr@cisco.com">jhildebr@cisco.com</a></td></tr>
</table>
</body></html>