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β TheFAPI_CONTEXTkeyPathβ the path to the encryption keyplainTextβ the plaintext data to encryptplainTextSizeβ the size of theplainTextin bytescipherTextβ 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β ifcontext,keyPath,plainText, orcipherTextisNULL.TSS2_FAPI_RC_BAD_CONTEXTβ if context corruption is detected.TSS2_FAPI_RC_KEY_NOT_FOUNDβ ifkeyPathdoes not map to a FAPI key.TSS2_FAPI_RC_BAD_KEYβ if the key atkeyPathis unsuitable for encryption.TSS2_FAPI_RC_BAD_VALUEβ ifplainTextSizeis 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β TheFAPI_CONTEXTkeyPathβ The path to the encryption keyplainTextβ TheplainTextdata to encryptplainTextSizeβ The size of theplainTextin bytes
π¨ Return values π¨
TSS2_RC_SUCCESSβ if the function call was a success.TSS2_FAPI_RC_BAD_REFERENCEβ ifcontext,keyPathorplainTextisNULL.TSS2_FAPI_RC_BAD_CONTEXTβ if context corruption is detected.TSS2_FAPI_RC_KEY_NOT_FOUNDβ ifkeyPathdoes not map to a FAPI key.TSS2_FAPI_RC_BAD_KEYβ if the key atkeyPathis unsuitable for encryption.TSS2_FAPI_RC_BAD_VALUEβ ifplainTextSizeis 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β TheFAPI_CONTEXTcipherTextβ The encoded ciphertextcipherTextSizeβ The size of the encoded cipher text.
π¨ Return values π¨
TSS2_RC_SUCCESSβ if the function call was a success.TSS2_FAPI_RC_BAD_REFERENCEβ ifcontextorciphertextisNULL.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
- 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