< draft-jones-json-web-key-02.txt   draft-jones-json-web-key-03.txt >
Network Working Group M. Jones Network Working Group M. Jones
Internet-Draft Microsoft Internet-Draft Microsoft
Intended status: Standards Track October 30, 2011 Intended status: Standards Track December 13, 2011
Expires: May 2, 2012 Expires: June 15, 2012
JSON Web Key (JWK) JSON Web Key (JWK)
draft-jones-json-web-key-02 draft-jones-json-web-key-03
Abstract Abstract
A JSON Web Key (JWK) is a JSON data structure that represents a set A JSON Web Key (JWK) is a JSON data structure that represents a set
of public keys. of public keys.
Requirements Language Requirements Language
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
skipping to change at page 1, line 37 skipping to change at page 1, line 37
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on May 2, 2012. This Internet-Draft will expire on June 15, 2012.
Copyright Notice Copyright Notice
Copyright (c) 2011 IETF Trust and the persons identified as the Copyright (c) 2011 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 2, line 16 skipping to change at page 2, line 16
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . 3
3. JSON Web Key (JWK) Overview . . . . . . . . . . . . . . . . . . 3 3. JSON Web Key (JWK) Overview . . . . . . . . . . . . . . . . . . 3
3.1. Example JWK . . . . . . . . . . . . . . . . . . . . . . . . 3 3.1. Example JWK . . . . . . . . . . . . . . . . . . . . . . . . 3
4. JWK Format . . . . . . . . . . . . . . . . . . . . . . . . . . 4 4. JWK Format . . . . . . . . . . . . . . . . . . . . . . . . . . 4
4.1. JWK Container Object Format . . . . . . . . . . . . . . . . 4 4.1. JWK Container Object Format . . . . . . . . . . . . . . . . 4
4.2. JWK Key Object Format . . . . . . . . . . . . . . . . . . . 4 4.2. JWK Key Object Format . . . . . . . . . . . . . . . . . . . 5
4.2.1. JWK Key Object Members for Elliptic Curve Keys . . . . 5 4.2.1. JWK Key Object Members for Elliptic Curve Keys . . . . 5
4.2.2. JWK Key Object Members for RSA Keys . . . . . . . . . . 6 4.2.2. JWK Key Object Members for RSA Keys . . . . . . . . . . 6
5. Base64url encoding as used by JWKs . . . . . . . . . . . . . . 7 5. Base64url encoding as used by JWKs . . . . . . . . . . . . . . 7
6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 7 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 7
7. Security Considerations . . . . . . . . . . . . . . . . . . . . 7 7. Security Considerations . . . . . . . . . . . . . . . . . . . . 7
8. Open Issues and Things To Be Done (TBD) . . . . . . . . . . . . 7 8. Open Issues and Things To Be Done (TBD) . . . . . . . . . . . . 7
9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 7 9. References . . . . . . . . . . . . . . . . . . . . . . . . . . 7
9.1. Normative References . . . . . . . . . . . . . . . . . . . 7 9.1. Normative References . . . . . . . . . . . . . . . . . . . 7
9.2. Informative References . . . . . . . . . . . . . . . . . . 8 9.2. Informative References . . . . . . . . . . . . . . . . . . 8
Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . . 8 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . . 8
Appendix B. Document History . . . . . . . . . . . . . . . . . . . 8 Appendix B. Document History . . . . . . . . . . . . . . . . . . . 8
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 8 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 9
1. Introduction 1. Introduction
A JSON Web Key (JWK) is a JSON data structure that represents a set A JSON Web Key (JWK) is a JSON data structure that represents a set
of public keys as a JSON object [RFC4627]. The JWK format is used to of public keys as a JSON object [RFC4627]. The JWK format is used to
represent bare keys; representing certificate chains is an explicit represent bare keys; representing certificate chains is an explicit
non-goal of this specification. JSON Web Keys are referenced in JSON non-goal of this specification. JSON Web Keys are referenced in JSON
Web Signatures (JWSs) [JWS] using the "jku" (JSON Key URL) header Web Signature (JWS) [JWS] using the "jku" (JSON Key URL) header
parameter. parameter and in JSON Web Encryption (JWE) [JWE] using the "jku"
(JSON Key URL) and "epk" (Ephemeral Public Key) header parameters.
2. Terminology 2. Terminology
JSON Web Key (JWK) A JSON data structure that represents a set of JSON Web Key (JWK) A JSON data structure that represents a set of
public keys. A JWK consists of a single JWK Container Object that public keys. A JWK consists of a single JWK Container Object that
contains an array of JWK Key Objects. contains an array of JWK Key Objects.
JWK Container Object A JSON object that contains an array of JWK Key JWK Container Object A JSON object that contains an array of JWK Key
Objects as a member. Objects as a member.
skipping to change at page 3, line 44 skipping to change at page 3, line 45
It is sometimes useful to be able to reference public key It is sometimes useful to be able to reference public key
representations, for instance, in order to verify the signature on representations, for instance, in order to verify the signature on
content signed with the corresponding private key. The JSON Web Key content signed with the corresponding private key. The JSON Web Key
(JWK) data structure provides a convenient JSON representation for (JWK) data structure provides a convenient JSON representation for
sets of public keys utilizing either the Elliptic Curve or RSA sets of public keys utilizing either the Elliptic Curve or RSA
families of algorithms. families of algorithms.
3.1. Example JWK 3.1. Example JWK
The following example JWK contains two public keys: one using an The following example JWK contains two public keys: one using an
Elliptic Curve algorithm and a second one using an RSA algorithm. In Elliptic Curve algorithm and a second one using an RSA algorithm.
both cases, integers are represented using the base64url encoding of The first specifies that the key is to be used for encryption. Both
their big endian representations. provide a Key ID for matching purposes. In both cases, integers are
represented using the base64url encoding of their big endian
{"keyvalues": representations. (Long lines are broken are for display purposes
[ only.)
{"algorithm":"EC", {"jwk":
"curve":"P-256", [
"x":"MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4", {"alg":"EC",
"y":"4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM", "crv":"P-256",
"use":"encryption", "x":"MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4",
"keyid":"1"}, "y":"4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM",
"use":"enc",
"kid":"1"},
{"algorithm":"RSA", {"alg":"RSA",
"modulus": "0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMstn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbISD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw", "mod": "0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx
"exponent":"AQAB", 4cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMs
"keyid":"2011-04-29"} tn64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2
] QvzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbI
} SD08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqb
w0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw",
"exp":"AQAB",
"kid":"2011-04-29"}
]
}
4. JWK Format 4. JWK Format
A JWK consists of a JWK Container Object, which is a JSON object that A JWK consists of a JWK Container Object, which is a JSON object that
contains an array of JWK Key Objects as a member. This section contains an array of JWK Key Objects as a member. This section
specifies the format of these objects. specifies the format of these objects.
4.1. JWK Container Object Format 4.1. JWK Container Object Format
A JWK Container Object is a JSON object containing a specific member. A JWK Container Object is a JSON object containing a specific member.
This member is: This member is:
+-----------+----------+--------------------------------------------+ +--------+----------+-----------------------------------------------+
| Member | JSON | Container Object Member Semantics | | Member | JSON | Container Object Member Semantics |
| Name | Value | | | Name | Value | |
| | Type | | | | Type | |
+-----------+----------+--------------------------------------------+ +--------+----------+-----------------------------------------------+
| keyvalues | array | The "keyvalues" member value contains an | | jwk | array | The "jwk" member value contains an array of |
| | | array of JWK Key Objects. This member is | | | | JWK Key Objects. This member is REQUIRED. |
| | | REQUIRED. | +--------+----------+-----------------------------------------------+
+-----------+----------+--------------------------------------------+
JWK Container Object Member JWK Container Object Member
Additional members MAY be present in the JWK Container Object. If Additional members MAY be present in the JWK Container Object. If
present, they MUST be understood by implementations using that JWK. present, they MUST be understood by implementations using that JWK.
4.2. JWK Key Object Format 4.2. JWK Key Object Format
A JWK Key Object is a JSON object containing specific members. Those A JWK Key Object is a JSON object containing specific members. Those
members that are common to all key types are as follows: members that are common to all key types are as follows:
+-----------+--------+----------------------------------------------+ +--------+--------+-------------------------------------------------+
| Member | JSON | Key Object Member Semantics | | Member | JSON | Key Object Member Semantics |
| Name | Value | | | Name | Value | |
| | Type | | | | Type | |
+-----------+--------+----------------------------------------------+ +--------+--------+-------------------------------------------------+
| algorithm | string | The "algorithm" member identifies the | | alg | string | The "alg" member identifies the cryptographic |
| | | cryptographic algorithm family used with the | | | | algorithm family used with the key. Values |
| | | key. Values defined by this specification | | | | defined by this specification are "EC" and |
| | | are "EC" and "RSA". Specific additional | | | | "RSA". Specific additional members are |
| | | members are required to represent the key, | | | | required to represent the key, depending upon |
| | | depending upon the "algorithm" value. The | | | | the "alg" value. The "alg" value is case |
| | | "algorithm" value is case sensitive. This | | | | sensitive. This member is REQUIRED. |
| | | member is REQUIRED. | | use | string | The "use" member identifies the intended use of |
| use | string | The "use" member identifies the intended use | | | | the key. Values defined by this specification |
| | | of the key. Values defined by this | | | | are "sig" (signature) and "enc" (encryption). |
| | | specification are "signature" and | | | | Other values MAY be used. The "use" value is |
| | | "encryption". Other values MAY be used. | | | | case sensitive. This member is OPTIONAL. |
| | | The "use" value is case sensitive. This | | kid | string | The "kid" (Key ID) member can be used to match |
| | | member is OPTIONAL. | | | | a specific key. This can be used, for |
| keyid | string | The "keyid" (Key ID) member can be used to | | | | instance, to choose among a set of keys within |
| | | match a specific key. This can be used, for | | | | the JWK during key rollover. The "kid" value |
| | | instance, to choose among a set of keys | | | | MAY correspond to a JWS "kid" value. The |
| | | within the JWK during key rollover. The | | | | interpretation of the "kid" value is |
| | | "keyid" value MAY correspond to a JWS "kid" | | | | unspecified. This member is OPTIONAL. |
| | | value. The interpretation of the "keyid" | +--------+--------+-------------------------------------------------+
| | | value is unspecified. This member is |
| | | OPTIONAL. |
+-----------+--------+----------------------------------------------+
JWK Key Object Members JWK Key Object Members
Additional members MAY be present in the JWK Key Object. If present, Additional members MAY be present in the JWK Key Object. If present,
they MUST be understood by implementations using that key. they MUST be understood by implementations using that key.
4.2.1. JWK Key Object Members for Elliptic Curve Keys 4.2.1. JWK Key Object Members for Elliptic Curve Keys
JWKs can represent Elliptic Curve [FIPS.186-3] keys. In this case, JWKs can represent Elliptic Curve [FIPS.186-3] keys. In this case,
the "algorithm" member value MUST be "EC". Furthermore, these the "alg" member value MUST be "EC". Furthermore, these additional
additional members MUST be present: members MUST be present:
+--------+--------+-------------------------------------------------+ +--------+--------+-------------------------------------------------+
| Member | JSON | Key Object Member Semantics | | Member | JSON | Key Object Member Semantics |
| Name | Value | | | Name | Value | |
| | Type | | | | Type | |
+--------+--------+-------------------------------------------------+ +--------+--------+-------------------------------------------------+
| curve | string | The "curve" member identifies the cryptographic | | crv | string | The "crv" member identifies the cryptographic |
| | | curve used with the key. Values defined by | | | | curve used with the key. Values defined by |
| | | this specification are "P-256", "P-384" and | | | | this specification are "P-256", "P-384" and |
| | | "P-521". Additional "curve" values MAY be | | | | "P-521". Additional "crv" values MAY be used, |
| | | used, provided they are understood by | | | | provided they are understood by implementations |
| | | implementations using that Elliptic Curve key. | | | | using that Elliptic Curve key. The "crv" value |
| | | The "curve" value is case sensitive. | | | | is case sensitive. |
| x | string | The "x" member contains the x coordinate for | | x | string | The "x" member contains the x coordinate for |
| | | the elliptic curve point. It is represented as | | | | the elliptic curve point. It is represented as |
| | | the base64url encoding of the coordinate's big | | | | the base64url encoding of the coordinate's big |
| | | endian representation. | | | | endian representation. |
| y | string | The "y" member contains the y coordinate for | | y | string | The "y" member contains the y coordinate for |
| | | the elliptic curve point. It is represented as | | | | the elliptic curve point. It is represented as |
| | | the base64url encoding of the coordinate's big | | | | the base64url encoding of the coordinate's big |
| | | endian representation. | | | | endian representation. |
+--------+--------+-------------------------------------------------+ +--------+--------+-------------------------------------------------+
Members for Elliptic Curve Keys Members for Elliptic Curve Keys
4.2.2. JWK Key Object Members for RSA Keys 4.2.2. JWK Key Object Members for RSA Keys
JWKs can represent RSA [RFC3447] keys. In this case, the "algorithm" JWKs can represent RSA [RFC3447] keys. In this case, the "alg"
member value MUST be "RSA". Furthermore, these additional members member value MUST be "RSA". Furthermore, these additional members
MUST be present: MUST be present:
+----------+--------+-----------------------------------------------+ +--------+--------+-------------------------------------------------+
| Member | JSON | Key Object Member Semantics | | Member | JSON | Key Object Member Semantics |
| Name | Value | | | Name | Value | |
| | Type | | | | Type | |
+----------+--------+-----------------------------------------------+ +--------+--------+-------------------------------------------------+
| modulus | string | The "modulus" member contains the modulus | | mod | string | The "mod" member contains the modulus value for |
| | | value for the RSA public key. It is | | | | the RSA public key. It is represented as the |
| | | represented as the base64url encoding of the | | | | base64url encoding of the value's big endian |
| | | value's big endian representation. | | | | representation. |
| exponent | string | The "exponent" member contains the exponent | | exp | string | The "exp" member contains the exponent value |
| | | value for the RSA public key. It is | | | | for the RSA public key. It is represented as |
| | | represented as the base64url encoding of the | | | | the base64url encoding of the value's big |
| | | value's big endian representation. | | | | endian representation. |
+----------+--------+-----------------------------------------------+ +--------+--------+-------------------------------------------------+
Members for RSA Keys Members for RSA Keys
5. Base64url encoding as used by JWKs 5. Base64url encoding as used by JWKs
JWKs make use of the base64url encoding as defined in RFC 4648 JWKs make use of the base64url encoding as defined in RFC 4648
[RFC4648]. As allowed by Section 3.2 of the RFC, this specification [RFC4648]. As allowed by Section 3.2 of the RFC, this specification
mandates that base64url encoding when used with JWKs MUST NOT use mandates that base64url encoding when used with JWKs MUST NOT use
padding. Notes on implementing base64url encoding can be found in padding. Notes on implementing base64url encoding can be found in
the JWS [JWS] specification. the JWS [JWS] specification.
skipping to change at page 8, line 7 skipping to change at page 8, line 7
Version 2.1", RFC 3447, February 2003. Version 2.1", RFC 3447, February 2003.
[RFC4627] Crockford, D., "The application/json Media Type for [RFC4627] Crockford, D., "The application/json Media Type for
JavaScript Object Notation (JSON)", RFC 4627, July 2006. JavaScript Object Notation (JSON)", RFC 4627, July 2006.
[RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data [RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data
Encodings", RFC 4648, October 2006. Encodings", RFC 4648, October 2006.
9.2. Informative References 9.2. Informative References
[JWE] Jones, M., Rescorla, E., and J. Hildebrand, "JSON Web
Encryption (JWE)", December 2011.
[JWS] Jones, M., Balfanz, D., Bradley, J., Goland, Y., Panzer, [JWS] Jones, M., Balfanz, D., Bradley, J., Goland, Y., Panzer,
J., Sakimura, N., and P. Tarjan, "JSON Web Signature J., Sakimura, N., and P. Tarjan, "JSON Web Signature
(JWS)", October 2011. (JWS)", December 2011.
[MagicSignatures] [MagicSignatures]
Panzer (editor), J., Laurie, B., and D. Balfanz, "Magic Panzer (editor), J., Laurie, B., and D. Balfanz, "Magic
Signatures", August 2010. Signatures", August 2010.
Appendix A. Acknowledgements Appendix A. Acknowledgements
A JSON representation for RSA public keys was previously introduced A JSON representation for RSA public keys was previously introduced
in Magic Signatures [MagicSignatures]. in Magic Signatures [MagicSignatures].
Appendix B. Document History Appendix B. Document History
-03
o Use short names since JWK Key Object values are used as JWE
Ephemeral Public Keys, and so compactness matters.
o Respect line length restrictions in examples.
-02 -02
o Editorial changes to have this spec better match the JWT, JWS, and o Editorial changes to have this spec better match the JWT, JWS, and
JWE specs. No normative changes. JWE specs. No normative changes.
-01 -01
o Changed "algorithm" member value for Elliptic Curve keys from o Changed "algorithm" member value for Elliptic Curve keys from
"ECDSA" to "EC", since Elliptic Curve keys can be used with more "ECDSA" to "EC", since Elliptic Curve keys can be used with more
algorithms than just the Elliptic Curve Digital Signature algorithms than just the Elliptic Curve Digital Signature
 End of changes. 18 change blocks. 
86 lines changed or deleted 100 lines changed or added

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