tpm2_createprimary.1 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710
  1. .\" Automatically generated by Pandoc 1.19.2.4
  2. .\"
  3. .TH "tpm2_createprimary" "1" "" "tpm2\-tools" "General Commands Manual"
  4. .hy
  5. .SH NAME
  6. .PP
  7. \f[B]tpm2_createprimary\f[](1) \- Create a primary key.
  8. .SH SYNOPSIS
  9. .PP
  10. \f[B]tpm2_createprimary\f[] [\f[I]OPTIONS\f[]]
  11. .SH DESCRIPTION
  12. .PP
  13. \f[B]tpm2_createprimary\f[](1) \- This command is used to create a
  14. primary object under one of the hierarchies: Owner, Platform,
  15. Endorsement, NULL.
  16. The command will create and load a Primary Object.
  17. The sensitive and public portions are not returned.
  18. A context file for the created object\[aq]s handle is saved as a file
  19. for future interactions with the created primary.
  20. .SH OPTIONS
  21. .IP \[bu] 2
  22. \f[B]\-C\f[], \f[B]\-\-hierarchy\f[]=\f[I]OBJECT\f[]:
  23. .RS 2
  24. The hierarchy under which the object is created.
  25. This will also dictate which authorization secret (if any) must be
  26. supplied.
  27. Defaults to \f[B]TPM_RH_OWNER\f[], when no value specified.
  28. Supported options are:
  29. .IP \[bu] 2
  30. \f[B]o\f[] for \f[B]TPM_RH_OWNER\f[]
  31. .IP \[bu] 2
  32. \f[B]p\f[] for \f[B]TPM_RH_PLATFORM\f[]
  33. .IP \[bu] 2
  34. \f[B]e\f[] for \f[B]TPM_RH_ENDORSEMENT\f[]
  35. .IP \[bu] 2
  36. \f[B]n\f[] for \f[B]TPM_RH_NULL\f[]
  37. .IP \[bu] 2
  38. \f[B]\f[C]<num>\f[]\f[] where a raw number can be used.
  39. .RE
  40. .IP \[bu] 2
  41. \f[B]\-P\f[], \f[B]\-\-hierarchy\-auth\f[]=\f[I]AUTH\f[]:
  42. .RS 2
  43. .PP
  44. The authorization value for the hierarchy specified with \f[B]\-C\f[].
  45. .RE
  46. .IP \[bu] 2
  47. \f[B]\-p\f[], \f[B]\-\-key\-auth\f[]=\f[I]AUTH\f[]:
  48. .RS 2
  49. .PP
  50. The authorization value for the primary object created.
  51. .RE
  52. .IP \[bu] 2
  53. \f[B]\-g\f[], \f[B]\-\-hash\-algorithm\f[]=\f[I]ALGORITHM\f[]:
  54. .RS 2
  55. .PP
  56. The hash algorithm to use for generating the objects name.
  57. Defaults to sha256 if not specified.
  58. .RE
  59. .IP \[bu] 2
  60. \f[B]\-G\f[], \f[B]\-\-key\-algorithm\f[]=\f[I]ALGORITHM\f[]:
  61. .RS 2
  62. .PP
  63. The algorithm type for the generated primary key.
  64. Defaults to rsa2048:null:aes128cfb.
  65. .RE
  66. .IP \[bu] 2
  67. \f[B]\-c\f[], \f[B]\-\-key\-context\f[]=\f[I]FILE\f[]:
  68. .RS 2
  69. .PP
  70. The file path to save the object context of the generated primary
  71. object.
  72. .RE
  73. .IP \[bu] 2
  74. \f[B]\-L\f[], \f[B]\-\-policy\f[]=\f[I]FILE\f[]:
  75. .RS 2
  76. .PP
  77. An optional file input that contains the policy digest for policy based
  78. authorization of the object.
  79. .RE
  80. .IP \[bu] 2
  81. \f[B]\-a\f[], \f[B]\-\-attributes\f[]=\f[I]ATTRIBUTES\f[]:
  82. .RS 2
  83. .PP
  84. The object attributes, optional.
  85. Defaults to:
  86. \f[C]TPMA_OBJECT_RESTRICTED|TPMA_OBJECT_DECRYPT|TPMA_OBJECT_FIXEDTPM|\ \ TPMA_OBJECT_FIXEDPARENT|TPMA_OBJECT_SENSITIVEDATAORIGIN|\ \ TPMA_OBJECT_USERWITHAUTH\f[]
  87. .RE
  88. .IP \[bu] 2
  89. \f[B]\-u\f[], \f[B]\-\-unique\-data\f[]=\f[I]FILE\f[] OR \f[I]STDIN\f[]:
  90. .RS 2
  91. .PP
  92. An optional file input that contains the unique field of
  93. \f[B]TPMT_PUBLIC\f[] in little\-endian format.
  94. Primary key creator may place information that causes the primary key
  95. generation scheme internal to the TPM to generate statistically unique
  96. values.
  97. The TPM v2.0 specification calls this field unique and overloads it so
  98. that it contains one value when the application provides this structure
  99. as input and another value when the applications receives this structure
  100. as output (like public portion of the rsa key).
  101. .PP
  102. If the data is specified as a file, the user is responsible for ensuring
  103. that this buffer is formatted per TPMU_PUBLIC_ID union.
  104. .PP
  105. The unique data can also be retrieved from stdin buffer by specifying
  106. \f[B]"\-"\f[] as the \f[B]\-\-unique\-data\f[] option value and the tool
  107. will parse the key type and associate the input data with the unique
  108. data buffer associated with the key type.
  109. NOTE:
  110. .IP "1." 3
  111. The maximum allowed bytes is dependent on key type and the TPM
  112. implementation.
  113. Eg.
  114. While TSS allows a value upto 512 for MAX_RSA_KEY_BYTES, however the
  115. ibmSwTPM implementation supports a value upto 256 bytes.
  116. .IP "2." 3
  117. The unique input data specified on stdin for ECC is split for specifying
  118. the X coordinate and Y coordinate buffers.
  119. .RE
  120. .IP \[bu] 2
  121. \f[B]\-\-creation\-data\f[]=\f[I]FILE\f[]:
  122. .RS 2
  123. .PP
  124. An optional file output that saves the creation data for certification.
  125. .RE
  126. .IP \[bu] 2
  127. \f[B]\-\-template\-data\f[]=\f[I]FILE\f[]:
  128. .RS 2
  129. .PP
  130. An optional file output that saves the key template data (TPM2B_PUBLIC)
  131. to be used in \f[B]tpm2_policytemplate\f[].
  132. .RE
  133. .IP \[bu] 2
  134. \f[B]\-t\f[], \f[B]\-\-creation\-ticket\f[]=\f[I]FILE\f[]:
  135. .RS 2
  136. .PP
  137. An optional file output that saves the creation ticket for
  138. certification.
  139. .RE
  140. .IP \[bu] 2
  141. \f[B]\-d\f[], \f[B]\-\-creation\-hash\f[]=\f[I]FILE\f[]:
  142. .RS 2
  143. .PP
  144. An optional file output that saves the creation hash for certification.
  145. .RE
  146. .IP \[bu] 2
  147. \f[B]\-q\f[], \f[B]\-\-outside\-info\f[]=\f[I]FILE_OR_HEX\f[]:
  148. .RS 2
  149. .PP
  150. An optional file or hex string to add unique data to the creation data.
  151. Note that it does not contribute in creating statistically unique
  152. object.
  153. .RE
  154. .IP \[bu] 2
  155. \f[B]\-l\f[], \f[B]\-\-pcr\-list\f[]=\f[I]PCR\f[]:
  156. .RS 2
  157. .PP
  158. The list of PCR banks and selected PCRs\[aq] ids for each bank to be
  159. included in the creation data for certification.
  160. .RE
  161. .IP \[bu] 2
  162. \f[B]\-\-cphash\f[]=\f[I]FILE\f[]
  163. .RS 2
  164. .PP
  165. File path to record the hash of the command parameters.
  166. This is commonly termed as cpHash.
  167. NOTE: When this option is selected, The tool will not actually execute
  168. the command, it simply returns a cpHash.
  169. .RE
  170. .SS References
  171. .SH Context Object Format
  172. .PP
  173. The type of a context object, whether it is a handle or file name, is
  174. determined according to the following logic \f[I]in\-order\f[]:
  175. .IP \[bu] 2
  176. If the argument is a file path, then the file is loaded as a restored
  177. TPM transient object.
  178. .IP \[bu] 2
  179. If the argument is a \f[I]prefix\f[] match on one of:
  180. .RS 2
  181. .IP \[bu] 2
  182. owner: the owner hierarchy
  183. .IP \[bu] 2
  184. platform: the platform hierarchy
  185. .IP \[bu] 2
  186. endorsement: the endorsement hierarchy
  187. .IP \[bu] 2
  188. lockout: the lockout control persistent object
  189. .RE
  190. .IP \[bu] 2
  191. If the argument argument can be loaded as a number it will be treat as a
  192. handle, e.g.
  193. 0x81010013 and used directly.\f[I]OBJECT\f[].
  194. .SH Authorization Formatting
  195. .PP
  196. Authorization for use of an object in TPM2.0 can come in 3 different
  197. forms: 1.
  198. Password 2.
  199. HMAC 3.
  200. Sessions
  201. .PP
  202. \f[B]NOTE:\f[] "Authorizations default to the \f[B]EMPTY PASSWORD\f[]
  203. when not specified".
  204. .SS Passwords
  205. .PP
  206. Passwords are interpreted in the following forms below using prefix
  207. identifiers.
  208. .PP
  209. \f[B]Note\f[]: By default passwords are assumed to be in the string form
  210. when they do not have a prefix.
  211. .SS String
  212. .PP
  213. A string password, specified by prefix "str:" or it\[aq]s absence (raw
  214. string without prefix) is not interpreted, and is directly used for
  215. authorization.
  216. .SS Examples
  217. .IP
  218. .nf
  219. \f[C]
  220. foobar
  221. str:foobar
  222. \f[]
  223. .fi
  224. .SS Hex\-string
  225. .PP
  226. A hex\-string password, specified by prefix "hex:" is converted from a
  227. hexidecimal form into a byte array form, thus allowing passwords with
  228. non\-printable and/or terminal un\-friendly characters.
  229. .SS Example
  230. .IP
  231. .nf
  232. \f[C]
  233. hex:0x1122334455667788
  234. \f[]
  235. .fi
  236. .SS File
  237. .PP
  238. A file based password, specified be prefix "file:" should be the path of
  239. a file containing the password to be read by the tool or a "\-" to use
  240. stdin.
  241. Storing passwords in files prevents information leakage, passwords
  242. passed as options can be read from the process list or common shell
  243. history features.
  244. .SS Examples
  245. .IP
  246. .nf
  247. \f[C]
  248. #\ to\ use\ stdin\ and\ be\ prompted
  249. file:\-
  250. #\ to\ use\ a\ file\ from\ a\ path
  251. file:path/to/password/file
  252. #\ to\ echo\ a\ password\ via\ stdin:
  253. echo\ foobar\ |\ tpm2_tool\ \-p\ file:\-
  254. #\ to\ use\ a\ bash\ here\-string\ via\ stdin:
  255. tpm2_tool\ \-p\ file:\-\ <<<\ foobar
  256. \f[]
  257. .fi
  258. .SS Sessions
  259. .PP
  260. When using a policy session to authorize the use of an object, prefix
  261. the option argument with the \f[I]session\f[] keyword.
  262. Then indicate a path to a session file that was created with
  263. tpm2_startauthsession(1).
  264. Optionally, if the session requires an auth value to be sent with the
  265. session handle (eg policy password), then append a + and a string as
  266. described in the \f[B]Passwords\f[] section.
  267. .SS Examples
  268. .PP
  269. To use a session context file called \f[I]session.ctx\f[].
  270. .IP
  271. .nf
  272. \f[C]
  273. session:session.ctx
  274. \f[]
  275. .fi
  276. .PP
  277. To use a session context file called \f[I]session.ctx\f[] \f[B]AND\f[]
  278. send the authvalue mypassword.
  279. .IP
  280. .nf
  281. \f[C]
  282. session:session.ctx+mypassword
  283. \f[]
  284. .fi
  285. .PP
  286. To use a session context file called \f[I]session.ctx\f[] \f[B]AND\f[]
  287. send the \f[I]HEX\f[] authvalue 0x11223344.
  288. .IP
  289. .nf
  290. \f[C]
  291. session:session.ctx+hex:11223344
  292. \f[]
  293. .fi
  294. .SS PCR Authorizations
  295. .PP
  296. You can satisfy a PCR policy using the "pcr:" prefix and the PCR
  297. minilanguage.
  298. The PCR minilanguage is as follows:
  299. \f[C]<pcr\-spec>=<raw\-pcr\-file>\f[]
  300. .PP
  301. The PCR spec is documented in in the section "PCR bank specifiers".
  302. .PP
  303. The \f[C]raw\-pcr\-file\f[] is an \f[B]optional\f[] the output of the
  304. raw PCR contents as returned by \f[I]tpm2_pcrread(1)\f[].
  305. .PP
  306. PCR bank specifiers (common/pcr.md)
  307. .SS Examples
  308. .PP
  309. To satisfy a PCR policy of sha256 on banks 0, 1, 2 and 3 use a specifier
  310. of:
  311. .IP
  312. .nf
  313. \f[C]
  314. pcr:sha256:0,1,2,3
  315. \f[]
  316. .fi
  317. .PP
  318. specifying \f[I]AUTH\f[].
  319. .SH Algorithm Specifiers
  320. .PP
  321. Options that take algorithms support "nice\-names".
  322. .PP
  323. There are two major algorithm specification string classes, simple and
  324. complex.
  325. Only certain algorithms will be accepted by the TPM, based on usage and
  326. conditions.
  327. .SS Simple specifiers
  328. .PP
  329. These are strings with no additional specification data.
  330. When creating objects, non\-specified portions of an object are assumed
  331. to defaults.
  332. You can find the list of known "Simple Specifiers Below".
  333. .SS Asymmetric
  334. .IP \[bu] 2
  335. rsa
  336. .IP \[bu] 2
  337. ecc
  338. .SS Symmetric
  339. .IP \[bu] 2
  340. aes
  341. .IP \[bu] 2
  342. camellia
  343. .SS Hashing Algorithms
  344. .IP \[bu] 2
  345. sha1
  346. .IP \[bu] 2
  347. sha256
  348. .IP \[bu] 2
  349. sha384
  350. .IP \[bu] 2
  351. sha512
  352. .IP \[bu] 2
  353. sm3_256
  354. .IP \[bu] 2
  355. sha3_256
  356. .IP \[bu] 2
  357. sha3_384
  358. .IP \[bu] 2
  359. sha3_512
  360. .SS Keyed Hash
  361. .IP \[bu] 2
  362. hmac
  363. .IP \[bu] 2
  364. xor
  365. .SS Signing Schemes
  366. .IP \[bu] 2
  367. rsassa
  368. .IP \[bu] 2
  369. rsapss
  370. .IP \[bu] 2
  371. ecdsa
  372. .IP \[bu] 2
  373. ecdaa
  374. .IP \[bu] 2
  375. ecschnorr
  376. .SS Asymmetric Encryption Schemes
  377. .IP \[bu] 2
  378. oaep
  379. .IP \[bu] 2
  380. rsaes
  381. .IP \[bu] 2
  382. ecdh
  383. .SS Modes
  384. .IP \[bu] 2
  385. ctr
  386. .IP \[bu] 2
  387. ofb
  388. .IP \[bu] 2
  389. cbc
  390. .IP \[bu] 2
  391. cfb
  392. .IP \[bu] 2
  393. ecb
  394. .SS Misc
  395. .IP \[bu] 2
  396. null
  397. .SS Complex Specifiers
  398. .PP
  399. Objects, when specified for creation by the TPM, have numerous
  400. algorithms to populate in the public data.
  401. Things like type, scheme and asymmetric details, key size, etc.
  402. Below is the general format for specifying this data:
  403. \f[C]<type>:<scheme>:<symmetric\-details>\f[]
  404. .SS Type Specifiers
  405. .PP
  406. This portion of the complex algorithm specifier is required.
  407. The remaining scheme and symmetric details will default based on the
  408. type specified and the type of the object being created.
  409. .IP \[bu] 2
  410. aes \- Default AES: aes128
  411. .IP \[bu] 2
  412. aes128\f[C]<mode>\f[] \- 128 bit AES with optional mode
  413. (\f[I]ctr\f[]|\f[I]ofb\f[]|\f[I]cbc\f[]|\f[I]cfb\f[]|\f[I]ecb\f[]).
  414. If mode is not specified, defaults to \f[I]null\f[].
  415. .IP \[bu] 2
  416. aes192\f[C]<mode>\f[] \- Same as aes128\f[C]<mode>\f[], except for a 192
  417. bit key size.
  418. .IP \[bu] 2
  419. aes256\f[C]<mode>\f[] \- Same as aes128\f[C]<mode>\f[], except for a 256
  420. bit key size.
  421. .IP \[bu] 2
  422. ecc \- Elliptical Curve, defaults to ecc256.
  423. .IP \[bu] 2
  424. ecc192 \- 192 bit ECC
  425. .IP \[bu] 2
  426. ecc224 \- 224 bit ECC
  427. .IP \[bu] 2
  428. ecc256 \- 256 bit ECC
  429. .IP \[bu] 2
  430. ecc384 \- 384 bit ECC
  431. .IP \[bu] 2
  432. ecc521 \- 521 bit ECC
  433. .IP \[bu] 2
  434. rsa \- Default RSA: rsa2048
  435. .IP \[bu] 2
  436. rsa1024 \- RSA with 1024 bit keysize.
  437. .IP \[bu] 2
  438. rsa2048 \- RSA with 2048 bit keysize.
  439. .IP \[bu] 2
  440. rsa4096 \- RSA with 4096 bit keysize.
  441. .SS Scheme Specifiers
  442. .PP
  443. Next, is an optional field, it can be skipped.
  444. .PP
  445. Schemes are usually \f[B]Signing Schemes\f[] or \f[B]Asymmetric
  446. Encryption Schemes\f[].
  447. Most signing schemes take a hash algorithm directly following the
  448. signing scheme.
  449. If the hash algorithm is missing, it defaults to \f[I]sha256\f[].
  450. Some take no arguments, and some take multiple arguments.
  451. .SS Hash Optional Scheme Specifiers
  452. .PP
  453. These scheme specifiers are followed by a dash and a valid hash
  454. algorithm, For example: \f[C]oaep\-sha256\f[].
  455. .IP \[bu] 2
  456. oaep
  457. .IP \[bu] 2
  458. ecdh
  459. .IP \[bu] 2
  460. rsassa
  461. .IP \[bu] 2
  462. rsapss
  463. .IP \[bu] 2
  464. ecdsa
  465. .IP \[bu] 2
  466. ecschnorr
  467. .SS Multiple Option Scheme Specifiers
  468. .PP
  469. This scheme specifier is followed by a count (max size UINT16) then
  470. followed by a dash(\-) and a valid hash algorithm.
  471. * ecdaa For example, ecdaa4\-sha256.
  472. If no count is specified, it defaults to 4.
  473. .SS No Option Scheme Specifiers
  474. .PP
  475. This scheme specifier takes NO arguments.
  476. * rsaes
  477. .SS Symmetric Details Specifiers
  478. .PP
  479. This field is optional, and defaults based on the \f[I]type\f[] of
  480. object being created and it\[aq]s attributes.
  481. Generally, any valid \f[B]Symmetric\f[] specifier from the \f[B]Type
  482. Specifiers\f[] list should work.
  483. If not specified, an asymmetric objects symmetric details defaults to
  484. \f[I]aes128cfb\f[].
  485. .SS Examples
  486. .SS Create an rsa2048 key with an rsaes asymmetric encryption scheme
  487. .PP
  488. \f[C]tpm2_create\ \-C\ parent.ctx\ \-G\ rsa2048:rsaes\ \-u\ key.pub\ \-r\ key.priv\f[]
  489. .SS Create an ecc256 key with an ecdaa signing scheme with a count of 4
  490. and sha384 hash
  491. .PP
  492. \f[C]/tpm2_create\ \-C\ parent.ctx\ \-G\ ecc256:ecdaa4\-sha384\ \-u\ key.pub\ \-r\ key.priv\f[]
  493. cryptographic algorithms \f[I]ALGORITHM\f[].
  494. .SH Object Attributes
  495. .PP
  496. Object Attributes are used to control various properties of created
  497. objects.
  498. When specified as an option, either the raw bitfield mask or
  499. "nice\-names" may be used.
  500. The values can be found in Table 31 Part 2 of the TPM2.0 specification,
  501. which can be found here:
  502. .PP
  503. <https://trustedcomputinggroup.org/wp-content/uploads/TPM-Rev-2.0-Part-2-Structures-01.38.pdf>
  504. .PP
  505. Nice names are calculated by taking the name field of table 31 and
  506. removing the prefix \f[B]TPMA_OBJECT_\f[] and lowercasing the result.
  507. Thus, \f[B]TPMA_OBJECT_FIXEDTPM\f[] becomes fixedtpm.
  508. Nice names can be joined using the bitwise or "|" symbol.
  509. .PP
  510. For instance, to set The fields \f[B]TPMA_OBJECT_FIXEDTPM\f[],
  511. \f[B]TPMA_OBJECT_NODA\f[], and \f[B]TPMA_OBJECT_SIGN_ENCRYPT\f[], the
  512. argument would be:
  513. .PP
  514. \f[B]fixedtpm|noda|sign\f[] specifying the object attributes
  515. \f[I]ATTRIBUTES\f[].
  516. .SH COMMON OPTIONS
  517. .PP
  518. This collection of options are common to many programs and provide
  519. information that many users may expect.
  520. .IP \[bu] 2
  521. \f[B]\-h\f[], \f[B]\-\-help=[man|no\-man]\f[]: Display the tools
  522. manpage.
  523. By default, it attempts to invoke the manpager for the tool, however, on
  524. failure will output a short tool summary.
  525. This is the same behavior if the "man" option argument is specified,
  526. however if explicit "man" is requested, the tool will provide errors
  527. from man on stderr.
  528. If the "no\-man" option if specified, or the manpager fails, the short
  529. options will be output to stdout.
  530. .RS 2
  531. .PP
  532. To successfully use the manpages feature requires the manpages to be
  533. installed or on \f[I]MANPATH\f[], See man(1) for more details.
  534. .RE
  535. .IP \[bu] 2
  536. \f[B]\-v\f[], \f[B]\-\-version\f[]: Display version information for this
  537. tool, supported tctis and exit.
  538. .IP \[bu] 2
  539. \f[B]\-V\f[], \f[B]\-\-verbose\f[]: Increase the information that the
  540. tool prints to the console during its execution.
  541. When using this option the file and line number are printed.
  542. .IP \[bu] 2
  543. \f[B]\-Q\f[], \f[B]\-\-quiet\f[]: Silence normal tool output to stdout.
  544. .IP \[bu] 2
  545. \f[B]\-Z\f[], \f[B]\-\-enable\-errata\f[]: Enable the application of
  546. errata fixups.
  547. Useful if an errata fixup needs to be applied to commands sent to the
  548. TPM.
  549. Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.
  550. information many users may expect.
  551. .SH TCTI Configuration
  552. .PP
  553. The TCTI or "Transmission Interface" is the communication mechanism with
  554. the TPM.
  555. TCTIs can be changed for communication with TPMs across different
  556. mediums.
  557. .PP
  558. To control the TCTI, the tools respect:
  559. .IP "1." 3
  560. The command line option \f[B]\-T\f[] or \f[B]\-\-tcti\f[]
  561. .IP "2." 3
  562. The environment variable: \f[I]TPM2TOOLS_TCTI\f[].
  563. .PP
  564. \f[B]Note:\f[] The command line option always overrides the environment
  565. variable.
  566. .PP
  567. The current known TCTIs are:
  568. .IP \[bu] 2
  569. tabrmd \- The resource manager, called
  570. tabrmd (https://github.com/tpm2-software/tpm2-abrmd).
  571. Note that tabrmd and abrmd as a tcti name are synonymous.
  572. .IP \[bu] 2
  573. mssim \- Typically used for communicating to the TPM software simulator.
  574. .IP \[bu] 2
  575. device \- Used when talking directly to a TPM device file.
  576. .IP \[bu] 2
  577. none \- Do not initalize a connection with the TPM.
  578. Some tools allow for off\-tpm options and thus support not using a TCTI.
  579. Tools that do not support it will error when attempted to be used
  580. without a TCTI connection.
  581. Does not support \f[I]ANY\f[] options and \f[I]MUST BE\f[] presented as
  582. the exact text of "none".
  583. .PP
  584. The arguments to either the command line option or the environment
  585. variable are in the form:
  586. .PP
  587. \f[C]<tcti\-name>:<tcti\-option\-config>\f[]
  588. .PP
  589. Specifying an empty string for either the \f[C]<tcti\-name>\f[] or
  590. \f[C]<tcti\-option\-config>\f[] results in the default being used for
  591. that portion respectively.
  592. .SS TCTI Defaults
  593. .PP
  594. When a TCTI is not specified, the default TCTI is searched for using
  595. \f[I]dlopen(3)\f[] semantics.
  596. The tools will search for \f[I]tabrmd\f[], \f[I]device\f[] and
  597. \f[I]mssim\f[] TCTIs \f[B]IN THAT ORDER\f[] and \f[B]USE THE FIRST ONE
  598. FOUND\f[].
  599. You can query what TCTI will be chosen as the default by using the
  600. \f[B]\-v\f[] option to print the version information.
  601. The "default\-tcti" key\-value pair will indicate which of the
  602. aforementioned TCTIs is the default.
  603. .SS Custom TCTIs
  604. .PP
  605. Any TCTI that implements the dynamic TCTI interface can be loaded.
  606. The tools internally use \f[I]dlopen(3)\f[], and the raw
  607. \f[I]tcti\-name\f[] value is used for the lookup.
  608. Thus, this could be a path to the shared library, or a library name as
  609. understood by \f[I]dlopen(3)\f[] semantics.
  610. .SH TCTI OPTIONS
  611. .PP
  612. This collection of options are used to configure the various known TCTI
  613. modules available:
  614. .IP \[bu] 2
  615. \f[B]device\f[]: For the device TCTI, the TPM character device file for
  616. use by the device TCTI can be specified.
  617. The default is \f[I]/dev/tpm0\f[].
  618. .RS 2
  619. .PP
  620. Example: \f[B]\-T device:/dev/tpm0\f[] or \f[B]export
  621. \f[I]TPM2TOOLS_TCTI\f[]="device:/dev/tpm0"\f[]
  622. .RE
  623. .IP \[bu] 2
  624. \f[B]mssim\f[]: For the mssim TCTI, the domain name or IP address and
  625. port number used by the simulator can be specified.
  626. The default are 127.0.0.1 and 2321.
  627. .RS 2
  628. .PP
  629. Example: \f[B]\-T mssim:host=localhost,port=2321\f[] or \f[B]export
  630. \f[I]TPM2TOOLS_TCTI\f[]="mssim:host=localhost,port=2321"\f[]
  631. .RE
  632. .IP \[bu] 2
  633. \f[B]abrmd\f[]: For the abrmd TCTI, the configuration string format is a
  634. series of simple key value pairs separated by a \[aq],\[aq] character.
  635. Each key and value string are separated by a \[aq]=\[aq] character.
  636. .RS 2
  637. .IP \[bu] 2
  638. TCTI abrmd supports two keys:
  639. .RS 2
  640. .IP "1." 3
  641. \[aq]bus_name\[aq] : The name of the tabrmd service on the bus (a
  642. string).
  643. .IP "2." 3
  644. \[aq]bus_type\[aq] : The type of the dbus instance (a string) limited to
  645. \[aq]session\[aq] and \[aq]system\[aq].
  646. .RE
  647. .PP
  648. Specify the tabrmd tcti name and a config string of
  649. \f[C]bus_name=com.example.FooBar\f[]:
  650. .PP
  651. \f[C]\\\-\-tcti=tabrmd:bus_name=com.example.FooBar\f[]
  652. .PP
  653. Specify the default (abrmd) tcti and a config string of
  654. \f[C]bus_type=session\f[]:
  655. .PP
  656. \f[C]\\\-\-tcti:bus_type=session\f[]
  657. .PP
  658. \f[B]NOTE\f[]: abrmd and tabrmd are synonymous.
  659. the various known TCTI modules.
  660. .RE
  661. .SH EXAMPLES
  662. .SS Create an ECC primary object
  663. .IP
  664. .nf
  665. \f[C]
  666. tpm2_createprimary\ \-C\ o\ \-g\ sha256\ \-G\ ecc\ \-c\ context.out
  667. \f[]
  668. .fi
  669. .SS Create a primary object that follows the guidance of TCG
  670. Provisioning guide
  671. .PP
  672. See :
  673. https://trustedcomputinggroup.org/wp\-content/uploads/TCG\-TPM\-v2.0\-Provisioning\-Guidance\-Published\-v1r1.pdf
  674. .PP
  675. Where unique.dat contains the binary\-formatted data: 0x00 0x01 (0x00 *
  676. 256)
  677. .IP
  678. .nf
  679. \f[C]
  680. tpm2_createprimary\ \-C\ o\ \-G\ rsa2048:aes128cfb\ \-g\ sha256\ \-c\ prim.ctx\ \\
  681. \-a\ \[aq]restricted|decrypt|fixedtpm|fixedparent|sensitivedataorigin|userwithauth|\\
  682. noda\[aq]\ \-u\ unique.dat
  683. \f[]
  684. .fi
  685. .SH Returns
  686. .PP
  687. Tools can return any of the following codes:
  688. .IP \[bu] 2
  689. 0 \- Success.
  690. .IP \[bu] 2
  691. 1 \- General non\-specific error.
  692. .IP \[bu] 2
  693. 2 \- Options handling error.
  694. .IP \[bu] 2
  695. 3 \- Authentication error.
  696. .IP \[bu] 2
  697. 4 \- TCTI related error.
  698. .IP \[bu] 2
  699. 5 \- Non supported scheme.
  700. Applicable to tpm2_testparams.
  701. .SH BUGS
  702. .PP
  703. Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
  704. .SH HELP
  705. .PP
  706. See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)