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

NAME

6       tpm2_certifycreation(1)  - Attest the association between a loaded pub‐
7       lic area and the provided hash of the creation data.
8

SYNOPSIS

10       tpm2_certifycreation [OPTIONS]
11

DESCRIPTION

13       tpm2_certifycreation(1) - Attest the association between a loaded  pub‐
14       lic area and the provided hash of the creation data.  The creation data
15       and the creation ticket is produced when creating the object.  The  ob‐
16       ject  itself  is  created with either TPM2_CreatePrimary or TPM2_Create
17       commands.
18

OPTIONS

20       · -C, --signingkey-context=OBJECT:
21
22         Context object pointing to the key used that signs the attestation.
23
24       · -P, --signingkey-authAUTH:
25
26         Optional authorization value to use for the key specified by -C.
27
28       · -c, --certifiedkey-context=OBJECT:
29
30         Context object pointing to the key that has to be certified.
31
32       · -g, --hash-algorithm=ALGORITHM:
33
34         The hash algorithm used to digest the creation data.
35
36       · -s, --scheme=ALGORITHM:
37
38         The signing scheme used to sign the attestation data.
39
40       · -d, --creation-hash=FILE
41
42         File containing the digest of the creation data.
43
44       · -t, --ticket=FILE:
45
46         The ticket file to validate that the creation data  was  produced  by
47         the TPM.
48
49       · -o, --signature=FILE:
50
51         File  containing the signature of the attestation data for the certi‐
52         fied key.
53
54       · -f, --format=FORMAT:
55
56         Output signature format selection.
57
58       · --attestation=FILE:
59
60         The attestation data of the type TPM2_CREATION_INFO signed with sign‐
61         ing key.
62
63       · -q, --qualification=FILE_OR_HEX:
64
65         Optional, the policy qualifier data that the signer can choose to in‐
66         clude in the signature.  Can either be a path or hex string.
67
68       · --cphash=FILE
69
70         File path to record the hash of the command parameters.  This is com‐
71         monly termed as cpHash.  NOTE: When this option is selected, The tool
72         will not actually execute the command, it simply returns a cpHash.
73
74   References

Context Object Format

76       The type of a context object, whether it is a handle or file  name,  is
77       determined according to the following logic in-order:
78
79       · If the argument is a file path, then the file is loaded as a restored
80         TPM transient object.
81
82       · If the argument is a prefix match on one of:
83
84         · owner: the owner hierarchy
85
86         · platform: the platform hierarchy
87
88         · endorsement: the endorsement hierarchy
89
90         · lockout: the lockout control persistent object
91
92       · If the argument argument can be loaded as a number it will  be  treat
93         as a handle, e.g.  0x81010013 and used directly.OBJECT.
94

Authorization Formatting

