summaryrefslogtreecommitdiff
path: root/specs/draft-pkcs11-trust-assertions.xml
blob: 1cfe38a7ae59c1cb92593da0c69675df700ee343 (plain)
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
<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc strict="yes" ?>
<?rfc toc="yes"?>
<?rfc tocdepth="4"?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes" ?>
<?rfc compact="yes" ?>
<?rfc subcompact="no" ?>

<rfc category="bcp" docName="draft-walter-pkcs11-trust" ipr="full3978">

	<front>
		<title abbrev="PKCS#11 Trust Assertions">Storing Trust Assertions in PKCS#11 Modules</title>

		<author fullname="Stef Walter" initials="S.W." role="editor" surname="Walter">
			<organization>GNOME</organization>

			<address>
				<!--<postal>
					<street></street>
					<city>Karlsruhe</city>
					<region></region>
					<code></code>
					<country>Germany</country>
				</postal>-->

				<phone>+1 505 926 1827</phone>
				<email>stefw@gnome.org</email>

			</address>
		</author>

		<date month="September" year="2010" />
		
		<area>General</area>

		<workgroup>Internet Engineering Task Force</workgroup>

		<keyword>security</keyword>
		<keyword>pkcs11</keyword>
		<keyword>trust</keyword>
		<keyword>x509</keyword>
		<keyword>certificate</keyword>
		<keyword>pki</keyword>

		<abstract>
			<t>PKCS#11 is a standard that defines ways to store certificates, keys
			and perform crypto operations. It does not specify a way to store trust
			assertions.</t>

			<t>Trust assertions are used to assign an explicit level of trust to a
			certificate. Examples of trust assertions are certificate authority
			root certificates, certificate revocation lists, and certificate
			trust exceptions.</t>

			<t>This document outlines a way to store trust assertions with PKCS#11.
			This is not a new design, but documentation of the method already in use
			by libraries such as NSS.</t>
		</abstract>
	</front>

	<middle>
		<section title="Introduction">
			<t>PKCS#11 is a useful and widely supported standard for storage and use
			of keys and certificates. It is often used with smart cards.</t>

			<section title="PKCS#11 Primer">
				<t>Xxxx</t>
			</section>

			<section title="Terminology">
				<t>Xxxxx</t>

				<t>Xxxx 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 RFC 2119.</t>
			</section>

		</section>

		<section title="Trust Assertions">
			<t>A trust assertion describes a level of trust in an object for a given usage
			or purpose. Conceptually each trust assertion is a triple containing:</t>

			<t><list style="symbols">
				<t>Certificate Reference</t>

				<t>Usage or Purpose</t>

				<t>Level of Trust</t>
			</list></t>

			<t>We examine each of these parts of the triple in further detail below.</t>

			<section title="Level of Trust">
				<t>A trust assertion ultimately denotes a level of trust. These are:
				<list style="symbols">
					<t>Untrusted: The certificate is explicitly untrusted.</t>

					<t>Unknown: The trust is not known and should be determined elsewhere.</t>

					<t>Trusted: The certificate itself is explicitly trusted.</t>

					<t>Trusted Delegator: The certificate is trusted as a certificate
					authority trust root. Trust is confers to certificates that this
					certificate has signed, or signed certificates have signed, and so on.</t>
				</list></t>
			</section>

			<section title="Usage or Purpose">
				<t>A trust assertion always refers to a specific purpose or usage.
				A certificate may be trusted for purposes like: email, code signing,
				authenticating a server.</t>
			</section>

			<section title="Certificate Reference">
				<t>Each trust assertion contains a reference to a certificate.</t>

				<t>There are two ways to refer to a certificate depending on whether
				that certificate is self-signed (like a certificate authority) or signed
				by another trusted certificate.</t>

				<t>Self-signed certificates are referred to by their 
				complete hash of the DER value of the certificate.</t>

				<t>Certificates signed by another certificate are referred to by
				the DER value of the issuer field, and the serial number.</t>

				<t>Referring to a self-signed certificate by its issuer and serial number
				is meaningless.</t>

				<t>Referring to a signed certificate by its hash, would preclude uses
				such as certificate relocation lists, which do not contain certificates
				or enough information to generate a hash.</t>

				<t>Therefore different methods MUST be used to refer to self-signed
				and issuer-signed certificates.</t>
			</section>
		</section>

		<section title="PKCS#11 Trust Assertion Objects">

			<t>Trust assertions are stored as objects on a PKCS#11 token. Although these are
			specific to a certificate, they do not need to be stored on the same token as
			the certificate. Trust assertions objects are of the class CKO_NETSCAPE_TRUST
			and have the following attributes.</t>

			<texttable anchor="trust_attributes" title="Trust Object Attributes" style="all">
				<preamble>Trust object attributes.</preamble>
	
				<ttcol align="left">Attribute</ttcol>
				<ttcol align="left">Type</ttcol>
				<ttcol align="left">Description</ttcol>
	
				<c>CKA_CLASS</c>
				<c>CK_OBJECT_CLASS</c>
				<c>CKO_NETSCAPE_TRUST</c>
	
				<c>CKA_ISSUER</c>
				<c>Byte array</c>
				<c>DER-encoding of the certificate issuer name</c>
	
				<c>CKA_SUBJECT</c>
				<c>Byte array</c>
				<c>DER-encoding of the certificate subject name. Optional, default empty</c>

				<c>CKA_SERIAL_NUMBER</c>
				<c>Byte array</c>
				<c>DER-encoding of the certificate serial number</c>

				<c>CKA_CERT_SHA1_HASH</c>
				<c>Byte array</c>
				<c>SHA1 hash of the the DER-encoding of certificate. Required for
				self-signed certificates.</c>

				<c>CKA_CERT_MD5_HASH</c>
				<c>Byte array</c>
				<c>MD5 hash of the the DER-encoding of certificate. Required for
				self-signed certificates.</c>

				<c>CKA_TRUST_SERVER_AUTH</c>
				<c>CK_TRUST</c>
				<c>Level of trust for server authentication extended usage.</c>

				<c>CKA_TRUST_CLIENT_AUTH</c>
				<c>CK_TRUST</c>
				<c>Level of trust for client authentication extended usage.</c>
	
				<c>CKA_TRUST_CODE_SIGNING</c>
				<c>CK_TRUST</c>
				<c>Level of trust for code signing extended usage.</c>
	
				<c>CKA_TRUST_EMAIL_PROTECTION</c>
				<c>CK_TRUST</c>
				<c>Level of trust for email protection extended usage.</c>
	
				<c>CKA_TRUST_IPSEC_END_SYSTEM</c>
				<c>CK_TRUST</c>
				<c>Level of trust for IPSEC end system extended usage.</c>
	
				<c>CKA_TRUST_IPSEC_TUNNEL</c>
				<c>CK_TRUST</c>
				<c>Level of trust for IPSEC tunnel extended usage.</c>

				<c>CKA_TRUST_IPSEC_USER</c>
				<c>CK_TRUST</c>
				<c>Level of trust for IPSEC user extended usage.</c>
	
				<c>CKA_TRUST_TIME_STAMPING</c>
				<c>CK_TRUST</c>
				<c>Level of trust for IPSEC time stamping extended usage.</c>

				<c>CKA_TRUST_DIGITAL_SIGNATURE</c>
				<c>CK_TRUST</c>
				<c>Level of trust for digital signature key usage.</c>

				<c>CKA_TRUST_NON_REPUDIATION</c>
				<c>CK_TRUST</c>
				<c>Level of trust for non-repudiation key usage.</c>

				<c>CKA_TRUST_KEY_ENCIPHERMENT</c>
				<c>CK_TRUST</c>
				<c>Level of trust for key-encipherment key usage.</c>

				<c>CKA_TRUST_DATA_ENCIPHERMENT</c>
				<c>CK_TRUST</c>
				<c>Level of trust for data-encipherment key usage.</c>

				<c>CKA_TRUST_KEY_AGREEMENT</c>
				<c>CK_TRUST</c>
				<c>Level of trust for key-agreement key usage.</c>

				<c>CKA_TRUST_KEY_CERT_SIGN</c>
				<c>CK_TRUST</c>
				<c>Level of trust for certificate signing key usage.</c>

				<c>CKA_TRUST_KEY_CRL_SIGN</c>
				<c>CK_TRUST</c>
				<c>Level of trust for crl signing key usage.</c>

				<postamble>Xxxx: Possible additional attributes: CKA_TRUST_TYPE
				(CKT_CERTIFICATE_SELF_SIGNED, CKT_CERTIFICATE_SIGNED),
				CKA_CERT_SHA256_HASH</postamble>
			</texttable>

			<texttable anchor="trust_values" title="CK_TRUST values">
				<preamble>CK_TRUST represenst a level of trust.</preamble>
	
				<ttcol align="left">Value</ttcol>
				<ttcol align="left">Description</ttcol>
	
				<c>CKT_UNTRUSTED</c>
				<c>Explicitly untrusted.</c>
	
				<c>CKT_UNKNOWN</c>
				<c>Trust is unknown and should be determined elsewhere.</c>
	
				<c>CKT_TRUSTED</c>
				<c>Explicitly trusts the certificate in the assertion.</c>

				<c>CKT_TRUSTED_DELEGATOR</c>
				<c>Trusts the certificate as a certificate authority.</c>
			</texttable>
		</section>

		<section title="Operations">
			<section title="Checking Trust Assertions">
				<t>Trust assertions are checked using a PKCS#11 C_FindObjects operation.</t>

				<t>Because trust is involved and presence/lack of results is important, this
				operation MUST be done with a specific set of lookup attributes. The
				attributes used differ depending on whether the certificate is self-signed
				or is signed by an issuer.</t>

				<t>Checking of trust assertions is always done for a specific purpose.</t>

				<section title="Checking a Root Certificate Authority">
					<t>A C_FindObjects operation is done using the following attributes.</t>

					<texttable>
						<ttcol align="left">Attribute</ttcol>
						<ttcol align="left">Value</ttcol>
	
						<c>CKA_CLASS</c>
						<c>CKO_NETSCAPE_TRUST</c>
	
						<c>CKA_CERT_SHA1_HASH</c>
						<c>20 byte value of hash of certificate.</c>

						<c>Purpose attribute</c>
						<c>CKT_TRUSTED_DELEGATOR</c>
					</texttable>
				</section>

				<section title="Checking a Self-Signed Certificate">
					<t>A C_FindObjects operation is done using the following attributes.</t>

					<texttable>
						<ttcol align="left">Attribute</ttcol>
						<ttcol align="left">Value</ttcol>
	
						<c>CKA_CLASS</c>
						<c>CKO_NETSCAPE_TRUST</c>
	
						<c>CKA_CERT_SHA1_HASH</c>
						<c>20 byte value of hash of certificate.</c>

						<c>Purpose attribute</c>
						<c>CKT_TRUSTED</c>
					</texttable>
				</section>

				<section title="Checking an otherwise Trusted Certificate">
					<t>A C_FindObjects operation is done using the following attributes.</t>

					<texttable>
						<ttcol align="left">Attribute</ttcol>
						<ttcol align="left">Value</ttcol>
	
						<c>CKA_CLASS</c>
						<c>CKO_NETSCAPE_TRUST</c>

						<c>CKA_ISSUER</c>
						<c>DER encoding of certificate issuer.</c>

						<c>CKA_SERIAL_NUMBER</c>
						<c>DER encoding of certificate serial number.</c>

						<c>Purpose attribute</c>
						<c>CKT_UNTRUSTED</c>
					</texttable>
				</section>

			</section>

			<section title="Storing Trust Assertions">
				<t>Xxxx</t>
			</section>

			<section title="Reading Trust Assertions">
				<t>Xxxx</t>
			</section>
		</section>
	
    <section anchor="Acknowledgements" title="Acknowledgements">
	<t>NSS: Who?</t>
    </section>

    <section title="Further Considerations">
	<t>xxxx</t>
    </section>

    <section anchor="Security" title="Security Considerations">
	<t>Xxxx: Use of multiple PKCS#11 modules</t>
	<t>Not using just any module.</t>
    </section>

  </middle>

  <!--  *****BACK MATTER ***** -->

  <back>
    <!-- References split into informative and normative -->

    <!-- There are 2 ways to insert reference entries from the citation libraries:
     1. define an ENTITY at the top, and use "ampersand character"RFC2629; here (as shown)
     2. simply use a PI "less than character"?rfc include="reference.RFC.2119.xml"?> here
        (for I-Ds: include="reference.I-D.narten-iana-considerations-rfc2434bis.xml")

     Both are cited textually in the same manner: by using xref elements.
     If you use the PI option, xml2rfc will, by default, try to find included files in the same
     directory as the including file. You can also define the XML_LIBRARY environment variable
     with a value containing a set of directories to search.  These can be either in the local
     filing system or remote ones accessed by http (http://domain/dir/... ).-->

    <references title="Normative References">
      <reference anchor="min_ref">
        <!-- the following is the minimum to make xml2rfc happy -->

        <front>
          <title>Minimal Reference</title>

          <author initials="authInitials" surname="authSurName">
            <organization></organization>
          </author>

          <date year="2006" />
        </front>
      </reference>
    </references>

    <references title="Informative References">
      <!-- A reference written by by an organization not a person. -->

      <reference anchor="DOMINATION"
                 target="http://www.example.com/dominator.html">
        <front>
          <title>Ultimate Plan for Taking Over the World</title>

          <author>
            <organization>Mad Dominators, Inc.</organization>
          </author>

          <date year="1984" />
        </front>
      </reference>
    </references>

    <section anchor="app-additional" title="Additional Stuff">
      <t>This becomes an Appendix.</t>
    </section>
  </back>
</rfc>