1tpm2_createpolicy(1)        General Commands Manual       tpm2_createpolicy(1)
2
3
4

NAME

6       tpm2_createpolicy(1)  - Creates simple assertion authorization policies
7       based on multiple PCR indices values across multiple enabled banks.
8

SYNOPSIS

10       tpm2_createpolicy [OPTIONS]
11

DESCRIPTION

13       tpm2_createpolicy(1) - Creates simple assertion authorization  policies
14       based on multiple PCR indices values across multiple enabled banks.  It
15       can then be used with object creation and or tools using the object.
16

OPTIONS

18       These options control creating the policy authorization session:
19
20-L, --policy=FILE:
21
22         The file to save the policy digest.
23
24--policy-pcr:
25
26         Identifies the PCR policy type for policy creation.
27
28-g, --policy-algorithm=ALGORITHM:
29
30         The hash algorithm used in computation of the policy digest.
31
32-l, --pcr-list=PCR:
33
34         The list of PCR banks and selected PCRs’ ids for each bank.
35
36-f, --pcr=FILE:
37
38         Optional Path or Name of the file containing expected PCR values  for
39         the specified index.  Default is to read the current PCRs per the set
40         list.
41
42--policy-session:
43
44         Start  a  policy  session  of  type   TPM_SE_POLICY.    Defaults   to
45         TPM_SE_TRIAL if this option isn’t specified.
46
47   References

Algorithm Specifiers

49       Options that take algorithms support “nice-names”.
50
51       There  are two major algorithm specification string classes, simple and
52       complex.  Only certain algorithms will be accepted by the TPM, based on
53       usage and conditions.
54
55   Simple specifiers
56       These are strings with no additional specification data.  When creating
57       objects, non-specified portions of an object are assumed  to  defaults.
58       You can find the list of known “Simple Specifiers” below.
59
60   Asymmetric
61       • rsa
62
63       • ecc
64
65   Symmetric
66       • aes
67
68       • camellia
69
70       • sm4
71
72   Hashing Algorithms
73       • sha1
74
75       • sha256
76
77       • sha384
78
79       • sha512
80
81       • sm3_256
82
83       • sha3_256
84
85       • sha3_384
86
87       • sha3_512
88
89   Keyed Hash
90       • hmac
91
92       • xor
93
94   Signing Schemes
95       • rsassa
96
97       • rsapss
98
99       • ecdsa
100
101       • ecdaa
102
103       • ecschnorr
104
105       • sm2
106
107   Asymmetric Encryption Schemes
108       • oaep
109
110       • rsaes
111
112       • ecdh
113
114   Modes
115       • ctr
116
117       • ofb
118
119       • cbc
120
121       • cfb
122
123       • ecb
124
125   Misc
126       • null
127
128   Complex Specifiers
129       Objects,  when  specified  for creation by the TPM, have numerous algo‐
130       rithms to populate in the public data.  Things like  type,  scheme  and
131       asymmetric  details,  key  size,  etc.  Below is the general format for
132       specifying this data: <type>:<scheme>:<symmetric-details>
133
134   Type Specifiers
135       This portion of the complex algorithm specifier is required.   The  re‐
136       maining  scheme  and  symmetric  details will default based on the type
137       specified and the type of the object being created.
138
139       • aes - Default AES: aes128
140
141       • aes128<mode> - 128 bit AES with optional mode  (ctr|ofb|cbc|cfb|ecb).
142         If mode is not specified, defaults to null.
143
144       • aes192<mode> - Same as aes128<mode>, except for a 192 bit key size.
145
146       • aes256<mode> - Same as aes128<mode>, except for a 256 bit key size.
147
148       • sm4 - Default SM4: sm4128
149
150       • sm4128   or   sm4_128  <mode>  -  128  bit  SM4  with  optional  mode
151         (ctr|ofb|cbc|cfb|ecb).  If mode is not specified, defaults to null.
152
153       • ecc - Elliptical Curve, defaults to ecc256.
154
155       • ecc192 or ecc_nist_p192 - 192 bit ECC NIST curve
156
157       • ecc224 or ecc_nist_p224 - 224 bit ECC NIST curve
158
159       • ecc256 or ecc_nist_p256 - 256 bit ECC NIST curve
160
161       • ecc384 or ecc_nist_p384 - 384 bit ECC NIST curve
162
163       • ecc521 or ecc_nist_p521 - 521 bit ECC NIST curve
164
165       • ecc_sm2 or ecc_sm2_p256 - 256 bit SM2 curve
166
167       • rsa - Default RSA: rsa2048
168
169       • rsa1024 - RSA with 1024 bit keysize.
170
171       • rsa2048 - RSA with 2048 bit keysize.
172
173       • rsa3072 - RSA with 3072 bit keysize.
174
175       • rsa4096 - RSA with 4096 bit keysize.
176
177   Scheme Specifiers
178       Next, is an optional field, it can be skipped.
179
180       Schemes are usually Signing Schemes or Asymmetric  Encryption  Schemes.
181       Most signing schemes take a hash algorithm directly following the sign‐
182       ing scheme.  If the hash algorithm is missing, it defaults  to  sha256.
183       Some take no arguments, and some take multiple arguments.
184
185   Hash Optional Scheme Specifiers
186       These  scheme  specifiers are followed by a dash and a valid hash algo‐
187       rithm, For example: oaep-sha256.
188
189       • oaep
190
191       • ecdh
192
193       • rsassa
194
195       • rsapss
196
197       • ecdsa
198
199       • ecschnorr
200
201       • sm2
202
203   Multiple Option Scheme Specifiers
204       This scheme specifier is followed by a count  (max  size  UINT16)  then
205       followed by a dash(-) and a valid hash algorithm.  * ecdaa For example,
206       ecdaa4-sha256.  If no count is specified, it defaults to 4.
207
208   No Option Scheme Specifiers
209       This scheme specifier takes NO arguments.  * rsaes
210
211   Symmetric Details Specifiers
212       This field is optional, and defaults based on the type of object  being
213       created  and it’s attributes.  Generally, any valid Symmetric specifier
214       from the Type Specifiers list should work.  If not specified, an  asym‐
215       metric objects symmetric details defaults to aes128cfb.
216
217   Examples
218   Create an rsa2048 key with an rsaes asymmetric encryption scheme
219       tpm2_create -C parent.ctx -G rsa2048:rsaes -u key.pub -r key.priv
220
221   Create  an  ecc256  key  with an ecdaa signing scheme with a count of 4 and
222       sha384 hash
223       /tpm2_create  -C  parent.ctx  -G  ecc256:ecdaa4-sha384  -u  key.pub  -r
224       key.priv cryptographic algorithms ALGORITHM.
225