96       Authorization  for  use  of an object in TPM2.0 can come in 3 different
97       forms: 1.  Password 2.  HMAC 3.  Sessions
98
99       NOTE: "Authorizations default to the EMPTY  PASSWORD  when  not  speci‐
100       fied".
101
102   Passwords
103       Passwords  are  interpreted  in  the following forms below using prefix
104       identifiers.
105
106       Note: By default passwords are assumed to be in the  string  form  when
107       they do not have a prefix.
108
109   String
110       A  string  password,  specified  by  prefix "str:" or it's absence (raw
111       string without prefix) is not interpreted, and is directly used for au‐
112       thorization.
113
114   Examples
115              foobar
116              str:foobar
117
118   Hex-string
119       A  hex-string  password, specified by prefix "hex:" is converted from a
120       hexidecimal form into a byte array form, thus allowing  passwords  with
121       non-printable and/or terminal un-friendly characters.
122
123   Example
124              hex:0x1122334455667788
125
126   File
127       A  file  based password, specified be prefix "file:" should be the path
128       of a file containing the password to be read by the tool or  a  "-"  to
129       use  stdin.   Storing  passwords in files prevents information leakage,
130       passwords passed as options can be read from the process list or common
131       shell history features.
132
133   Examples
134              # to use stdin and be prompted
135              file:-
136
137              # to use a file from a path
138              file:path/to/password/file
139
140              # to echo a password via stdin:
141              echo foobar | tpm2_tool -p file:-
142
143              # to use a bash here-string via stdin:
144
145              tpm2_tool -p file:- <<< foobar
146
147   Sessions
148       When  using  a policy session to authorize the use of an object, prefix
149       the option argument with the session keyword.  Then indicate a path  to
150       a session file that was created with tpm2_startauthsession(1).  Option‐
151       ally, if the session requires an auth value to be sent with the session
152       handle  (eg policy password), then append a + and a string as described
153       in the Passwords section.
154
155   Examples
156       To use a session context file called session.ctx.
157
158              session:session.ctx
159
160       To use a session context file called session.ctx AND send the authvalue
161       mypassword.
162
163              session:session.ctx+mypassword
164
165       To use a session context file called session.ctx AND send the HEX auth‐
166       value 0x11223344.
167
168              session:session.ctx+hex:11223344
169
170   PCR Authorizations
171       You can satisfy a PCR policy using the "pcr:" prefix and the PCR  mini‐
172       language.       The     PCR     minilanguage     is     as     follows:
173       <pcr-spec>=<raw-pcr-file>
174
175       The PCR spec is documented in in the section "PCR bank specifiers".
176
177       The raw-pcr-file is an optional the output of the raw PCR  contents  as
178       returned by tpm2_pcrread(1).
179
180       PCR bank specifiers (common/pcr.md)
181
182   Examples
183       To satisfy a PCR policy of sha256 on banks 0, 1, 2 and 3 use a specifi‐
184       er of:
185
186              pcr:sha256:0,1,2,3
187
188       specifying AUTH.
189

Algorithm Specifiers

191       Options that take algorithms support "nice-names".
192
193       There are two major algorithm specification string classes, simple  and
194       complex.  Only certain algorithms will be accepted by the TPM, based on
195       usage and conditions.
196
197   Simple specifiers
198       These are strings with no additional specification data.  When creating
199       objects,  non-specified  portions of an object are assumed to defaults.
200       You can find the list of known "Simple Specifiers Below".
201
202   Asymmetric
203       · rsa
204
205       · ecc
206
207   Symmetric
208       · aes
209
210       · camellia
211
212   Hashing Algorithms
213       · sha1
214
215       · sha256
216
217       · sha384
218
219       · sha512
220
221       · sm3_256
222
223       · sha3_256
224
225       · sha3_384
226
227       · sha3_512
228
229   Keyed Hash
230       · hmac
231
232       · xor
233
234   Signing Schemes
235       · rsassa
236
237       · rsapss
238
239       · ecdsa
240
241       · ecdaa
242
243       · ecschnorr
244
245   Asymmetric Encryption Schemes
246       · oaep
247
248       · rsaes
249
250       · ecdh
251
252   Modes
253       · ctr
254
255       · ofb
256
257       · cbc
258
259       · cfb
260
261       · ecb
262
263   Misc
264       · null
265
266   Complex Specifiers
267       Objects, when specified for creation by the TPM,  have  numerous  algo‐
268       rithms  to  populate  in the public data.  Things like type, scheme and
269       asymmetric details, key size, etc.  Below is  the  general  format  for
270       specifying this data: <type>:<scheme>:<symmetric-details>
271
272   Type Specifiers
273       This  portion  of the complex algorithm specifier is required.  The re‐
274       maining scheme and symmetric details will default  based  on  the  type
275       specified and the type of the object being created.
276
277       · aes - Default AES: aes128
278
279       · aes128<mode>  - 128 bit AES with optional mode (ctr|ofb|cbc|cfb|ecb).
280         If mode is not specified, defaults to null.
281
282       · aes192<mode> - Same as aes128<mode>, except for a 192 bit key size.
283
284       · aes256<mode> - Same as aes128<mode>, except for a 256 bit key size.
285
286       · ecc - Elliptical Curve, defaults to ecc256.
287
288       · ecc192 - 192 bit ECC
289
290       · ecc224 - 224 bit ECC
291
292       · ecc256 - 256 bit ECC
293
294       · ecc384 - 384 bit ECC
295
296       · ecc521 - 521 bit ECC
297
298       · rsa - Default RSA: rsa2048
299
300       · rsa1024 - RSA with 1024 bit keysize.
301
302       · rsa2048 - RSA with 2048 bit keysize.
303
304       · rsa4096 - RSA with 4096 bit keysize.
305
306   Scheme Specifiers
307       Next, is an optional field, it can be skipped.
308
309       Schemes are usually Signing Schemes or Asymmetric  Encryption  Schemes.
310       Most signing schemes take a hash algorithm directly following the sign‐
311       ing scheme.  If the hash algorithm is missing, it defaults  to  sha256.
312       Some take no arguments, and some take multiple arguments.
313
314   Hash Optional Scheme Specifiers
315       These  scheme  specifiers are followed by a dash and a valid hash algo‐
316       rithm, For example: oaep-sha256.
317
318       · oaep
319
320       · ecdh
321
322       · rsassa
323
324       · rsapss
325
326       · ecdsa
327
328       · ecschnorr
329
330   Multiple Option Scheme Specifiers
331       This scheme specifier is followed by a count  (max  size  UINT16)  then
332       folloed  by a dash(-) and a valid hash algorithm.  * ecdaa For example,
333       ecdaa4-sha256.  If no count is specified, it defaults to 4.
334
335   No Option Scheme Specifiers
336       This scheme specifier takes NO arguments.  * rsaes
337
338   Symmetric Details Specifiers
339       This field is optional, and defaults based on the type of object  being
340       created  and it's attributes.  Generally, any valid Symmetric specifier
341       from the Type Specifiers list should work.  If not specified, an  asym‐
342       metric objects symmetric details defaults to aes128cfb.
343
344   Examples
345   Create an rsa2048 key with an rsaes asymmetric encryption scheme
346       tpm2_create -C parent.ctx -G rsa2048:rsaes -u key.pub -r key.priv
347
348   Create an ecc256 key with an ecdaa signing scheme with a count of 4
349       and sha384 hash
350
351       /tpm2_create -C parent.ctx -G ecc256:ec‐
352       daa4-sha384 -u key.pub -r key.priv cryptographic algorithms ALGORITHM.
353

