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 β€” The FAPI_CONTEXT
  • path β€” The path to the policy that is to be exported
  • jsonPolicy β€” The JSON-encoded policy. jsonPolicy MUST NOT be NULL. (fr fr, do not pass NULL here, it will not go well πŸ’€)

⭐ Return values

  • TSS2_RC_SUCCESS if the function call was a success.
  • TSS2_FAPI_RC_BAD_REFERENCE if context, path or jsonPolicy is NULL.
  • TSS2_FAPI_RC_BAD_CONTEXT if context corruption is detected.
  • TSS2_FAPI_RC_BAD_PATH if path does not map to a FAPI policy.
  • TSS2_FAPI_RC_BAD_SEQUENCE if the context has an asynchronous operation already pending.
  • TSS2_FAPI_RC_IO_ERROR if the data cannot be saved.
  • TSS2_FAPI_RC_MEMORY if the FAPI cannot allocate enough memory for internal operations or return parameters.
  • TSS2_FAPI_RC_NO_TPM if FAPI was initialized in no-TPM-mode via its config file.
  • TSS2_FAPI_RC_TRY_AGAIN if an I/O operation is not finished yet and this function needs to be called again.
  • TSS2_FAPI_RC_GENERAL_FAILURE if an internal error occurred.
  • TSS2_FAPI_RC_BAD_VALUE if an invalid value was passed into the function.
  • TSS2_FAPI_RC_PATH_NOT_FOUND if a FAPI object path was not found during authorization.
  • TSS2_FAPI_RC_KEY_NOT_FOUND if a key was not found.
  • TSS2_ESYS_RC_* possible error codes of ESAPI.
  • TSS2_FAPI_RC_NOT_PROVISIONED FAPI 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 β€” The FAPI_CONTEXT
  • path β€” The path to the policy that is to be exported

⭐ Return values

  • TSS2_RC_SUCCESS if the function call was a success.
  • TSS2_FAPI_RC_BAD_REFERENCE if context or path is NULL.
  • TSS2_FAPI_RC_BAD_CONTEXT if context corruption is detected.
  • TSS2_FAPI_RC_BAD_PATH if path does not map to a FAPI policy.
  • TSS2_FAPI_RC_BAD_SEQUENCE if the context has an asynchronous operation already pending.
  • TSS2_FAPI_RC_IO_ERROR if the data cannot be saved.
  • TSS2_FAPI_RC_MEMORY if the FAPI cannot allocate enough memory for internal operations or return parameters.
  • TSS2_FAPI_RC_NO_TPM if 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 β€” The FAPI_CONTEXT
  • jsonPolicy β€” The JSON-encoded policy. jsonPolicy MUST NOT be NULL. Again. Still true. Always true πŸ™ˆ

⭐ Return values

  • TSS2_RC_SUCCESS if the function call was a success.
  • TSS2_FAPI_RC_BAD_REFERENCE if context or jsonPolicy is NULL.
  • TSS2_FAPI_RC_BAD_CONTEXT if context corruption is detected.
  • TSS2_FAPI_RC_BAD_SEQUENCE if the context has an asynchronous operation already pending.
  • TSS2_FAPI_RC_IO_ERROR if the data cannot be saved.
  • TSS2_FAPI_RC_MEMORY if the FAPI cannot allocate enough memory for internal operations or return parameters.
  • TSS2_FAPI_RC_TRY_AGAIN if the asynchronous operation is not yet complete. Call this function again later. (patience, queen ⏳)
  • TSS2_FAPI_RC_BAD_PATH if a path is used in inappropriate context or contains illegal characters.
  • TSS2_FAPI_RC_GENERAL_FAILURE if an internal error occurred.
  • TSS2_FAPI_RC_BAD_VALUE if an invalid value was passed into the function.
  • TSS2_FAPI_RC_PATH_NOT_FOUND if a FAPI object path was not found during authorization.
  • TSS2_FAPI_RC_KEY_NOT_FOUND if a key was not found.
  • TSS2_FAPI_RC_NOT_PROVISIONED FAPI 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