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

NAME

6       tpm2_certify(1) - Prove that an object is loaded in the TPM.
7

SYNOPSIS

9       tpm2_certify [OPTIONS]
10

DESCRIPTION

12       tpm2_certify(1)  - Proves that an object with a specific NAME is loaded
13       in the TPM.  By certifying that the object is loaded, the TPM  warrants
14       that  a public area with a given NAME is self-consistent and associated
15       with a valid sensitive area.
16
17       If a relying party has a public area that has the same NAME as  a  NAME
18       certified  with  this  command, then the values in that public area are
19       correct.  An object that only has its public area loaded cannot be cer‐
20       tified.
21

OPTIONS

23       These options control the certification:
24
25       · -c, --certifiedkey-context=OBJECT:
26
27         The object to be certified.
28
29       · -C, --signingkey-context=OBJECT:
30
31         The key used to sign the attestation structure.
32
33       · -p, --certifiedkey-auth=AUTH:
34
35         The authorization value provided for the object specified with -c.
36
37       · -g, --hash-algorithm=ALGORITHM:
38
39         The hash algorithm to use in signature generation.
40
41       · -P, --signingkey-auth=AUTH:
42
43         The authorization value for the signing key specified with -C.
44
45       · -o, --attestation=FILE:
46
47         Output file name for the attestation data.
48
49       · -s, --signature=FILE:
50
51         Output file name for the signature data.
52
53       · -f, --format=FORMAT:
54
55         Format selection for the signature output file.
56
57   References

Context Object Format

59       The  type  of a context object, whether it is a handle or file name, is
60       determined according to the following logic in-order:
61
62       · If the argument is a file path, then the file is loaded as a restored
63         TPM transient object.
64
65       · If the argument is a prefix match on one of:
66
67         · owner: the owner hierarchy
68
69         · platform: the platform hierarchy
70
71         · endorsement: the endorsement hierarchy
72
73         · lockout: the lockout control persistent object
74
75       · If  the  argument argument can be loaded as a number it will be treat
76         as a handle, e.g.  0x81010013 and used directly.OBJECT.
77

Authorization Formatting

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

Algorithm Specifiers

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

Signature Format Specifiers

338       Format selection for the signature output file.  tss (the default) will
339       output a binary blob according to the TPM 2.0 specification and any po‐
340       tential  compiler padding.  The option plain will output the plain sig‐
341       nature data as defined by the used cryptographic algorithm.   signature
342       FORMAT.
343

COMMON OPTIONS

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

TCTI Configuration

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

TCTI OPTIONS

428       This collection of options are used to configure the various known TCTI
429       modules available:
430
431       · device: For the device TCTI, the TPM character device file for use by
432         the device TCTI can be specified.  The default is /dev/tpm0.
433
434         Example:   -T   device:/dev/tpm0   or   export    TPM2TOOLS_TCTI="de‐
435         vice:/dev/tpm0"
436
437       · mssim:  For  the  mssim  TCTI, the domain name or IP address and port
438         number used by the simulator  can  be  specified.   The  default  are
439         127.0.0.1 and 2321.
440
441         Example:  -T  mssim:host=localhost,port=2321  or export TPM2TOOLS_TC‐
442         TI="mssim:host=localhost,port=2321"
443
444       · abrmd: For the abrmd TCTI, the configuration string format is  a  se‐
445         ries  of  simple  key value pairs separated by a ',' character.  Each
446         key and value string are separated by a '=' character.
447
448         · TCTI abrmd supports two keys:
449
450           1. 'bus_name' : The name of  the  tabrmd  service  on  the  bus  (a
451              string).
452
453           2. 'bus_type' : The type of the dbus instance (a string) limited to
454              'session' and 'system'.
455
456         Specify the tabrmd tcti name and a config string of  bus_name=com.ex‐
457         ample.FooBar:
458
459         \--tcti=tabrmd:bus_name=com.example.FooBar
460
461         Specify the default (abrmd) tcti and a config string of bus_type=ses‐
462         sion:
463
464         \--tcti:bus_type=session
465
466         NOTE: abrmd and tabrmd are synonymous.  the various known  TCTI  mod‐
467         ules.
468

EXAMPLES

470              tpm2_certify -H 0x81010002 -P 0x0011 -p 0x00FF -g 0x00B -a <fileName> \
471              -s <fileName>
472
473              tpm2_certify -C obj.context -c key.context -P 0x0011 -p 0x00FF -g 0x00B \
474              -a <fileName> -s <fileName>
475
476              tpm2_certify -H 0x81010002 -P 0011 -p 00FF  -g 0x00B -a <fileName> -s <fileName>
477

Returns

479       Tools can return any of the following codes:
480
481       · 0 - Success.
482
483       · 1 - General non-specific error.
484
485       · 2 - Options handling error.
486
487       · 3 - Authentication error.
488
489       · 4 - TCTI related error.
490
491       · 5 - Non supported scheme.  Applicable to tpm2_testparams.
492

BUGS

494       Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
495

HELP

497       See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)
498
499
500
501tpm2-tools                                                     tpm2_certify(1)
Impressum