tpm2-tools icon indicating copy to clipboard operation
tpm2-tools copied to clipboard

loading of private key in TPM using c++ Apis

Open sumanth797 opened this issue 11 months ago • 0 comments

Hi,

Can you give me the C++ Api implementation for the below commands with authentication, any examples?

tpm2 createprimary -C e -G rsa2048 -a 'restricted|decrypt|fixedtpm|fixedparent|sensitivedataorigin|userwithauth' -c endorsementkey.ctx -P hpasswd -p ctxtpasswd

tpm2_import -C endorsementkey.ctx -G rsa -i private.pem -u key.pub -r key.priv -P ctxtpwd -p vpasswd

tpm2_load -C endorsementkey.ctx -u key.pub -r key.priv -c vkey.ctx -P vpasswd

tpm2_evictcontrol -C o -c vkey.ctx 0x81010001 -P spasswd

Thanks in Advance

sumanth797 avatar Mar 22 '24 16:03 sumanth797