ESYS_CONTEXT.3 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. .TH "ESYS_CONTEXT" 3 "Fri Oct 7 2022" "Version 3.2.0" "tpm2-tss" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. ESYS_CONTEXT
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .SS "Typedefs"
  10. .in +1c
  11. .ti -1c
  12. .RI "typedef struct \fBESYS_CONTEXT\fP \fBESYS_CONTEXT\fP"
  13. .br
  14. .in -1c
  15. .SS "Functions"
  16. .in +1c
  17. .ti -1c
  18. .RI "TSS2_RC \fBEsys_Initialize\fP (\fBESYS_CONTEXT\fP **esys_context, TSS2_TCTI_CONTEXT *tcti, TSS2_ABI_VERSION *abiVersion)"
  19. .br
  20. .ti -1c
  21. .RI "TSS2_RC \fBEsys_GetTcti\fP (\fBESYS_CONTEXT\fP *esys_context, TSS2_TCTI_CONTEXT **tcti)"
  22. .br
  23. .ti -1c
  24. .RI "TSS2_RC \fBEsys_GetPollHandles\fP (\fBESYS_CONTEXT\fP *esys_context, TSS2_TCTI_POLL_HANDLE **handles, size_t *count)"
  25. .br
  26. .ti -1c
  27. .RI "TSS2_RC \fBEsys_SetTimeout\fP (\fBESYS_CONTEXT\fP *esys_context, int32_t timeout)"
  28. .br
  29. .ti -1c
  30. .RI "TSS2_RC \fBEsys_GetSysContext\fP (\fBESYS_CONTEXT\fP *esys_context, TSS2_SYS_CONTEXT **sys_context)"
  31. .br
  32. .ti -1c
  33. .RI "void \fBEsys_Free\fP (void *__ptr)"
  34. .br
  35. .in -1c
  36. .SH "Detailed Description"
  37. .PP
  38. An \fBESYS_CONTEXT\fP holds tdata for the connection to the TPM as well as the metadata for TPM Resource; such as Transient key, Persistent objects, NV spaces, Sessions or PCRs\&.
  39. .SH "Typedef Documentation"
  40. .PP
  41. .SS "\fBESYS_CONTEXT\fP"
  42. Reference to the \fBESYS_CONTEXT\fP that holds data for the connection to the TPM as well as the metadata for TPM Resource; such as Transient key, Persistent objects, NV spaces, Sessions or PCRs\&.
  43. .SH "Function Documentation"
  44. .PP
  45. .SS "TSS2_RC Esys_GetPollHandles (\fBESYS_CONTEXT\fP * esys_context, TSS2_TCTI_POLL_HANDLE ** handles, size_t * count)"
  46. Return the poll handles of the used TCTI\&.
  47. .PP
  48. The connection to the TPM is held using a TCTI\&. These may optionally provide handles that can be used to poll for incoming data\&. This is useful when using the asynchronous function of ESAPI in an event-loop model\&.
  49. .PP
  50. \fBParameters:\fP
  51. .RS 4
  52. \fIesys_context\fP [in] The \fBESYS_CONTEXT\fP\&.
  53. .br
  54. \fIhandles\fP [out] The poll handles (callee-allocated, use free())
  55. .br
  56. \fIcount\fP [out] The number of poll handles\&.
  57. .RE
  58. .PP
  59. \fBReturn values:\fP
  60. .RS 4
  61. \fITSS2_RC_SUCCESS\fP on Success\&.
  62. .br
  63. \fITSS2_ESYS_RC_BAD_REFERENCE\fP if esysContext, handles or count is NULL\&.
  64. .br
  65. \fITSS2_RCs\fP produced by lower layers of the software stack\&.
  66. .RE
  67. .PP
  68. .SS "TSS2_RC Esys_GetSysContext (\fBESYS_CONTEXT\fP * esys_context, TSS2_SYS_CONTEXT ** sys_context)"
  69. Helper function that returns sys contest from the give esys context\&.
  70. .PP
  71. Function returns sys contest from the give esys context\&.
  72. .PP
  73. \fBParameters:\fP
  74. .RS 4
  75. \fIesys_context\fP [in] ESYS context\&.
  76. .br
  77. \fIsys_context\fP [out] SYS context\&.
  78. .RE
  79. .PP
  80. \fBReturn values:\fP
  81. .RS 4
  82. \fITSS2_RC_SUCCESS\fP on Success\&.
  83. .br
  84. \fITSS2_ESYS_RC_BAD_REFERENCE\fP if esys_context of sys_context are NULL\&.
  85. .RE
  86. .PP
  87. .SS "TSS2_RC Esys_GetTcti (\fBESYS_CONTEXT\fP * esys_context, TSS2_TCTI_CONTEXT ** tcti)"
  88. Return the used TCTI context\&.
  89. .PP
  90. If a tcti context was passed into Esys_Initialize then this tcti context is return\&. If NULL was passed in, then NULL will be returned\&. This function is useful before Esys_Finalize to retrieve the tcti context and perform a clean Tss2_Tcti_Finalize\&.
  91. .PP
  92. \fBParameters:\fP
  93. .RS 4
  94. \fIesys_context\fP [in] The \fBESYS_CONTEXT\fP\&.
  95. .br
  96. \fItcti\fP [out] The TCTI context used to connect to the TPM (may be NULL)\&.
  97. .RE
  98. .PP
  99. \fBReturn values:\fP
  100. .RS 4
  101. \fITSS2_RC_SUCCESS\fP on Success\&.
  102. .br
  103. \fITSS2_ESYS_RC_BAD_REFERENCE\fP if esysContext or tcti is NULL\&.
  104. .RE
  105. .PP
  106. .SS "TSS2_RC Esys_Initialize (\fBESYS_CONTEXT\fP ** esys_context, TSS2_TCTI_CONTEXT * tcti, TSS2_ABI_VERSION * abiVersion)"
  107. Initialize an \fBESYS_CONTEXT\fP for further use\&.
  108. .PP
  109. Initialize an \fBESYS_CONTEXT\fP that holds all the state and metadata information during an interaction with the TPM\&. If not specified, load a TCTI in this order: Library libtss2-tcti-default\&.so (link to the preferred TCTI) Library libtss2-tcti-tabrmd\&.so (tabrmd) Device /dev/tpmrm0 (kernel resident resource manager) Device /dev/tpm0 (hardware TPM) TCP socket localhost:2321 (TPM simulator)
  110. .PP
  111. \fBParameters:\fP
  112. .RS 4
  113. \fIesys_context\fP [out] The \fBESYS_CONTEXT\fP\&.
  114. .br
  115. \fItcti\fP [in] The TCTI context used to connect to the TPM (may be NULL)\&.
  116. .br
  117. \fIabiVersion\fP [in,out] The abi version to check and the abi version supported by this implementation (may be NULL)\&.
  118. .RE
  119. .PP
  120. \fBReturn values:\fP
  121. .RS 4
  122. \fITSS2_ESYS_RC_SUCCESS\fP if the function call was a success\&.
  123. .br
  124. \fITSS2_ESYS_RC_BAD_REFERENCE\fP if esysContext is NULL\&.
  125. .br
  126. \fITSS2_ESYS_RC_MEMORY\fP if the ESAPI cannot allocate enough memory to create the context\&.
  127. .br
  128. \fITSS2_RCs\fP produced by lower layers of the software stack may be returned to the caller unaltered unless handled internally\&.
  129. .RE
  130. .PP
  131. .SS "TSS2_RC Esys_SetTimeout (\fBESYS_CONTEXT\fP * esys_context, int32_t timeout)"
  132. Set the timeout of Esys asynchronous functions\&.
  133. .PP
  134. Sets the timeout for the _finish() functions in the asynchronous versions of the Esys commands\&.
  135. .PP
  136. \fBParameters:\fP
  137. .RS 4
  138. \fIesys_context\fP [in] The \fBESYS_CONTEXT\fP\&.
  139. .br
  140. \fItimeout\fP [in] The timeout in ms or -1 to block indefinately\&.
  141. .RE
  142. .PP
  143. \fBReturn values:\fP
  144. .RS 4
  145. \fITSS2_RC_SUCCESS\fP on Success\&.
  146. .br
  147. \fITSS2_ESYS_RC_BAD_REFERENCE\fP if esysContext is NULL\&.
  148. .RE
  149. .PP
  150. .SH "Author"
  151. .PP
  152. Generated automatically by Doxygen for tpm2-tss from the source code\&.