tpm2_activatecredential.1 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  1. .\" Automatically generated by Pandoc 1.19.2.4
  2. .\"
  3. .TH "tpm2_activatecredential" "1" "" "tpm2\-tools" "General Commands Manual"
  4. .hy
  5. .SH NAME
  6. .PP
  7. \f[B]tpm2_activatecredential\f[](1) \- Enables access to the credential
  8. qualifier to recover the credential secret.
  9. .SH SYNOPSIS
  10. .PP
  11. \f[B]tpm2_activatecredential\f[] [\f[I]OPTIONS\f[]]
  12. .SH DESCRIPTION
  13. .PP
  14. \f[B]tpm2_activatecredential\f[](1) \- Enables the association of a
  15. credential with an object in a way that ensures that the TPM has
  16. validated the parameters of the credentialed object.
  17. In an attestation scheme , this guarantees the registrar that the
  18. attestation key belongs to the TPM with a qualified parent key in the
  19. TPM.
  20. .SH OPTIONS
  21. .IP \[bu] 2
  22. \f[B]\-c\f[], \f[B]\-\-credentialedkey\-context\f[]=\f[I]OBJECT\f[]:
  23. .RS 2
  24. .PP
  25. Object associated with the created certificate by CA.
  26. .RE
  27. .IP \[bu] 2
  28. \f[B]\-C\f[], \f[B]\-\-credentialkey\-context\f[]=\f[I]OBJECT\f[]:
  29. .RS 2
  30. .PP
  31. The loaded object used to decrypt the random seed.
  32. .RE
  33. .IP \[bu] 2
  34. \f[B]\-p\f[], \f[B]\-\-credentialedkey\-auth\f[]=\f[I]AUTH\f[]:
  35. .RS 2
  36. .PP
  37. The auth value of the credentialed object specified with \f[B]\-c\f[].
  38. .RE
  39. .IP \[bu] 2
  40. \f[B]\-P\f[], \f[B]\-\-credentialkey\-auth\f[]=\f[I]AUTH\f[]:
  41. .RS 2
  42. .PP
  43. The auth value of the credential object specified with \f[B]\-C\f[].
  44. .RE
  45. .IP \[bu] 2
  46. \f[B]\-i\f[], \f[B]\-\-credential\-blob\f[]=\f[I]FILE\f[]:
  47. .RS 2
  48. .PP
  49. The input file path containing the credential blob and secret created
  50. with the \f[B]tpm2_makecredential\f[](1) tool.
  51. .RE
  52. .IP \[bu] 2
  53. \f[B]\-o\f[], \f[B]\-\-certinfo\-data\f[]=\f[I]FILE\f[]:
  54. .RS 2
  55. .PP
  56. The output file path to save the decrypted credential secret
  57. information.
  58. .RE
  59. .IP \[bu] 2
  60. \f[B]\-\-cphash\f[]=\f[I]FILE\f[]
  61. .RS 2
  62. .PP
  63. File path to record the hash of the command parameters.
  64. This is commonly termed as cpHash.
  65. NOTE: When this option is selected, The tool will not actually execute
  66. the command, it simply returns a cpHash, unless rphash is also required.
  67. .RE
  68. .IP \[bu] 2
  69. \f[B]\-\-rphash\f[]=\f[I]FILE\f[]
  70. .RS 2
  71. .PP
  72. File path to record the hash of the response parameters.
  73. This is commonly termed as rpHash.
  74. .RE
  75. .IP \[bu] 2
  76. \f[B]\-S\f[], \f[B]\-\-session\f[]=\f[I]FILE\f[]:
  77. .RS 2
  78. .PP
  79. The session created using \f[B]tpm2_startauthsession\f[].
  80. This can be used to specify an auxiliary session for auditing and or
  81. encryption/decryption of the parameters.
  82. .RE
  83. .SS References
  84. .SH Context Object Format
  85. .PP
  86. The type of a context object, whether it is a handle or file name, is
  87. determined according to the following logic \f[I]in\-order\f[]:
  88. .IP \[bu] 2
  89. If the argument is a file path, then the file is loaded as a restored
  90. TPM transient object.
  91. .IP \[bu] 2
  92. If the argument is a \f[I]prefix\f[] match on one of:
  93. .RS 2
  94. .IP \[bu] 2
  95. owner: the owner hierarchy
  96. .IP \[bu] 2
  97. platform: the platform hierarchy
  98. .IP \[bu] 2
  99. endorsement: the endorsement hierarchy
  100. .IP \[bu] 2
  101. lockout: the lockout control persistent object
  102. .RE
  103. .IP \[bu] 2
  104. If the argument argument can be loaded as a number it will be treat as a
  105. handle, e.g.
  106. 0x81010013 and used directly.\f[I]OBJECT\f[].
  107. .SH Authorization Formatting
  108. .PP
  109. Authorization for use of an object in TPM2.0 can come in 3 different
  110. forms: 1.
  111. Password 2.
  112. HMAC 3.
  113. Sessions
  114. .PP
  115. \f[B]NOTE:\f[] "Authorizations default to the \f[B]EMPTY PASSWORD\f[]
  116. when not specified".
  117. .SS Passwords
  118. .PP
  119. Passwords are interpreted in the following forms below using prefix
  120. identifiers.
  121. .PP
  122. \f[B]Note\f[]: By default passwords are assumed to be in the string form
  123. when they do not have a prefix.
  124. .SS String
  125. .PP
  126. A string password, specified by prefix "str:" or it\[aq]s absence (raw
  127. string without prefix) is not interpreted, and is directly used for
  128. authorization.
  129. .SS Examples
  130. .IP
  131. .nf
  132. \f[C]
  133. foobar
  134. str:foobar
  135. \f[]
  136. .fi
  137. .SS Hex\-string
  138. .PP
  139. A hex\-string password, specified by prefix "hex:" is converted from a
  140. hexidecimal form into a byte array form, thus allowing passwords with
  141. non\-printable and/or terminal un\-friendly characters.
  142. .SS Example
  143. .IP
  144. .nf
  145. \f[C]
  146. hex:0x1122334455667788
  147. \f[]
  148. .fi
  149. .SS File
  150. .PP
  151. A file based password, specified be prefix "file:" should be the path of
  152. a file containing the password to be read by the tool or a "\-" to use
  153. stdin.
  154. Storing passwords in files prevents information leakage, passwords
  155. passed as options can be read from the process list or common shell
  156. history features.
  157. .SS Examples
  158. .IP
  159. .nf
  160. \f[C]
  161. #\ to\ use\ stdin\ and\ be\ prompted
  162. file:\-
  163. #\ to\ use\ a\ file\ from\ a\ path
  164. file:path/to/password/file
  165. #\ to\ echo\ a\ password\ via\ stdin:
  166. echo\ foobar\ |\ tpm2_tool\ \-p\ file:\-
  167. #\ to\ use\ a\ bash\ here\-string\ via\ stdin:
  168. tpm2_tool\ \-p\ file:\-\ <<<\ foobar
  169. \f[]
  170. .fi
  171. .SS Sessions
  172. .PP
  173. When using a policy session to authorize the use of an object, prefix
  174. the option argument with the \f[I]session\f[] keyword.
  175. Then indicate a path to a session file that was created with
  176. tpm2_startauthsession(1).
  177. Optionally, if the session requires an auth value to be sent with the
  178. session handle (eg policy password), then append a + and a string as
  179. described in the \f[B]Passwords\f[] section.
  180. .SS Examples
  181. .PP
  182. To use a session context file called \f[I]session.ctx\f[].
  183. .IP
  184. .nf
  185. \f[C]
  186. session:session.ctx
  187. \f[]
  188. .fi
  189. .PP
  190. To use a session context file called \f[I]session.ctx\f[] \f[B]AND\f[]
  191. send the authvalue mypassword.
  192. .IP
  193. .nf
  194. \f[C]
  195. session:session.ctx+mypassword
  196. \f[]
  197. .fi
  198. .PP
  199. To use a session context file called \f[I]session.ctx\f[] \f[B]AND\f[]
  200. send the \f[I]HEX\f[] authvalue 0x11223344.
  201. .IP
  202. .nf
  203. \f[C]
  204. session:session.ctx+hex:11223344
  205. \f[]
  206. .fi
  207. .SS PCR Authorizations
  208. .PP
  209. You can satisfy a PCR policy using the "pcr:" prefix and the PCR
  210. minilanguage.
  211. The PCR minilanguage is as follows:
  212. \f[C]<pcr\-spec>=<raw\-pcr\-file>\f[]
  213. .PP
  214. The PCR spec is documented in in the section "PCR bank specifiers".
  215. .PP
  216. The \f[C]raw\-pcr\-file\f[] is an \f[B]optional\f[] the output of the
  217. raw PCR contents as returned by \f[I]tpm2_pcrread(1)\f[].
  218. .PP
  219. PCR bank specifiers (common/pcr.md)
  220. .SS Examples
  221. .PP
  222. To satisfy a PCR policy of sha256 on banks 0, 1, 2 and 3 use a specifier
  223. of:
  224. .IP
  225. .nf
  226. \f[C]
  227. pcr:sha256:0,1,2,3
  228. \f[]
  229. .fi
  230. .PP
  231. specifying \f[I]AUTH\f[].
  232. .SH COMMON OPTIONS
  233. .PP
  234. This collection of options are common to many programs and provide
  235. information that many users may expect.
  236. .IP \[bu] 2
  237. \f[B]\-h\f[], \f[B]\-\-help=[man|no\-man]\f[]: Display the tools
  238. manpage.
  239. By default, it attempts to invoke the manpager for the tool, however, on
  240. failure will output a short tool summary.
  241. This is the same behavior if the "man" option argument is specified,
  242. however if explicit "man" is requested, the tool will provide errors
  243. from man on stderr.
  244. If the "no\-man" option if specified, or the manpager fails, the short
  245. options will be output to stdout.
  246. .RS 2
  247. .PP
  248. To successfully use the manpages feature requires the manpages to be
  249. installed or on \f[I]MANPATH\f[], See man(1) for more details.
  250. .RE
  251. .IP \[bu] 2
  252. \f[B]\-v\f[], \f[B]\-\-version\f[]: Display version information for this
  253. tool, supported tctis and exit.
  254. .IP \[bu] 2
  255. \f[B]\-V\f[], \f[B]\-\-verbose\f[]: Increase the information that the
  256. tool prints to the console during its execution.
  257. When using this option the file and line number are printed.
  258. .IP \[bu] 2
  259. \f[B]\-Q\f[], \f[B]\-\-quiet\f[]: Silence normal tool output to stdout.
  260. .IP \[bu] 2
  261. \f[B]\-Z\f[], \f[B]\-\-enable\-errata\f[]: Enable the application of
  262. errata fixups.
  263. Useful if an errata fixup needs to be applied to commands sent to the
  264. TPM.
  265. Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.
  266. information many users may expect.
  267. .SH TCTI Configuration
  268. .PP
  269. The TCTI or "Transmission Interface" is the communication mechanism with
  270. the TPM.
  271. TCTIs can be changed for communication with TPMs across different
  272. mediums.
  273. .PP
  274. To control the TCTI, the tools respect:
  275. .IP "1." 3
  276. The command line option \f[B]\-T\f[] or \f[B]\-\-tcti\f[]
  277. .IP "2." 3
  278. The environment variable: \f[I]TPM2TOOLS_TCTI\f[].
  279. .PP
  280. \f[B]Note:\f[] The command line option always overrides the environment
  281. variable.
  282. .PP
  283. The current known TCTIs are:
  284. .IP \[bu] 2
  285. tabrmd \- The resource manager, called
  286. tabrmd (https://github.com/tpm2-software/tpm2-abrmd).
  287. Note that tabrmd and abrmd as a tcti name are synonymous.
  288. .IP \[bu] 2
  289. mssim \- Typically used for communicating to the TPM software simulator.
  290. .IP \[bu] 2
  291. device \- Used when talking directly to a TPM device file.
  292. .IP \[bu] 2
  293. none \- Do not initalize a connection with the TPM.
  294. Some tools allow for off\-tpm options and thus support not using a TCTI.
  295. Tools that do not support it will error when attempted to be used
  296. without a TCTI connection.
  297. Does not support \f[I]ANY\f[] options and \f[I]MUST BE\f[] presented as
  298. the exact text of "none".
  299. .PP
  300. The arguments to either the command line option or the environment
  301. variable are in the form:
  302. .PP
  303. \f[C]<tcti\-name>:<tcti\-option\-config>\f[]
  304. .PP
  305. Specifying an empty string for either the \f[C]<tcti\-name>\f[] or
  306. \f[C]<tcti\-option\-config>\f[] results in the default being used for
  307. that portion respectively.
  308. .SS TCTI Defaults
  309. .PP
  310. When a TCTI is not specified, the default TCTI is searched for using
  311. \f[I]dlopen(3)\f[] semantics.
  312. The tools will search for \f[I]tabrmd\f[], \f[I]device\f[] and
  313. \f[I]mssim\f[] TCTIs \f[B]IN THAT ORDER\f[] and \f[B]USE THE FIRST ONE
  314. FOUND\f[].
  315. You can query what TCTI will be chosen as the default by using the
  316. \f[B]\-v\f[] option to print the version information.
  317. The "default\-tcti" key\-value pair will indicate which of the
  318. aforementioned TCTIs is the default.
  319. .SS Custom TCTIs
  320. .PP
  321. Any TCTI that implements the dynamic TCTI interface can be loaded.
  322. The tools internally use \f[I]dlopen(3)\f[], and the raw
  323. \f[I]tcti\-name\f[] value is used for the lookup.
  324. Thus, this could be a path to the shared library, or a library name as
  325. understood by \f[I]dlopen(3)\f[] semantics.
  326. .SH TCTI OPTIONS
  327. .PP
  328. This collection of options are used to configure the various known TCTI
  329. modules available:
  330. .IP \[bu] 2
  331. \f[B]device\f[]: For the device TCTI, the TPM character device file for
  332. use by the device TCTI can be specified.
  333. The default is \f[I]/dev/tpm0\f[].
  334. .RS 2
  335. .PP
  336. Example: \f[B]\-T device:/dev/tpm0\f[] or \f[B]export
  337. \f[I]TPM2TOOLS_TCTI\f[]="device:/dev/tpm0"\f[]
  338. .RE
  339. .IP \[bu] 2
  340. \f[B]mssim\f[]: For the mssim TCTI, the domain name or IP address and
  341. port number used by the simulator can be specified.
  342. The default are 127.0.0.1 and 2321.
  343. .RS 2
  344. .PP
  345. Example: \f[B]\-T mssim:host=localhost,port=2321\f[] or \f[B]export
  346. \f[I]TPM2TOOLS_TCTI\f[]="mssim:host=localhost,port=2321"\f[]
  347. .RE
  348. .IP \[bu] 2
  349. \f[B]abrmd\f[]: For the abrmd TCTI, the configuration string format is a
  350. series of simple key value pairs separated by a \[aq],\[aq] character.
  351. Each key and value string are separated by a \[aq]=\[aq] character.
  352. .RS 2
  353. .IP \[bu] 2
  354. TCTI abrmd supports two keys:
  355. .RS 2
  356. .IP "1." 3
  357. \[aq]bus_name\[aq] : The name of the tabrmd service on the bus (a
  358. string).
  359. .IP "2." 3
  360. \[aq]bus_type\[aq] : The type of the dbus instance (a string) limited to
  361. \[aq]session\[aq] and \[aq]system\[aq].
  362. .RE
  363. .PP
  364. Specify the tabrmd tcti name and a config string of
  365. \f[C]bus_name=com.example.FooBar\f[]:
  366. .PP
  367. \f[C]\\\-\-tcti=tabrmd:bus_name=com.example.FooBar\f[]
  368. .PP
  369. Specify the default (abrmd) tcti and a config string of
  370. \f[C]bus_type=session\f[]:
  371. .PP
  372. \f[C]\\\-\-tcti:bus_type=session\f[]
  373. .PP
  374. \f[B]NOTE\f[]: abrmd and tabrmd are synonymous.
  375. the various known TCTI modules.
  376. .RE
  377. .SH EXAMPLES
  378. .IP
  379. .nf
  380. \f[C]
  381. echo\ "12345678"\ >\ secret.data
  382. tpm2_createek\ \-Q\ \-c\ 0x81010001\ \-G\ rsa\ \-u\ ek.pub
  383. tpm2_createak\ \-C\ 0x81010001\ \-c\ ak.ctx\ \-G\ rsa\ \-g\ sha256\ \-s\ rsassa\ \-u\ ak.pub\ \\
  384. \-n\ ak.name\ \-p\ akpass>\ ak.out
  385. file_size=`stat\ \-\-printf="%s"\ ak.name`
  386. loaded_key_name=`cat\ ak.name\ |\ xxd\ \-p\ \-c\ $file_size`
  387. tpm2_makecredential\ \-Q\ \-e\ ek.pub\ \ \-s\ secret.data\ \-n\ $loaded_key_name\ \\
  388. \-o\ mkcred.out
  389. tpm2_startauthsession\ \-\-policy\-session\ \-S\ session.ctx
  390. tpm2_policysecret\ \-S\ session.ctx\ \-c\ e
  391. tpm2_activatecredential\ \-Q\ \-c\ ak.ctx\ \-C\ 0x81010001\ \-i\ mkcred.out\ \\
  392. \-o\ actcred.out\ \-p\ akpass\ \-P"session:session.ctx"
  393. tpm2_flushcontext\ session.ctx
  394. \f[]
  395. .fi
  396. .SH Returns
  397. .PP
  398. Tools can return any of the following codes:
  399. .IP \[bu] 2
  400. 0 \- Success.
  401. .IP \[bu] 2
  402. 1 \- General non\-specific error.
  403. .IP \[bu] 2
  404. 2 \- Options handling error.
  405. .IP \[bu] 2
  406. 3 \- Authentication error.
  407. .IP \[bu] 2
  408. 4 \- TCTI related error.
  409. .IP \[bu] 2
  410. 5 \- Non supported scheme.
  411. Applicable to tpm2_testparams.
  412. .SH BUGS
  413. .PP
  414. Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
  415. .SH HELP
  416. .PP
  417. See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)