JSON Private Keydraft-jones-jose-json-private-key-01

Abstract

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 May 10, 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.

3.1.
JWK Parameters for Elliptic Curve Private Keys

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

3.2.1.
"d" (Private Exponent) Parameter

The d (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.

3.2.4.
"dp" (First Factor CRT Exponent) Parameter

The dp (first factor CRT exponent)
member contains the Chinese Remainder Theorem (CRT) exponent
of the first factor, a positive integer.
It is represented as the base64url encoding of the
value's unsigned big endian representation as a byte array.

3.2.5.
"dq" (Second Factor CRT Exponent) Parameter

The dq (second factor CRT exponent)
member contains the Chinese Remainder Theorem (CRT) exponent
of the second factor, a positive integer.
It is represented as the base64url encoding of the
value's unsigned big endian representation as a byte array.

3.2.6.
"qi" (First CRT Coefficient) Parameter

The dp (first CRT coefficient)
member contains the Chinese Remainder Theorem (CRT)
coefficient of the second factor, a positive integer.
It is represented as the base64url encoding of the
value's unsigned big endian representation as a byte array.

3.2.7.
"oth" (Other Primes Info) Parameter

The oth (other primes info)
member contains an array of information about any third and subsequent
primes, should they exist.
When only two primes have been used (the normal case),
this parameter MUST be omitted.
When three or more primes have been used, the number of array
elements MUST be the number of primes used minus two.
Each array element MUST be an object with the following members:

3.2.7.1.
"r" (Prime Factor)

The r (prime factor) parameter
within an oth array member
represents the value of a subsequent prime factor,
a positive integer.
It is represented as the base64url encoding of the
value's unsigned big endian representation as a byte array.

3.2.7.2.
"d" (Factor CRT Exponent)

The d (Factor CRT Exponent) parameter
within an oth array member
represents the CRT exponent of the corresponding prime factor,
a positive integer.
It is represented as the base64url encoding of the
value's unsigned big endian representation as a byte array.

3.2.7.3.
"t" (Factor CRT Coefficient)

The t (factor CRT coefficient) parameter
within an oth array member
represents the CRT coefficient of the corresponding prime factor,
a positive integer.
It is represented as the base64url encoding of the
value's unsigned big endian representation as a byte array.

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),” November 2012.),
adding private key values.
(Line breaks are for display purposes only.)

Appendix A.
Document History

Changed the names of the RSA key parameters
so that the identifiers are the same as those used in RFC 3447.

Added the RSA private key fields enabling Chinese Remainder Theorem (CRT)
calculations, based upon their use in RFC 3447.

-00

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.