Esys_Sign(3)
π Esys_Sign β the ESAPI function for the TPM2_Sign command π
Okay so bestie, welcome to Esys_Sign(3), straight out of the tpm2-tss library functions manual. This is the ESAPI glow-up of the TPM2_Sign command, and trust me, once you get it you're gonna be signing digests like it's nothing. β¨
πΈ NAME πΈ
Esys_Sign β literally the ESAPI function for the TPM2_Sign command. That's the whole vibe. π
π¦ SYNOPSIS π¦
Functions
TSS2_RC Esys_Sign_Async (ESYS_CONTEXT *esysContext, ESYS_TR keyHandle,
ESYS_TR shandle1, ESYS_TR shandle2, ESYS_TR shandle3, const
TPM2B_DIGEST *digest, const TPMT_SIG_SCHEME *inScheme, const
TPMT_TK_HASHCHECK *validation)
TSS2_RC Esys_Sign (ESYS_CONTEXT *esysContext, ESYS_TR keyHandle, ESYS_TR
shandle1, ESYS_TR shandle2, ESYS_TR shandle3, const TPM2B_DIGEST
*digest, const TPMT_SIG_SCHEME *inScheme, const TPMT_TK_HASHCHECK
*validation, TPMT_SIGNATURE **signature)
TSS2_RC Esys_Sign_Finish (ESYS_CONTEXT *esysContext, TPMT_SIGNATURE
**signature)
Three functions, one mission: get that digest signed. π
π Detailed Description π
ESAPI function to invoke the TPM2_Sign command β either as a one-call or in an asynchronous manner. Pick your fighter, both are iconic. π
π Function Documentation π
β TSS2_RC Esys_Sign (ESYS_CONTEXT * esysContext, ESYS_TR keyHandle, ESYS_TR shandle1, ESYS_TR shandle2, ESYS_TR shandle3, const TPM2B_DIGEST * digest, const TPMT_SIG_SCHEME * inScheme, const TPMT_TK_HASHCHECK * validation, TPMT_SIGNATURE ** signature)
One-Call function for TPM2_Sign π«Ά
So this one invokes the TPM2_Sign command in a one-call variant. Which means... the function will literally block until the TPM response is available. No cap, it just sits there and waits for the TPM to text back. π All input parameters are const. And the memory for non-simple output parameters is allocated by the function implementation β so she provides, you receive. π
πΈ Parameters
esysContextβ TheESYS_CONTEXT.keyHandleβ Handle of key that will perform signing. (The main character of this whole operation, honestly.)shandle1β Session handle for authorization ofkeyHandle.shandle2β Second session handle.shandle3β Third session handle.digestβ Digest to be signed. βοΈinSchemeβ TPM2_Signing scheme to use if the scheme forkeyHandleisTPM2_ALG_NULL.validationβ Proof thatdigestwas created by the TPM.signatureβ The signature. (callee-allocated)
π Return values
TSS2_RC_SUCCESSβ if the function call was a success. slay πTSS2_ESYS_RC_BAD_REFERENCEβ if theesysContextor required input pointers or required output handle references areNULL.TSS2_ESYS_RC_BAD_CONTEXTβ ifesysContextcorruption is detected.TSS2_ESYS_RC_MEMORYβ if the ESAPI cannot allocate enough memory for internal operations or return parameters.TSS2_ESYS_RC_BAD_SEQUENCEβ if the context has an asynchronous operation already pending.TSS2_ESYS_RC_INSUFFICIENT_RESPONSEβ if the TPM's response does not at least contain the tag, response length, and response code.TSS2_ESYS_RC_MALFORMED_RESPONSEβ if the TPM's response is corrupted.TSS2_ESYS_RC_RSP_AUTH_FAILEDβ if the response HMAC from the TPM did not verify.TSS2_ESYS_RC_MULTIPLE_DECRYPT_SESSIONSβ if more than one session has the'decrypt'attribute bit set.TSS2_ESYS_RC_MULTIPLE_ENCRYPT_SESSIONSβ if more than one session has the'encrypt'attribute bit set.TSS2_ESYS_RC_BAD_TRβ if any of theESYS_TRobjects are unknown to theESYS_CONTEXTor are of the wrong type or if requiredESYS_TRobjects areESYS_TR_NONE.TSS2_ESYS_RC_NO_ENCRYPT_PARAMβ if one of the sessions has the'encrypt'attribute set and the command does not support encryption of the first response parameter.TSS2_RCs produced by lower layers of the software stack may be returned to the caller unaltered unless handled internally.
β TSS2_RC Esys_Sign_Async (ESYS_CONTEXT * esysContext, ESYS_TR keyHandle, ESYS_TR shandle1, ESYS_TR shandle2, ESYS_TR shandle3, const TPM2B_DIGEST * digest, const TPMT_SIG_SCHEME * inScheme, const TPMT_TK_HASHCHECK * validation)
Asynchronous function for TPM2_Sign π¦
This one invokes the TPM2_Sign command in a asynchronous variant. Translation: the function returns as soon as the command has been sent downwards the stack to the TPM β she does NOT wait around, she has places to be. π¨ All input parameters are const. In order to retrieve the TPM's response, call Esys_Sign_Finish. That's the whole two-step. iykyk. β¨
πΈ Parameters
esysContextβ TheESYS_CONTEXT.keyHandleβ Handle of key that will perform signing.shandle1β Session handle for authorization ofkeyHandle.shandle2β Second session handle.shandle3β Third session handle.digestβ Digest to be signed.inSchemeβ TPM2_Signing scheme to use if the scheme forkeyHandleisTPM2_ALG_NULL.validationβ Proof thatdigestwas created by the TPM.
π Return values
ESYS_RC_SUCCESSβ if the function call was a success. (Yes bestie, that's how it's written in the source β keep it exactly like that. π)TSS2_ESYS_RC_BAD_REFERENCEβ if theesysContextor required input pointers or required output handle references areNULL.TSS2_ESYS_RC_BAD_CONTEXTβ ifesysContextcorruption is detected.TSS2_ESYS_RC_MEMORYβ if the ESAPI cannot allocate enough memory for internal operations or return parameters.TSS2_RCs produced by lower layers of the software stack may be returned to the caller unaltered unless handled internally.TSS2_ESYS_RC_MULTIPLE_DECRYPT_SESSIONSβ if more than one session has the'decrypt'attribute bit set.TSS2_ESYS_RC_MULTIPLE_ENCRYPT_SESSIONSβ if more than one session has the'encrypt'attribute bit set.TSS2_ESYS_RC_BAD_TRβ if any of theESYS_TRobjects are unknown to theESYS_CONTEXTor are of the wrong type or if requiredESYS_TRobjects areESYS_TR_NONE.TSS2_ESYS_RC_NO_ENCRYPT_PARAMβ if one of the sessions has the'encrypt'attribute set and the command does not support encryption of the first response parameter.
β TSS2_RC Esys_Sign_Finish (ESYS_CONTEXT * esysContext, TPMT_SIGNATURE ** signature)
Asynchronous finish function for TPM2_Sign π§
This is the part two, the ~resolution~, the third act. π This function returns the results of a TPM2_Sign command invoked via Esys_Sign_Finish. All non-simple output parameters are allocated by the function's implementation. And here's the cute part: NULL can be passed for every output parameter if the value is not required. Low-maintenance queen. π
π«Ά Ngl, the source really does say "invoked via Esys_Sign_Finish" right there β that's the text, we keep it, we don't touch it.
πΈ Parameters
esysContextβ TheESYS_CONTEXT.signatureβ The signature. (callee-allocated)
π Return values
TSS2_RC_SUCCESSβ on success.ESYS_RC_SUCCESSβ if the function call was a success.TSS2_ESYS_RC_BAD_REFERENCEβ if theesysContextor required input pointers or required output handle references areNULL.TSS2_ESYS_RC_BAD_CONTEXTβ ifesysContextcorruption is detected.TSS2_ESYS_RC_MEMORYβ if the ESAPI cannot allocate enough memory for internal operations or return parameters.TSS2_ESYS_RC_BAD_SEQUENCEβ if the context has an asynchronous operation already pending.TSS2_ESYS_RC_TRY_AGAINβ if the timeout counter expires before the TPM response is received. π (be patient, she's typingβ¦)TSS2_ESYS_RC_INSUFFICIENT_RESPONSEβ if the TPM's response does not at least contain the tag, response length, and response code.TSS2_ESYS_RC_RSP_AUTH_FAILEDβ if the response HMAC from the TPM did not verify.TSS2_ESYS_RC_MALFORMED_RESPONSEβ if the TPM's response is corrupted. πTSS2_RCs produced by lower layers of the software stack may be returned to the caller unaltered unless handled internally.
π Author π
Generated automatically by Doxygen for tpm2-tss from the source code. So nobody hand-wrote this, it's giving machine-made icon behavior. π€β¨
Okay bestie, that's the whole page! Go sign those digests. Mwah π
tpm2-tss Β· Version 4.1.5 Β· Esys_Sign(3) β that's the version and date situation, signed off with love ππ
π¦ 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