summaryrefslogtreecommitdiff
path: root/doc/rfc/rfc5208.txt
blob: cb49b2c0d00ebd70312689999b6fbbbfb7c0f68e (plain) (blame)
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
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
Network Working Group                                         B. Kaliski
Request for Comments: 5208                                           EMC
Category: Informational                                         May 2008


             Public-Key Cryptography Standards (PKCS) #8:
        Private-Key Information Syntax Specification Version 1.2

Status of This Memo

   This memo provides information for the Internet community.  It does
   not specify an Internet standard of any kind.  Distribution of this
   memo is unlimited.

IESG Note

   The IESG thanks RSA Laboratories for transferring change control to
   the IETF.  Enhancements to this specification that preserve backward
   compatibility are expected in an upcoming IETF standards track
   document.

Abstract

   This document represents a republication of PKCS #8 v1.2 from RSA
   Laboratories' Public Key Cryptography Standard (PKCS) series.  Change
   control is transferred to the IETF.  The body of this document,
   except for the security considerations section, is taken directly
   from the PKCS #8 v1.2 specification.

   This document describes a syntax for private-key information.

Table of Contents

   1. Introduction ....................................................2
   2. Definitions .....................................................2
   3. Symbols and Abbreviations .......................................2
   4. General Overview ................................................2
   5. Private-Key Information Syntax ..................................3
   6. Encrypted Private-Key Information Syntax ........................4
   7. Security Considerations .........................................4
   Appendix A. ASN.1 Syntax ...........................................5
   Informative References .............................................6









Kaliski                      Informational                      [Page 1]
^L
RFC 5208    PKCS #8: Private-Key Information Syntax Standard    May 2008


