I am using the IBM tpm2.0 simulator. My use case is that I would like to
encrypt data and send to tpm and then decrypt this at the tpm side. I would
want to use the endorsement key (EK) for this purpose. Hence, I would like
to encrypt data using EK's public key and decrypt using EK's private key. I
tried creating EK using tpm2_createek -G rsa -f pem -c - -p ek.pem. Now, I
have the ek.pem( public portion of EK) to encrypt the data. When I load
this key into the tpm and invoke tpm2_rsadecrypt I get an error. I also
tried using tpm2_createprimary to create an EK but failed in the above
attempt. Could anyone please help me out so that I can use EK to
Please let me know if more information is needed.
Thanks in advance.