COMMON OPTIONS

355       This collection of options are common to many programs and provide  in‐
356       formation that many users may expect.
357
358       · -h,  --help=[man|no-man]:  Display the tools manpage.  By default, it
359         attempts to invoke the manpager for the  tool,  however,  on  failure
360         will  output  a short tool summary.  This is the same behavior if the
361         "man" option argument is specified, however if explicit "man" is  re‐
362         quested,  the  tool  will  provide errors from man on stderr.  If the
363         "no-man" option if specified, or the manpager fails,  the  short  op‐
364         tions will be output to stdout.
365
366         To  successfully use the manpages feature requires the manpages to be
367         installed or on MANPATH, See man(1) for more details.
368
369       · -v, --version: Display version information for this  tool,  supported
370         tctis and exit.
371
372       · -V,  --verbose:  Increase the information that the tool prints to the
373         console during its execution.  When using this option  the  file  and
374         line number are printed.
375
376       · -Q, --quiet: Silence normal tool output to stdout.
377
378       · -Z, --enable-errata: Enable the application of errata fixups.  Useful
379         if an errata fixup needs to be applied to commands sent to  the  TPM.
380         Defining  the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.  in‐
381         formation many users may expect.
382

TCTI Configuration

384       The TCTI or "Transmission Interface"  is  the  communication  mechanism
385       with  the TPM.  TCTIs can be changed for communication with TPMs across
386       different mediums.
387
388       To control the TCTI, the tools respect:
389
390       1. The command line option -T or --tcti
391
392       2. The environment variable: TPM2TOOLS_TCTI.
393
394       Note: The command line option always overrides  the  environment  vari‐
395       able.
396
397       The current known TCTIs are:
398
399       · tabrmd      -     The     resource     manager,     called     tabrmd
400         (https://github.com/tpm2-software/tpm2-abrmd).  Note that tabrmd  and
401         abrmd as a tcti name are synonymous.
402
403       · mssim  - Typically used for communicating to the TPM software simula‐
404         tor.
405
406       · device - Used when talking directly to a TPM device file.
407
408       · none - Do not initalize a connection with the TPM.  Some tools  allow
409         for off-tpm options and thus support not using a TCTI.  Tools that do
410         not support it will error when attempted to be used  without  a  TCTI
411         connection.   Does  not  support ANY options and MUST BE presented as
412         the exact text of "none".
413
414       The arguments to either the command  line  option  or  the  environment
415       variable are in the form:
416
417       <tcti-name>:<tcti-option-config>
418
419       Specifying  an  empty  string  for  either the <tcti-name> or <tcti-op‐
420       tion-config> results in the default being used for that portion respec‐
421       tively.
422
423   TCTI Defaults
424       When  a  TCTI  is not specified, the default TCTI is searched for using
425       dlopen(3) semantics.  The tools will  search  for  tabrmd,  device  and
426       mssim  TCTIs  IN THAT ORDER and USE THE FIRST ONE FOUND.  You can query
427       what TCTI will be chosen as the default by using the -v option to print
428       the  version information.  The "default-tcti" key-value pair will indi‐
429       cate which of the aforementioned TCTIs is the default.
430
431   Custom TCTIs
432       Any TCTI that implements the dynamic TCTI interface can be loaded.  The
433       tools internally use dlopen(3), and the raw tcti-name value is used for
434       the lookup.  Thus, this could be a path to the shared library, or a li‐
435       brary name as understood by dlopen(3) semantics.
436

TCTI OPTIONS

438       This collection of options are used to configure the various known TCTI
439       modules available:
440
441       · device: For the device TCTI, the TPM character device file for use by
442         the device TCTI can be specified.  The default is /dev/tpm0.
443
444         Example:    -T   device:/dev/tpm0   or   export   TPM2TOOLS_TCTI="de‐
445         vice:/dev/tpm0"
446
447       · mssim: For the mssim TCTI, the domain name or  IP  address  and  port
448         number  used  by  the  simulator  can  be specified.  The default are
449         127.0.0.1 and 2321.
450
451         Example: -T mssim:host=localhost,port=2321  or  export  TPM2TOOLS_TC‐
452         TI="mssim:host=localhost,port=2321"
453
454       · abrmd:  For  the abrmd TCTI, the configuration string format is a se‐
455         ries of simple key value pairs separated by a  ','  character.   Each
456         key and value string are separated by a '=' character.
457
458         · TCTI abrmd supports two keys:
459
460           1. 'bus_name'  :  The  name  of  the  tabrmd  service on the bus (a
461              string).
462
463           2. 'bus_type' : The type of the dbus instance (a string) limited to
464              'session' and 'system'.
465
466         Specify  the tabrmd tcti name and a config string of bus_name=com.ex‐
467         ample.FooBar:
468
469         \--tcti=tabrmd:bus_name=com.example.FooBar
470
471         Specify the default (abrmd) tcti and a config string of bus_type=ses‐
472         sion:
473
474         \--tcti:bus_type=session
475
476         NOTE:  abrmd  and tabrmd are synonymous.  the various known TCTI mod‐
477         ules.  # Signature Format Specifiers
478
479       Format selection for the signature output file.  tss (the default) will
480       output a binary blob according to the TPM 2.0 specification and any po‐
481       tential compiler padding.  The option plain will output the plain  sig‐
482       nature data as defined by the used cryptographic algorithm.
483

EXAMPLES

485   Certify creation data of a primary key.
486              tpm2_createprimary -C o -c prim.ctx --creation-data create.dat \
487              -d create.dig -t create.ticket
488
489              tpm2_create -G rsa -u rsa.pub -r rsa.priv -C prim.ctx -c signing_key.ctx
490
491              tpm2_certifycreation -C signing_key.ctx -c prim.ctx -d create.dig \
492              -t create.ticket -g sha256 -o sig.nature --attestation attestat.ion -f plain \
493              -s rsassa
494

Returns

496       Tools can return any of the following codes:
497
498       · 0 - Success.
499
500       · 1 - General non-specific error.
501
502       · 2 - Options handling error.
503
504       · 3 - Authentication error.
505
506       · 4 - TCTI related error.
507
508       · 5 - Non supported scheme.  Applicable to tpm2_testparams.
509

BUGS

511       Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
512

HELP

514       See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)
515
516
517
518tpm2-tools                                             tpm2_certifycreation(1)
Impressum