tpm2-tools
tpm2-tools copied to clipboard
loading of private key in TPM using c++ Apis
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