COMMON OPTIONS

227       This  collection of options are common to many programs and provide in‐
228       formation that many users may expect.
229
230-h, --help=[man|no-man]: Display the tools manpage.  By  default,  it
231         attempts  to  invoke  the  manpager for the tool, however, on failure
232         will output a short tool summary.  This is the same behavior  if  the
233         “man”  option argument is specified, however if explicit “man” is re‐
234         quested, the tool will provide errors from man  on  stderr.   If  the
235         “no-man”  option  if  specified, or the manpager fails, the short op‐
236         tions will be output to stdout.
237
238         To successfully use the manpages feature requires the manpages to  be
239         installed or on MANPATH, See man(1) for more details.
240
241-v,  --version:  Display version information for this tool, supported
242         tctis and exit.
243
244-V, --verbose: Increase the information that the tool prints  to  the
245         console  during  its  execution.  When using this option the file and
246         line number are printed.
247
248-Q, --quiet: Silence normal tool output to stdout.
249
250-Z, --enable-errata: Enable the application of errata fixups.  Useful
251         if  an  errata fixup needs to be applied to commands sent to the TPM.
252         Defining  the  environment  TPM2TOOLS_ENABLE_ERRATA  is   equivalent.
253         bank/algorithm PCR.
254

COMMON OPTIONS

256       This  collection of options are common to many programs and provide in‐
257       formation that many users may expect.
258
259-h, --help=[man|no-man]: Display the tools manpage.  By  default,  it
260         attempts  to  invoke  the  manpager for the tool, however, on failure
261         will output a short tool summary.  This is the same behavior  if  the
262         “man”  option argument is specified, however if explicit “man” is re‐
263         quested, the tool will provide errors from man  on  stderr.   If  the
264         “no-man”  option  if  specified, or the manpager fails, the short op‐
265         tions will be output to stdout.
266
267         To successfully use the manpages feature requires the manpages to  be
268         installed or on MANPATH, See man(1) for more details.
269
270-v,  --version:  Display version information for this tool, supported
271         tctis and exit.
272
273-V, --verbose: Increase the information that the tool prints  to  the
274         console  during  its  execution.  When using this option the file and
275         line number are printed.
276
277-Q, --quiet: Silence normal tool output to stdout.
278
279-Z, --enable-errata: Enable the application of errata fixups.  Useful
280         if  an  errata fixup needs to be applied to commands sent to the TPM.
281         Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.   in‐
282         formation many users may expect.
283

TCTI Configuration

