summaryrefslogtreecommitdiff
path: root/usr/src/man/man7/pkcs11_tpm.7
blob: 3d67400906e7a79683cf88de0842665518873f95 (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
'\" te
.\"  Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved
.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
.\"  See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with
.\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
.TH PKCS11_TPM 7 "May 13, 2017"
.SH NAME
pkcs11_tpm \- RSA PKCS#11 token for Trusted Platform Modules (TPM)
.SH SYNOPSIS
.LP
.nf
/usr/lib/security/pkcs11_tpm.so
.fi

.LP
.nf
/usr/lib/security/64/pkcs11_tpm.so
.fi

.SH DESCRIPTION
.LP
The \fBpkcs11_tpm.so\fR object implements the RSA PKCS#11 v2.20 specification
using Trusted Computing Group protocols to talk to a TPM security device. This
provider implements the PKCS#11 specification and uses the TCG Software Stack
(TSS) APIs in the \fBtrousers\fR package.
.sp
.LP
Application developers should link to \fBlibpkcs11.so.1\fR rather than link
directly with \fBpkcs11_tpm.so\fR. See \fBlibpkcs11\fR(3LIB).
.sp
.LP
The following cryptographic algorithms are implemented: \fBRSA\fR, \fBSHA1\fR,
and \fBMD5\fR.
.sp
.LP
All of the standard PKCS#11 functions listed in \fBlibpkcs11\fR(3LIB) are
implemented except for the following:
.sp
.in +2
.nf
C_EncryptUpdate
C_EncryptFinal
C_DecryptUpdate
C_DecryptFinal
C_DigestEncryptUpdate
C_DecryptDigestUpdate
C_SignEncryptUpdate
C_DecryptVerifyUpdate
C_GetFunctionStatus
C_CancelFunction
C_WaitForSlotEvent
C_GenerateKey
C_DeriveKey
.fi
.in -2
.sp

.sp
.LP
The following RSA PKCS#11 v2.20 mechanisms are supported:
.sp
.in +2
.nf
CKM_RSA_PKCS_KEY_PAIR_GEN
CKM_RSA_PKCS
CKM_RSA_PKCS_OAEP
CKM_RSA_X_509
CKM_MD5_RSA_PKCS
CKM_SHA1_RSA_PKCS
CKM_SHA_1
CKM_SHA_1_HMAC
CKM_SHA_1_HMAC_GENERAL
CKM_MD5
CKM_MD5_HMAC
CKM_MD5_HMAC_GENERAL
.fi
.in -2
.sp

.SS "Per-User Initialization"
.LP
The \fBpkcs11_tpm\fR provider can only be used on a system which has a TPM
device and which also has the \fBtrousers\fR package installed. If those
prerequisites are met, users can create their own private tokens using
\fBpktool\fR(1), which will allow them to perform operations using the TPM
device and protect their private data with TPM-protected keys.
.sp
.LP
To prepare and initialize a user's TPM token, the following steps must be
performed:
.RS +4
.TP
1.
Initialize the token.
.RE
.RS +4
.TP
2.
Set the SO (security officer) PIN.
.RE
.RS +4
.TP
3.
Set the user's unique PIN.
.RE
.sp
.LP
Initializing the token is done using the \fBpktool\fR(1) command as follows:
.sp
.in +2
.nf
$ \fBpktool inittoken currlabel=TPM newlabel=tpm/myname\fR
.fi
.in -2
.sp

.RS +4
.TP
.ie t \(bu
.el o
By default, an uninitialized TPM is recognized by the name \fBTPM\fR. When a
user initializes their own private token, it can either be renamed to something
else (for example, \fBtpm/joeuser\fR) or kept as \fBTPM\fR (in which case the
\fBnewlabel\fR argument would be omitted).
.RE
.RS +4
.TP
.ie t \(bu
.el o
The user will have to supply the default SO PIN before being able to initialize
his or her token. The default SO PIN is \fB87654321\fR. It is changed in step
2, above.
.RE
.sp
.LP
Once the token is initialized, the SO and user PINs must be changed from the
default values. Again, \fBpktool\fR(1) is used to change these PIN values.
.sp
.LP
Changing the SO PIN:
.sp
.in +2
.nf
$ \fBpktool setpin token=tpm/joeuser so\fR
.fi
.in -2
.sp

.sp
.LP
The \fBso\fR option indicates that this "setpin" operation is to change the SO
PIN and must be present. The user must then enter the default SO PIN
(\fB87654321\fR) and then enter (and confirm) a new PIN.
.sp
.LP
Once the SO PIN is reset from the default, the user's unique PIN must also be
changed.
.sp
.LP
Changing the user's PIN:
.sp
.in +2
.nf
$ \fBpktool setpin token=tmp/joeuser\fR
.fi
.in -2
.sp

.sp
.LP
The default PIN for a non-SO user is \fB12345678\fR. The user must enter the
default PIN and then enter (and confirm) a new, unique PIN.
.sp
.LP
The PIN provided for the \fBpktool\fR \fBsetpin\fR operation or by calling
\fBC_Login()\fR and \fBC_SetPIN()\fR functions can be any string of characters
with a length between 1 and 256 and no embedded nulls.
.SS "Accessing the Token"
.LP
After a user initializes their token, they can begin using it with
\fBpktool\fR(1) or by writing PKCS11 applications and locating the token using
the name created above (\fBtpm/joeuser\fR in the examples above).
.sp
.LP
Examples:
.sp
.in +2
.nf
$ \fBpktool gencert token=tpm/joeuser -i\fR
$ \fBpktool list token=tpm/joeuser\fR
.fi
.in -2
.sp

.SS "Notes"
.LP
\fBpkcs11_tpm.so\fR provides object storage in a filesystem-specific token
object storage area. Private objects are protected by encryption with private
keys and can only be decrypted by loading the token's private key into the TPM
and performing the decryption entirely in the TPM. The user's private key is
generated by the TPM when the user sets their personal PIN (see above). The
keys for both the SO and users are stored in the TSS persistent storage
database and are referenced by a unique UUID value. All user tokens have a
unique SO key and unique user key so that the PINs for one user's token will
not unlock private data in another user's token on the same machine.
.sp
.LP
Each TPM is unique and the token keys created on one TPM may not be used on
another TPM. The \fBpkcs11_tpm.so\fR token data is all managed on the system
where the TPM resides and may not be moved to other systems. If the TPM is
reset and the SRK (Storage Root Key) is changed, all of the keys previously
generated for that TPM will no longer be valid.
.sp
.LP
\fBpkcs11_tpm.so\fR creates a private workspace to manage administrative files
for each token created. By default, this area is created as
\fB/var/tpm/pkcs11/$USERNAME\fR. However, users may override this by setting
the \fBPKCS11_TPM_DIR\fR environment variable prior to initializing or using
the token.
.SH RETURN VALUES
.LP
The return values for each of the implemented functions are defined and listed
in the RSA PKCS#11 v2.20 specification. See \fBhttp://www.rsasecurity.com\fR.
.SH FILES
.ne 2
.na
\fB\fB/var/tpm/pkcs11/USERNAME\fR\fR
.ad
.sp .6
.RS 4n
User's default token object store.
.RE

.sp
.ne 2
.na
\fB\fB${PKCS11_TPM_DIR}\fR\fR
.ad
.sp .6
.RS 4n
Alternate token object store.
.RE

.SH ATTRIBUTES
.LP
See \fBattributes\fR(7) for descriptions of the following attributes:
.sp

.sp
.TS
box;
c | c
l | l .
ATTRIBUTE TYPE	ATTRIBUTE VALUE
_
Interface Stability	Committed
_
MT-Level	MT-Safe with Exceptions (see below)
_
Standard 	PKCS#11 v2.20
.TE

.sp
.LP
Exceptions to MT-Safe attribute are documented in section 6.5.2 of RSA PKCS#11
v2.20.
.SH SEE ALSO
.LP
.BR pktool (1),
.BR libpkcs11 (3LIB),
.BR attributes (7),
.BR cryptoadm (8)
.sp
.LP
TCG Software Stack (TSS) Specifications: \fBhttps://www.trustedcomputinggroup.org/specs/TSS\fR (as of the date of publication)