I have a TPM NV handle value, e.g. 0x01500047, and I'm pretty sure that it is already created inside TPM.
However, I don't know how to call this nv_read_public() below by passing this handle value (0x01500047) as parameter, to get this nv's public information.
|
pub fn nv_read_public(&mut self, nv_index_handle: NvIndexHandle) -> Result<(NvPublic, Name)> { |
because this function requires a handle NvIndexHandle value, which is not the u32 value of 0x01500047.
I understand that, please correct me if I am wrong, we can use this code below to convert this u32 value to NvIndexTpmHandle value:
let nvtpmhandle = NvIndexTpmHandle::new(0x01500047).unwrap();
But now, the question is how to convert the value (nvtpmhandle) type of NvIndexTpmHandle to the type of NvIndexHandle, which is required to be passed into function nv_read_public()?
Actually, there are too many handles, which is quite confusing to me.
For example, NvIndexTpmHandle, NvIndexHandle, TpmHandle, ObjectHandle...
I have a TPM NV handle value, e.g. 0x01500047, and I'm pretty sure that it is already created inside TPM.
However, I don't know how to call this nv_read_public() below by passing this handle value (0x01500047) as parameter, to get this nv's public information.
rust-tss-esapi/tss-esapi/src/context/tpm_commands/non_volatile_storage.rs
Line 458 in 2dfc315
because this function requires a handle NvIndexHandle value, which is not the u32 value of 0x01500047.
I understand that, please correct me if I am wrong, we can use this code below to convert this u32 value to NvIndexTpmHandle value:
let nvtpmhandle = NvIndexTpmHandle::new(0x01500047).unwrap();But now, the question is how to convert the value (nvtpmhandle) type of NvIndexTpmHandle to the type of NvIndexHandle, which is required to be passed into function nv_read_public()?
Actually, there are too many handles, which is quite confusing to me.
For example, NvIndexTpmHandle, NvIndexHandle, TpmHandle, ObjectHandle...