Skip to content

how to use nv_read_public()? #479

Description

@bingzhux

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...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions