.TH "Fapi_NvRead" 3 "Sun May 7 2023" "Version 4.0.1" "tpm2-tss" \" -*- nroff -*- .ad l .nh .SH NAME Fapi_NvRead \- Fapi_NvRead .SH SYNOPSIS .br .PP .SS "Functions" .in +1c .ti -1c .RI "TSS2_RC \fBFapi_NvRead\fP (\fBFAPI_CONTEXT\fP *context, char const *path, uint8_t **data, size_t *size, char **logData)" .br .ti -1c .RI "TSS2_RC \fBFapi_NvRead_Async\fP (\fBFAPI_CONTEXT\fP *context, char const *path)" .br .ti -1c .RI "TSS2_RC \fBFapi_NvRead_Finish\fP (\fBFAPI_CONTEXT\fP *context, uint8_t **data, size_t *size, char **logData)" .br .in -1c .SH "Detailed Description" .PP FAPI functions to invoke NvRead either as one-call or in an asynchronous manner\&. .SH "Function Documentation" .PP .SS "TSS2_RC Fapi_NvRead (\fBFAPI_CONTEXT\fP * context, char const * nvPath, uint8_t ** data, size_t * size, char ** logData)" One-Call function for Fapi_NvRead .PP Reads data from an NV index within the TPM\&. The FAPI will automatically do the multiple reads if the NV index is larger than the TPM's TPM2_MAX_NV_BUFFER_SIZE\&. .PP \fBParameters\fP .RS 4 \fIcontext\fP The \fBFAPI_CONTEXT\fP .br \fInvPath\fP The path of the NV index to read .br \fIdata\fP The data that was read from the NV index .br \fIsize\fP The size of data in bytes\&. May be NULL .br \fIlogData\fP The log data of the NV index if the index is of type 'extend'\&. May be NULL .RE .PP \fBReturn values\fP .RS 4 \fITSS2_RC_SUCCESS\fP if the function call was a success\&. .br \fITSS2_FAPI_RC_BAD_REFERENCE\fP if context, nvPath or data is NULL\&. .br \fITSS2_FAPI_RC_BAD_CONTEXT\fP if context corruption is detected\&. .br \fITSS2_FAPI_RC_BAD_PATH\fP if nvPath is not found\&. .br \fITSS2_FAPI_RC_AUTHORIZATION_FAILED\fP if authorization fails\&. .br \fITSS2_FAPI_RC_AUTHORIZATION_UNKNOWN\fP if don't know how to authenticate\&. .br \fITSS2_FAPI_RC_NV_NOT_READABLE\fP if the NV is not a readable index\&. .br \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&. .br \fITSS2_FAPI_RC_IO_ERROR\fP if the data cannot be saved\&. .br \fITSS2_FAPI_RC_MEMORY\fP if the FAPI cannot allocate enough memory for internal operations or return parameters\&. .br \fITSS2_FAPI_RC_NO_TPM\fP if FAPI was initialized in no-TPM-mode via its config file\&. .br \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP if a FAPI object path was not found during authorization\&. .br \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&. .br \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&. .br \fITSS2_FAPI_RC_TRY_AGAIN\fP if an I/O operation is not finished yet and this function needs to be called again\&. .br \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&. .br \fITSS2_FAPI_RC_POLICY_UNKNOWN\fP if policy search for a certain policy digest was not successful\&. .br \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&. .br \fITSS2_FAPI_RC_NOT_PROVISIONED\fP FAPI was not provisioned\&. .RE .PP .SS "TSS2_RC Fapi_NvRead_Async (\fBFAPI_CONTEXT\fP * context, char const * nvPath)" Asynchronous function for Fapi_NvRead .PP Reads data from an NV index within the TPM\&. The FAPI will automatically do the multiple reads if the NV index is larger than the TPM's TPM2_MAX_NV_BUFFER_SIZE\&. .PP Call Fapi_NvRead_Finish to finish the execution of this command\&. .PP \fBParameters\fP .RS 4 \fIcontext\fP The \fBFAPI_CONTEXT\fP .br \fInvPath\fP The path of the NV index to read .RE .PP \fBReturn values\fP .RS 4 \fITSS2_RC_SUCCESS\fP if the function call was a success\&. .br \fITSS2_FAPI_RC_BAD_REFERENCE\fP if context or nvPath is NULL\&. * .br \fITSS2_FAPI_RC_BAD_CONTEXT\fP if context corruption is detected\&. .br \fITSS2_FAPI_RC_BAD_PATH\fP if nvPath is not found\&. .br \fITSS2_FAPI_RC_AUTHORIZATION_FAILED\fP if authorization fails\&. .br \fITSS2_FAPI_RC_AUTHORIZATION_UNKNOWN\fP if don't know how to authenticate\&. .br \fITSS2_FAPI_RC_NV_NOT_READABLE\fP if the NV is not a readable index\&. .br \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&. .br \fITSS2_FAPI_RC_IO_ERROR\fP if the data cannot be saved\&. .br \fITSS2_FAPI_RC_MEMORY\fP if the FAPI cannot allocate enough memory for internal operations or return parameters\&. .br \fITSS2_FAPI_RC_NO_TPM\fP if FAPI was initialized in no-TPM-mode via its config file\&. .br \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP if a FAPI object path was not found during authorization\&. .br \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&. .br \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&. .br \fITSS2_FAPI_RC_NOT_PROVISIONED\fP FAPI was not provisioned\&. .RE .PP .SS "TSS2_RC Fapi_NvRead_Finish (\fBFAPI_CONTEXT\fP * context, uint8_t ** data, size_t * size, char ** logData)" Asynchronous finish function for Fapi_NvRead .PP This function should be called after a previous Fapi_NvRead_Async\&. .PP \fBParameters\fP .RS 4 \fIcontext\fP The \fBFAPI_CONTEXT\fP .br \fIdata\fP The data that was read from the NV index .br \fIsize\fP The size of data in bytes\&. May be NULL .br \fIlogData\fP The log data of the NV index if the index is of type 'extend'\&. May be NULL .RE .PP \fBReturn values\fP .RS 4 \fITSS2_RC_SUCCESS\fP if the function call was a success\&. .br \fITSS2_FAPI_RC_BAD_REFERENCE\fP if context or data is NULL\&. .br \fITSS2_FAPI_RC_BAD_CONTEXT\fP if context corruption is detected\&. .br \fITSS2_FAPI_RC_BAD_SEQUENCE\fP if the context has an asynchronous operation already pending\&. .br \fITSS2_FAPI_RC_IO_ERROR\fP if the data cannot be saved\&. .br \fITSS2_FAPI_RC_MEMORY\fP if the FAPI cannot allocate enough memory for internal operations or return parameters\&. .br \fITSS2_FAPI_RC_TRY_AGAIN\fP if the asynchronous operation is not yet complete\&. Call this function again later\&. .br \fITSS2_FAPI_RC_BAD_PATH\fP if a path is used in inappropriate context or contains illegal characters\&. .br \fITSS2_FAPI_RC_GENERAL_FAILURE\fP if an internal error occurred\&. .br \fITSS2_FAPI_RC_BAD_VALUE\fP if an invalid value was passed into the function\&. .br \fITSS2_FAPI_RC_PATH_NOT_FOUND\fP if a FAPI object path was not found during authorization\&. .br \fITSS2_FAPI_RC_KEY_NOT_FOUND\fP if a key was not found\&. .br \fITSS2_FAPI_RC_AUTHORIZATION_UNKNOWN\fP if a required authorization callback is not set\&. .br \fITSS2_FAPI_RC_AUTHORIZATION_FAILED\fP if the authorization attempt fails\&. .br \fITSS2_FAPI_RC_POLICY_UNKNOWN\fP if policy search for a certain policy digest was not successful\&. .br \fITSS2_ESYS_RC_*\fP possible error codes of ESAPI\&. .br \fITSS2_FAPI_RC_NOT_PROVISIONED\fP FAPI was not provisioned\&. .RE .PP .SH "Author" .PP Generated automatically by Doxygen for tpm2-tss from the source code\&.