Skip to content
This repository has been archived by the owner on May 16, 2020. It is now read-only.

Create TPM key

Iwan Timmer edited this page Feb 10, 2018 · 1 revision

Create a primary key with hash algorithm sha256 and key algorithm rsa and store the object context in a file (po.ctx)

tpm2_createprimary -H o -g sha256 -G rsa -C po.ctx

Now create an object that can be loaded into the TPM with parent object from file (po.ctx) using hash algorithm sha256 and key algorithm rsa output the public and private keys to key.pub|priv

tpm2_create -c po.ctx -g sha256 -G rsa -u key.pub -r key.priv

Load the private and public keys into the TPM's transient memory

tpm2_load -c po.ctx -u key.pub -r key.priv -C obj.ctx

Make the object persistent, specifying a valid handle

tpm2_evictcontrol -A o -c obj.ctx -H 0x81010010

Now you can remove all temporarily files.

rm key.name *.ctx
Clone this wiki locally