Fapi_ExportPolicy(3)
π Fapi_ExportPolicy(3) π
okay bestie, buckle up β this is the Fapi_ExportPolicy page from the Library Functions Manual, and it's genuinely iconic for anyone doing TPM2 FAPI stuff. No cap, it's a lot of return codes, but we're gonna get through it together π«Ά
β¨ NAME β¨
Fapi_ExportPolicy β literally what it says on the tin: export a policy. That's the whole vibe π
πΈ SYNOPSIS πΈ
π Functions
TSS2_RC Fapi_ExportPolicy (FAPI_CONTEXT *context, char const *path, char
**jsonPolicy)
TSS2_RC Fapi_ExportPolicy_Async (FAPI_CONTEXT *context, char const
*path)
TSS2_RC Fapi_ExportPolicy_Finish (FAPI_CONTEXT *context, char
**jsonPolicy)
π¦ Detailed Description π¦
So these are the FAPI functions that let you invoke ExportPolicy β and you get two ways to do it, bestie: the chill one-call way, or the async girlboss way where you have to come back and finish it yourself β¨
π Function Documentation π
π TSS2_RC Fapi_ExportPolicy (FAPI_CONTEXT * context, char const * path, char ** jsonPolicy)
One-Call function for Fapi_ExportPolicy. This is the "just do it all in one go, I trust you" version π
Exports a policy to a JSON encoded byte buffer. Slay.
π Parameters
contextβ TheFAPI_CONTEXTpathβ The path to the policy that is to be exportedjsonPolicyβ The JSON-encoded policy.jsonPolicyMUST NOT beNULL. (fr fr, do not passNULLhere, it will not go well π)
β Return values
TSS2_RC_SUCCESSif the function call was a success.TSS2_FAPI_RC_BAD_REFERENCEifcontext,pathorjsonPolicyisNULL.TSS2_FAPI_RC_BAD_CONTEXTif context corruption is detected.TSS2_FAPI_RC_BAD_PATHifpathdoes not map to a FAPI policy.TSS2_FAPI_RC_BAD_SEQUENCEif the context has an asynchronous operation already pending.TSS2_FAPI_RC_IO_ERRORif the data cannot be saved.TSS2_FAPI_RC_MEMORYif the FAPI cannot allocate enough memory for internal operations or return parameters.TSS2_FAPI_RC_NO_TPMif FAPI was initialized in no-TPM-mode via its config file.TSS2_FAPI_RC_TRY_AGAINif an I/O operation is not finished yet and this function needs to be called again.TSS2_FAPI_RC_GENERAL_FAILUREif an internal error occurred.TSS2_FAPI_RC_BAD_VALUEif an invalid value was passed into the function.TSS2_FAPI_RC_PATH_NOT_FOUNDif a FAPI object path was not found during authorization.TSS2_FAPI_RC_KEY_NOT_FOUNDif a key was not found.TSS2_ESYS_RC_*possible error codes of ESAPI.TSS2_FAPI_RC_NOT_PROVISIONEDFAPI was not provisioned.
π₯ TSS2_RC Fapi_ExportPolicy_Async (FAPI_CONTEXT * context, char const * path)
Asynchronous function for Fapi_ExportPolicy. Main character energy β it starts the job and then dips, and you have to come back for it later π
Exports a policy to a JSON encoded byte buffer.
Call Fapi_ExportPolicy_Finish to finish the execution of this command. Do not forget, bestie, or you'll be left hanging π
π Parameters
contextβ TheFAPI_CONTEXTpathβ The path to the policy that is to be exported
β Return values
TSS2_RC_SUCCESSif the function call was a success.TSS2_FAPI_RC_BAD_REFERENCEifcontextorpathisNULL.TSS2_FAPI_RC_BAD_CONTEXTif context corruption is detected.TSS2_FAPI_RC_BAD_PATHifpathdoes not map to a FAPI policy.TSS2_FAPI_RC_BAD_SEQUENCEif the context has an asynchronous operation already pending.TSS2_FAPI_RC_IO_ERRORif the data cannot be saved.TSS2_FAPI_RC_MEMORYif the FAPI cannot allocate enough memory for internal operations or return parameters.TSS2_FAPI_RC_NO_TPMif FAPI was initialized in no-TPM-mode via its config file.
π§ TSS2_RC Fapi_ExportPolicy_Finish (FAPI_CONTEXT * context, char ** jsonPolicy)
Asynchronous finish function for Fapi_ExportPolicy. The part where you actually collect what the async call started π
This function should be called after a previous Fapi_ExportPolicy_Async. Like, that's the whole requirement, okay?
π Parameters
contextβ TheFAPI_CONTEXTjsonPolicyβ The JSON-encoded policy.jsonPolicyMUST NOT beNULL. Again. Still true. Always true π
β Return values
TSS2_RC_SUCCESSif the function call was a success.TSS2_FAPI_RC_BAD_REFERENCEifcontextorjsonPolicyisNULL.TSS2_FAPI_RC_BAD_CONTEXTif context corruption is detected.TSS2_FAPI_RC_BAD_SEQUENCEif the context has an asynchronous operation already pending.TSS2_FAPI_RC_IO_ERRORif the data cannot be saved.TSS2_FAPI_RC_MEMORYif the FAPI cannot allocate enough memory for internal operations or return parameters.TSS2_FAPI_RC_TRY_AGAINif the asynchronous operation is not yet complete. Call this function again later. (patience, queen β³)TSS2_FAPI_RC_BAD_PATHif a path is used in inappropriate context or contains illegal characters.TSS2_FAPI_RC_GENERAL_FAILUREif an internal error occurred.TSS2_FAPI_RC_BAD_VALUEif an invalid value was passed into the function.TSS2_FAPI_RC_PATH_NOT_FOUNDif a FAPI object path was not found during authorization.TSS2_FAPI_RC_KEY_NOT_FOUNDif a key was not found.TSS2_FAPI_RC_NOT_PROVISIONEDFAPI was not provisioned.
π Author π
Generated automatically by Doxygen for tpm2-tss from the source code. Not me writing it by hand, the robots did that one π€β¨
k byeee π this page is from tpm2-tss, Version 4.1.5, and it's the Fapi_ExportPolicy(3) moment β go export some policies, bestie, you're gonna do amazing ππΈ
π¦ where this page comes from
- fedora 44: tpm2-tss-devel 4.1.5-1.fc44 Β· BSD-2-Clause
- fedora 44: tpm2-tss-devel 4.1.5-1.fc44 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms