tpm2_zgen2phase.1 12 KB

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