ifapi_policy_store.3 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. .TH "ifapi_policy_store" 3 "Fri Oct 7 2022" "Version 3.2.0" "tpm2-tss" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. ifapi_policy_store
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .SS "Functions"
  10. .in +1c
  11. .ti -1c
  12. .RI "TSS2_RC \fBifapi_policy_delete\fP (\fBIFAPI_POLICY_STORE\fP *pstore, char *path)"
  13. .br
  14. .ti -1c
  15. .RI "TSS2_RC \fBifapi_policy_store_initialize\fP (\fBIFAPI_POLICY_STORE\fP *pstore, const char *config_policydir)"
  16. .br
  17. .ti -1c
  18. .RI "TSS2_RC \fBifapi_policy_store_load_async\fP (\fBIFAPI_POLICY_STORE\fP *pstore, \fBIFAPI_IO\fP *io, const char *path)"
  19. .br
  20. .ti -1c
  21. .RI "TSS2_RC \fBifapi_policy_store_load_finish\fP (\fBIFAPI_POLICY_STORE\fP *pstore, \fBIFAPI_IO\fP *io, \fBTPMS_POLICY\fP *policy)"
  22. .br
  23. .ti -1c
  24. .RI "TSS2_RC \fBifapi_policy_store_store_async\fP (\fBIFAPI_POLICY_STORE\fP *pstore, \fBIFAPI_IO\fP *io, const char *path, const \fBTPMS_POLICY\fP *policy)"
  25. .br
  26. .ti -1c
  27. .RI "TSS2_RC \fBifapi_policy_store_store_finish\fP (\fBIFAPI_POLICY_STORE\fP *pstore, \fBIFAPI_IO\fP *io)"
  28. .br
  29. .in -1c
  30. .SH "Detailed Description"
  31. .PP
  32. Provides internal fapi functions for reading and writing to the policy store\&.
  33. .SH "Function Documentation"
  34. .PP
  35. .SS "TSS2_RC ifapi_policy_delete (\fBIFAPI_POLICY_STORE\fP * pstore, char * path)"
  36. Remove file storing a policy object\&.
  37. .PP
  38. \fBParameters:\fP
  39. .RS 4
  40. \fIpstore\fP The policy directory\&.
  41. .br
  42. \fIpath\fP The relative name of the object be removed\&.
  43. .RE
  44. .PP
  45. \fBReturn values:\fP
  46. .RS 4
  47. \fITSS2_RC_SUCCESS\fP On success\&.
  48. .br
  49. \fITSS2_FAPI_RC_MEMORY\fP If memory could not be allocated\&.
  50. .br
  51. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP If no file is found in policy store\&.
  52. .br
  53. \fITSS2_FAPI_RC_IO_ERROR\fP If the file can't be removed\&.
  54. .RE
  55. .PP
  56. .SS "TSS2_RC ifapi_policy_store_initialize (\fBIFAPI_POLICY_STORE\fP * pstore, const char * config_policydir)"
  57. Store policy store parameters in the policy store context\&.
  58. .PP
  59. Also the user directory will be created if it does not exist\&.
  60. .PP
  61. \fBParameters:\fP
  62. .RS 4
  63. \fIpstore\fP The keystore to be initialized\&.
  64. .br
  65. \fIconfig_policydir\fP The configured policy directory\&.
  66. .RE
  67. .PP
  68. \fBReturn values:\fP
  69. .RS 4
  70. \fITSS2_RC_SUCCESS\fP If the keystore can be initialized\&.
  71. .br
  72. \fITSS2_FAPI_RC_IO_ERROR\fP If the policy store can't be initialized\&.
  73. .br
  74. \fITSS2_FAPI_RC_MEMORY\fP if memory could not be allocated\&.
  75. .br
  76. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  77. .br
  78. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  79. .RE
  80. .PP
  81. .SS "TSS2_RC ifapi_policy_store_load_async (\fBIFAPI_POLICY_STORE\fP * pstore, \fBIFAPI_IO\fP * io, const char * path)"
  82. Start loading FAPI policy from policy store\&.
  83. .PP
  84. Keys objects, NV objects, and hierarchies can be loaded\&.
  85. .PP
  86. \fBParameters:\fP
  87. .RS 4
  88. \fIpstore\fP The policy directory\&.
  89. .br
  90. \fIio\fP The input/output context being used for file I/O\&.
  91. .br
  92. \fIpath\fP The relative path of the object\&. For keys the path will expanded if possible\&.
  93. .RE
  94. .PP
  95. \fBReturn values:\fP
  96. .RS 4
  97. \fITSS2_RC_SUCCESS\fP If the object can be read\&.
  98. .br
  99. \fITSS2_FAPI_RC_IO_ERROR\fP if an I/O error was encountered\&.
  100. .br
  101. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP if the file does not exist\&.
  102. .br
  103. \fITSS2_FAPI_RC_MEMORY\fP if memory could not be allocated to hold the read data\&.
  104. .RE
  105. .PP
  106. .SS "TSS2_RC ifapi_policy_store_load_finish (\fBIFAPI_POLICY_STORE\fP * pstore, \fBIFAPI_IO\fP * io, \fBTPMS_POLICY\fP * policy)"
  107. Finish loading FAPI policy from policy store\&.
  108. .PP
  109. This function needs to be called repeatedly until it does not return TSS2_FAPI_RC_TRY_AGAIN\&.
  110. .PP
  111. \fBParameters:\fP
  112. .RS 4
  113. \fIpstore\fP The policy context with the policy directory\&.
  114. .br
  115. \fIio\fP The input/output context being used for file I/O\&.
  116. .br
  117. \fIpolicy\fP The caller allocated policy which will loaded from policy store\&.
  118. .RE
  119. .PP
  120. \fBReturn values:\fP
  121. .RS 4
  122. \fITSS2_RC_SUCCESS\fP After successfully loading the object\&.
  123. .br
  124. \fITSS2_FAPI_RC_IO_ERROR\fP if an I/O error was encountered; such as the file was not found\&.
  125. .br
  126. \fITSS2_FAPI_RC_TRY_AGAIN\fP if the asynchronous operation is not yet complete\&.
  127. .br
  128. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  129. .br
  130. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  131. .br
  132. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  133. .br
  134. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  135. .RE
  136. .PP
  137. .SS "TSS2_RC ifapi_policy_store_store_async (\fBIFAPI_POLICY_STORE\fP * pstore, \fBIFAPI_IO\fP * io, const char * path, const \fBTPMS_POLICY\fP * policy)"
  138. Start writing FAPI object to the key store\&.
  139. .PP
  140. The relative path will be expanded, if the default policy directory (/policy) is not part of the path\&.
  141. .PP
  142. \fBParameters:\fP
  143. .RS 4
  144. \fIpstore\fP The policy context with the policy directory\&.
  145. .br
  146. \fIio\fP The input/output context being used for file I/O\&.
  147. .br
  148. \fIpath\fP The relative path of the policy\&.
  149. .br
  150. \fIpolicy\fP The policy to be written to the policy store\&.
  151. .RE
  152. .PP
  153. \fBReturn values:\fP
  154. .RS 4
  155. \fITSS2_RC_SUCCESS\fP If the policy is written successfully\&.
  156. .br
  157. \fITSS2_FAPI_RC_IO_ERROR\fP If an I/O error was encountered;
  158. .br
  159. \fITSS2_FAPI_RC_MEMORY\fP If memory could not be allocated to hold the output data\&.
  160. .br
  161. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  162. .br
  163. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  164. .RE
  165. .PP
  166. .SS "TSS2_RC ifapi_policy_store_store_finish (\fBIFAPI_POLICY_STORE\fP * pstore, \fBIFAPI_IO\fP * io)"
  167. Finish writing a FAPI policy object to the policy store\&.
  168. .PP
  169. This function needs to be called repeatedly until it does not return TSS2_FAPI_RC_TRY_AGAIN\&.
  170. .PP
  171. \fBParameters:\fP
  172. .RS 4
  173. \fIpstore\fP The policy context with the policy directory\&.
  174. .br
  175. \fIio\fP The input/output context being used for file I/O\&.
  176. .RE
  177. .PP
  178. \fBReturn values:\fP
  179. .RS 4
  180. \fITSS2_RC_SUCCESS\fP if the function call was a success\&.
  181. .br
  182. \fITSS2_FAPI_RC_IO_ERROR\fP if an I/O error was encountered; such as the file was not found\&.
  183. .br
  184. \fITSS2_FAPI_RC_TRY_AGAIN\fP if the asynchronous operation is not yet complete\&. Call this function again later\&.
  185. .RE
  186. .PP
  187. .SH "Author"
  188. .PP
  189. Generated automatically by Doxygen for tpm2-tss from the source code\&.