... code before where we set phPubKey BYTE* phEK; UINT32 phEKLen = 20; result = Tspi_GetAttribData(phPubKey, TSS_TSPATTRIB_KEY_BLOB, TSS_TSPATTRIB_KEYBLOB_PUBLIC_KEY, &phEKLen, &phEK); DBG("Get PubEK:\n", result); Printhex("EK Pub blob:\n", phEK, phEKLen); /* OR we print only modulus which ok too as public exponent is always the same */ result = Tspi_GetAttribData(phPubKey, TSS_TSPATTRIB_RSAKEY_INFO, TSS_TSPATTRIB_KEYINFO_RSA_MODULUS, &phEKLen, &phEK); DBG("Get PubEK:\n", result); Printhex("EK Pub modulus:\n", phEK, phEKLen); ... code after