tpm2_ecdhkeygen.1 11 KB

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