tpm2_createpolicy.1 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. .\" Automatically generated by Pandoc 1.19.2.4
  2. .\"
  3. .TH "tpm2_createpolicy" "1" "" "tpm2\-tools" "General Commands Manual"
  4. .hy
  5. .SH NAME
  6. .PP
  7. \f[B]tpm2_createpolicy\f[](1) \- Creates simple assertion authorization
  8. policies based on multiple PCR indices values across multiple enabled
  9. banks.
  10. .SH SYNOPSIS
  11. .PP
  12. \f[B]tpm2_createpolicy\f[] [\f[I]OPTIONS\f[]]
  13. .SH DESCRIPTION
  14. .PP
  15. \f[B]tpm2_createpolicy\f[](1) \- Creates simple assertion authorization
  16. policies based on multiple PCR indices values across multiple enabled
  17. banks.
  18. It can then be used with object creation and or tools using the object.
  19. .SH OPTIONS
  20. .PP
  21. These options control creating the policy authorization session:
  22. .IP \[bu] 2
  23. \f[B]\-L\f[], \f[B]\-\-policy\f[]=\f[I]FILE\f[]:
  24. .RS 2
  25. .PP
  26. The file to save the policy digest.
  27. .RE
  28. .IP \[bu] 2
  29. \f[B]\-\-policy\-pcr\f[]:
  30. .RS 2
  31. .PP
  32. Identifies the PCR policy type for policy creation.
  33. .RE
  34. .IP \[bu] 2
  35. \f[B]\-g\f[], \f[B]\-\-policy\-algorithm\f[]=\f[I]ALGORITHM\f[]:
  36. .RS 2
  37. .PP
  38. The hash algorithm used in computation of the policy digest.
  39. .RE
  40. .IP \[bu] 2
  41. \f[B]\-l\f[], \f[B]\-\-pcr\-list\f[]=\f[I]PCR\f[]:
  42. .RS 2
  43. .PP
  44. The list of PCR banks and selected PCRs\[aq] ids for each bank.
  45. .RE
  46. .IP \[bu] 2
  47. \f[B]\-f\f[], \f[B]\-\-pcr\f[]=\f[I]FILE\f[]:
  48. .RS 2
  49. .PP
  50. Optional Path or Name of the file containing expected PCR values for the
  51. specified index.
  52. Default is to read the current PCRs per the set list.
  53. .RE
  54. .IP \[bu] 2
  55. \f[B]\-\-policy\-session\f[]:
  56. .RS 2
  57. .PP
  58. Start a policy session of type \f[B]TPM_SE_POLICY\f[].
  59. Defaults to \f[B]TPM_SE_TRIAL\f[] if this option isn\[aq]t specified.
  60. .RE
  61. .SS References
  62. .SH Algorithm Specifiers
  63. .PP
  64. Options that take algorithms support "nice\-names".
  65. .PP
  66. There are two major algorithm specification string classes, simple and
  67. complex.
  68. Only certain algorithms will be accepted by the TPM, based on usage and
  69. conditions.
  70. .SS Simple specifiers
  71. .PP
  72. These are strings with no additional specification data.
  73. When creating objects, non\-specified portions of an object are assumed
  74. to defaults.
  75. You can find the list of known "Simple Specifiers Below".
  76. .SS Asymmetric
  77. .IP \[bu] 2
  78. rsa
  79. .IP \[bu] 2
  80. ecc
  81. .SS Symmetric
  82. .IP \[bu] 2
  83. aes
  84. .IP \[bu] 2
  85. camellia
  86. .SS Hashing Algorithms
  87. .IP \[bu] 2
  88. sha1
  89. .IP \[bu] 2
  90. sha256
  91. .IP \[bu] 2
  92. sha384
  93. .IP \[bu] 2
  94. sha512
  95. .IP \[bu] 2
  96. sm3_256
  97. .IP \[bu] 2
  98. sha3_256
  99. .IP \[bu] 2
  100. sha3_384
  101. .IP \[bu] 2
  102. sha3_512
  103. .SS Keyed Hash
  104. .IP \[bu] 2
  105. hmac
  106. .IP \[bu] 2
  107. xor
  108. .SS Signing Schemes
  109. .IP \[bu] 2
  110. rsassa
  111. .IP \[bu] 2
  112. rsapss
  113. .IP \[bu] 2
  114. ecdsa
  115. .IP \[bu] 2
  116. ecdaa
  117. .IP \[bu] 2
  118. ecschnorr
  119. .SS Asymmetric Encryption Schemes
  120. .IP \[bu] 2
  121. oaep
  122. .IP \[bu] 2
  123. rsaes
  124. .IP \[bu] 2
  125. ecdh
  126. .SS Modes
  127. .IP \[bu] 2
  128. ctr
  129. .IP \[bu] 2
  130. ofb
  131. .IP \[bu] 2
  132. cbc
  133. .IP \[bu] 2
  134. cfb
  135. .IP \[bu] 2
  136. ecb
  137. .SS Misc
  138. .IP \[bu] 2
  139. null
  140. .SS Complex Specifiers
  141. .PP
  142. Objects, when specified for creation by the TPM, have numerous
  143. algorithms to populate in the public data.
  144. Things like type, scheme and asymmetric details, key size, etc.
  145. Below is the general format for specifying this data:
  146. \f[C]<type>:<scheme>:<symmetric\-details>\f[]
  147. .SS Type Specifiers
  148. .PP
  149. This portion of the complex algorithm specifier is required.
  150. The remaining scheme and symmetric details will default based on the
  151. type specified and the type of the object being created.
  152. .IP \[bu] 2
  153. aes \- Default AES: aes128
  154. .IP \[bu] 2
  155. aes128\f[C]<mode>\f[] \- 128 bit AES with optional mode
  156. (\f[I]ctr\f[]|\f[I]ofb\f[]|\f[I]cbc\f[]|\f[I]cfb\f[]|\f[I]ecb\f[]).
  157. If mode is not specified, defaults to \f[I]null\f[].
  158. .IP \[bu] 2
  159. aes192\f[C]<mode>\f[] \- Same as aes128\f[C]<mode>\f[], except for a 192
  160. bit key size.
  161. .IP \[bu] 2
  162. aes256\f[C]<mode>\f[] \- Same as aes128\f[C]<mode>\f[], except for a 256
  163. bit key size.
  164. .IP \[bu] 2
  165. ecc \- Elliptical Curve, defaults to ecc256.
  166. .IP \[bu] 2
  167. ecc192 \- 192 bit ECC
  168. .IP \[bu] 2
  169. ecc224 \- 224 bit ECC
  170. .IP \[bu] 2
  171. ecc256 \- 256 bit ECC
  172. .IP \[bu] 2
  173. ecc384 \- 384 bit ECC
  174. .IP \[bu] 2
  175. ecc521 \- 521 bit ECC
  176. .IP \[bu] 2
  177. rsa \- Default RSA: rsa2048
  178. .IP \[bu] 2
  179. rsa1024 \- RSA with 1024 bit keysize.
  180. .IP \[bu] 2
  181. rsa2048 \- RSA with 2048 bit keysize.
  182. .IP \[bu] 2
  183. rsa4096 \- RSA with 4096 bit keysize.
  184. .SS Scheme Specifiers
  185. .PP
  186. Next, is an optional field, it can be skipped.
  187. .PP
  188. Schemes are usually \f[B]Signing Schemes\f[] or \f[B]Asymmetric
  189. Encryption Schemes\f[].
  190. Most signing schemes take a hash algorithm directly following the
  191. signing scheme.
  192. If the hash algorithm is missing, it defaults to \f[I]sha256\f[].
  193. Some take no arguments, and some take multiple arguments.
  194. .SS Hash Optional Scheme Specifiers
  195. .PP
  196. These scheme specifiers are followed by a dash and a valid hash
  197. algorithm, For example: \f[C]oaep\-sha256\f[].
  198. .IP \[bu] 2
  199. oaep
  200. .IP \[bu] 2
  201. ecdh
  202. .IP \[bu] 2
  203. rsassa
  204. .IP \[bu] 2
  205. rsapss
  206. .IP \[bu] 2
  207. ecdsa
  208. .IP \[bu] 2
  209. ecschnorr
  210. .SS Multiple Option Scheme Specifiers
  211. .PP
  212. This scheme specifier is followed by a count (max size UINT16) then
  213. followed by a dash(\-) and a valid hash algorithm.
  214. * ecdaa For example, ecdaa4\-sha256.
  215. If no count is specified, it defaults to 4.
  216. .SS No Option Scheme Specifiers
  217. .PP
  218. This scheme specifier takes NO arguments.
  219. * rsaes
  220. .SS Symmetric Details Specifiers
  221. .PP
  222. This field is optional, and defaults based on the \f[I]type\f[] of
  223. object being created and it\[aq]s attributes.
  224. Generally, any valid \f[B]Symmetric\f[] specifier from the \f[B]Type
  225. Specifiers\f[] list should work.
  226. If not specified, an asymmetric objects symmetric details defaults to
  227. \f[I]aes128cfb\f[].
  228. .SS Examples
  229. .SS Create an rsa2048 key with an rsaes asymmetric encryption scheme
  230. .PP
  231. \f[C]tpm2_create\ \-C\ parent.ctx\ \-G\ rsa2048:rsaes\ \-u\ key.pub\ \-r\ key.priv\f[]
  232. .SS Create an ecc256 key with an ecdaa signing scheme with a count of 4
  233. and sha384 hash
  234. .PP
  235. \f[C]/tpm2_create\ \-C\ parent.ctx\ \-G\ ecc256:ecdaa4\-sha384\ \-u\ key.pub\ \-r\ key.priv\f[]
  236. cryptographic algorithms \f[I]ALGORITHM\f[].
  237. .SH COMMON OPTIONS
  238. .PP
  239. This collection of options are common to many programs and provide
  240. information that many users may expect.
  241. .IP \[bu] 2
  242. \f[B]\-h\f[], \f[B]\-\-help=[man|no\-man]\f[]: Display the tools
  243. manpage.
  244. By default, it attempts to invoke the manpager for the tool, however, on
  245. failure will output a short tool summary.
  246. This is the same behavior if the "man" option argument is specified,
  247. however if explicit "man" is requested, the tool will provide errors
  248. from man on stderr.
  249. If the "no\-man" option if specified, or the manpager fails, the short
  250. options will be output to stdout.
  251. .RS 2
  252. .PP
  253. To successfully use the manpages feature requires the manpages to be
  254. installed or on \f[I]MANPATH\f[], See man(1) for more details.
  255. .RE
  256. .IP \[bu] 2
  257. \f[B]\-v\f[], \f[B]\-\-version\f[]: Display version information for this
  258. tool, supported tctis and exit.
  259. .IP \[bu] 2
  260. \f[B]\-V\f[], \f[B]\-\-verbose\f[]: Increase the information that the
  261. tool prints to the console during its execution.
  262. When using this option the file and line number are printed.
  263. .IP \[bu] 2
  264. \f[B]\-Q\f[], \f[B]\-\-quiet\f[]: Silence normal tool output to stdout.
  265. .IP \[bu] 2
  266. \f[B]\-Z\f[], \f[B]\-\-enable\-errata\f[]: Enable the application of
  267. errata fixups.
  268. Useful if an errata fixup needs to be applied to commands sent to the
  269. TPM.
  270. Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.
  271. bank/algorithm \f[I]PCR\f[].
  272. .SH COMMON OPTIONS
  273. .PP
  274. This collection of options are common to many programs and provide
  275. information that many users may expect.
  276. .IP \[bu] 2
  277. \f[B]\-h\f[], \f[B]\-\-help=[man|no\-man]\f[]: Display the tools
  278. manpage.
  279. By default, it attempts to invoke the manpager for the tool, however, on
  280. failure will output a short tool summary.
  281. This is the same behavior if the "man" option argument is specified,
  282. however if explicit "man" is requested, the tool will provide errors
  283. from man on stderr.
  284. If the "no\-man" option if specified, or the manpager fails, the short
  285. options will be output to stdout.
  286. .RS 2
  287. .PP
  288. To successfully use the manpages feature requires the manpages to be
  289. installed or on \f[I]MANPATH\f[], See man(1) for more details.
  290. .RE
  291. .IP \[bu] 2
  292. \f[B]\-v\f[], \f[B]\-\-version\f[]: Display version information for this
  293. tool, supported tctis and exit.
  294. .IP \[bu] 2
  295. \f[B]\-V\f[], \f[B]\-\-verbose\f[]: Increase the information that the
  296. tool prints to the console during its execution.
  297. When using this option the file and line number are printed.
  298. .IP \[bu] 2
  299. \f[B]\-Q\f[], \f[B]\-\-quiet\f[]: Silence normal tool output to stdout.
  300. .IP \[bu] 2
  301. \f[B]\-Z\f[], \f[B]\-\-enable\-errata\f[]: Enable the application of
  302. errata fixups.
  303. Useful if an errata fixup needs to be applied to commands sent to the
  304. TPM.
  305. Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.
  306. information many users may expect.
  307. .SH TCTI Configuration
  308. .PP
  309. The TCTI or "Transmission Interface" is the communication mechanism with
  310. the TPM.
  311. TCTIs can be changed for communication with TPMs across different
  312. mediums.
  313. .PP
  314. To control the TCTI, the tools respect:
  315. .IP "1." 3
  316. The command line option \f[B]\-T\f[] or \f[B]\-\-tcti\f[]
  317. .IP "2." 3
  318. The environment variable: \f[I]TPM2TOOLS_TCTI\f[].
  319. .PP
  320. \f[B]Note:\f[] The command line option always overrides the environment
  321. variable.
  322. .PP
  323. The current known TCTIs are:
  324. .IP \[bu] 2
  325. tabrmd \- The resource manager, called
  326. tabrmd (https://github.com/tpm2-software/tpm2-abrmd).
  327. Note that tabrmd and abrmd as a tcti name are synonymous.
  328. .IP \[bu] 2
  329. mssim \- Typically used for communicating to the TPM software simulator.
  330. .IP \[bu] 2
  331. device \- Used when talking directly to a TPM device file.
  332. .IP \[bu] 2
  333. none \- Do not initalize a connection with the TPM.
  334. Some tools allow for off\-tpm options and thus support not using a TCTI.
  335. Tools that do not support it will error when attempted to be used
  336. without a TCTI connection.
  337. Does not support \f[I]ANY\f[] options and \f[I]MUST BE\f[] presented as
  338. the exact text of "none".
  339. .PP
  340. The arguments to either the command line option or the environment
  341. variable are in the form:
  342. .PP
  343. \f[C]<tcti\-name>:<tcti\-option\-config>\f[]
  344. .PP
  345. Specifying an empty string for either the \f[C]<tcti\-name>\f[] or
  346. \f[C]<tcti\-option\-config>\f[] results in the default being used for
  347. that portion respectively.
  348. .SS TCTI Defaults
  349. .PP
  350. When a TCTI is not specified, the default TCTI is searched for using
  351. \f[I]dlopen(3)\f[] semantics.
  352. The tools will search for \f[I]tabrmd\f[], \f[I]device\f[] and
  353. \f[I]mssim\f[] TCTIs \f[B]IN THAT ORDER\f[] and \f[B]USE THE FIRST ONE
  354. FOUND\f[].
  355. You can query what TCTI will be chosen as the default by using the
  356. \f[B]\-v\f[] option to print the version information.
  357. The "default\-tcti" key\-value pair will indicate which of the
  358. aforementioned TCTIs is the default.
  359. .SS Custom TCTIs
  360. .PP
  361. Any TCTI that implements the dynamic TCTI interface can be loaded.
  362. The tools internally use \f[I]dlopen(3)\f[], and the raw
  363. \f[I]tcti\-name\f[] value is used for the lookup.
  364. Thus, this could be a path to the shared library, or a library name as
  365. understood by \f[I]dlopen(3)\f[] semantics.
  366. .SH TCTI OPTIONS
  367. .PP
  368. This collection of options are used to configure the various known TCTI
  369. modules available:
  370. .IP \[bu] 2
  371. \f[B]device\f[]: For the device TCTI, the TPM character device file for
  372. use by the device TCTI can be specified.
  373. The default is \f[I]/dev/tpm0\f[].
  374. .RS 2
  375. .PP
  376. Example: \f[B]\-T device:/dev/tpm0\f[] or \f[B]export
  377. \f[I]TPM2TOOLS_TCTI\f[]="device:/dev/tpm0"\f[]
  378. .RE
  379. .IP \[bu] 2
  380. \f[B]mssim\f[]: For the mssim TCTI, the domain name or IP address and
  381. port number used by the simulator can be specified.
  382. The default are 127.0.0.1 and 2321.
  383. .RS 2
  384. .PP
  385. Example: \f[B]\-T mssim:host=localhost,port=2321\f[] or \f[B]export
  386. \f[I]TPM2TOOLS_TCTI\f[]="mssim:host=localhost,port=2321"\f[]
  387. .RE
  388. .IP \[bu] 2
  389. \f[B]abrmd\f[]: For the abrmd TCTI, the configuration string format is a
  390. series of simple key value pairs separated by a \[aq],\[aq] character.
  391. Each key and value string are separated by a \[aq]=\[aq] character.
  392. .RS 2
  393. .IP \[bu] 2
  394. TCTI abrmd supports two keys:
  395. .RS 2
  396. .IP "1." 3
  397. \[aq]bus_name\[aq] : The name of the tabrmd service on the bus (a
  398. string).
  399. .IP "2." 3
  400. \[aq]bus_type\[aq] : The type of the dbus instance (a string) limited to
  401. \[aq]session\[aq] and \[aq]system\[aq].
  402. .RE
  403. .PP
  404. Specify the tabrmd tcti name and a config string of
  405. \f[C]bus_name=com.example.FooBar\f[]:
  406. .PP
  407. \f[C]\\\-\-tcti=tabrmd:bus_name=com.example.FooBar\f[]
  408. .PP
  409. Specify the default (abrmd) tcti and a config string of
  410. \f[C]bus_type=session\f[]:
  411. .PP
  412. \f[C]\\\-\-tcti:bus_type=session\f[]
  413. .PP
  414. \f[B]NOTE\f[]: abrmd and tabrmd are synonymous.
  415. the various known TCTI modules.
  416. .RE
  417. .SH EXAMPLES
  418. .SS Create a authorization policy tied to a specific PCR index
  419. .IP
  420. .nf
  421. \f[C]
  422. tpm2_createpolicy\ \\\-\-policy\-pcr\ \-l\ 0x4:0\ \-L\ policy.file\ \-f\ pcr0.bin
  423. \f[]
  424. .fi
  425. .SH Returns
  426. .PP
  427. Tools can return any of the following codes:
  428. .IP \[bu] 2
  429. 0 \- Success.
  430. .IP \[bu] 2
  431. 1 \- General non\-specific error.
  432. .IP \[bu] 2
  433. 2 \- Options handling error.
  434. .IP \[bu] 2
  435. 3 \- Authentication error.
  436. .IP \[bu] 2
  437. 4 \- TCTI related error.
  438. .IP \[bu] 2
  439. 5 \- Non supported scheme.
  440. Applicable to tpm2_testparams.
  441. .SH BUGS
  442. .PP
  443. Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
  444. .SH HELP
  445. .PP
  446. See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)