JOSE Working Group M. Jones Internet-Draft Microsoft Intended status: Standards Track August 15, 2012 Expires: February 16, 2013 JSON Private Key draft-jones-jose-json-private-key-00 Abstract The JSON Private Key specification extends the JSON Web Key (JWK) and JSON Web Algorithms (JWA) specifications to define a JavaScript Object Notation (JSON) representation of private keys. Status of this Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. 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/. 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." This Internet-Draft will expire on February 16, 2013. Copyright Notice Copyright (c) 2012 IETF Trust and the persons identified as the document authors. All rights reserved. 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. Jones Expires February 16, 2013 [Page 1] Internet-Draft JWS JSON Serialization (JWS-JS) August 2012 Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 1.1. Notational Conventions . . . . . . . . . . . . . . . . . . 3 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3. JWK Parameters for Private Keys . . . . . . . . . . . . . . . . 3 3.1. JWK Parameters for Elliptic Curve Private Keys . . . . . . 3 3.1.1. "d" (ECC Private Key) Parameter . . . . . . . . . . . . 3 3.2. JWK Parameters for RSA Private Keys . . . . . . . . . . . . 3 3.2.1. "pri" (Private Exponent) Parameter . . . . . . . . . . 4 4. Example Private Keys . . . . . . . . . . . . . . . . . . . . . 4 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . . 5 5.1. JSON Web Key Parameters Registration . . . . . . . . . . . 5 5.1.1. Registry Contents . . . . . . . . . . . . . . . . . . . 5 6. Security Considerations . . . . . . . . . . . . . . . . . . . . 5 7. Normative References . . . . . . . . . . . . . . . . . . . . . 5 Appendix A. Document History . . . . . . . . . . . . . . . . . . . 5 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 6 Jones Expires February 16, 2013 [Page 2] Internet-Draft JWS JSON Serialization (JWS-JS) August 2012 1. Introduction The JSON Private Key specification extends the JSON Web Key (JWK) [JWK] and JSON Web Algorithms (JWA) [JWA] specifications to define a JavaScript Object Notation (JSON) [RFC4627] representation of private keys. 1.1. Notational Conventions 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 [RFC2119]. 2. Terminology This specification uses the same terminology as the JSON Web Key (JWK) [JWK] and JSON Web Algorithms (JWA) [JWA] specifications. 3. JWK Parameters for Private Keys This section defines additional JSON Web Key parameters that enable JWKs to represent private keys. 3.1. JWK Parameters for Elliptic Curve Private Keys When the JWK "alg" member value is "EC", the following member MAY be used to represent an Elliptic Curve private key: 3.1.1. "d" (ECC Private Key) Parameter The "d" (ECC private key) member contains the Elliptic Curve private key value. It is represented as the base64url encoding of the value's unsigned big endian representation as a byte array. The array representation MUST not be shortened to omit any leading zero bytes. For instance, when representing 521 bit integers, the byte array to be base64url encoded MUST contain 66 bytes, including any leading zero bytes. 3.2. JWK Parameters for RSA Private Keys When the JWK "alg" member value is "RSA", the following member MAY be used to represent an RSA private key: Jones Expires February 16, 2013 [Page 3] Internet-Draft JWS JSON Serialization (JWS-JS) August 2012 3.2.1. "pri" (Private Exponent) Parameter The "pri" (private exponent) member contains the private exponent value for the RSA private key. It is represented as the base64url encoding of the value's unsigned big endian representation as a byte array. The array representation MUST not be shortened to omit any leading zero bytes. For instance, when representing 2048 bit integers, the byte array to be base64url encoded MUST contain 256 bytes, including any leading zero bytes. 4. Example Private Keys The following example JWK Set contains two keys represented as JWKs containing both public and private key values: one using an Elliptic Curve algorithm and a second one using an RSA algorithm. This example extends the example in Section 3 of [JWK], adding private key values. (Line breaks are for display purposes only.) {"keys": [ {"alg":"EC", "crv":"P-256", "x":"MKBCTNIcKUSDii11ySs3526iDZ8AiTo7Tu6KPAqv7D4", "y":"4Etl6SRW2YiLUrN5vfvVHuhp7x8PxltmWWlbbM4IFyM", "d":"870MB6gfuTJ4HtUnUvYMyJpr5eUZNP4Bk43bVdj3eAE", "use":"enc", "kid":"1"}, {"alg":"RSA", "mod":"0vx7agoebGcQSuuPiLJXZptN9nndrQmbXEps2aiAFbWhM78LhWx4 cbbfAAtVT86zwu1RK7aPFFxuhDR1L6tSoc_BJECPebWKRXjBZCiFV4n3oknjhMst n64tZ_2W-5JsGY4Hc5n9yBXArwl93lqt7_RN5w6Cf0h4QyQ5v-65YGjQR0_FDW2Q vzqY368QQMicAtaSqzs8KJZgnYb9c7d0zgdAZHzu6qMQvRL5hajrn1n91CbOpbIS D08qNLyrdkt-bFTWhAI4vMQFh6WeZu0fM4lFd2NcRwr3XPksINHaQ-G_xBniIqbw 0Ls1jF44-csFCur-kEgU8awapJzKnqDKgw", "exp":"AQAB", "pri":"X4cTteJY_gn4FYPsXB8rdXix5vwsg1FLN5E3EaG6RJoVH-HLLKD9 M7dx5oo7GURknchnrRweUkC7hT5fJLM0WbFAKNLWY2vv7B6NqXSzUvxT0_YSfqij wp3RTzlBaCxWp4doFk5N2o8Gy_nHNKroADIkJ46pRUohsXywbReAdYaMwFs9tv8d _cPVY3i07a3t8MN6TNwm0dSawm9v47UiCl3Sk5ZiG7xojPLu4sbg1U2jx4IBTNBz nbJSzFHK66jT8bgkuqsk0GjskDJk19Z4qwjwbsnn4j2WBii3RL-Us2lGVkY8fkFz me1z0HbIkfz0Y6mqnOYtqc0X4jfcKoAC8Q", "kid":"2011-04-29"} ] } Jones Expires February 16, 2013 [Page 4] Internet-Draft JWS JSON Serialization (JWS-JS) August 2012 5. IANA Considerations 5.1. JSON Web Key Parameters Registration This specification registers the parameter names defined in Section 3.1 and Section 3.2 in the IANA JSON Web Key Parameters registry [JWK]. 5.1.1. Registry Contents o Parameter Name: "d" o Change Controller: IETF o Specification Document(s): Section 3.1.1 of [[ this document ]] o Parameter Name: "pri" o Change Controller: IETF o Specification Document(s): Section 3.2.1 of [[ this document ]] 6. Security Considerations The security considerations for this specification are the same as those for the JSON Web Key (JWK) [JWK] specification and the portion of the JSON Web Algorithms (JWA) [JWA] specification that pertains to key representations. 7. Normative References [JWA] Jones, M., "JSON Web Algorithms (JWA)", July 2012. [JWK] Jones, M., "JSON Web Key (JWK)", July 2012. [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC4627] Crockford, D., "The application/json Media Type for JavaScript Object Notation (JSON)", RFC 4627, July 2006. Appendix A. Document History [[ to be removed by the RFC editor before publication as an RFC ]] Jones Expires February 16, 2013 [Page 5] Internet-Draft JWS JSON Serialization (JWS-JS) August 2012 -00 o Created draft-jones-jose-json-private-key to facilitate discussion of the question from the W3C WebCrypto WG to the IETF JOSE WG of whether JOSE plans to support a format for representing private keys. Author's Address Michael B. Jones Microsoft Email: mbj@microsoft.com URI: http://self-issued.info/ Jones Expires February 16, 2013 [Page 6]