ifapi_utility.3 62 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770
  1. .TH "ifapi_utility" 3 "Fri Oct 7 2022" "Version 3.2.0" "tpm2-tss" \" -*- nroff -*-
  2. .ad l
  3. .nh
  4. .SH NAME
  5. ifapi_utility
  6. .SH SYNOPSIS
  7. .br
  8. .PP
  9. .SS "Functions"
  10. .in +1c
  11. .ti -1c
  12. .RI "void \fBfull_path_to_fapi_path\fP (\fBIFAPI_KEYSTORE\fP *keystore, char *path)"
  13. .br
  14. .ti -1c
  15. .RI "TSS2_RC \fBifapi_authorize_object\fP (\fBFAPI_CONTEXT\fP *context, \fBIFAPI_OBJECT\fP *object, \fBESYS_TR\fP *session)"
  16. .br
  17. .ti -1c
  18. .RI "TPM2_RC \fBifapi_capability_get\fP (\fBFAPI_CONTEXT\fP *context, TPM2_CAP capability, UINT32 count, TPMS_CAPABILITY_DATA **capability_data)"
  19. .br
  20. .ti -1c
  21. .RI "TPM2_RC \fBifapi_capability_init\fP (\fBFAPI_CONTEXT\fP *context)"
  22. .br
  23. .ti -1c
  24. .RI "TSS2_RC \fBifapi_change_auth_hierarchy\fP (\fBFAPI_CONTEXT\fP *context, \fBESYS_TR\fP handle, \fBIFAPI_OBJECT\fP *hierarchy_object, TPM2B_AUTH *newAuthValue)"
  25. .br
  26. .ti -1c
  27. .RI "TSS2_RC \fBifapi_change_policy_hierarchy\fP (\fBFAPI_CONTEXT\fP *context, \fBESYS_TR\fP handle, \fBIFAPI_OBJECT\fP *hierarchy_object, \fBTPMS_POLICY\fP *policy)"
  28. .br
  29. .ti -1c
  30. .RI "TSS2_RC \fBifapi_cleanup_session\fP (\fBFAPI_CONTEXT\fP *context)"
  31. .br
  32. .ti -1c
  33. .RI "TSS2_RC \fBifapi_esys_serialize_object\fP (\fBESYS_CONTEXT\fP *ectx, \fBIFAPI_OBJECT\fP *object)"
  34. .br
  35. .ti -1c
  36. .RI "TSS2_RC \fBifapi_flush_object\fP (\fBFAPI_CONTEXT\fP *context, \fBESYS_TR\fP handle)"
  37. .br
  38. .ti -1c
  39. .RI "void \fBifapi_flush_policy_session\fP (\fBFAPI_CONTEXT\fP *context, \fBESYS_TR\fP session, TSS2_RC r)"
  40. .br
  41. .ti -1c
  42. .RI "void \fBifapi_free_object\fP (\fBFAPI_CONTEXT\fP *context, \fBIFAPI_OBJECT\fP **object)"
  43. .br
  44. .ti -1c
  45. .RI "void \fBifapi_free_objects\fP (\fBFAPI_CONTEXT\fP *context)"
  46. .br
  47. .ti -1c
  48. .RI "TSS2_RC \fBifapi_get_certificates\fP (\fBFAPI_CONTEXT\fP *context, UINT32 min_handle, UINT32 max_handle, \fBNODE_OBJECT_T\fP **cert_list)"
  49. .br
  50. .ti -1c
  51. .RI "TSS2_RC \fBifapi_get_description\fP (\fBIFAPI_OBJECT\fP *object, char **description)"
  52. .br
  53. .ti -1c
  54. .RI "TSS2_RC \fBifapi_get_free_handle_async\fP (\fBFAPI_CONTEXT\fP *fctx, TPM2_HANDLE *handle)"
  55. .br
  56. .ti -1c
  57. .RI "TSS2_RC \fBifapi_get_free_handle_finish\fP (\fBFAPI_CONTEXT\fP *fctx, TPM2_HANDLE *handle, TPM2_HANDLE max)"
  58. .br
  59. .ti -1c
  60. .RI "TSS2_RC \fBifapi_get_json\fP (\fBFAPI_CONTEXT\fP *context, \fBIFAPI_OBJECT\fP *object, char **json_string)"
  61. .br
  62. .ti -1c
  63. .RI "TSS2_RC \fBifapi_get_random\fP (\fBFAPI_CONTEXT\fP *context, size_t numBytes, uint8_t **data)"
  64. .br
  65. .ti -1c
  66. .RI "TSS2_RC \fBifapi_get_session_async\fP (\fBESYS_CONTEXT\fP *esys, \fBESYS_TR\fP saltkey, const \fBIFAPI_PROFILE\fP *profile, TPMI_ALG_HASH hashAlg)"
  67. .br
  68. .ti -1c
  69. .RI "TSS2_RC \fBifapi_get_session_finish\fP (\fBESYS_CONTEXT\fP *esys, \fBESYS_TR\fP *session, TPMA_SESSION flags)"
  70. .br
  71. .ti -1c
  72. .RI "TSS2_RC \fBifapi_get_sessions_async\fP (\fBFAPI_CONTEXT\fP *context, IFAPI_SESSION_TYPE session_flags, TPMA_SESSION attribute_flags1, TPMA_SESSION attribute_flags2)"
  73. .br
  74. .ti -1c
  75. .RI "TSS2_RC \fBifapi_get_sessions_finish\fP (\fBFAPI_CONTEXT\fP *context, const \fBIFAPI_PROFILE\fP *profile, TPMI_ALG_HASH hash_alg)"
  76. .br
  77. .ti -1c
  78. .RI "TSS2_RC \fBifapi_get_sig_scheme\fP (\fBFAPI_CONTEXT\fP *context, \fBIFAPI_OBJECT\fP *object, char const *padding, TPM2B_DIGEST *digest, TPMT_SIG_SCHEME *sig_scheme)"
  79. .br
  80. .ti -1c
  81. .RI "TSS2_RC \fBifapi_init_primary_async\fP (\fBFAPI_CONTEXT\fP *context, TSS2_KEY_TYPE ktype)"
  82. .br
  83. .ti -1c
  84. .RI "TSS2_RC \fBifapi_initialize_object\fP (\fBESYS_CONTEXT\fP *ectx, \fBIFAPI_OBJECT\fP *object)"
  85. .br
  86. .ti -1c
  87. .RI "TSS2_RC \fBifapi_key_create\fP (\fBFAPI_CONTEXT\fP *context, \fBIFAPI_KEY_TEMPLATE\fP *template)"
  88. .br
  89. .ti -1c
  90. .RI "TSS2_RC \fBifapi_key_create_prepare\fP (\fBFAPI_CONTEXT\fP *context, char const *keyPath, char const *policyPath)"
  91. .br
  92. .ti -1c
  93. .RI "TSS2_RC \fBifapi_key_create_prepare_auth\fP (\fBFAPI_CONTEXT\fP *context, char const *keyPath, char const *policyPath, char const *authValue)"
  94. .br
  95. .ti -1c
  96. .RI "TSS2_RC \fBifapi_key_create_prepare_sensitive\fP (\fBFAPI_CONTEXT\fP *context, char const *keyPath, char const *policyPath, size_t dataSize, char const *authValue, uint8_t const *data)"
  97. .br
  98. .ti -1c
  99. .RI "TSS2_RC \fBifapi_key_sign\fP (\fBFAPI_CONTEXT\fP *context, \fBIFAPI_OBJECT\fP *sig_key_object, char const *padding, TPM2B_DIGEST *digest, TPMT_SIGNATURE **tpm_signature, char **publicKey, char **certificate)"
  100. .br
  101. .ti -1c
  102. .RI "TSS2_RC \fBifapi_load_key\fP (\fBFAPI_CONTEXT\fP *context, char const *keyPath, \fBIFAPI_OBJECT\fP **key_object)"
  103. .br
  104. .ti -1c
  105. .RI "TSS2_RC \fBifapi_load_key_async\fP (\fBFAPI_CONTEXT\fP *context, size_t position)"
  106. .br
  107. .ti -1c
  108. .RI "TSS2_RC \fBifapi_load_key_finish\fP (\fBFAPI_CONTEXT\fP *context, bool flush_parent)"
  109. .br
  110. .ti -1c
  111. .RI "TSS2_RC \fBifapi_load_keys_async\fP (\fBFAPI_CONTEXT\fP *context, char const *keyPath)"
  112. .br
  113. .ti -1c
  114. .RI "TSS2_RC \fBifapi_load_keys_finish\fP (\fBFAPI_CONTEXT\fP *context, bool flush_parent, \fBESYS_TR\fP *handle, \fBIFAPI_OBJECT\fP **key_object)"
  115. .br
  116. .ti -1c
  117. .RI "TSS2_RC \fBifapi_load_primary_async\fP (\fBFAPI_CONTEXT\fP *context, char *path)"
  118. .br
  119. .ti -1c
  120. .RI "TSS2_RC \fBifapi_load_primary_finish\fP (\fBFAPI_CONTEXT\fP *context, \fBESYS_TR\fP *handle)"
  121. .br
  122. .ti -1c
  123. .RI "TSS2_RC \fBifapi_merge_profile_into_nv_template\fP (\fBFAPI_CONTEXT\fP *context, \fBIFAPI_NV_TEMPLATE\fP *template)"
  124. .br
  125. .ti -1c
  126. .RI "TSS2_RC \fBifapi_merge_profile_into_template\fP (const \fBIFAPI_PROFILE\fP *profile, \fBIFAPI_KEY_TEMPLATE\fP *template)"
  127. .br
  128. .ti -1c
  129. .RI "TSS2_RC \fBifapi_non_tpm_mode_init\fP (\fBFAPI_CONTEXT\fP *context)"
  130. .br
  131. .ti -1c
  132. .RI "TSS2_RC \fBifapi_nv_read\fP (\fBFAPI_CONTEXT\fP *context, uint8_t **data, size_t *size)"
  133. .br
  134. .ti -1c
  135. .RI "TSS2_RC \fBifapi_nv_write\fP (\fBFAPI_CONTEXT\fP *context, char *nvPath, size_t param_offset, uint8_t const *data, size_t size)"
  136. .br
  137. .ti -1c
  138. .RI "void \fBifapi_primary_clean\fP (\fBFAPI_CONTEXT\fP *context)"
  139. .br
  140. .ti -1c
  141. .RI "void \fBifapi_session_clean\fP (\fBFAPI_CONTEXT\fP *context)"
  142. .br
  143. .ti -1c
  144. .RI "TSS2_RC \fBifapi_session_init\fP (\fBFAPI_CONTEXT\fP *context)"
  145. .br
  146. .ti -1c
  147. .RI "TSS2_RC \fBifapi_set_auth\fP (\fBFAPI_CONTEXT\fP *context, \fBIFAPI_OBJECT\fP *auth_object, const char *description)"
  148. .br
  149. .ti -1c
  150. .RI "void \fBifapi_set_description\fP (\fBIFAPI_OBJECT\fP *object, char *description)"
  151. .br
  152. .ti -1c
  153. .RI "\fBIFAPI_OBJECT\fP * \fBifapi_allocate_object\fP (\fBFAPI_CONTEXT\fP *context)"
  154. .br
  155. .ti -1c
  156. .RI "TSS2_RC \fBifapi_create_primary\fP (\fBFAPI_CONTEXT\fP *context, \fBIFAPI_KEY_TEMPLATE\fP *template)"
  157. .br
  158. .ti -1c
  159. .RI "TSS2_RC \fBifapi_get_key_properties\fP (\fBFAPI_CONTEXT\fP *context, char const *key_path, bool *is_primary, bool *in_null_hierarchy)"
  160. .br
  161. .ti -1c
  162. .RI "const char * \fBifapi_get_object_path\fP (\fBIFAPI_OBJECT\fP *object)"
  163. .br
  164. .ti -1c
  165. .RI "TSS2_RC \fBifapi_load_parent_keys_async\fP (\fBFAPI_CONTEXT\fP *context, char const *keyPath)"
  166. .br
  167. .in -1c
  168. .SH "Detailed Description"
  169. .PP
  170. Provides internal utility functions\&.
  171. .SH "Function Documentation"
  172. .PP
  173. .SS "void full_path_to_fapi_path (\fBIFAPI_KEYSTORE\fP * keystore, char * path)"
  174. Convert full FAPI path to relative path\&.
  175. .PP
  176. The relative path will be copied directly into the passed object\&.
  177. .PP
  178. \fBParameters:\fP
  179. .RS 4
  180. \fIkeystore\fP The key directories and default profile\&.
  181. .br
  182. \fIpath\fP The absolute path\&.
  183. .RE
  184. .PP
  185. .SS "ifapi_allocate_object (\fBFAPI_CONTEXT\fP * context)"
  186. Allocate ifapi object and store the result in a linked list\&.
  187. .PP
  188. Allocated ifapi objects will be recorded in the context\&.
  189. .PP
  190. \fBParameters:\fP
  191. .RS 4
  192. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  193. .RE
  194. .PP
  195. \fBReturn values:\fP
  196. .RS 4
  197. \fIThe\fP allocated ifapi object\&.
  198. .br
  199. \fINULL\fP if the object cannot be allocated\&.
  200. .RE
  201. .PP
  202. .SS "TSS2_RC ifapi_authorize_object (\fBFAPI_CONTEXT\fP * context, \fBIFAPI_OBJECT\fP * object, \fBESYS_TR\fP * session)"
  203. State machine to authorize a key, a NV object of a hierarchy\&.
  204. .PP
  205. \fBParameters:\fP
  206. .RS 4
  207. \fIcontext\fP for storing all state information\&.
  208. .br
  209. \fIobject\fP The FAPI object\&.
  210. .br
  211. \fIsession\fP The session which can be used for object authorization\&.
  212. .RE
  213. .PP
  214. \fBReturn values:\fP
  215. .RS 4
  216. \fITSS2_RC_SUCCESS\fP If the authorization is successful
  217. .br
  218. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  219. .br
  220. \fITSS2_FAPI_RC_BAD_VALUE\fP If wrong values are detected during execution\&.
  221. .br
  222. \fITSS2_FAPI_RC_IO_ERROR\fP If an error occurs during access to the policy store\&.
  223. .br
  224. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP If a policy for a certain path was not found\&.
  225. .br
  226. \fITSS2_FAPI_RC_POLICY_UNKNOWN\fP If policy search for a certain policy digest was not successful\&.
  227. .br
  228. \fITPM2_RC_BAD_AUTH\fP If the authentication for an object needed for the policy execution fails\&.
  229. .br
  230. \fITSS2_FAPI_RC_AUTHORIZATION_UNKNOWN\fP if a needed authorization callback is not defined\&.
  231. .br
  232. \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&.
  233. .br
  234. \fITSS2_FAPI_RC_AUTHORIZATION_FAILED\fP if the authorization attempt fails\&.
  235. .br
  236. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  237. .br
  238. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  239. .br
  240. \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&.
  241. .RE
  242. .PP
  243. .SS "TPM2_RC ifapi_capability_get (\fBFAPI_CONTEXT\fP * context, TPM2_CAP capability, UINT32 count, TPMS_CAPABILITY_DATA ** capability_data)"
  244. State machine for receiving TPM capability information\&.
  245. .PP
  246. The state machine shares the state with the FAPI function Fapi_GetInfo\&. context->state == GET_INFO_GET_CAP_MORE signals that more capability data can be retrieved\&.
  247. .PP
  248. \fBParameters:\fP
  249. .RS 4
  250. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  251. .br
  252. \fIcapability\fP The capability to be retrieved\&.
  253. .br
  254. \fIcount\fP The maximal number of items that should be retrieved\&.
  255. .br
  256. \fIcapability_data\fP The retrieved capability information\&.
  257. .RE
  258. .PP
  259. \fBReturn values:\fP
  260. .RS 4
  261. \fITSS2_RC_SUCCESS\fP If all capability data is retrieved\&.
  262. .br
  263. \fITSS2_FAPI_RC_TRY_AGAIN\fP if more capability data is available\&.
  264. .br
  265. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  266. .br
  267. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  268. .br
  269. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  270. .br
  271. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  272. .RE
  273. .PP
  274. .SS "TPM2_RC ifapi_capability_init (\fBFAPI_CONTEXT\fP * context)"
  275. Prepare the receiving of capability data\&.
  276. .PP
  277. \fBParameters:\fP
  278. .RS 4
  279. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  280. .RE
  281. .PP
  282. \fBReturn values:\fP
  283. .RS 4
  284. \fITSS2_RC_SUCCESS\&.\fP
  285. .RE
  286. .PP
  287. .SS "TSS2_RC ifapi_change_auth_hierarchy (\fBFAPI_CONTEXT\fP * context, \fBESYS_TR\fP handle, \fBIFAPI_OBJECT\fP * hierarchy_object, TPM2B_AUTH * newAuthValue)"
  288. State machine for changing the hierarchy authorization\&.
  289. .PP
  290. First it will be tried to set the auth value of the hierarchy with a 'null' authorization\&. If this trial is not successful it will be tried to authorize the hierarchy via a callback\&. If an not null auth value is passed with_auth is set to yes for the object otherwise to no\&. So for later authorizations it will be clear whether null authorization is possible or not\&.
  291. .PP
  292. \fBParameters:\fP
  293. .RS 4
  294. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  295. .br
  296. \fIhandle\fP The ESAPI handle of the hierarchy\&.
  297. .br
  298. \fIhierarchy_object\fP The internal FAPI representation of a hierarchy\&.
  299. .br
  300. \fInewAuthValue\fP The new authorization for the hierarchy\&.
  301. .RE
  302. .PP
  303. \fBReturn values:\fP
  304. .RS 4
  305. \fITSS2_RC_SUCCESS\fP on success\&.
  306. .br
  307. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  308. .br
  309. \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&.
  310. .br
  311. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  312. .br
  313. \fITSS2_FAPI_RC_AUTHORIZATION_UNKNOWN\fP if a required authorization callback is not set\&.
  314. .br
  315. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  316. .br
  317. \fITSS2_FAPI_RC_AUTHORIZATION_FAILED\fP if the authorization attempt fails\&.
  318. .br
  319. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occured\&.
  320. .br
  321. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP if a FAPI object path was not found during authorization\&.
  322. .br
  323. \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&.
  324. .br
  325. \fITSS2_FAPI_RC_IO_ERROR\fP if an error occured while accessing the object store\&.
  326. .br
  327. \fITSS2_FAPI_RC_POLICY_UNKNOWN\fP if policy search for a certain policy digest was not successful\&.
  328. .RE
  329. .PP
  330. .SS "TSS2_RC ifapi_change_policy_hierarchy (\fBFAPI_CONTEXT\fP * context, \fBESYS_TR\fP handle, \fBIFAPI_OBJECT\fP * hierarchy_object, \fBTPMS_POLICY\fP * policy)"
  331. State machine for changing the policy of a hierarchy\&.
  332. .PP
  333. Based on a passed policy the policy digest will be computed\&. First it will be tried to set the policy of the hierarchy with a 'null' authorization\&. If this trial is not successful it will be tried to authorize the hierarchy via a callback\&. If an not null auth value is passed with_auth is set to yes for the object otherwise to no\&. So for later authorizations it will be clear whether null authorization is possible or not\&.
  334. .PP
  335. \fBParameters:\fP
  336. .RS 4
  337. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  338. .br
  339. \fIhandle\fP The ESAPI handle of the hierarchy\&.
  340. .br
  341. \fIhierarchy_object\fP The internal FAPI representation of a hierarchy\&.
  342. .br
  343. \fIpolicy\fP The new policy assigned to the hierarchy\&.
  344. .RE
  345. .PP
  346. \fBReturn values:\fP
  347. .RS 4
  348. \fITSS2_RC_SUCCESS\fP on success\&.
  349. .br
  350. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  351. .br
  352. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  353. .br
  354. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP If an internal error occurs, which is not covered by other return codes\&.
  355. .br
  356. \fITSS2_FAPI_RC_BAD_VALUE\fP If wrong values are detected during policy calculation\&.
  357. .br
  358. \fITSS2_FAPI_RC_IO_ERROR\fP If an error occurs during access to the policy store\&.
  359. .br
  360. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP If an object needed for policy calculation was not found\&.
  361. .br
  362. \fITSS2_FAPI_RC_POLICY_UNKNOWN\fP If policy search for a certain policy digest was not successful\&.
  363. .br
  364. \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&.
  365. .br
  366. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  367. .br
  368. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  369. .br
  370. \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&.
  371. .br
  372. \fITSS2_FAPI_RC_AUTHORIZATION_UNKNOWN\fP if a required authorization callback is not set\&.
  373. .br
  374. \fITSS2_FAPI_RC_AUTHORIZATION_FAILED\fP if the authorization attempt fails\&.
  375. .br
  376. \fITSS2_FAPI_RC_NOT_PROVISIONED\fP FAPI was not provisioned\&.
  377. .br
  378. \fITSS2_FAPI_RC_BAD_PATH\fP if the path is used in inappropriate context or contains illegal characters\&.
  379. .RE
  380. .PP
  381. < no path needed
  382. .SS "TSS2_RC ifapi_cleanup_session (\fBFAPI_CONTEXT\fP * context)"
  383. State machine for asynchronous cleanup of a FAPI session\&.
  384. .PP
  385. Used sessions and the SRK will be flushed\&.
  386. .PP
  387. \fBParameters:\fP
  388. .RS 4
  389. \fIcontext\fP The \fBFAPI_CONTEXT\fP storing the used handles\&.
  390. .RE
  391. .PP
  392. \fBReturn values:\fP
  393. .RS 4
  394. \fITSS2_RC_SUCCESS\fP on success\&.
  395. .br
  396. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  397. .br
  398. \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&.
  399. .br
  400. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  401. .RE
  402. .PP
  403. .SS "ifapi_create_primary (\fBFAPI_CONTEXT\fP * context, \fBIFAPI_KEY_TEMPLATE\fP * template)"
  404. Creation of a primary key\&.
  405. .PP
  406. Depending on the flags stored in the context the creation of a primary key will be prepared\&.
  407. .PP
  408. \fBParameters:\fP
  409. .RS 4
  410. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  411. .br
  412. \fItemplate\fP The template which defines the key attributes and whether the key will be persistent\&.
  413. .RE
  414. .PP
  415. \fBReturn values:\fP
  416. .RS 4
  417. \fITSS2_RC_SUCCESS\fP on success\&.
  418. .br
  419. \fITSS2_FAPI_RC_BAD_VALUE\fP if a wrong type was passed\&.
  420. .br
  421. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  422. .br
  423. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  424. .br
  425. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  426. .br
  427. \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&.
  428. .br
  429. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  430. .br
  431. \fITSS2_FAPI_RC_IO_ERROR\fP if an error occurred while accessing the object store\&.
  432. .br
  433. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  434. .br
  435. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP if a FAPI object path was not found during authorization\&.
  436. .br
  437. \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&.
  438. .br
  439. \fITSS2_FAPI_RC_NOT_PROVISIONED\fP FAPI was not provisioned\&.
  440. .br
  441. \fITSS2_FAPI_RC_BAD_PATH\fP if the path is used in inappropriate context or contains illegal characters\&.
  442. .br
  443. \fITSS2_FAPI_RC_AUTHORIZATION_UNKNOWN\fP if a required authorization callback is not set\&.
  444. .br
  445. \fITSS2_FAPI_RC_AUTHORIZATION_FAILED\fP if the authorization attempt fails\&.
  446. .br
  447. \fITSS2_FAPI_RC_POLICY_UNKNOWN\fP if policy search for a certain policy digest was not successful\&.
  448. .br
  449. \fITSS2_FAPI_RC_PATH_ALREADY_EXISTS\fP if the object already exists in object store\&.
  450. .RE
  451. .PP
  452. .SS "TSS2_RC ifapi_esys_serialize_object (\fBESYS_CONTEXT\fP * ectx, \fBIFAPI_OBJECT\fP * object)"
  453. Serialize persistent objects into buffer of keystore object\&.
  454. .PP
  455. NV objects and persistent keys will serialized via the ESYS API to enable reconstruction durinng loading from keystore\&.
  456. .PP
  457. \fBParameters:\fP
  458. .RS 4
  459. \fIectx\fP The ESAPI context\&.
  460. .br
  461. \fIobject\fP The nv object or the key\&.
  462. .RE
  463. .PP
  464. \fBReturn values:\fP
  465. .RS 4
  466. \fITSS2_RC_SUCCESS\fP if the function call was a success\&.
  467. .br
  468. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occured\&.
  469. .RE
  470. .PP
  471. .SS "TSS2_RC ifapi_flush_object (\fBFAPI_CONTEXT\fP * context, \fBESYS_TR\fP handle)"
  472. State machine for flushing objects\&.
  473. .PP
  474. \fBParameters:\fP
  475. .RS 4
  476. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  477. .br
  478. \fIhandle\fP of the object to be flushed\&.
  479. .RE
  480. .PP
  481. \fBReturn values:\fP
  482. .RS 4
  483. \fITSS2_RC_SUCCESS\fP on success\&.
  484. .br
  485. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  486. .br
  487. \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&.
  488. .br
  489. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  490. .RE
  491. .PP
  492. .SS "void ifapi_flush_policy_session (\fBFAPI_CONTEXT\fP * context, \fBESYS_TR\fP session, TSS2_RC r)"
  493. Check whether policy session has to be flushed\&.
  494. .PP
  495. Policy sessions with cleared continue session flag are not flushed in error cases\&. Therefore the return code will be checked and if a policy session was used the session will be flushed if the command was not executed successfully\&.
  496. .PP
  497. \fBParameters:\fP
  498. .RS 4
  499. \fIcontext\fP for storing all state information\&.
  500. .br
  501. \fIsession\fP the session to be checked whether flush is needed\&.
  502. .br
  503. \fIr\fP The return code of the command using the session\&.
  504. .RE
  505. .PP
  506. .SS "void ifapi_free_object (\fBFAPI_CONTEXT\fP * context, \fBIFAPI_OBJECT\fP ** object)"
  507. Free ifapi a object stored in the context\&.
  508. .PP
  509. \fBParameters:\fP
  510. .RS 4
  511. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  512. .br
  513. \fIobject\fP The object which should be removed from the the linked list stored in context\&.
  514. .RE
  515. .PP
  516. .SS "void ifapi_free_objects (\fBFAPI_CONTEXT\fP * context)"
  517. Free all ifapi objects stored in the context\&.
  518. .PP
  519. \fBParameters:\fP
  520. .RS 4
  521. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  522. .RE
  523. .PP
  524. .SS "TSS2_RC ifapi_get_certificates (\fBFAPI_CONTEXT\fP * context, UINT32 min_handle, UINT32 max_handle, \fBNODE_OBJECT_T\fP ** cert_list)"
  525. Get certificates stored in NV ram\&.
  526. .PP
  527. The NV handles in the certificate range are determined\&. The corresponding certificates are read out and stored in a linked list\&.
  528. .PP
  529. \fBParameters:\fP
  530. .RS 4
  531. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&. The sub context for NV reading will be used\&.
  532. .br
  533. \fImin_handle\fP The first possible handle in the handle range\&.
  534. .br
  535. \fImax_handle\fP Maximal handle to filter out the handles not in the handle range for certificates\&.
  536. .br
  537. \fIcert_list\fP The callee allocates linked list of certificates\&.
  538. .RE
  539. .PP
  540. \fBReturn values:\fP
  541. .RS 4
  542. \fITSS2_RC_SUCCESS\fP on success\&.
  543. .br
  544. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  545. .br
  546. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  547. .br
  548. \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&.
  549. .br
  550. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  551. .br
  552. \fITSS2_FAPI_RC_AUTHORIZATION_UNKNOWN\fP if a required authorization callback is not set\&.
  553. .br
  554. \fITSS2_FAPI_RC_AUTHORIZATION_FAILED\fP if the authorization attempt fails\&.
  555. .br
  556. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  557. .br
  558. \fITSS2_FAPI_RC_IO_ERROR\fP if an error occurred while accessing the object store\&.
  559. .br
  560. \fITSS2_FAPI_RC_POLICY_UNKNOWN\fP if policy search for a certain policy digest was not successful\&.
  561. .br
  562. \fITSS2_FAPI_RC_NOT_PROVISIONED\fP FAPI was not provisioned\&.
  563. .br
  564. \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&.
  565. .br
  566. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  567. .br
  568. \fITSS2_FAPI_RC_BAD_PATH\fP if the path is used in inappropriate context or contains illegal characters\&.
  569. .br
  570. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  571. .br
  572. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP if a FAPI object path was not found during authorization\&.
  573. .RE
  574. .PP
  575. .SS "TSS2_RC ifapi_get_description (\fBIFAPI_OBJECT\fP * object, char ** description)"
  576. Get description of an internal FAPI object\&.
  577. .PP
  578. \fBParameters:\fP
  579. .RS 4
  580. \fIobject\fP The object with the description\&.
  581. .br
  582. \fIdescription\fP The callee allocated description\&.
  583. .RE
  584. .PP
  585. \fBReturn values:\fP
  586. .RS 4
  587. \fITSS2_RC_SUCCESS\fP If a copy of the description can be returned or if no description exists\&.
  588. .br
  589. \fITSS2_FAPI_RC_MEMORY\fP in the copy cannot be allocated\&.
  590. .RE
  591. .PP
  592. .SS "TSS2_RC ifapi_get_free_handle_async (\fBFAPI_CONTEXT\fP * fctx, TPM2_HANDLE * handle)"
  593. Preparation for getting a free handle after a start handle number\&.
  594. .PP
  595. \fBParameters:\fP
  596. .RS 4
  597. \fIfctx\fP The \fBFAPI_CONTEXT\fP\&.
  598. .br
  599. \fIhandle\fP The start value for handle search\&.
  600. .RE
  601. .PP
  602. \fBReturn values:\fP
  603. .RS 4
  604. \fITSS2_RC_SUCCESS\fP on success\&.
  605. .br
  606. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  607. .RE
  608. .PP
  609. .SS "TSS2_RC ifapi_get_free_handle_finish (\fBFAPI_CONTEXT\fP * fctx, TPM2_HANDLE * handle, TPM2_HANDLE max)"
  610. Execution of get capability until a free handle is found\&.
  611. .PP
  612. The get capability method is called until a free handle is found or the max number of trials passe to the function is exeeded\&.
  613. .PP
  614. \fBParameters:\fP
  615. .RS 4
  616. \fIfctx\fP The \fBFAPI_CONTEXT\fP\&.
  617. .br
  618. \fIhandle\fP The free handle\&.
  619. .br
  620. \fImax\fP The maximal number of trials\&.
  621. .RE
  622. .PP
  623. \fBReturn values:\fP
  624. .RS 4
  625. \fITSS2_RC_SUCCESS\fP on success\&.
  626. .br
  627. \fITSS2_FAPI_RC_NV_TOO_SMALL\fP if too many NV handles are defined\&.
  628. .br
  629. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  630. .br
  631. \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&.
  632. .RE
  633. .PP
  634. .SS "TSS2_RC ifapi_get_json (\fBFAPI_CONTEXT\fP * context, \fBIFAPI_OBJECT\fP * object, char ** json_string)"
  635. Get json encoding for FAPI object\&.
  636. .PP
  637. A json representation which can be used for exporting of a FAPI object will be created\&.
  638. .PP
  639. \fBParameters:\fP
  640. .RS 4
  641. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  642. .br
  643. \fIobject\fP The object to be serialized\&.
  644. .br
  645. \fIjson_string\fP The json string created by the deserialzation function (callee-allocated)\&.
  646. .RE
  647. .PP
  648. \fBReturn values:\fP
  649. .RS 4
  650. \fITSS2_RC_SUCCESS\fP If the serialization was successful\&.
  651. .br
  652. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  653. .br
  654. \fITSS2_FAPI_RC_BAD_VALUE\fP If wrong values are detected during serialization\&.
  655. .br
  656. \fITSS2_FAPI_RC_BAD_REFERENCE\fP If a NULL pointer was passed for the object\&.
  657. .br
  658. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  659. .br
  660. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  661. .RE
  662. .PP
  663. .SS "ifapi_get_key_properties (\fBFAPI_CONTEXT\fP * context, char const * key_path, bool * is_primary, bool * in_null_hierarchy)"
  664. Determine key properties (primary, null hierarchy)\&.
  665. .PP
  666. It will be checked whether a path is the path of a primary key, and whether it's a key in null hiearchy
  667. .PP
  668. \fBParameters:\fP
  669. .RS 4
  670. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  671. .br
  672. \fIkey_path\fP the key path\&.
  673. .br
  674. \fIis_primary\fP if key path is the path of a primary\&.
  675. .br
  676. \fIin_null_hierarchy\fP if key is a null hierarchy key\&.
  677. .RE
  678. .PP
  679. \fBReturn values:\fP
  680. .RS 4
  681. \fITSS2_RC_SUCCESS\fP If the preparation is successful\&.
  682. .br
  683. \fITSS2_FAPI_RC_MEMORY\fP if memory could not be allocated for path names\&.
  684. .br
  685. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  686. .br
  687. \fITSS2_FAPI_RC_BAD_PATH\fP if the path is used in inappropriate context or contains illegal characters\&.
  688. .br
  689. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP if a FAPI object path was not found during authorization\&.
  690. .RE
  691. .PP
  692. .SS "ifapi_get_object_path (\fBIFAPI_OBJECT\fP * object)"
  693. Get relative path of a FAPI object\&.
  694. .PP
  695. \fBParameters:\fP
  696. .RS 4
  697. \fIobject\fP The internal FAPI object\&.
  698. .RE
  699. .PP
  700. \fBReturn values:\fP
  701. .RS 4
  702. \fIThe\fP relative path of the object\&.
  703. .br
  704. \fINULL\fP if no path is available\&.
  705. .RE
  706. .PP
  707. .SS "TSS2_RC ifapi_get_random (\fBFAPI_CONTEXT\fP * context, size_t numBytes, uint8_t ** data)"
  708. State machine to retrieve random data from TPM\&.
  709. .PP
  710. If the buffer size exceeds the maximum size, several ESAPI calls are made\&.
  711. .PP
  712. \fBParameters:\fP
  713. .RS 4
  714. \fIcontext\fP for storing all state information\&.
  715. .br
  716. \fInumBytes\fP Number of random bytes to be computed\&.
  717. .br
  718. \fIdata\fP The random data\&.
  719. .RE
  720. .PP
  721. \fBReturn values:\fP
  722. .RS 4
  723. \fITSS2_RC_SUCCESS\fP If random data can be computed\&.
  724. .br
  725. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  726. .br
  727. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  728. .br
  729. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  730. .br
  731. \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&.
  732. .br
  733. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  734. .RE
  735. .PP
  736. .SS "TSS2_RC ifapi_get_session_async (\fBESYS_CONTEXT\fP * esys, \fBESYS_TR\fP saltkey, const \fBIFAPI_PROFILE\fP * profile, TPMI_ALG_HASH hashAlg)"
  737. Preparation for getting a session handle\&.
  738. .PP
  739. The corresponding async call be executed and a session secret for encryption TPM2B parameters will be created\&.
  740. .PP
  741. \fBParameters:\fP
  742. .RS 4
  743. \fIesys\fP The \fBESYS_CONTEXT\fP\&.
  744. .br
  745. \fIsaltkey\fP The key which will be used for the encryption of the session secret\&.
  746. .br
  747. \fIprofile\fP The FAPI profile will be used to adjust the sessions symmetric parameters\&.
  748. .br
  749. \fIhashAlg\fP The hash algorithm used for the session\&.
  750. .RE
  751. .PP
  752. \fBReturn values:\fP
  753. .RS 4
  754. \fITSS2_RC_SUCCESS\fP on success\&.
  755. .br
  756. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  757. .RE
  758. .PP
  759. .SS "TSS2_RC ifapi_get_session_finish (\fBESYS_CONTEXT\fP * esys, \fBESYS_TR\fP * session, TPMA_SESSION flags)"
  760. Call for getting a session handle and adjust session parameters\&.
  761. .PP
  762. \fBParameters:\fP
  763. .RS 4
  764. \fIesys\fP The \fBESYS_CONTEXT\fP\&.
  765. .br
  766. \fIsession\fP The session handle\&.
  767. .br
  768. \fIflags\fP The flags to adjust the session attributes\&.
  769. .RE
  770. .PP
  771. \fBReturn values:\fP
  772. .RS 4
  773. \fITSS2_RC_SUCCESS\fP on success\&.
  774. .br
  775. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  776. .RE
  777. .PP
  778. .SS "TSS2_RC ifapi_get_sessions_async (\fBFAPI_CONTEXT\fP * context, IFAPI_SESSION_TYPE session_flags, TPMA_SESSION attribute_flags1, TPMA_SESSION attribute_flags2)"
  779. Prepare the session creation of a FAPI command\&.
  780. .PP
  781. The initial state of the state machine for session creation will be determined\&. Depending of the session_flags creation of a primary for the encryption of the session secret can be adjusted\&. The session passed session attributes will be used for the ESAPI command Esys_TRSess_SetAttributes\&.
  782. .PP
  783. \fBParameters:\fP
  784. .RS 4
  785. \fIcontext\fP The \fBFAPI_CONTEXT\fP storing the used handles\&.
  786. .br
  787. \fIsession_flags\fP The flags to adjust used session and encryption key\&. With IFAPI_SESSION1 and IFAPI_SESSION2 the session creation for sesion1 and session2 can be activated, IFAPI_SESSION_GENEK triggers the creation of the primary for session secret encryption\&.
  788. .br
  789. \fIattribute_flags1\fP The attributes used for session1\&.
  790. .br
  791. \fIattribute_flags2\fP The attributes used for session2\&.
  792. .RE
  793. .PP
  794. \fBReturn values:\fP
  795. .RS 4
  796. \fITSS2_RC_SUCCESS\fP on success\&.
  797. .br
  798. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP if the hierarchy file or the primary key file does not exist\&.
  799. .br
  800. \fITSS2_FAPI_RC_MEMORY\fP if memory could not be allocated for path names\&. of the primary\&.
  801. .br
  802. \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&.
  803. .br
  804. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  805. .br
  806. \fITSS2_FAPI_RC_IO_ERROR\fP if an error occurred while accessing the object store\&.
  807. .br
  808. \fITSS2_FAPI_RC_NOT_PROVISIONED\fP FAPI was not provisioned\&.
  809. .br
  810. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  811. .br
  812. \fITSS2_FAPI_RC_BAD_PATH\fP if the path is used in inappropriate context or contains illegal characters\&.
  813. .RE
  814. .PP
  815. .SS "TSS2_RC ifapi_get_sessions_finish (\fBFAPI_CONTEXT\fP * context, const \fBIFAPI_PROFILE\fP * profile, TPMI_ALG_HASH hash_alg)"
  816. State machine for the session creation of a FAPI command\&.
  817. .PP
  818. The sessions needed for a FAPI command will be created\&. If needed also the primary key for session encryption will be created\&.
  819. .PP
  820. \fBParameters:\fP
  821. .RS 4
  822. \fIcontext\fP The \fBFAPI_CONTEXT\fP storing the used handles\&.
  823. .br
  824. \fIprofile\fP The FAPI profile will be used to adjust session parameters\&.
  825. .br
  826. \fIhash_alg\fP The hash algorithm used for the session\&.
  827. .RE
  828. .PP
  829. \fBReturn values:\fP
  830. .RS 4
  831. \fITSS2_RC_SUCCESS\fP on success\&.
  832. .br
  833. \fITSS2_FAPI_RC_IO_ERROR\fP if an I/O error was encountered\&.
  834. .br
  835. \fITSS2_FAPI_RC_MEMORY\fP if memory could not be allocated for path names\&.
  836. .br
  837. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  838. .br
  839. \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&.
  840. .br
  841. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  842. .br
  843. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  844. .br
  845. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  846. .br
  847. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  848. .br
  849. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP if a FAPI object path was not found during authorization\&.
  850. .br
  851. \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&.
  852. .br
  853. \fITSS2_FAPI_RC_AUTHORIZATION_UNKNOWN\fP if a required authorization callback is not set\&.
  854. .br
  855. \fITSS2_FAPI_RC_AUTHORIZATION_FAILED\fP if the authorization attempt fails\&.
  856. .br
  857. \fITSS2_FAPI_RC_POLICY_UNKNOWN\fP if policy search for a certain policy digest was not successful\&.
  858. .br
  859. \fITSS2_FAPI_RC_NOT_PROVISIONED\fP FAPI was not provisioned\&.
  860. .br
  861. \fITSS2_FAPI_RC_BAD_PATH\fP if the path is used in inappropriate context or contains illegal characters\&.
  862. .RE
  863. .PP
  864. .SS "TSS2_RC ifapi_get_sig_scheme (\fBFAPI_CONTEXT\fP * context, \fBIFAPI_OBJECT\fP * object, char const * padding, TPM2B_DIGEST * digest, TPMT_SIG_SCHEME * sig_scheme)"
  865. Get signature scheme for key\&.
  866. .PP
  867. If padding is passed the scheme will be derived from paddint otherwise the scheme form object will be used\&.
  868. .PP
  869. \fBParameters:\fP
  870. .RS 4
  871. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  872. .br
  873. \fIobject\fP The internal FAPI object of the key\&.
  874. .br
  875. \fIpadding\fP The strings RSA_SSA or RSA_PSS will be converted into the TSS constants used for the signing scheme\&.
  876. .br
  877. \fIdigest\fP The digest size will be used to determine the hashalg for the signature scheme\&.
  878. .br
  879. \fIsig_scheme\fP The computed signature scheme\&.
  880. .RE
  881. .PP
  882. \fBReturn values:\fP
  883. .RS 4
  884. \fITSS2_FAPI_RC_BAD_VALUE\fP If the digest size is not appropriate\&.
  885. .br
  886. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  887. .RE
  888. .PP
  889. .SS "TSS2_RC ifapi_init_primary_async (\fBFAPI_CONTEXT\fP * context, TSS2_KEY_TYPE ktype)"
  890. Prepare the creation of a primary key\&.
  891. .PP
  892. Depending on the parameters the creation of an endorsement or storage root key will be prepared\&.
  893. .PP
  894. \fBParameters:\fP
  895. .RS 4
  896. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  897. .br
  898. \fIktype\fP The type of key TSS2_EK or TSS2_SRK\&.
  899. .RE
  900. .PP
  901. \fBReturn values:\fP
  902. .RS 4
  903. \fITSS2_RC_SUCCESS\fP on success\&.
  904. .br
  905. \fITSS2_FAPI_RC_BAD_VALUE\fP if a wrong type was passed\&.
  906. .br
  907. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  908. .br
  909. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  910. .br
  911. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  912. .br
  913. \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&.
  914. .br
  915. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  916. .br
  917. \fITSS2_FAPI_RC_IO_ERROR\fP if an error occurred while accessing the object store\&.
  918. .br
  919. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  920. .br
  921. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP if a FAPI object path was not found during authorization\&.
  922. .br
  923. \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&.
  924. .br
  925. \fITSS2_FAPI_RC_NOT_PROVISIONED\fP FAPI was not provisioned\&.
  926. .br
  927. \fITSS2_FAPI_RC_BAD_PATH\fP if the path is used in inappropriate context or contains illegal characters\&.
  928. .RE
  929. .PP
  930. < no path needed
  931. .SS "TSS2_RC ifapi_initialize_object (\fBESYS_CONTEXT\fP * ectx, \fBIFAPI_OBJECT\fP * object)"
  932. Initialize the part of an IFAPI_OBJECT which is not serialized\&.
  933. .PP
  934. For persistent objects the correspodning ESYS object will be created\&.
  935. .PP
  936. \fBParameters:\fP
  937. .RS 4
  938. \fIectx\fP The ESYS context\&.
  939. .br
  940. \fIobject\fP the deserialzed binary object\&.
  941. .RE
  942. .PP
  943. \fBReturn values:\fP
  944. .RS 4
  945. \fITSS2_RC_SUCCESS\fP if the function call was a success\&.
  946. .br
  947. \fITSS2_FAPI_RC_BAD_VALUE\fP if the json object can't be deserialized\&.
  948. .RE
  949. .PP
  950. .SS "TSS2_RC ifapi_key_create (\fBFAPI_CONTEXT\fP * context, \fBIFAPI_KEY_TEMPLATE\fP * template)"
  951. State machine for key creation\&.
  952. .PP
  953. The function for the preparation of the key have to called before the state machine can be activated\&. The linked list for the used directories must be available in the FAPI context\&. It will be checked whether the object already exists in key store and the FAPI context will be initialized appropriate for key creation\&.
  954. .PP
  955. \fBParameters:\fP
  956. .RS 4
  957. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  958. .br
  959. \fItemplate\fP The template which defines the key attributes and whether the key will be persistent\&.
  960. .RE
  961. .PP
  962. \fBReturn values:\fP
  963. .RS 4
  964. \fITSS2_RC_SUCCESS\fP If the key could be generated\&.
  965. .br
  966. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  967. .br
  968. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  969. .br
  970. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP If an internal error occurs, which is not covered by other return codes\&.
  971. .br
  972. \fITSS2_FAPI_RC_BAD_VALUE\fP If wrong values are detected during execution\&.
  973. .br
  974. \fITSS2_FAPI_RC_IO_ERROR\fP If an error occurs during access to the policy store\&.
  975. .br
  976. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP If an object needed for creation or authentication was not found\&.
  977. .br
  978. \fITSS2_FAPI_RC_POLICY_UNKNOWN\fP If policy search for a certain policy digest was not successful\&.
  979. .br
  980. \fITPM2_RC_BAD_AUTH\fP If the authentication for an object needed for creation fails\&.
  981. .br
  982. \fITSS2_FAPI_RC_AUTHORIZATION_UNKNOWN\fP if a needed authorization callback is not defined\&.
  983. .br
  984. \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&.
  985. .br
  986. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  987. .br
  988. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  989. .br
  990. \fITSS2_FAPI_RC_NOT_PROVISIONED\fP FAPI was not provisioned\&.
  991. .br
  992. \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&.
  993. .br
  994. \fITSS2_FAPI_RC_BAD_PATH\fP if the path is used in inappropriate context or contains illegal characters\&.
  995. .br
  996. \fITSS2_FAPI_RC_AUTHORIZATION_FAILED\fP if the authorization attempt fails\&.
  997. .br
  998. \fITSS2_FAPI_RC_PATH_ALREADY_EXISTS\fP if the object already exists in object store\&.
  999. .RE
  1000. .PP
  1001. .SS "TSS2_RC ifapi_key_create_prepare (\fBFAPI_CONTEXT\fP * context, char const * keyPath, char const * policyPath)"
  1002. Prepare key creation if possible\&.
  1003. .PP
  1004. It will be checked whether the object already exists in key store and the FAPI context will be initialized appropriate for key creation\&.
  1005. .PP
  1006. \fBParameters:\fP
  1007. .RS 4
  1008. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  1009. .br
  1010. \fIkeyPath\fP the key path without the parent directories of the key store\&. (e\&.g\&. HE/EK, HS/SRK/mykey)
  1011. .br
  1012. \fIpolicyPath\fP identifies the policy to be associated with the new key\&. policyPath MAY be NULL\&. If policyPath is NULL then no policy will be associated with the key\&.
  1013. .RE
  1014. .PP
  1015. \fBReturn values:\fP
  1016. .RS 4
  1017. \fITSS2_RC_SUCCESS\fP If the preparation was successful\&.
  1018. .br
  1019. \fITSS2_FAPI_RC_PATH_ALREADY_EXISTS\fP If the object with does already exist in keystore\&.
  1020. .br
  1021. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  1022. .br
  1023. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  1024. .br
  1025. \fITSS2_FAPI_RC_NO_TPM\fP if FAPI was initialized in no-TPM-mode via its config file\&.
  1026. .br
  1027. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  1028. .br
  1029. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  1030. .br
  1031. \fITSS2_FAPI_RC_BAD_PATH\fP if the path is used in inappropriate context or contains illegal characters\&.
  1032. .br
  1033. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP if a FAPI object path was not found during authorization\&.
  1034. .RE
  1035. .PP
  1036. .SS "TSS2_RC ifapi_key_create_prepare_auth (\fBFAPI_CONTEXT\fP * context, char const * keyPath, char const * policyPath, char const * authValue)"
  1037. Prepare key creation with an auth value\&.
  1038. .PP
  1039. The auth value will be copied int the FAPI context for later use in key creation\&.
  1040. .PP
  1041. \fBParameters:\fP
  1042. .RS 4
  1043. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  1044. .br
  1045. \fIkeyPath\fP the key path without the parent directories of the key store\&. (e\&.g\&. HE/EK, HS/SRK/mykey)
  1046. .br
  1047. \fIpolicyPath\fP identifies the policy to be associated with the new key\&. policyPath MAY be NULL\&. If policyPath is NULL then no policy will be associated with the key\&.
  1048. .br
  1049. \fIauthValue\fP The authentication value of the key\&.
  1050. .RE
  1051. .PP
  1052. \fBReturn values:\fP
  1053. .RS 4
  1054. \fITSS2_RC_SUCCESS\fP If the preparation was successful\&.
  1055. .br
  1056. \fITSS2_FAPI_RC_PATH_ALREADY_EXISTS\fP If the object with does already exist in keystore\&.
  1057. .br
  1058. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  1059. .br
  1060. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  1061. .br
  1062. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  1063. .br
  1064. \fITSS2_FAPI_RC_NO_TPM\fP if FAPI was initialized in no-TPM-mode via its config file\&.
  1065. .br
  1066. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  1067. .br
  1068. \fITSS2_FAPI_RC_BAD_PATH\fP if the path is used in inappropriate context or contains illegal characters\&.
  1069. .br
  1070. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP if a FAPI object path was not found during authorization\&.
  1071. .RE
  1072. .PP
  1073. .SS "TSS2_RC ifapi_key_create_prepare_sensitive (\fBFAPI_CONTEXT\fP * context, char const * keyPath, char const * policyPath, size_t dataSize, char const * authValue, uint8_t const * data)"
  1074. Prepare key creation with an auth value and sensitive data\&.
  1075. .PP
  1076. The auth value and the sensitive data will be copied int the FAPI context for later use in key creation\&.
  1077. .PP
  1078. \fBParameters:\fP
  1079. .RS 4
  1080. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  1081. .br
  1082. \fIkeyPath\fP the key path without the parent directories of the key store\&. (e\&.g\&. HE/EK, HS/SRK/mykey)
  1083. .br
  1084. \fIpolicyPath\fP identifies the policy to be associated with the new key\&. policyPath MAY be NULL\&. If policyPath is NULL then no policy will be associated with the key\&.
  1085. .br
  1086. \fIdataSize\fP The size of the sensitive data\&.
  1087. .br
  1088. \fIauthValue\fP The authentication value of the key\&.
  1089. .br
  1090. \fIdata\fP The sensitive data\&.
  1091. .RE
  1092. .PP
  1093. \fBReturn values:\fP
  1094. .RS 4
  1095. \fITSS2_RC_SUCCESS\fP If the preparation was successful\&.
  1096. .br
  1097. \fITSS2_FAPI_RC_PATH_ALREADY_EXISTS\fP If the object with does already exist in keystore\&.
  1098. .br
  1099. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  1100. .br
  1101. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  1102. .br
  1103. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  1104. .br
  1105. \fITSS2_FAPI_RC_NO_TPM\fP if FAPI was initialized in no-TPM-mode via its config file\&.
  1106. .br
  1107. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  1108. .br
  1109. \fITSS2_FAPI_RC_BAD_PATH\fP if the path is used in inappropriate context or contains illegal characters\&.
  1110. .br
  1111. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP if a FAPI object path was not found during authorization\&.
  1112. .RE
  1113. .PP
  1114. .SS "TSS2_RC ifapi_key_sign (\fBFAPI_CONTEXT\fP * context, \fBIFAPI_OBJECT\fP * sig_key_object, char const * padding, TPM2B_DIGEST * digest, TPMT_SIGNATURE ** tpm_signature, char ** publicKey, char ** certificate)"
  1115. State machine for signing operation\&.
  1116. .PP
  1117. The key used for signing will be authorized and the signing of the passed data will be executed\&.
  1118. .PP
  1119. \fBParameters:\fP
  1120. .RS 4
  1121. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  1122. .br
  1123. \fIsig_key_object\fP The Fapi key object which will be used to sign the passed digest\&.
  1124. .br
  1125. \fIpadding\fP is the padding algorithm used\&. Possible values are RSA_SSA, RSA_PPSS (case insensitive)\&. padding MAY be NULL\&.
  1126. .br
  1127. \fIdigest\fP is the data to be signed, already hashed\&. digest MUST NOT be NULL\&.
  1128. .br
  1129. \fItpm_signature\fP returns the signature in binary form (DER format)\&. tpm_signature MUST NOT be NULL (callee-allocated)\&.
  1130. .br
  1131. \fIpublicKey\fP is the public key of the signing key in PEM format\&. publicKey is callee allocated and MAY be NULL\&.
  1132. .br
  1133. \fIcertificate\fP is the certificate associated with the signing key in PEM format\&. certificate MAY be NULL\&.
  1134. .RE
  1135. .PP
  1136. \fBReturn values:\fP
  1137. .RS 4
  1138. \fITSS2_RC_SUCCESS\fP If the signing was successful\&.
  1139. .br
  1140. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  1141. .br
  1142. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  1143. .br
  1144. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP If an internal error occurs, which is not covered by other return codes\&.
  1145. .br
  1146. \fITSS2_FAPI_RC_BAD_VALUE\fP If wrong values are detected during execution\&.
  1147. .br
  1148. \fITSS2_FAPI_RC_IO_ERROR\fP If an error occurs during access to the policy store\&.
  1149. .br
  1150. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP If a policy for a certain path was not found\&.
  1151. .br
  1152. \fITSS2_FAPI_RC_POLICY_UNKNOWN\fP If policy search for a certain policy digest was not successful\&.
  1153. .br
  1154. \fITSS2_FAPI_RC_BAD_TEMPLATE\fP In a invalid policy is loaded during execution\&.
  1155. .br
  1156. \fITPM2_RC_BAD_AUTH\fP If the authentication for an object needed for policy execution fails\&.
  1157. .br
  1158. \fITSS2_FAPI_RC_AUTHORIZATION_UNKNOWN\fP if a needed authorization callback is not defined\&.
  1159. .br
  1160. \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&.
  1161. .br
  1162. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  1163. .br
  1164. \fITSS2_FAPI_RC_AUTHORIZATION_FAILED\fP if the authorization attempt fails\&.
  1165. .br
  1166. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  1167. .br
  1168. \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&.
  1169. .RE
  1170. .PP
  1171. .SS "TSS2_RC ifapi_load_key (\fBFAPI_CONTEXT\fP * context, char const * keyPath, \fBIFAPI_OBJECT\fP ** key_object)"
  1172. Load a key and initialize profile and session for ESAPI execution\&.
  1173. .PP
  1174. This state machine prepares the session for key loading\&. Some session related parameters will be taken from profile\&.
  1175. .PP
  1176. \fBParameters:\fP
  1177. .RS 4
  1178. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  1179. .br
  1180. \fIkeyPath\fP the key path without the parent directories of the key store\&. (e\&.g\&. HE/EK, HS/SRK/mykey)
  1181. .br
  1182. \fIkey_object\fP The callee allocated internal representation of a key object\&.
  1183. .RE
  1184. .PP
  1185. \fBReturn values:\fP
  1186. .RS 4
  1187. \fITSS2_RC_SUCCESS\fP If the key was loaded successfully\&.
  1188. .br
  1189. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  1190. .br
  1191. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  1192. .br
  1193. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP If an internal error occurs, which is not covered by other return codes\&.
  1194. .br
  1195. \fITSS2_FAPI_RC_BAD_VALUE\fP If wrong values are detected during execution\&.
  1196. .br
  1197. \fITSS2_FAPI_RC_IO_ERROR\fP If an error occurs during access to the object store\&.
  1198. .br
  1199. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP If a policy or key was not found\&.
  1200. .br
  1201. \fITSS2_FAPI_RC_POLICY_UNKNOWN\fP If policy search for a certain policy digest was not successful\&.
  1202. .br
  1203. \fITPM2_RC_BAD_AUTH\fP If the authentication for an object needed for policy execution fails\&.
  1204. .br
  1205. \fITSS2_FAPI_RC_AUTHORIZATION_UNKNOWN\fP if a needed authorization callback is not defined\&.
  1206. .br
  1207. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  1208. .br
  1209. \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&.
  1210. .br
  1211. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  1212. .br
  1213. \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&.
  1214. .br
  1215. \fITSS2_FAPI_RC_AUTHORIZATION_FAILED\fP if the authorization attempt fails\&.
  1216. .br
  1217. \fITSS2_FAPI_RC_NOT_PROVISIONED\fP FAPI was not provisioned\&.
  1218. .br
  1219. \fITSS2_FAPI_RC_BAD_PATH\fP if the path is used in inappropriate context or contains illegal characters\&.
  1220. .RE
  1221. .PP
  1222. .SS "TSS2_RC ifapi_load_key_async (\fBFAPI_CONTEXT\fP * context, size_t position)"
  1223. Initialize state machine for loading a key\&.
  1224. .PP
  1225. \fBParameters:\fP
  1226. .RS 4
  1227. \fIcontext\fP for storing all state information\&.
  1228. .br
  1229. \fIposition\fP the position of the key in path list stored in context->loadKey\&.path_list\&.
  1230. .RE
  1231. .PP
  1232. \fBReturn values:\fP
  1233. .RS 4
  1234. \fITSS2_RC_SUCCESS\fP on success\&.
  1235. .br
  1236. \fITSS2_FAPI_RC_MEMORY\fP if memory could not be allocated for path names\&.
  1237. .RE
  1238. .PP
  1239. .SS "TSS2_RC ifapi_load_key_finish (\fBFAPI_CONTEXT\fP * context, bool flush_parent)"
  1240. State machine for loading a key\&.
  1241. .PP
  1242. A stack with all sup keys will be created and decremented during the loading auf all keys\&. The object of the loaded key will be stored in: context->loadKey\&.auth_object
  1243. .PP
  1244. \fBParameters:\fP
  1245. .RS 4
  1246. \fIcontext\fP for storing all state information\&.
  1247. .br
  1248. \fIflush_parent\fP If flush_parent is false parent is only flushed if a new parent is available\&.
  1249. .RE
  1250. .PP
  1251. \fBReturn values:\fP
  1252. .RS 4
  1253. \fITSS2_RC_SUCCESS\fP If the loading of the key was successful\&.
  1254. .br
  1255. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  1256. .br
  1257. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  1258. .br
  1259. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP If an internal error occurs, which is not covered by other return codes\&.
  1260. .br
  1261. \fITSS2_FAPI_RC_BAD_VALUE\fP If wrong values are detected during execution\&.
  1262. .br
  1263. \fITSS2_FAPI_RC_IO_ERROR\fP If an error occurs during access to the policy store\&.
  1264. .br
  1265. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP If an object needed for loading or authentication was not found\&.
  1266. .br
  1267. \fITSS2_FAPI_RC_POLICY_UNKNOWN\fP If policy search for a certain policy digest was not successful\&.
  1268. .br
  1269. \fITPM2_RC_BAD_AUTH\fP If the authentication for an object needed for loading fails\&.
  1270. .br
  1271. \fITSS2_FAPI_RC_AUTHORIZATION_UNKNOWN\fP if a needed authorization callback is not defined\&.
  1272. .br
  1273. \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&.
  1274. .br
  1275. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  1276. .br
  1277. \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&.
  1278. .br
  1279. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  1280. .br
  1281. \fITSS2_FAPI_RC_AUTHORIZATION_FAILED\fP if the authorization attempt fails\&.
  1282. .br
  1283. \fITSS2_FAPI_RC_BAD_PATH\fP if the path is used in inappropriate context or contains illegal characters\&.
  1284. .br
  1285. \fITSS2_FAPI_RC_NOT_PROVISIONED\fP FAPI was not provisioned\&.
  1286. .RE
  1287. .PP
  1288. < to avoid scan-build errors\&.
  1289. .PP
  1290. < to avoid scan-build errors\&.
  1291. .SS "TSS2_RC ifapi_load_keys_async (\fBFAPI_CONTEXT\fP * context, char const * keyPath)"
  1292. Asynchronous preparation for loading a key and parent keys\&.
  1293. .PP
  1294. The key loading is prepared\&. The pathname will be extended if possible and a linked list with the directories will be created\&.
  1295. .PP
  1296. \fBParameters:\fP
  1297. .RS 4
  1298. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  1299. .br
  1300. \fIkeyPath\fP the key path without the parent directories of the key store\&. (e\&.g\&. HE/EK, HS/SRK/mykey)
  1301. .RE
  1302. .PP
  1303. \fBReturn values:\fP
  1304. .RS 4
  1305. \fITSS2_RC_SUCCESS\fP If the preparation is successful\&.
  1306. .br
  1307. \fITSS2_FAPI_RC_MEMORY\fP if memory could not be allocated for path names\&.
  1308. .br
  1309. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  1310. .br
  1311. \fITSS2_FAPI_RC_BAD_PATH\fP if the path is used in inappropriate context or contains illegal characters\&.
  1312. .br
  1313. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP if a FAPI object path was not found during authorization\&.
  1314. .RE
  1315. .PP
  1316. .SS "TSS2_RC ifapi_load_keys_finish (\fBFAPI_CONTEXT\fP * context, bool flush_parent, \fBESYS_TR\fP * handle, \fBIFAPI_OBJECT\fP ** key_object)"
  1317. Asynchronous finish function for loading a key\&.
  1318. .PP
  1319. \fBParameters:\fP
  1320. .RS 4
  1321. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  1322. .br
  1323. \fIflush_parent\fP If false the parent of the key to be loaded will not be flushed\&.
  1324. .br
  1325. \fIhandle\fP The ESYS handle of the key\&.
  1326. .br
  1327. \fIkey_object\fP The object which will be used for the authorization of the loaded key\&.
  1328. .RE
  1329. .PP
  1330. \fBReturn values:\fP
  1331. .RS 4
  1332. \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&.
  1333. .br
  1334. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  1335. .br
  1336. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  1337. .br
  1338. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  1339. .br
  1340. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  1341. .br
  1342. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP if a FAPI object path was not found during authorization\&.
  1343. .br
  1344. \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&.
  1345. .br
  1346. \fITSS2_FAPI_RC_IO_ERROR\fP if an error occurred while accessing the object store\&.
  1347. .br
  1348. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  1349. .br
  1350. \fITSS2_FAPI_RC_AUTHORIZATION_UNKNOWN\fP if a required authorization callback is not set\&.
  1351. .br
  1352. \fITSS2_FAPI_RC_AUTHORIZATION_FAILED\fP if the authorization attempt fails\&.
  1353. .br
  1354. \fITSS2_FAPI_RC_POLICY_UNKNOWN\fP if policy search for a certain policy digest was not successful\&.
  1355. .br
  1356. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  1357. .br
  1358. \fITSS2_FAPI_RC_BAD_PATH\fP if the path is used in inappropriate context or contains illegal characters\&.
  1359. .br
  1360. \fITSS2_FAPI_RC_NOT_PROVISIONED\fP FAPI was not provisioned\&.
  1361. .RE
  1362. .PP
  1363. .SS "ifapi_load_parent_keys_async (\fBFAPI_CONTEXT\fP * context, char const * keyPath)"
  1364. Asynchronous preparation for loading of the parent keys\&.
  1365. .PP
  1366. The key loading is prepared\&. The pathname will be extended if possible and a linked list with the directories will be created\&.
  1367. .PP
  1368. \fBParameters:\fP
  1369. .RS 4
  1370. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  1371. .br
  1372. \fIkeyPath\fP the key path without the parent directories of the key store\&. (e\&.g\&. HE/EK, HS/SRK/mykey)
  1373. .RE
  1374. .PP
  1375. \fBReturn values:\fP
  1376. .RS 4
  1377. \fITSS2_RC_SUCCESS\fP If the preparation is successful\&.
  1378. .br
  1379. \fITSS2_FAPI_RC_MEMORY\fP if memory could not be allocated for path names\&.
  1380. .br
  1381. \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&.
  1382. .br
  1383. \fITSS2_FAPI_RC_BAD_PATH\fP if the path is used in inappropriate context or contains illegal characters\&.
  1384. .br
  1385. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP if a FAPI object path was not found during authorization\&.
  1386. .RE
  1387. .PP
  1388. .SS "TSS2_RC ifapi_load_primary_async (\fBFAPI_CONTEXT\fP * context, char * path)"
  1389. Prepare the loading of a primary key from key store\&.
  1390. .PP
  1391. The asynchronous loading or the key from keystore will be prepared and the path will be stored in the FAPI context\&.
  1392. .PP
  1393. \fBParameters:\fP
  1394. .RS 4
  1395. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  1396. .br
  1397. \fIpath\fP The FAPI path of the primary key\&.
  1398. .RE
  1399. .PP
  1400. \fBReturn values:\fP
  1401. .RS 4
  1402. \fITSS2_RC_SUCCESS\fP on success\&.
  1403. .br
  1404. \fITSS2_FAPI_RC_BAD_VALUE\fP if a wrong type was passed\&.
  1405. .br
  1406. \fITSS2_FAPI_RC_IO_ERROR\fP if an I/O error was encountered\&.
  1407. .br
  1408. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP if the file does not exist\&.
  1409. .br
  1410. \fITSS2_FAPI_RC_MEMORY\fP if memory could not be allocated for path names\&.
  1411. .br
  1412. \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&.
  1413. .br
  1414. \fITSS2_FAPI_RC_NOT_PROVISIONED\fP FAPI was not provisioned\&.
  1415. .br
  1416. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  1417. .br
  1418. \fITSS2_FAPI_RC_BAD_PATH\fP if the path is used in inappropriate context or contains illegal characters\&.
  1419. .RE
  1420. .PP
  1421. .SS "TSS2_RC ifapi_load_primary_finish (\fBFAPI_CONTEXT\fP * context, \fBESYS_TR\fP * handle)"
  1422. State machine to finalize the loading of a primary key from key store\&.
  1423. .PP
  1424. The asynchronous loading or the key from keystore will be finalized\&. Afterwards the hierarchy object, which will be used for authorization will be loaded and the ESAPI functions for primary generation will be called if the primary is not persistent\&.
  1425. .PP
  1426. \fBParameters:\fP
  1427. .RS 4
  1428. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  1429. .br
  1430. \fIhandle\fP The object handle of the primary key\&.
  1431. .RE
  1432. .PP
  1433. \fBReturn values:\fP
  1434. .RS 4
  1435. \fITSS2_RC_SUCCESS\fP on success\&.
  1436. .br
  1437. \fITSS2_FAPI_RC_BAD_VALUE\fP if a wrong type was passed\&.
  1438. .br
  1439. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP if the hierarchy file does not exist\&.
  1440. .br
  1441. \fITSS2_FAPI_RC_IO_ERROR\fP if an I/O error was encountered\&.
  1442. .br
  1443. \fITSS2_FAPI_RC_MEMORY\fP if memory could not be allocated for path names\&.
  1444. .br
  1445. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  1446. .br
  1447. \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&.
  1448. .br
  1449. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  1450. .br
  1451. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&.
  1452. .br
  1453. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  1454. .br
  1455. \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&.
  1456. .br
  1457. \fITSS2_FAPI_RC_AUTHORIZATION_UNKNOWN\fP if a required authorization callback is not set\&.
  1458. .br
  1459. \fITSS2_FAPI_RC_AUTHORIZATION_FAILED\fP if the authorization attempt fails\&.
  1460. .br
  1461. \fITSS2_FAPI_RC_POLICY_UNKNOWN\fP if policy search for a certain policy digest was not successful\&.
  1462. .br
  1463. \fITSS2_FAPI_RC_NOT_PROVISIONED\fP FAPI was not provisioned\&.
  1464. .br
  1465. \fITSS2_FAPI_RC_BAD_PATH\fP if the path is used in inappropriate context or contains illegal characters\&.
  1466. .RE
  1467. .PP
  1468. .SS "TSS2_RC ifapi_merge_profile_into_nv_template (\fBFAPI_CONTEXT\fP * context, \fBIFAPI_NV_TEMPLATE\fP * template)"
  1469. Merge profile already stored in FAPI context into a NV object template\&.
  1470. .PP
  1471. The defaults for NV creation which are stored in the FAPI default profile will be merged in the passed templates default values\&.
  1472. .PP
  1473. \fBParameters:\fP
  1474. .RS 4
  1475. \fIcontext\fP The \fBFAPI_CONTEXT\fP with the default profile\&.
  1476. .br
  1477. \fItemplate\fP The template with the default values for the NV object\&.
  1478. .RE
  1479. .PP
  1480. \fBReturn values:\fP
  1481. .RS 4
  1482. \fITSS2_RC_SUCCESS\fP on success\&.
  1483. .RE
  1484. .PP
  1485. .SS "TSS2_RC ifapi_merge_profile_into_template (const \fBIFAPI_PROFILE\fP * profile, \fBIFAPI_KEY_TEMPLATE\fP * template)"
  1486. Merge profile already stored in FAPI context into a key template\&.
  1487. .PP
  1488. The defaults for key creation which are stored in the FAPI default profile will be merged in the passed templates default values\&.
  1489. .PP
  1490. \fBParameters:\fP
  1491. .RS 4
  1492. \fIprofile\fP The profile which will be used to adjust the template\&.
  1493. .br
  1494. \fItemplate\fP The template with the default values for the key object\&.
  1495. .RE
  1496. .PP
  1497. \fBReturn values:\fP
  1498. .RS 4
  1499. \fITSS2_RC_SUCCESS\fP on success\&.
  1500. .RE
  1501. .PP
  1502. .SS "TSS2_RC ifapi_non_tpm_mode_init (\fBFAPI_CONTEXT\fP * context)"
  1503. Prepare session for FAPI command execution without TPM\&.
  1504. .PP
  1505. It will be checked whether the context of FAPI is initialized and whether no other FAPI command session is running\&. Also some handle variables in the context are initialized\&.
  1506. .PP
  1507. \fBParameters:\fP
  1508. .RS 4
  1509. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  1510. .RE
  1511. .PP
  1512. \fBReturn values:\fP
  1513. .RS 4
  1514. \fITSS2_RC_SUCCESS\fP on success\&.
  1515. .br
  1516. \fITSS2_FAPI_RC_BAD_REFERENCE\fP if the context is not initialized\&.
  1517. .br
  1518. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP If a FAPI command session is active\&.
  1519. .RE
  1520. .PP
  1521. .SS "TSS2_RC ifapi_nv_read (\fBFAPI_CONTEXT\fP * context, uint8_t ** data, size_t * size)"
  1522. State machine to read data from the NV ram of the TPM\&.
  1523. .PP
  1524. Context nv_cmd has to be prepared before the call of this function:
  1525. .IP "\(bu" 2
  1526. auth_index The ESAPI handle of the authorization object\&.
  1527. .IP "\(bu" 2
  1528. numBytes The number of bytes which should be read\&.
  1529. .IP "\(bu" 2
  1530. esys_handle The ESAPI handle of the NV object\&.
  1531. .PP
  1532. .PP
  1533. \fBParameters:\fP
  1534. .RS 4
  1535. \fIcontext\fP for storing all state information\&.
  1536. .br
  1537. \fIdata\fP the data fetched from TPM\&.
  1538. .br
  1539. \fIsize\fP The number of bytes requested and fetched\&.
  1540. .RE
  1541. .PP
  1542. \fBReturn values:\fP
  1543. .RS 4
  1544. \fITSS2_RC_SUCCESS\fP If the data was read successfully\&.
  1545. .br
  1546. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  1547. .br
  1548. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  1549. .br
  1550. \fITSS2_FAPI_RC_BAD_VALUE\fP If wrong values are detected during execution\&.
  1551. .br
  1552. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP If an internal error occurs, which is
  1553. .IP "\(bu" 2
  1554. not covered by other return codes\&.
  1555. .PP
  1556. .br
  1557. \fITSS2_FAPI_RC_IO_ERROR\fP If an error occurs during access to the object store\&.
  1558. .br
  1559. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP If a policy for a certain path was not found\&.
  1560. .br
  1561. \fITSS2_FAPI_RC_POLICY_UNKNOWN\fP If policy search for a certain policy digest was not successful\&.
  1562. .br
  1563. \fITPM2_RC_BAD_AUTH\fP If the authentication for an object needed for the execution fails\&.
  1564. .br
  1565. \fITSS2_FAPI_RC_AUTHORIZATION_UNKNOWN\fP if a needed authorization callback is not defined\&.
  1566. .br
  1567. \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&.
  1568. .br
  1569. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  1570. .br
  1571. \fITSS2_FAPI_RC_AUTHORIZATION_FAILED\fP if the authorization attempt fails\&.
  1572. .br
  1573. \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&.
  1574. .RE
  1575. .PP
  1576. .SS "TSS2_RC ifapi_nv_write (\fBFAPI_CONTEXT\fP * context, char * nvPath, size_t param_offset, uint8_t const * data, size_t size)"
  1577. State machine to write data to the NV ram of the TPM\&.
  1578. .PP
  1579. The NV object will be read from object store and the data will be written by one, or more than one if necessary, ESAPI calls to the NV ram of the TPM\&. The sub context nv_cmd will be prepared:
  1580. .IP "\(bu" 2
  1581. data The buffer for the data which has to be written
  1582. .IP "\(bu" 2
  1583. offset The current offset for writing
  1584. .IP "\(bu" 2
  1585. numBytes The number of bytes which have to be written\&.
  1586. .PP
  1587. .PP
  1588. \fBParameters:\fP
  1589. .RS 4
  1590. \fIcontext\fP for storing all state information\&.
  1591. .br
  1592. \fInvPath\fP The fapi path of the NV object\&.
  1593. .br
  1594. \fIparam_offset\fP The offset in the NV memory (will be stored in context)\&.
  1595. .br
  1596. \fIdata\fP The pointer to the data to be written\&.
  1597. .br
  1598. \fIsize\fP The number of bytes to be written\&.
  1599. .RE
  1600. .PP
  1601. \fBReturn values:\fP
  1602. .RS 4
  1603. \fITSS2_RC_SUCCESS\fP If data can be written\&.
  1604. .br
  1605. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  1606. .br
  1607. \fITSS2_FAPI_RC_MEMORY\fP if not enough memory can be allocated\&.
  1608. .br
  1609. \fITSS2_FAPI_RC_BAD_VALUE\fP If wrong values are detected during execution\&.
  1610. .br
  1611. \fITSS2_FAPI_RC_GENERAL_FAILURE\fP If an internal error occurs, which is
  1612. .IP "\(bu" 2
  1613. not covered by other return codes\&.
  1614. .PP
  1615. .br
  1616. \fITSS2_FAPI_RC_IO_ERROR\fP If an error occurs during access to the object store\&.
  1617. .br
  1618. \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP The nv object or an object needed for authentication was not found\&.
  1619. .br
  1620. \fITSS2_FAPI_RC_POLICY_UNKNOWN\fP If policy search for a certain policy digest was not successful\&.
  1621. .br
  1622. \fITPM2_RC_BAD_AUTH\fP If the authentication for an object needed for the command execution fails\&.
  1623. .br
  1624. \fITSS2_FAPI_RC_AUTHORIZATION_UNKNOWN\fP if a needed authorization callback is not defined\&.
  1625. .br
  1626. \fITSS2_FAPI_RC_BAD_PATH\fP if a path is used in inappropriate context or contains illegal characters\&.
  1627. .br
  1628. \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&.
  1629. .br
  1630. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&.
  1631. .br
  1632. \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&.
  1633. .br
  1634. \fITSS2_FAPI_RC_BAD_REFERENCE\fP a invalid null pointer is passed\&.
  1635. .br
  1636. \fITSS2_FAPI_RC_AUTHORIZATION_FAILED\fP if the authorization attempt fails\&.
  1637. .br
  1638. \fITSS2_FAPI_RC_NOT_PROVISIONED\fP FAPI was not provisioned\&.
  1639. .RE
  1640. .PP
  1641. .SS "void ifapi_primary_clean (\fBFAPI_CONTEXT\fP * context)"
  1642. Cleanup primary keys in error cases (non asynchronous)\&.
  1643. .PP
  1644. \fBParameters:\fP
  1645. .RS 4
  1646. \fIcontext\fP The \fBFAPI_CONTEXT\fP storing the used handles\&.
  1647. .RE
  1648. .PP
  1649. \fBReturn values:\fP
  1650. .RS 4
  1651. \fITSS2_RC_SUCCESS\fP on success\&.
  1652. .br
  1653. \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&.
  1654. .RE
  1655. .PP
  1656. .SS "void ifapi_session_clean (\fBFAPI_CONTEXT\fP * context)"
  1657. Cleanup FAPI sessions in error cases\&.
  1658. .PP
  1659. The uses sessions and the SRK (if not persistent) will be flushed non asynchronous in error cases\&.
  1660. .PP
  1661. \fBParameters:\fP
  1662. .RS 4
  1663. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  1664. .RE
  1665. .PP
  1666. .SS "TSS2_RC ifapi_session_init (\fBFAPI_CONTEXT\fP * context)"
  1667. Prepare session for FAPI command execution\&.
  1668. .PP
  1669. It will be checked whether the context of FAPI and ESAPI is initialized and whether no other FAPI command session is running\&. Also some handle variables in the context are initialized\&.
  1670. .PP
  1671. \fBParameters:\fP
  1672. .RS 4
  1673. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  1674. .RE
  1675. .PP
  1676. \fBReturn values:\fP
  1677. .RS 4
  1678. \fITSS2_RC_SUCCESS\fP on success\&.
  1679. .br
  1680. \fITSS2_FAPI_RC_BAD_REFERENCE\fP if the context is not initialized\&.
  1681. .br
  1682. \fITSS2_FAPI_RC_BAD_SEQUENCE\fP If a FAPI command session is active\&.
  1683. .br
  1684. \fITSS2_FAPI_RC_NO_TPM\fP if the ESAPI context is not initialized\&.
  1685. .RE
  1686. .PP
  1687. .SS "TSS2_RC ifapi_set_auth (\fBFAPI_CONTEXT\fP * context, \fBIFAPI_OBJECT\fP * auth_object, const char * description)"
  1688. Set authorization value for a FAPI object\&.
  1689. .PP
  1690. The callback which provides the auth value must be defined\&.
  1691. .PP
  1692. \fBParameters:\fP
  1693. .RS 4
  1694. \fIcontext\fP The \fBFAPI_CONTEXT\fP\&.
  1695. .br
  1696. \fIauth_object\fP The auth value will be assigned to this object\&.
  1697. .br
  1698. \fIdescription\fP The description will be passed to the callback which delivers the auth value\&.
  1699. .RE
  1700. .PP
  1701. \fBReturn values:\fP
  1702. .RS 4
  1703. \fITSS2_RC_SUCCESS\fP on success\&.
  1704. .br
  1705. \fITSS2_FAPI_RC_AUTHORIZATION_UNKNOWN\fP If the callback for getting the auth value is not defined\&.
  1706. .RE
  1707. .PP
  1708. .SS "void ifapi_set_description (\fBIFAPI_OBJECT\fP * object, char * description)"
  1709. Set description of an internal FAPI object\&.
  1710. .PP
  1711. \fBParameters:\fP
  1712. .RS 4
  1713. \fIobject\fP The object with the description\&.
  1714. .br
  1715. \fIdescription\fP The description char strint or NULL\&.
  1716. .RE
  1717. .PP
  1718. .SH "Author"
  1719. .PP
  1720. Generated automatically by Doxygen for tpm2-tss from the source code\&.