Fapi_Encrypt(3)

okay so bestie, welcome to Fapi_Encrypt(3) from the Library Functions Manual β€” this is the FAPI encrypt page, and it's literally about invoking Encrypt one-call style or async style. πŸ’–βœ¨

πŸ’– NAME πŸ’–

Fapi_Encrypt β€” yep, it's Fapi_Encrypt. The name is the name, and the vibes are impeccable. πŸ’…

✨ SYNOPSIS ✨

Functions, bestie. Here's the exact lineup:

TSS2_RC Fapi_Encrypt (FAPI_CONTEXT *context, char const *keyPath,
    uint8_t const *plainText, size_t plainTextSize, uint8_t
    **cipherText, size_t *cipherTextSize)
TSS2_RC Fapi_Encrypt_Async (FAPI_CONTEXT *context, char const *keyPath,
    uint8_t const *plainText, size_t plainTextSize)
TSS2_RC Fapi_Encrypt_Finish (FAPI_CONTEXT *context, uint8_t
    **cipherText, size_t *cipherTextSize)

🌸 Detailed Description 🌸

FAPI functions to invoke Encrypt either as one-call or in an asynchronous manner. That's the whole plot: one-call energy, or async main-character energy. ✨

πŸ› οΈ Function Documentation πŸ› οΈ

Okay, now the three functions, one by one. No skipping, no cap. 🫢

πŸ’– Fapi_Encrypt β€” the One-Call function πŸ’–

TSS2_RC Fapi_Encrypt (FAPI_CONTEXT * context, char const * keyPath, uint8_t const * plainText, size_t plainTextSize, uint8_t ** cipherText, size_t * cipherTextSize)

One-Call function for Fapi_Encrypt. It encrypts the provided data for the target key using the TPM encryption schemes as specified in the crypto profile. This function does not use the TPM; i.e. works in non-TPM mode. πŸ’…

πŸŽ€ Parameters πŸŽ€

  • context β€” The FAPI_CONTEXT
  • keyPath β€” the path to the encryption key
  • plainText β€” the plaintext data to encrypt
  • plainTextSize β€” the size of the plainText in bytes
  • cipherText β€” the encoded cipher text.
  • cipherTextSize β€” the size of the encoded cipher text.

🚨 Return values 🚨

  • TSS2_RC_SUCCESS β€” if the function call was a success.
  • TSS2_FAPI_RC_BAD_REFERENCE β€” if context, keyPath, plainText, or cipherText is NULL.
  • TSS2_FAPI_RC_BAD_CONTEXT β€” if context corruption is detected.
  • TSS2_FAPI_RC_KEY_NOT_FOUND β€” if keyPath does not map to a FAPI key.
  • TSS2_FAPI_RC_BAD_KEY β€” if the key at keyPath is unsuitable for encryption.
  • TSS2_FAPI_RC_BAD_VALUE β€” if plainTextSize is 0.
  • TSS2_FAPI_RC_BAD_SEQUENCE β€” if the context has an asynchronous operation already pending.
  • 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_IO_ERROR β€” if an error occurred while accessing the object store.
  • TSS2_FAPI_RC_NOT_IMPLEMENTED β€” if the encryption algorithm is not available.
  • 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_PATH_NOT_FOUND β€” if a FAPI object path was not found during authorization.
  • TSS2_FAPI_RC_GENERAL_FAILURE β€” if an internal error occurred.
  • TSS2_FAPI_RC_AUTHORIZATION_UNKNOWN β€” if a required authorization callback is not set.
  • TSS2_FAPI_RC_AUTHORIZATION_FAILED β€” if the authorization attempt fails.
  • TSS2_FAPI_RC_POLICY_UNKNOWN β€” if policy search for a certain policy digest was not successful.
  • TSS2_ESYS_RC_* β€” possible error codes of ESAPI.
  • TSS2_FAPI_RC_NOT_PROVISIONED β€” FAPI was not provisioned.
  • TSS2_FAPI_RC_BAD_PATH β€” if the path is used in inappropriate context or contains illegal characters.

