TOC 
JOSE Working GroupM. Jones
Internet-DraftMicrosoft
Intended status: Standards TrackAugust 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.



Table of Contents

1.  Introduction
    1.1.  Notational Conventions
2.  Terminology
3.  JWK Parameters for Private Keys
    3.1.  JWK Parameters for Elliptic Curve Private Keys
        3.1.1.  "d" (ECC Private Key) Parameter
    3.2.  JWK Parameters for RSA Private Keys
        3.2.1.  "pri" (Private Exponent) Parameter
4.  Example Private Keys
5.  IANA Considerations
    5.1.  JSON Web Key Parameters Registration
        5.1.1.  Registry Contents
6.  Security Considerations
7.  Normative References
Appendix A.  Document History
§  Author's Address




 TOC 

1.  Introduction

The JSON Private Key specification extends the JSON Web Key (JWK) [JWK] (Jones, M., “JSON Web Key (JWK),” July 2012.) and JSON Web Algorithms (JWA) [JWA] (Jones, M., “JSON Web Algorithms (JWA),” July 2012.) specifications to define a JavaScript Object Notation (JSON) [RFC4627] (Crockford, D., “The application/json Media Type for JavaScript Object Notation (JSON),” July 2006.) representation of private keys.



 TOC 

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] (Bradner, S., “Key words for use in RFCs to Indicate Requirement Levels,” March 1997.).



 TOC 

2.  Terminology

This specification uses the same terminology as the JSON Web Key (JWK) [JWK] (Jones, M., “JSON Web Key (JWK),” July 2012.) and JSON Web Algorithms (JWA) [JWA] (Jones, M., “JSON Web Algorithms (JWA),” July 2012.) specifications.



 TOC 

3.  JWK Parameters for Private Keys

This section defines additional JSON Web Key parameters that enable JWKs to represent private keys.



 TOC 

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:



 TOC 

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.



 TOC 

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:



 TOC 

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.



 TOC 

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] (Jones, M., “JSON Web Key (JWK),” July 2012.), 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"}
    ]
  }


 TOC 

5.  IANA Considerations



 TOC 

5.1.  JSON Web Key Parameters Registration

This specification registers the parameter names defined in Section 3.1 (JWK Parameters for Elliptic Curve Private Keys) and Section 3.2 (JWK Parameters for RSA Private Keys) in the IANA JSON Web Key Parameters registry [JWK] (Jones, M., “JSON Web Key (JWK),” July 2012.).



 TOC 

5.1.1.  Registry Contents



 TOC 

6.  Security Considerations

The security considerations for this specification are the same as those for the JSON Web Key (JWK) [JWK] (Jones, M., “JSON Web Key (JWK),” July 2012.) specification and the portion of the JSON Web Algorithms (JWA) [JWA] (Jones, M., “JSON Web Algorithms (JWA),” July 2012.) specification that pertains to key representations.



 TOC 

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 (TXT, HTML, XML).
[RFC4627] Crockford, D., “The application/json Media Type for JavaScript Object Notation (JSON),” RFC 4627, July 2006 (TXT).


 TOC 

Appendix A.  Document History

[[ to be removed by the RFC editor before publication as an RFC ]]

-00



 TOC 

Author's Address

  Michael B. Jones
  Microsoft
Email:  mbj@microsoft.com
URI:  http://self-issued.info/