1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
|
Internet Engineering Task Force (IETF) S. Turner
Request for Comments: 5915 IECA
Category: Informational D. Brown
ISSN: 2070-1721 Certicom
June 2010
Elliptic Curve Private Key Structure
Abstract
This document specifies the syntax and semantics for conveying
Elliptic Curve (EC) private key information. The syntax and
semantics defined herein are based on similar syntax and semantics
defined by the Standards for Efficient Cryptography Group (SECG).
Status of This Memo
This document is not an Internet Standards Track specification; it is
published for informational purposes.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Not all documents
approved by the IESG are a candidate for any level of Internet
Standard; see Section 2 of RFC 5741.
Information about the current status of this document, any
errata, and how to provide feedback on it may be obtained at
http://www.rfc-editor.org/info/rfc5915.
Copyright Notice
Copyright (c) 2010 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.
Turner & Brown Informational [Page 1]
^L
RFC 5915 Elliptic Curve Private Key Structure June 2010
1. Introduction
This document specifies a syntax and semantics for Elliptic Curve
(EC) private key information. EC private key information includes a
private key and parameters. Additionally, it may include the
corresponding public key. The syntax and semantics defined herein
are based on similar syntax and semantics defined by the Standards
for Efficient Cryptography Group (SECG) [SECG1].
Most Public Key Infrastructures (PKIs) mandate local key generation;
however, there are some PKIs that also support centralized key
generation (e.g., the public-private key pair is generated by a
Certification Authority). The structure defined in this document
allows the entity that generates the private and public keys to
distribute the key pair and the associated domain parameters.
This syntax is useful when distributing EC private keys using
PrivateKeyInfo, as defined in PKCS #8 [RFC5208]. Distributing an EC
private key with PKCS#8 [RFC5208] involves including:
a) id-ecPublicKey, id-ecDH, or id-ecMQV (from [RFC5480]) with the
namedCurve as the parameters in the privateKeyAlgorithm field; and
b) ECPrivateKey in the PrivateKey field, which is an OCTET STRING.
When an EC public key is included in the distributed PrivateKeyInfo,
the publicKey field in ECPrivateKey is used.
2. Terminology
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 [RFC2119].
3. Elliptic Curve Private Key Format
This section gives the syntax for an EC private key.
Computationally, an EC private key is an unsigned integer, but for
representation, EC private key information SHALL have ASN.1 type
ECPrivateKey:
ECPrivateKey ::= SEQUENCE {
version INTEGER { ecPrivkeyVer1(1) } (ecPrivkeyVer1),
privateKey OCTET STRING,
parameters [0] ECParameters {{ NamedCurve }} OPTIONAL,
publicKey [1] BIT STRING OPTIONAL
}
Turner & Brown Informational [Page 2]
^L
RFC 5915 Elliptic Curve Private Key Structure June 2010
The fields of type ECPrivateKey have the following meanings:
o version specifies the syntax version number of the elliptic curve
private key structure. For this version of the document, it SHALL
be set to ecPrivkeyVer1, which is of type INTEGER and whose value
is one (1).
o privateKey is the private key. It is an octet string of length
ceiling (log2(n)/8) (where n is the order of the curve) obtained
from the unsigned integer via the Integer-to-Octet-String-
Primitive (I2OSP) defined in [RFC3447].
o parameters specifies the elliptic curve domain parameters
associated to the private key. The type ECParameters is discussed
in [RFC5480]. As specified in [RFC5480], only the namedCurve
CHOICE is permitted. namedCurve is an object identifier that
fully identifies the required values for a particular set of
elliptic curve domain parameters. Though the ASN.1 indicates that
the parameters field is OPTIONAL, implementations that conform to
this document MUST always include the parameters field.
o publicKey contains the elliptic curve public key associated with
the private key in question. The format of the public key is
specified in Section 2.2 of [RFC5480]. Though the ASN.1 indicates
publicKey is OPTIONAL, implementations that conform to this
document SHOULD always include the publicKey field. The publicKey
field can be omitted when the public key has been distributed via
another mechanism, which is beyond the scope of this document.
Given the private key and the parameters, the public key can
always be recomputed; this field exists as a convenience to the
consumer.
4. Other Considerations
When generating a transfer encoding, generators SHOULD use
Distinguished Encoding Rules (DER) [X.690] and receivers SHOULD be
prepared to handle Basic Encoding Rules (BER) [X.690] and DER
[X.690].
Section 1 described a format for transporting EC private keys (i.e.,
converting ECPrivateKey to PrivateKeyInfo [PKCS#8]); however, this
format can also be used for local storage.
Local storage of an unencrypted ECPrivateKey object is out of scope
of this document. However, one popular format uses the .pem file
extension. It is the PEM encoding, which is the Base64 encoding (see
Section 4 of [RFC4648]), of the DER-encoded ECPrivateKey object that
is sandwiched between:
Turner & Brown Informational [Page 3]
^L
RFC 5915 Elliptic Curve Private Key Structure June 2010
-----BEGIN EC PRIVATE KEY-----
-----END EC PRIVATE KEY-----
Another local storage format uses the .der file extension. In this
case, it is a DER [X.690] encoding of the ECPrivateKey object.
Local storage of an encrypted ECPrivateKey object is out of scope of
this document. However, ECPrivateKey should be the format for the
plaintext key being encrypted. DER [X.690] encoding the ECPrivateKey
will promote interoperability if the key is encrypted for transport
to another party. PEM encoding the DER-encoded ECPrivateKey is
common; "Proc-Type:" and "DEK-INFO:" fields [RFC1421] followed by the
DER-encoded ECPrivateKey are sandwiched between:
-----BEGIN EC PRIVATE KEY-----
-----END EC PRIVATE KEY-----
5. Security Considerations
This structure does not protect the EC private key information in any
way. This structure should be combined with a security protocol to
protect it.
Protection of the private key information is vital to public key
cryptography. The consequences of disclosure depend on the purpose
of the private key. If a private key is used for signature, then the
disclosure allows unauthorized signing. If a private key is used for
key management, then disclosure allows unauthorized parties to access
the managed keying material. The encryption algorithm used in the
encryption process must be as 'strong' as the key it is protecting.
6. References
6.1. Normative References
[RFC1421] Linn, J., "Privacy Enhancement for Internet Electronic
Mail: Part I: Message Encryption and Authentication
Procedures", RFC 1421, February 1993.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC3447] Jonsson, J. and B. Kaliski, "Public-Key Cryptography
Standards (PKCS) #1: RSA Cryptography Specifications
Version 2.1", RFC 3447, February 2003.
[RFC4648] Josefsson, S., "The Base16, Base32, and Base64 Data
Encodings", RFC 4648, October 2006.
Turner & Brown Informational [Page 4]
^L
RFC 5915 Elliptic Curve Private Key Structure June 2010
[RFC5480] Turner, S., Brown, D., Yiu, K., Housley, R., and T. Polk,
"Elliptic Curve Cryptography Subject Public Key
Information", RFC 5480, March 2009.
[RFC5912] Schaad, J. and P. Hoffman, "New ASN.1 Modules for the
Public Key Infrastructure Using X.509 (PKIX)" RFC 5912,
June 2010.
[SECG1] Standards for Efficient Cryptography Group (SECG), "SEC 1:
Elliptic Curve Cryptography", Version 2.0, May 2009.
[X.680] ITU-T Recommendation X.680 (2002) | ISO/IEC 8824-1:2002,
Information Technology - Abstract Syntax Notation One.
[X.681] ITU-T Recommendation X.681 (2002) | ISO/IEC 8824-2:2002,
Information Technology - Abstract Syntax Notation One:
Information Object Specification.
[X.682] ITU-T Recommendation X.682 (2002) | ISO/IEC 8824-3:2002,
Information Technology - Abstract Syntax Notation One:
Constraint Specification.
[X.683] ITU-T Recommendation X.683 (2002) | ISO/IEC 8824-4:2002,
Information Technology - Abstract Syntax Notation One:
Parameterization of ASN.1 Specifications, 2002.
[X.690] ITU-T Recommendation X.690 (2002) | ISO/IEC 8825-1:2002,
Information Technology - ASN.1 encoding rules:
Specification of Basic Encoding Rules (BER), Canonical
Encoding Rules (CER) and Distinguished Encoding Rules
(DER).
7.2. Informative References
[RFC5208] Kaliski, B., "Public-Key Cryptography Standards (PKCS) #8:
Private-Key Information Syntax Specification Version 1.2",
RFC 5208, May 2008.
Turner & Brown Informational [Page 5]
^L
RFC 5915 Elliptic Curve Private Key Structure June 2010
Appendix A. ASN.1 Module
This appendix provides ASN.1 definitions for the structures described
in this specification using ASN.1 as defined in [X.680], [X.681],
[X.682], and [X.683] for compilers that support the 2002 ASN.1.
ECPrivateKey { iso(1) identified-organization(3) dod(6)
internet(1) security(5) mechanisms(5) pkix(7) id-mod(0)
id-mod-ecprivateKey(65) }
DEFINITIONS EXPLICIT TAGS ::=
BEGIN
-- EXPORTS ALL;
IMPORTS
-- FROM New PKIX ASN.1 [RFC5912]
ECParameters, NamedCurve
FROM PKIXAlgs-2009
{ iso(1) identified-organization(3) dod(6) internet(1)
security(5) mechanisms(5) pkix(7) id-mod(0)
id-mod-pkix1-algorithms2008-02(56) }
;
ECPrivateKey ::= SEQUENCE {
version INTEGER { ecPrivkeyVer1(1) } (ecPrivkeyVer1),
privateKey OCTET STRING,
parameters [0] ECParameters {{ NamedCurve }} OPTIONAL,
publicKey [1] BIT STRING OPTIONAL
}
END
Appendix B. Differences with SECG1
This appendix lists the differences between this document and
[SECG1]:
1. This document uses the I2OSP routine defined in [RFC3447] while
SECG1 defines its own routine. The two routines result in the
same output.
Turner & Brown Informational [Page 6]
^L
RFC 5915 Elliptic Curve Private Key Structure June 2010
2. SECG1 constrains its parameters (i.e., the curves) to
SECGCurveNames. This document constrains the parameters to
NamedCurve from [RFC5480].
3. This document requires parameters be present while SECG1 does
not.
4. This document specifies requirements for encoding rules while
SECG1 did not.
Acknowledgements
The authors would like to thank Simon Blake-Wilson and John O. Goyo
for their work on defining the structure in [SECG1]. The authors
would also like to thank Pasi Eronen, Alfred Hoenes, Joel Jaegglie,
Avshalom Houri, Russ Housley, Jim Schaad, and Carl Wallace for their
comments.
Authors' Addresses
Sean Turner
IECA, Inc.
3057 Nutley Street, Suite 106
Fairfax, VA 22031
USA
EMail: turners@ieca.com
Daniel R. L. Brown
Certicom Corp
5520 Explorer Drive #400
Mississauga, ON L4W 5L1
Canada
EMail: dbrown@certicom.com
Turner & Brown Informational [Page 7]
^L
|