πŸ¦‹ Fapi_Encrypt_Async β€” the async era πŸ¦‹

TSS2_RC Fapi_Encrypt_Async (FAPI_CONTEXT * context, char const * keyPath, uint8_t const * plainText, size_t plainTextSize)

Asynchronous function for Fapi_Encrypt. It encrypts the provided data for the target key using the TPM encryption schemes as specified in the crypto profile. This function does not use the TPM; i.e. works in non-TPM mode. πŸ’…

Call Fapi_Encrypt_Finish to finish the execution of this command. That's your "bestie, come back and finish" moment. 🫢

πŸŽ€ Parameters πŸŽ€

  • context β€” The FAPI_CONTEXT
  • keyPath β€” The path to the encryption key
  • plainText β€” The plainText data to encrypt
  • plainTextSize β€” The size of the plainText in bytes

🚨 Return values 🚨

  • TSS2_RC_SUCCESS β€” if the function call was a success.
  • TSS2_FAPI_RC_BAD_REFERENCE β€” if context, keyPath or plainText is NULL.
  • TSS2_FAPI_RC_BAD_CONTEXT β€” if context corruption is detected.
  • TSS2_FAPI_RC_KEY_NOT_FOUND β€” if keyPath does not map to a FAPI key.
  • TSS2_FAPI_RC_BAD_KEY β€” if the key at keyPath is unsuitable for encryption.
  • TSS2_FAPI_RC_BAD_VALUE β€” if plainTextSize is 0.
  • TSS2_FAPI_RC_BAD_SEQUENCE β€” if the context has an asynchronous operation already pending.
  • 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.

🧚 Fapi_Encrypt_Finish β€” finish her πŸ’…

TSS2_RC Fapi_Encrypt_Finish (FAPI_CONTEXT * context, uint8_t ** cipherText, size_t * cipherTextSize)

Asynchronous finish function for Fapi_Encrypt. This function should be called after a previous Fapi_Encrypt_Async. No skipping the sequel, bestie. ✨

πŸŽ€ Parameters πŸŽ€

  • context β€” The FAPI_CONTEXT
  • cipherText β€” The encoded ciphertext
  • cipherTextSize β€” The size of the encoded cipher text.

🚨 Return values 🚨

  • TSS2_RC_SUCCESS β€” if the function call was a success.
  • TSS2_FAPI_RC_BAD_REFERENCE β€” if context or ciphertext 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.
  • TSS2_FAPI_RC_NOT_IMPLEMENTED β€” if the encryption algorithm is not available.
  • 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_GENERAL_FAILURE β€” if an internal error occurred.
  • TSS2_FAPI_RC_AUTHORIZATION_UNKNOWN β€” if a required authorization callback is not set.
  • TSS2_FAPI_RC_AUTHORIZATION_FAILED β€” if the authorization attempt fails.
  • TSS2_FAPI_RC_POLICY_UNKNOWN β€” if policy search for a certain policy digest was not successful.
  • TSS2_ESYS_RC_* β€” possible error codes of ESAPI.
  • TSS2_FAPI_RC_NOT_PROVISIONED β€” FAPI was not provisioned.
  • TSS2_FAPI_RC_BAD_PATH β€” if the path is used in inappropriate context or contains illegal characters.

πŸ“ Author πŸ“

Generated automatically by Doxygen for tpm2-tss from the source code. The robots did the typing, and honestly? Slay. πŸ€–βœ¨


okay bestie, that's the whole Fapi_Encrypt(3) page. It comes from tpm2-tss, Version 4.1.5 β€” stay encrypted, stay iconic, and may your return values always be TSS2_RC_SUCCESS. πŸ’–πŸ”βœ¨

πŸ“¦ where this page comes from