func (nv *NV) AssignPolicy(policy *Policy) error {
	err := tspiError(C.Tspi_Policy_AssignToObject(policy.handle, (C.TSS_HOBJECT)(nv.handle)))
	return err
}
AssignPolicy assigns a policy to the TPM NVRAM region
package tspi
import "C"
import "unsafe"
type NV struct {
	handle  C.TSS_HNVSTORE
	context C.TSS_HCONTEXT
}
func (nv *NV) ReadValue(offset uint, length uint) ([]byte, error) {
	var cdata *C.BYTE
	defer C.Tspi_Context_FreeMemory(nv.context, cdata)
	err := tspiError(C.Tspi_NV_ReadValue(nv.handle, (C.UINT32)(offset), (*C.UINT32)(unsafe.Pointer(&length)), &cdata))
	if err != nil {
		return nil, err
	}
	data := C.GoBytes(unsafe.Pointer(cdata), C.int(length))
	return data, err
}
func (nv *NV) SetIndex(index uint) error {
	err := tspiError(C.Tspi_SetAttribUint32((C.TSS_HOBJECT)(nv.handle), C.TSS_TSPATTRIB_NV_INDEX, 0, (C.UINT32)(index)))
	return err
}