tpm2_policytemplate.1 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. .\" Automatically generated by Pandoc 1.19.2.4
  2. .\"
  3. .TH "tpm2_policytemplate" "1" "" "tpm2\-tools" "General Commands Manual"
  4. .hy
  5. .SH NAME
  6. .PP
  7. \f[B]tpm2_policytemplate\f[](1) \- Couples a policy with public template
  8. data digest of an object.
  9. .SH SYNOPSIS
  10. .PP
  11. \f[B]tpm2_policytemplate\f[] [\f[I]OPTIONS\f[]]
  12. .SH DESCRIPTION
  13. .PP
  14. \f[B]tpm2_policytemplate\f[](1) \- Couples a policy with public template
  15. data digest of an object.
  16. This is a deferred assertion where the hash of the public template data
  17. of an object is checked against the one specified in the policy.
  18. .SH OPTIONS
  19. .IP \[bu] 2
  20. \f[B]\-L\f[], \f[B]\-\-policy\f[]=\f[I]FILE\f[]:
  21. .RS 2
  22. .PP
  23. File to save the compounded policy digest.
  24. .RE
  25. .IP \[bu] 2
  26. \f[B]\-S\f[], \f[B]\-\-session\f[]=\f[I]FILE\f[]:
  27. .RS 2
  28. .PP
  29. The policy session file generated via the \f[B]\-S\f[] option to
  30. \f[B]tpm2_startauthsession\f[](1).
  31. .RE
  32. .IP \[bu] 2
  33. \f[B]\-\-template\-hash\f[]=\f[I]FILE\f[]:
  34. .RS 2
  35. .PP
  36. The file containing the hash of the public template of the object.
  37. .RE
  38. .SS References
  39. .SH COMMON OPTIONS
  40. .PP
  41. This collection of options are common to many programs and provide
  42. information that many users may expect.
  43. .IP \[bu] 2
  44. \f[B]\-h\f[], \f[B]\-\-help=[man|no\-man]\f[]: Display the tools
  45. manpage.
  46. By default, it attempts to invoke the manpager for the tool, however, on
  47. failure will output a short tool summary.
  48. This is the same behavior if the "man" option argument is specified,
  49. however if explicit "man" is requested, the tool will provide errors
  50. from man on stderr.
  51. If the "no\-man" option if specified, or the manpager fails, the short
  52. options will be output to stdout.
  53. .RS 2
  54. .PP
  55. To successfully use the manpages feature requires the manpages to be
  56. installed or on \f[I]MANPATH\f[], See man(1) for more details.
  57. .RE
  58. .IP \[bu] 2
  59. \f[B]\-v\f[], \f[B]\-\-version\f[]: Display version information for this
  60. tool, supported tctis and exit.
  61. .IP \[bu] 2
  62. \f[B]\-V\f[], \f[B]\-\-verbose\f[]: Increase the information that the
  63. tool prints to the console during its execution.
  64. When using this option the file and line number are printed.
  65. .IP \[bu] 2
  66. \f[B]\-Q\f[], \f[B]\-\-quiet\f[]: Silence normal tool output to stdout.
  67. .IP \[bu] 2
  68. \f[B]\-Z\f[], \f[B]\-\-enable\-errata\f[]: Enable the application of
  69. errata fixups.
  70. Useful if an errata fixup needs to be applied to commands sent to the
  71. TPM.
  72. Defining the environment TPM2TOOLS_ENABLE_ERRATA is equivalent.
  73. information many users may expect.
  74. .SH TCTI Configuration
  75. .PP
  76. The TCTI or "Transmission Interface" is the communication mechanism with
  77. the TPM.
  78. TCTIs can be changed for communication with TPMs across different
  79. mediums.
  80. .PP
  81. To control the TCTI, the tools respect:
  82. .IP "1." 3
  83. The command line option \f[B]\-T\f[] or \f[B]\-\-tcti\f[]
  84. .IP "2." 3
  85. The environment variable: \f[I]TPM2TOOLS_TCTI\f[].
  86. .PP
  87. \f[B]Note:\f[] The command line option always overrides the environment
  88. variable.
  89. .PP
  90. The current known TCTIs are:
  91. .IP \[bu] 2
  92. tabrmd \- The resource manager, called
  93. tabrmd (https://github.com/tpm2-software/tpm2-abrmd).
  94. Note that tabrmd and abrmd as a tcti name are synonymous.
  95. .IP \[bu] 2
  96. mssim \- Typically used for communicating to the TPM software simulator.
  97. .IP \[bu] 2
  98. device \- Used when talking directly to a TPM device file.
  99. .IP \[bu] 2
  100. none \- Do not initalize a connection with the TPM.
  101. Some tools allow for off\-tpm options and thus support not using a TCTI.
  102. Tools that do not support it will error when attempted to be used
  103. without a TCTI connection.
  104. Does not support \f[I]ANY\f[] options and \f[I]MUST BE\f[] presented as
  105. the exact text of "none".
  106. .PP
  107. The arguments to either the command line option or the environment
  108. variable are in the form:
  109. .PP
  110. \f[C]<tcti\-name>:<tcti\-option\-config>\f[]
  111. .PP
  112. Specifying an empty string for either the \f[C]<tcti\-name>\f[] or
  113. \f[C]<tcti\-option\-config>\f[] results in the default being used for
  114. that portion respectively.
  115. .SS TCTI Defaults
  116. .PP
  117. When a TCTI is not specified, the default TCTI is searched for using
  118. \f[I]dlopen(3)\f[] semantics.
  119. The tools will search for \f[I]tabrmd\f[], \f[I]device\f[] and
  120. \f[I]mssim\f[] TCTIs \f[B]IN THAT ORDER\f[] and \f[B]USE THE FIRST ONE
  121. FOUND\f[].
  122. You can query what TCTI will be chosen as the default by using the
  123. \f[B]\-v\f[] option to print the version information.
  124. The "default\-tcti" key\-value pair will indicate which of the
  125. aforementioned TCTIs is the default.
  126. .SS Custom TCTIs
  127. .PP
  128. Any TCTI that implements the dynamic TCTI interface can be loaded.
  129. The tools internally use \f[I]dlopen(3)\f[], and the raw
  130. \f[I]tcti\-name\f[] value is used for the lookup.
  131. Thus, this could be a path to the shared library, or a library name as
  132. understood by \f[I]dlopen(3)\f[] semantics.
  133. .SH TCTI OPTIONS
  134. .PP
  135. This collection of options are used to configure the various known TCTI
  136. modules available:
  137. .IP \[bu] 2
  138. \f[B]device\f[]: For the device TCTI, the TPM character device file for
  139. use by the device TCTI can be specified.
  140. The default is \f[I]/dev/tpm0\f[].
  141. .RS 2
  142. .PP
  143. Example: \f[B]\-T device:/dev/tpm0\f[] or \f[B]export
  144. \f[I]TPM2TOOLS_TCTI\f[]="device:/dev/tpm0"\f[]
  145. .RE
  146. .IP \[bu] 2
  147. \f[B]mssim\f[]: For the mssim TCTI, the domain name or IP address and
  148. port number used by the simulator can be specified.
  149. The default are 127.0.0.1 and 2321.
  150. .RS 2
  151. .PP
  152. Example: \f[B]\-T mssim:host=localhost,port=2321\f[] or \f[B]export
  153. \f[I]TPM2TOOLS_TCTI\f[]="mssim:host=localhost,port=2321"\f[]
  154. .RE
  155. .IP \[bu] 2
  156. \f[B]abrmd\f[]: For the abrmd TCTI, the configuration string format is a
  157. series of simple key value pairs separated by a \[aq],\[aq] character.
  158. Each key and value string are separated by a \[aq]=\[aq] character.
  159. .RS 2
  160. .IP \[bu] 2
  161. TCTI abrmd supports two keys:
  162. .RS 2
  163. .IP "1." 3
  164. \[aq]bus_name\[aq] : The name of the tabrmd service on the bus (a
  165. string).
  166. .IP "2." 3
  167. \[aq]bus_type\[aq] : The type of the dbus instance (a string) limited to
  168. \[aq]session\[aq] and \[aq]system\[aq].
  169. .RE
  170. .PP
  171. Specify the tabrmd tcti name and a config string of
  172. \f[C]bus_name=com.example.FooBar\f[]:
  173. .PP
  174. \f[C]\\\-\-tcti=tabrmd:bus_name=com.example.FooBar\f[]
  175. .PP
  176. Specify the default (abrmd) tcti and a config string of
  177. \f[C]bus_type=session\f[]:
  178. .PP
  179. \f[C]\\\-\-tcti:bus_type=session\f[]
  180. .PP
  181. \f[B]NOTE\f[]: abrmd and tabrmd are synonymous.
  182. the various known TCTI modules.
  183. .RE
  184. .SH EXAMPLES
  185. .SH Restrict the primary object type created under a hierarchy
  186. .IP
  187. .nf
  188. \f[C]
  189. tpm2_createprimary\ \-C\ o\ \-c\ prim.ctx\ \-\-template\-data\ template.data
  190. cat\ template.data\ |\ openssl\ dgst\ \-sha256\ \-binary\ \-out\ template.hash
  191. tpm2_startauthsession\ \-S\ session.ctx\ \-g\ sha256
  192. tpm2_policytemplate\ \-S\ session.ctx\ \-L\ policy.template\ \\
  193. \-\-template\-hash\ template.hash
  194. tpm2_flushcontext\ session.ctx
  195. tpm2_setprimarypolicy\ \-C\ o\ \-g\ sha256\ \-L\ policy.template
  196. tpm2_startauthsession\ \-S\ session.ctx\ \-g\ sha256\ \-\-policy\-session
  197. tpm2_policytemplate\ \-S\ session.ctx\ \-\-template\-hash\ template.hash
  198. tpm2_createprimary\ \-C\ o\ \-c\ prim2.ctx\ \-P\ session:session.ctx
  199. tpm2_flushcontext\ session.ctx
  200. \f[]
  201. .fi
  202. .SH Returns
  203. .PP
  204. Tools can return any of the following codes:
  205. .IP \[bu] 2
  206. 0 \- Success.
  207. .IP \[bu] 2
  208. 1 \- General non\-specific error.
  209. .IP \[bu] 2
  210. 2 \- Options handling error.
  211. .IP \[bu] 2
  212. 3 \- Authentication error.
  213. .IP \[bu] 2
  214. 4 \- TCTI related error.
  215. .IP \[bu] 2
  216. 5 \- Non supported scheme.
  217. Applicable to tpm2_testparams.
  218. .SH Limitations
  219. .PP
  220. It expects a session to be already established via
  221. \f[B]tpm2_startauthsession\f[](1) and requires one of the following:
  222. .IP \[bu] 2
  223. direct device access
  224. .IP \[bu] 2
  225. extended session support with \f[B]tpm2\-abrmd\f[].
  226. .PP
  227. Without it, most resource managers \f[B]will not\f[] save session state
  228. between command invocations.
  229. .SH BUGS
  230. .PP
  231. Github Issues (https://github.com/tpm2-software/tpm2-tools/issues)
  232. .SH HELP
  233. .PP
  234. See the Mailing List (https://lists.01.org/mailman/listinfo/tpm2)