tpm2_makecredential.1 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. .\" Automatically generated by Pandoc 1.19.2.4
  2. .\"
  3. .TH "tpm2_makecredential" "1" "" "tpm2\-tools" "General Commands Manual"
  4. .hy
  5. .SH NAME
  6. .PP
  7. \f[B]tpm2_makecredential\f[](1) \- Generate the
  8. encrypted\-user\-chosen\-data and the
  9. wrapped\-secret\-data\-encryption\-key for the privacy\-sensitive
  10. credentialing process of a TPM object.
  11. .SH SYNOPSIS
  12. .PP
  13. \f[B]tpm2_makecredential\f[] [\f[I]OPTIONS\f[]]
  14. .SH DESCRIPTION
  15. .PP
  16. \f[B]tpm2_makecredential\f[](1) \- The TPM supports a privacy preserving
  17. protocol for distributing credentials for keys on a TPM.
  18. The process guarantees that the credentialed\-TPM\-object(AIK) is loaded
  19. on the same TPM as a well\-known public\-key\-object(EK) without
  20. knowledge of the specific public properties of the
  21. credentialed\-TPM\-object(AIK).
  22. The privacy is guaranteed due to the fact that only the name of the
  23. credentialed\-TPM\-object(AIK) is shared and not the
  24. credentialed\-TPM\-object\[aq]s public key itself.
  25. .PP
  26. Make\-credential is the first step in this process where in after
  27. receiving the public\-key\-object(EK) public key of the TPM and the name
  28. of the credentialed\-TPM\-object(AIK), an encrypted\-user\-chosen\-data
  29. is generated and the secret\-data\-encryption\-key is generated and
  30. wrapped using cryptographic processes specific to credential activation
  31. that guarantees that the credentialed\-TPM\-object(AIK) is loaded on the
  32. TPM with the well\-known public\-key\-object(EK).
  33. .PP
  34. \f[B]tpm2_makecredential\f[] can be used to generate the
  35. encrypted\-user\-chosen\-data and the wrapped
  36. secret\-data\-encryption\-key without a TPM by using the \f[B]none\f[]
  37. TCTI option.
  38. .SH OPTIONS
  39. .IP \[bu] 2
  40. \f[B]\-e\f[], \f[B]\-\-encryption\-key\f[]=\f[I]FILE\f[]:
  41. .RS 2
  42. .PP
  43. \f[B]DEPRECATED\f[], use \f[B]\-u\f[] or \f[B]\-\-public\f[] instead.
  44. .RE
  45. .IP \[bu] 2
  46. \f[B]\-u\f[], \f[B]\-\-public\f[]=\f[I]FILE\f[]:
  47. .RS 2
  48. .PP
  49. A TPM public key which was used to wrap the seed.
  50. NOTE: This option is same as \f[B]\-e\f[] and is added to make it
  51. similar with other tools specifying the public key.
  52. The old option is retained for backwards compatibility.
  53. .RE
  54. .IP \[bu] 2
  55. \f[B]\-G\f[], \f[B]\-\-key\-algorithm\f[]=\f[I]ALGORITHM\f[]:
  56. .RS 2
  57. .PP
  58. The key algorithm associated with TPM public key.
  59. Specify either RSA/ ECC.
  60. When this option is used, input public key is expected to be in PEM
  61. format and the default TCG EK template is used for the key properties.
  62. .RE
  63. .IP \[bu] 2
  64. \f[B]\-s\f[], \f[B]\-\-secret\f[]=\f[I]FILE\f[] or \f[I]STDIN\f[]:
  65. .RS 2
  66. .PP
  67. The secret which will be protected by the key derived from the random
  68. seed.
  69. It can be specified as a file or passed from stdin.
  70. .RE
  71. .IP \[bu] 2
  72. \f[B]\-n\f[], \f[B]\-\-name\f[]=\f[I]FILE\f[]:
  73. .RS 2
  74. .PP
  75. The name of the key for which certificate is to be created.
  76. .RE
  77. .IP \[bu] 2
  78. \f[B]\-o\f[], \f[B]\-\-credential\-blob\f[]=\f[I]FILE\f[]:
  79. .RS 2
  80. .PP
  81. The output file path, recording the encrypted\-user\-chosen\-data and
  82. the wrapped secret\-data\-encryption\-key.
  83. .RE
  84. .SH COMMON OPTIONS
  85. .PP
  86. This collection of options are common to many programs and provide
  87. information that many users may expect.
  88. .IP \[bu] 2
  89. \f[B]\-h\f[], \f[B]\-\-help=[man|no\-man]\f[]: Display the tools
  90. manpage.
  91. By default, it attempts to invoke the manpager for the tool, however, on
  92. failure will output a short tool summary.
  93. This is the same behavior if the "man" option argument is specified,
  94. however if explicit "man" is requested, the tool will provide errors
  95. from man on stderr.
  96. If the "no\-man" option if specified, or the manpager fails, the short
  97. options will be output to stdout.
  98. .RS 2
  99. .PP
  100. To successfully use the manpages feature requires the manpages to be
  101. installed or on \f[I]MANPATH\f[], See man(1) for more details.
  102. .RE
  103. .IP \[bu] 2
  104. \f[B]\-v\f[], \f[B]\-\-version\f[]: Display version information for this
  105. tool, supported tctis and exit.
  106. .IP \[bu] 2
  107. \f[B]\-V\f[], \f[B]\-\-verbose\f[]: Increase the information that the
  108. tool prints to the console during its execution.
  109. When using this option the file and line number are printed.
  110. .IP \[bu] 2
  111. \f[B]\-Q\f[], \f[B]\-\-quiet\f[]: Silence normal tool output to stdout.
  112. .IP \[bu] 2
  113. \f[B]\-Z\f[], \f[B]\-\-enable\-errata\f[]: Enable the application of
  114. errata fixups.
  115. Useful if an errata fixup needs to be applied to commands sent to the
  116. TPM.
  117. Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.
  118. .SH TCTI Configuration
  119. .PP
  120. The TCTI or "Transmission Interface" is the communication mechanism with
  121. the TPM.
  122. TCTIs can be changed for communication with TPMs across different
  123. mediums.
  124. .PP
  125. To control the TCTI, the tools respect:
  126. .IP "1." 3
  127. The command line option \f[B]\-T\f[] or \f[B]\-\-tcti\f[]
  128. .IP "2." 3
  129. The environment variable: \f[I]TPM2TOOLS_TCTI\f[].
  130. .PP
  131. \f[B]Note:\f[] The command line option always overrides the environment
  132. variable.
  133. .PP
  134. The current known TCTIs are:
  135. .IP \[bu] 2
  136. tabrmd \- The resource manager, called
  137. tabrmd (https://github.com/tpm2-software/tpm2-abrmd).
  138. Note that tabrmd and abrmd as a tcti name are synonymous.
  139. .IP \[bu] 2
  140. mssim \- Typically used for communicating to the TPM software simulator.
  141. .IP \[bu] 2
  142. device \- Used when talking directly to a TPM device file.
  143. .IP \[bu] 2
  144. none \- Do not initalize a connection with the TPM.
  145. Some tools allow for off\-tpm options and thus support not using a TCTI.
  146. Tools that do not support it will error when attempted to be used
  147. without a TCTI connection.
  148. Does not support \f[I]ANY\f[] options and \f[I]MUST BE\f[] presented as
  149. the exact text of "none".
  150. .PP
  151. The arguments to either the command line option or the environment
  152. variable are in the form:
  153. .PP
  154. \f[C]<tcti\-name>:<tcti\-option\-config>\f[]
  155. .PP
  156. Specifying an empty string for either the \f[C]<tcti\-name>\f[] or
  157. \f[C]<tcti\-option\-config>\f[] results in the default being used for
  158. that portion respectively.
  159. .SS TCTI Defaults
  160. .PP
  161. When a TCTI is not specified, the default TCTI is searched for using
  162. \f[I]dlopen(3)\f[] semantics.
  163. The tools will search for \f[I]tabrmd\f[], \f[I]device\f[] and
  164. \f[I]mssim\f[] TCTIs \f[B]IN THAT ORDER\f[] and \f[B]USE THE FIRST ONE
  165. FOUND\f[].
  166. You can query what TCTI will be chosen as the default by using the
  167. \f[B]\-v\f[] option to print the version information.
  168. The "default\-tcti" key\-value pair will indicate which of the
  169. aforementioned TCTIs is the default.
  170. .SS Custom TCTIs
  171. .PP
  172. Any TCTI that implements the dynamic TCTI interface can be loaded.
  173. The tools internally use \f[I]dlopen(3)\f[], and the raw
  174. \f[I]tcti\-name\f[] value is used for the lookup.
  175. Thus, this could be a path to the shared library, or a library name as
  176. understood by \f[I]dlopen(3)\f[] semantics.
  177. .SH TCTI OPTIONS
  178. .PP
  179. This collection of options are used to configure the various known TCTI
  180. modules available:
  181. .IP \[bu] 2
  182. \f[B]device\f[]: For the device TCTI, the TPM character device file for
  183. use by the device TCTI can be specified.
  184. The default is \f[I]/dev/tpm0\f[].
  185. .RS 2
  186. .PP
  187. Example: \f[B]\-T device:/dev/tpm0\f[] or \f[B]export
  188. \f[I]TPM2TOOLS_TCTI\f[]="device:/dev/tpm0"\f[]
  189. .RE
  190. .IP \[bu] 2
  191. \f[B]mssim\f[]: For the mssim TCTI, the domain name or IP address and
  192. port number used by the simulator can be specified.
  193. The default are 127.0.0.1 and 2321.
  194. .RS 2
  195. .PP
  196. Example: \f[B]\-T mssim:host=localhost,port=2321\f[] or \f[B]export
  197. \f[I]TPM2TOOLS_TCTI\f[]="mssim:host=localhost,port=2321"\f[]
  198. .RE
  199. .IP \[bu] 2
  200. \f[B]abrmd\f[]: For the abrmd TCTI, the configuration string format is a
  201. series of simple key value pairs separated by a \[aq],\[aq] character.
  202. Each key and value string are separated by a \[aq]=\[aq] character.
  203. .RS 2
  204. .IP \[bu] 2
  205. TCTI abrmd supports two keys:
  206. .RS 2
  207. .IP "1." 3
  208. \[aq]bus_name\[aq] : The name of the tabrmd service on the bus (a
  209. string).
  210. .IP "2." 3
  211. \[aq]bus_type\[aq] : The type of the dbus instance (a string) limited to
  212. \[aq]session\[aq] and \[aq]system\[aq].
  213. .RE
  214. .PP
  215. Specify the tabrmd tcti name and a config string of
  216. \f[C]bus_name=com.example.FooBar\f[]:
  217. .PP
  218. \f[C]\\\-\-tcti=tabrmd:bus_name=com.example.FooBar\f[]
  219. .PP
  220. Specify the default (abrmd) tcti and a config string of
  221. \f[C]bus_type=session\f[]:
  222. .PP
  223. \f[C]\\\-\-tcti:bus_type=session\f[]
  224. .PP
  225. \f[B]NOTE\f[]: abrmd and tabrmd are synonymous.
  226. .RE
  227. .SH EXAMPLES
  228. .IP
  229. .nf
  230. \f[C]
  231. tpm2\ createek\ \-Q\ \-c\ 0x81010009\ \-G\ rsa\ \-u\ ek.pub
  232. tpm2\ createak\ \-C\ 0x81010009\ \-c\ ak.ctx\ \-G\ rsa\ \-g\ sha256\ \-s\ rsassa\ \-u\ ak.pub\ \\
  233. \-n\ ak.name\ \-p\ akpass>\ ak.out
  234. file_size=`ls\ \-l\ ak.name\ |\ awk\ {\[aq]print\ $5\[aq]}`
  235. loaded_key_name=`cat\ ak.name\ |\ xxd\ \-p\ \-c\ $file_size`
  236. tpm2\ readpublic\ \-c\ 0x81010009\ \-o\ ek.pem\ \-f\ pem\ \-Q
  237. echo\ "12345678"\ |\ tpm2\ makecredential\ \-Q\ \-u\ ek.pem\ \-s\ \-\ \-n\ $loaded_key_name\ \\
  238. \-o\ mkcred.out\ \-G\ rsa
  239. \f[]
  240. .fi
  241. .SH Returns
  242. .PP
  243. Tools can return any of the following codes:
  244. .IP \[bu] 2
  245. 0 \- Success.
  246. .IP \[bu] 2
  247. 1 \- General non\-specific error.
  248. .IP \[bu] 2
  249. 2 \- Options handling error.
  250. .IP \[bu] 2
  251. 3 \- Authentication error.
  252. .IP \[bu] 2
  253. 4 \- TCTI related error.
  254. .IP \[bu] 2
  255. 5 \- Non supported scheme.
  256. Applicable to tpm2_testparams.
  257. .SH BUGS
  258. .PP
  259. Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
  260. .SH HELP
  261. .PP
  262. See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)