285       The  TCTI  or  “Transmission  Interface” is the communication mechanism
286       with the TPM.  TCTIs can be changed for communication with TPMs  across
287       different mediums.
288
289       To control the TCTI, the tools respect:
290
291       1. The command line option -T or --tcti
292
293       2. The environment variable: TPM2TOOLS_TCTI.
294
295       Note:  The  command  line option always overrides the environment vari‐
296       able.
297
298       The current known TCTIs are:
299
300       • tabrmd     -     The     resource     manager,     called      tabrmd
301         (https://github.com/tpm2-software/tpm2-abrmd).   Note that tabrmd and
302         abrmd as a tcti name are synonymous.
303
304       • mssim - Typically used for communicating to the TPM software  simula‐
305         tor.
306
307       • device - Used when talking directly to a TPM device file.
308
309       • none  - Do not initalize a connection with the TPM.  Some tools allow
310         for off-tpm options and thus support not using a TCTI.  Tools that do
311         not  support  it  will error when attempted to be used without a TCTI
312         connection.  Does not support ANY options and MUST  BE  presented  as
313         the exact text of “none”.
314
315       The  arguments  to  either  the  command line option or the environment
316       variable are in the form:
317
318       <tcti-name>:<tcti-option-config>
319
320       Specifying an empty string for  either  the  <tcti-name>  or  <tcti-op‐
321       tion-config> results in the default being used for that portion respec‐
322       tively.
323
324   TCTI Defaults
325       When a TCTI is not specified, the default TCTI is  searched  for  using
326       dlopen(3)  semantics.   The  tools  will  search for tabrmd, device and
327       mssim TCTIs IN THAT ORDER and USE THE FIRST ONE FOUND.  You  can  query
328       what TCTI will be chosen as the default by using the -v option to print
329       the version information.  The “default-tcti” key-value pair will  indi‐
330       cate which of the aforementioned TCTIs is the default.
331
332   Custom TCTIs
333       Any TCTI that implements the dynamic TCTI interface can be loaded.  The
334       tools internally use dlopen(3), and the raw tcti-name value is used for
335       the lookup.  Thus, this could be a path to the shared library, or a li‐
336       brary name as understood by dlopen(3) semantics.
337

TCTI OPTIONS

339       This collection of options are used to configure the various known TCTI
340       modules available:
341
342device: For the device TCTI, the TPM character device file for use by
343         the device TCTI can be specified.  The default is /dev/tpm0.
344
345         Example:   -T   device:/dev/tpm0   or   export    TPM2TOOLS_TCTI=“de‐
346         vice:/dev/tpm0”
347
348mssim:  For  the  mssim  TCTI, the domain name or IP address and port
349         number used by the simulator  can  be  specified.   The  default  are
350         127.0.0.1 and 2321.
351
352         Example:  -T  mssim:host=localhost,port=2321  or export TPM2TOOLS_TC‐
353         TI=“mssim:host=localhost,port=2321”
354
355abrmd: For the abrmd TCTI, the configuration string format is  a  se‐
356         ries  of  simple  key value pairs separated by a `,' character.  Each
357         key and value string are separated by a `=' character.
358
359         • TCTI abrmd supports two keys:
360
361           1. `bus_name' : The name of  the  tabrmd  service  on  the  bus  (a
362              string).
363
364           2. `bus_type' : The type of the dbus instance (a string) limited to
365              `session' and `system'.
366
367         Specify the tabrmd tcti name and a config string of  bus_name=com.ex‐
368         ample.FooBar:
369
370                \--tcti=tabrmd:bus_name=com.example.FooBar
371
372         Specify the default (abrmd) tcti and a config string of bus_type=ses‐
373         sion:
374
375                \--tcti:bus_type=session
376
377         NOTE: abrmd and tabrmd are synonymous.  the various known  TCTI  mod‐
378         ules.
379

EXAMPLES

381   Create a authorization policy tied to a specific PCR index
382              tpm2_createpolicy \--policy-pcr -l 0x4:0 -L policy.file -f pcr0.bin
383

Returns

385       Tools can return any of the following codes:
386
387       • 0 - Success.
388
389       • 1 - General non-specific error.
390
391       • 2 - Options handling error.
392
393       • 3 - Authentication error.
394
395       • 4 - TCTI related error.
396
397       • 5 - Non supported scheme.  Applicable to tpm2_testparams.
398

BUGS

400       Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
401

HELP

403       See the Mailing List (https://lists.linuxfoundation.org/mailman/listin
404       fo/tpm2)
405
406
407
408tpm2-tools                                                tpm2_createpolicy(1)
Impressum