1.  Introduction

   This document describes a syntax for private-key information.
   Private-key information includes a private key for some public-key
   algorithm and a set of attributes.  The document also describes a
   syntax for encrypted private keys.  A password-based encryption
   algorithm (e.g., one of those described in [PKCS#5]) could be used to
   encrypt the private-key information.

   The intention of including a set of attributes is to provide a simple
   way for a user to establish trust in information such as a
   distinguished name or a top-level certification authority's public
   key.  While such trust could also be established with a digital
   signature, encryption with a secret key known only to the user is
   just as effective and possibly easier to implement.  A non-exhaustive
   list of attributes is given in [PKCS#9].

2.  Definitions

   For the purposes of this document, the following definitions apply.

      AlgorithmIdentifier: A type that identifies an algorithm (by
      object identifier) and any associated parameters.  This type is
      defined in [X.509].

      ASN.1: Abstract Syntax Notation One, as defined in [X.208].

      Attribute: A type that contains an attribute type (specified by
      object identifier) and one or more attribute values.  This type is
      defined in [X.501].

      BER: Basic Encoding Rules, as defined in [X.209].

3.  Symbols and Abbreviations

   No symbols or abbreviations are defined in this document.

4.  General Overview

   The next two sections specify private-key information syntax and
   encrypted private-key information syntax.

   This document exports two types: PrivateKeyInfo (Section 6) and
   EncryptedPrivateKeyInfo (Section 7).







Kaliski                      Informational                      [Page 2]
^L
RFC 5208    PKCS #8: Private-Key Information Syntax Standard    May 2008


5.  Private-Key Information Syntax

   This section gives the syntax for private-key information.

   Private-key information shall have ASN.1 type PrivateKeyInfo:

      PrivateKeyInfo ::= SEQUENCE {
        version                   Version,
        privateKeyAlgorithm       PrivateKeyAlgorithmIdentifier,
        privateKey                PrivateKey,
        attributes           [0]  IMPLICIT Attributes OPTIONAL }

      Version ::= INTEGER

      PrivateKeyAlgorithmIdentifier ::= AlgorithmIdentifier

      PrivateKey ::= OCTET STRING

      Attributes ::= SET OF Attribute

   The fields of type PrivateKeyInfo have the following meanings:

      version is the syntax version number, for compatibility with
      future revisions of this document.  It shall be 0 for this version
      of the document.

      privateKeyAlgorithm identifies the private-key algorithm.  One
      example of a private-key algorithm is PKCS #1's rsaEncryption
      [PKCS#1].

      privateKey is an octet string whose contents are the value of the
      private key.  The interpretation of the contents is defined in the
      registration of the private-key algorithm.  For an RSA private
      key, for example, the contents are a BER encoding of a value of
      type RSAPrivateKey.

      attributes is a set of attributes.  These are the extended
      information that is encrypted along with the private-key
      information.












Kaliski                      Informational                      [Page 3]
^L
RFC 5208    PKCS #8: Private-Key Information Syntax Standard    May 2008


6.  Encrypted Private-Key Information Syntax

   This section gives the syntax for encrypted private-key information.

   Encrypted private-key information shall have ASN.1 type
   EncryptedPrivateKeyInfo:

      EncryptedPrivateKeyInfo ::= SEQUENCE {
        encryptionAlgorithm  EncryptionAlgorithmIdentifier,
        encryptedData        EncryptedData }

      EncryptionAlgorithmIdentifier ::= AlgorithmIdentifier

      EncryptedData ::= OCTET STRING

   The fields of type EncryptedPrivateKeyInfo have the following
   meanings:

      encryptionAlgorithm identifies the algorithm under which the
      private-key information is encrypted.  Two examples are PKCS #5's
      pbeWithMD2AndDES-CBC and pbeWithMD5AndDES-CBC [PKCS#5].

      encryptedData is the result of encrypting the private-key
      information.

   The encryption process involves the following two steps:

      1. The private-key information is BER encoded, yielding an octet
         string.

      2. The result of step 1 is encrypted with the secret key to give
         an octet string, the result of the encryption process.

7.  Security Considerations

   Protection of the private-key information is vital to public-key
   cryptography.  Disclosure of the private-key material to another
   entity can lead to masquerades.  The encryption algorithm used in the
   encryption process must be as 'strong' as the key it is protecting.












Kaliski                      Informational                      [Page 4]
^L
RFC 5208    PKCS #8: Private-Key Information Syntax Standard    May 2008


Appendix A.  ASN.1 Syntax

PKCS-8 {iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1) pkcs-8(8)
         modules(1) pkcs-8(1)}

-- $Revision: 1.5 $

-- This module has been checked for conformance with the ASN.1
-- standard by the OSS ASN.1 Tools

DEFINITIONS IMPLICIT TAGS ::=

BEGIN

-- EXPORTS All --
-- All types and values defined in this module is exported for use in
-- other ASN.1 modules.

IMPORTS

informationFramework
         FROM UsefulDefinitions {joint-iso-itu-t(2) ds(5) module(1)
                                 usefulDefinitions(0) 3}

Attribute
         FROM InformationFramework informationFramework

AlgorithmIdentifier, ALGORITHM-IDENTIFIER
         FROM PKCS-5 {iso(1) member-body(2) us(840) rsadsi(113549)
         pkcs(1) pkcs-5(5) modules(16) pkcs-5(1)};

-- Private-key information syntax

PrivateKeyInfo ::= SEQUENCE {
   version Version,
   privateKeyAlgorithm AlgorithmIdentifier {{PrivateKeyAlgorithms}},
   privateKey PrivateKey,
   attributes [0] Attributes OPTIONAL }

Version ::= INTEGER {v1(0)} (v1,...)

PrivateKey ::= OCTET STRING

Attributes ::= SET OF Attribute







Kaliski                      Informational                      [Page 5]
^L
RFC 5208    PKCS #8: Private-Key Information Syntax Standard    May 2008


-- Encrypted private-key information syntax

EncryptedPrivateKeyInfo ::= SEQUENCE {
    encryptionAlgorithm AlgorithmIdentifier {{KeyEncryptionAlgorithms}},
    encryptedData EncryptedData
}

EncryptedData ::= OCTET STRING

PrivateKeyAlgorithms ALGORITHM-IDENTIFIER ::= {
     ... -- For local profiles
}

KeyEncryptionAlgorithms ALGORITHM-IDENTIFIER ::= {
     ... -- For local profiles
}

END

Informative References

   [PKCS#1]  RSA Laboratories. PKCS #1: RSA Encryption Standard. Version
             1.5, November 1993.

   [PKCS#5]  RSA Laboratories. PKCS #5: Password-Based Encryption
             Standard. Version 1.5, November 1993.

   [PKCS#9]  RSA Laboratories. PKCS #9: Selected Attribute Types.
             Version 1.1, November 1993.

   [X.208]   CCITT. Recommendation X.208: Specification of Abstract
             Syntax Notation One (ASN.1). 1988.

   [X.209]   CCITT. Recommendation X.209: Specification of Basic
             Encoding Rules for Abstract Syntax Notation One (ASN.1).
             1988.

   [X.501]   CCITT. Recommendation X.501: The Directory - Models. 1988.

   [X.509]   CCITT. Recommendation X.509: The Directory - Authentication
             Framework. 1988.










Kaliski                      Informational                      [Page 6]
^L
RFC 5208    PKCS #8: Private-Key Information Syntax Standard    May 2008


Author's Addresses

   Burt Kaliski
   EMC Corporation
   176 South Street
   Hopkinton, MA  01748
   USA

   EMail: kaliski_burt@emc.com










































Kaliski                      Informational                      [Page 7]
^L
RFC 5208    PKCS #8: Private-Key Information Syntax Standard    May 2008


Full Copyright Statement

   Copyright (C) The IETF Trust (2008).

   This document is subject to the rights, licenses and restrictions
   contained in BCP 78, and except as set forth therein, the authors
   retain all their rights.

   This document and the information contained herein are provided on an
   "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
   OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND
   THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS
   OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF
   THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
   WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

Intellectual Property

   The IETF takes no position regarding the validity or scope of any
   Intellectual Property Rights or other rights that might be claimed to
   pertain to the implementation or use of the technology described in
   this document or the extent to which any license under such rights
   might or might not be available; nor does it represent that it has
   made any independent effort to identify any such rights.  Information
   on the procedures with respect to rights in RFC documents can be
   found in BCP 78 and BCP 79.

   Copies of IPR disclosures made to the IETF Secretariat and any
   assurances of licenses to be made available, or the result of an
   attempt made to obtain a general license or permission for the use of
   such proprietary rights by implementers or users of this
   specification can be obtained from the IETF on-line IPR repository at
   http://www.ietf.org/ipr.

   The IETF invites any interested party to bring to its attention any
   copyrights, patents or patent applications, or other proprietary
   rights that may cover technology that may be required to implement
   this standard.  Please address the information to the IETF at
   ietf-ipr@ietf.org.












Kaliski                      Informational                      [Page 8]
^L