tpm2.1 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  1. .\" Automatically generated by Pandoc 1.19.2.4
  2. .\"
  3. .TH "tpm2" "1" "" "tpm2\-tools" "General Commands Manual"
  4. .hy
  5. .SH NAME
  6. .PP
  7. \f[B]tpm2\f[](1) \- A single small executable that combines the various
  8. tpm2\-tools much like a BusyBox that provides a fairly complete
  9. environment for any small or embedded system.
  10. .SH SYNOPSIS
  11. .PP
  12. \f[B]tpm2\f[] [\f[I]OPTIONS\f[]] [\f[I]ARGUMENTS\f[]]
  13. .SH DESCRIPTION
  14. .PP
  15. \f[B]tpm2\f[](1) \- To ease installation of tpm2\-tools in initrd or
  16. embedded systems where size\-optimization and limited resources are
  17. important, it is convenient to have a single executable that can
  18. dispatch the various TPM2 functionalities specified by the argument
  19. which is one of the available tool names.
  20. .PP
  21. The options and arguments that follow are either the \f[B]common
  22. options\f[] or those specific to the \f[B]tool name\f[].
  23. .PP
  24. It is important to note that individual tools with prefix \f[B]tpm2_\f[]
  25. can still be invoked, however, they are now soft\-linked to this
  26. \f[B]tpm2\f[] executable.
  27. And so unlike BusyBox, full functionality of the individual tools is
  28. available in the executable.
  29. For example: \f[B]tpm2_getrandom 8\f[] can alternatively be specified as
  30. \f[B]tpm2 getrandom 8\f[].
  31. .SH ARGUMENTS
  32. .PP
  33. List of possible tool names.
  34. NOTE: Specify only one of these.
  35. Look at examples.
  36. .PP
  37. \f[B]certifyX509certutil\f[]
  38. .PP
  39. \f[B]checkquote\f[]
  40. .PP
  41. \f[B]eventlog\f[]
  42. .PP
  43. \f[B]print\f[]
  44. .PP
  45. \f[B]rc_decode\f[]
  46. .PP
  47. \f[B]activatecredential\f[]
  48. .PP
  49. \f[B]certify\f[]
  50. .PP
  51. \f[B]changeauth\f[]
  52. .PP
  53. \f[B]changeeps\f[]
  54. .PP
  55. \f[B]changepps\f[]
  56. .PP
  57. \f[B]clear\f[]
  58. .PP
  59. \f[B]clearcontrol\f[]
  60. .PP
  61. \f[B]clockrateadjust\f[]
  62. .PP
  63. \f[B]create\f[]
  64. .PP
  65. \f[B]createak\f[]
  66. .PP
  67. \f[B]createek\f[]
  68. .PP
  69. \f[B]createpolicy\f[]
  70. .PP
  71. \f[B]setprimarypolicy\f[]
  72. .PP
  73. \f[B]createprimary\f[]
  74. .PP
  75. \f[B]dictionarylockout\f[]
  76. .PP
  77. \f[B]duplicate\f[]
  78. .PP
  79. \f[B]getcap\f[]
  80. .PP
  81. \f[B]gettestresult\f[]
  82. .PP
  83. \f[B]encryptdecrypt\f[]
  84. .PP
  85. \f[B]evictcontrol\f[]
  86. .PP
  87. \f[B]flushcontext\f[]
  88. .PP
  89. \f[B]getekcertificate\f[]
  90. .PP
  91. \f[B]getrandom\f[]
  92. .PP
  93. \f[B]gettime\f[]
  94. .PP
  95. \f[B]hash\f[]
  96. .PP
  97. \f[B]hierarchycontrol\f[]
  98. .PP
  99. \f[B]hmac\f[]
  100. .PP
  101. \f[B]import\f[]
  102. .PP
  103. \f[B]incrementalselftest\f[]
  104. .PP
  105. \f[B]load\f[]
  106. .PP
  107. \f[B]loadexternal\f[]
  108. .PP
  109. \f[B]makecredential\f[]
  110. .PP
  111. \f[B]nvdefine\f[]
  112. .PP
  113. \f[B]nvextend\f[]
  114. .PP
  115. \f[B]nvincrement\f[]
  116. .PP
  117. \f[B]nvreadpublic\f[]
  118. .PP
  119. \f[B]nvread\f[]
  120. .PP
  121. \f[B]nvreadlock\f[]
  122. .PP
  123. \f[B]nvundefine\f[]
  124. .PP
  125. \f[B]nvwrite\f[]
  126. .PP
  127. \f[B]nvwritelock\f[]
  128. .PP
  129. \f[B]nvsetbits\f[]
  130. .PP
  131. \f[B]pcrallocate\f[]
  132. .PP
  133. \f[B]pcrevent\f[]
  134. .PP
  135. \f[B]pcrextend\f[]
  136. .PP
  137. \f[B]pcrread\f[]
  138. .PP
  139. \f[B]pcrreset\f[]
  140. .PP
  141. \f[B]policypcr\f[]
  142. .PP
  143. \f[B]policyauthorize\f[]
  144. .PP
  145. \f[B]policyauthorizenv\f[]
  146. .PP
  147. \f[B]policynv\f[]
  148. .PP
  149. \f[B]policycountertimer\f[]
  150. .PP
  151. \f[B]policyor\f[]
  152. .PP
  153. \f[B]policynamehash\f[]
  154. .PP
  155. \f[B]policytemplate\f[]
  156. .PP
  157. \f[B]policycphash\f[]
  158. .PP
  159. \f[B]policypassword\f[]
  160. .PP
  161. \f[B]policysigned\f[]
  162. .PP
  163. \f[B]policyticket\f[]
  164. .PP
  165. \f[B]policyauthvalue\f[]
  166. .PP
  167. \f[B]policysecret\f[]
  168. .PP
  169. \f[B]policyrestart\f[]
  170. .PP
  171. \f[B]policycommandcode\f[]
  172. .PP
  173. \f[B]policynvwritten\f[]
  174. .PP
  175. \f[B]policyduplicationselect\f[]
  176. .PP
  177. \f[B]policylocality\f[]
  178. .PP
  179. \f[B]quote\f[]
  180. .PP
  181. \f[B]readclock\f[]
  182. .PP
  183. \f[B]readpublic\f[]
  184. .PP
  185. \f[B]rsadecrypt\f[]
  186. .PP
  187. \f[B]rsaencrypt\f[]
  188. .PP
  189. \f[B]send\f[]
  190. .PP
  191. \f[B]selftest\f[]
  192. .PP
  193. \f[B]sessionconfig\f[]
  194. .PP
  195. \f[B]setclock\f[]
  196. .PP
  197. \f[B]shutdown\f[]
  198. .PP
  199. \f[B]sign\f[]
  200. .PP
  201. \f[B]certifycreation\f[]
  202. .PP
  203. \f[B]nvcertify\f[]
  204. .PP
  205. \f[B]startauthsession\f[]
  206. .PP
  207. \f[B]startup\f[]
  208. .PP
  209. \f[B]stirrandom\f[]
  210. .PP
  211. \f[B]testparms\f[]
  212. .PP
  213. \f[B]unseal\f[]
  214. .PP
  215. \f[B]verifysignature\f[]
  216. .PP
  217. \f[B]setcommandauditstatus\f[]
  218. .PP
  219. \f[B]getcommandauditdigest\f[]
  220. .PP
  221. \f[B]getsessionauditdigest\f[]
  222. .PP
  223. \f[B]geteccparameters\f[]
  224. .PP
  225. \f[B]ecephemeral\f[]
  226. .PP
  227. \f[B]commit\f[]
  228. .PP
  229. \f[B]ecdhkeygen\f[]
  230. .PP
  231. \f[B]ecdhzgen\f[]
  232. .PP
  233. \f[B]zgen2phase\f[]
  234. .SS References
  235. .SH COMMON OPTIONS
  236. .PP
  237. This collection of options are common to many programs and provide
  238. information that many users may expect.
  239. .IP \[bu] 2
  240. \f[B]\-h\f[], \f[B]\-\-help=[man|no\-man]\f[]: Display the tools
  241. manpage.
  242. By default, it attempts to invoke the manpager for the tool, however, on
  243. failure will output a short tool summary.
  244. This is the same behavior if the "man" option argument is specified,
  245. however if explicit "man" is requested, the tool will provide errors
  246. from man on stderr.
  247. If the "no\-man" option if specified, or the manpager fails, the short
  248. options will be output to stdout.
  249. .RS 2
  250. .PP
  251. To successfully use the manpages feature requires the manpages to be
  252. installed or on \f[I]MANPATH\f[], See man(1) for more details.
  253. .RE
  254. .IP \[bu] 2
  255. \f[B]\-v\f[], \f[B]\-\-version\f[]: Display version information for this
  256. tool, supported tctis and exit.
  257. .IP \[bu] 2
  258. \f[B]\-V\f[], \f[B]\-\-verbose\f[]: Increase the information that the
  259. tool prints to the console during its execution.
  260. When using this option the file and line number are printed.
  261. .IP \[bu] 2
  262. \f[B]\-Q\f[], \f[B]\-\-quiet\f[]: Silence normal tool output to stdout.
  263. .IP \[bu] 2
  264. \f[B]\-Z\f[], \f[B]\-\-enable\-errata\f[]: Enable the application of
  265. errata fixups.
  266. Useful if an errata fixup needs to be applied to commands sent to the
  267. TPM.
  268. Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.
  269. information many users may expect.
  270. .SH TCTI Configuration
  271. .PP
  272. The TCTI or "Transmission Interface" is the communication mechanism with
  273. the TPM.
  274. TCTIs can be changed for communication with TPMs across different
  275. mediums.
  276. .PP
  277. To control the TCTI, the tools respect:
  278. .IP "1." 3
  279. The command line option \f[B]\-T\f[] or \f[B]\-\-tcti\f[]
  280. .IP "2." 3
  281. The environment variable: \f[I]TPM2TOOLS_TCTI\f[].
  282. .PP
  283. \f[B]Note:\f[] The command line option always overrides the environment
  284. variable.
  285. .PP
  286. The current known TCTIs are:
  287. .IP \[bu] 2
  288. tabrmd \- The resource manager, called
  289. tabrmd (https://github.com/tpm2-software/tpm2-abrmd).
  290. Note that tabrmd and abrmd as a tcti name are synonymous.
  291. .IP \[bu] 2
  292. mssim \- Typically used for communicating to the TPM software simulator.
  293. .IP \[bu] 2
  294. device \- Used when talking directly to a TPM device file.
  295. .IP \[bu] 2
  296. none \- Do not initalize a connection with the TPM.
  297. Some tools allow for off\-tpm options and thus support not using a TCTI.
  298. Tools that do not support it will error when attempted to be used
  299. without a TCTI connection.
  300. Does not support \f[I]ANY\f[] options and \f[I]MUST BE\f[] presented as
  301. the exact text of "none".
  302. .PP
  303. The arguments to either the command line option or the environment
  304. variable are in the form:
  305. .PP
  306. \f[C]<tcti\-name>:<tcti\-option\-config>\f[]
  307. .PP
  308. Specifying an empty string for either the \f[C]<tcti\-name>\f[] or
  309. \f[C]<tcti\-option\-config>\f[] results in the default being used for
  310. that portion respectively.
  311. .SS TCTI Defaults
  312. .PP
  313. When a TCTI is not specified, the default TCTI is searched for using
  314. \f[I]dlopen(3)\f[] semantics.
  315. The tools will search for \f[I]tabrmd\f[], \f[I]device\f[] and
  316. \f[I]mssim\f[] TCTIs \f[B]IN THAT ORDER\f[] and \f[B]USE THE FIRST ONE
  317. FOUND\f[].
  318. You can query what TCTI will be chosen as the default by using the
  319. \f[B]\-v\f[] option to print the version information.
  320. The "default\-tcti" key\-value pair will indicate which of the
  321. aforementioned TCTIs is the default.
  322. .SS Custom TCTIs
  323. .PP
  324. Any TCTI that implements the dynamic TCTI interface can be loaded.
  325. The tools internally use \f[I]dlopen(3)\f[], and the raw
  326. \f[I]tcti\-name\f[] value is used for the lookup.
  327. Thus, this could be a path to the shared library, or a library name as
  328. understood by \f[I]dlopen(3)\f[] semantics.
  329. .SH TCTI OPTIONS
  330. .PP
  331. This collection of options are used to configure the various known TCTI
  332. modules available:
  333. .IP \[bu] 2
  334. \f[B]device\f[]: For the device TCTI, the TPM character device file for
  335. use by the device TCTI can be specified.
  336. The default is \f[I]/dev/tpm0\f[].
  337. .RS 2
  338. .PP
  339. Example: \f[B]\-T device:/dev/tpm0\f[] or \f[B]export
  340. \f[I]TPM2TOOLS_TCTI\f[]="device:/dev/tpm0"\f[]
  341. .RE
  342. .IP \[bu] 2
  343. \f[B]mssim\f[]: For the mssim TCTI, the domain name or IP address and
  344. port number used by the simulator can be specified.
  345. The default are 127.0.0.1 and 2321.
  346. .RS 2
  347. .PP
  348. Example: \f[B]\-T mssim:host=localhost,port=2321\f[] or \f[B]export
  349. \f[I]TPM2TOOLS_TCTI\f[]="mssim:host=localhost,port=2321"\f[]
  350. .RE
  351. .IP \[bu] 2
  352. \f[B]abrmd\f[]: For the abrmd TCTI, the configuration string format is a
  353. series of simple key value pairs separated by a \[aq],\[aq] character.
  354. Each key and value string are separated by a \[aq]=\[aq] character.
  355. .RS 2
  356. .IP \[bu] 2
  357. TCTI abrmd supports two keys:
  358. .RS 2
  359. .IP "1." 3
  360. \[aq]bus_name\[aq] : The name of the tabrmd service on the bus (a
  361. string).
  362. .IP "2." 3
  363. \[aq]bus_type\[aq] : The type of the dbus instance (a string) limited to
  364. \[aq]session\[aq] and \[aq]system\[aq].
  365. .RE
  366. .PP
  367. Specify the tabrmd tcti name and a config string of
  368. \f[C]bus_name=com.example.FooBar\f[]:
  369. .PP
  370. \f[C]\\\-\-tcti=tabrmd:bus_name=com.example.FooBar\f[]
  371. .PP
  372. Specify the default (abrmd) tcti and a config string of
  373. \f[C]bus_type=session\f[]:
  374. .PP
  375. \f[C]\\\-\-tcti:bus_type=session\f[]
  376. .PP
  377. \f[B]NOTE\f[]: abrmd and tabrmd are synonymous.
  378. the various known TCTI modules.
  379. .RE
  380. .SH EXAMPLES
  381. .SS Get 8 rand bytes from the TPM
  382. .IP
  383. .nf
  384. \f[C]
  385. tpm2\ getrandom\ 8\ |\ xxd\ \-p
  386. \f[]
  387. .fi
  388. .SS Send a TPM Startup Command with flags TPM2_SU_CLEAR
  389. .IP
  390. .nf
  391. \f[C]
  392. tpm2\ startup\ \-c
  393. \f[]
  394. .fi
  395. .SH Returns
  396. .PP
  397. Tools can return any of the following codes:
  398. .IP \[bu] 2
  399. 0 \- Success.
  400. .IP \[bu] 2
  401. 1 \- General non\-specific error.
  402. .IP \[bu] 2
  403. 2 \- Options handling error.
  404. .IP \[bu] 2
  405. 3 \- Authentication error.
  406. .IP \[bu] 2
  407. 4 \- TCTI related error.
  408. .IP \[bu] 2
  409. 5 \- Non supported scheme.
  410. Applicable to tpm2_testparams.
  411. .SH BUGS
  412. .PP
  413. Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
  414. .SH HELP
  415. .PP
  416. See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)