3
PATH="$PATH":"$new_path"
5
file_primary_key_ctx=context.p_B1
6
file_evict_key_pub=opuB1_B8
7
file_evict_key_priv=oprB1_B8
8
file_evict_key_ctx=context_load_out_B1_B8
9
file_evict_key_name=name.load.B1_B8
11
persistentHandle=0x81010003
15
alg_primary_key=0x0001
19
rm $file_primary_key_ctx $file_evict_key_pub $file_evict_key_priv $file_evict_key_ctx $file_evict_key_name $file_output_data -rf
23
tpm2_createprimary -A e -g $alg_hash -G $alg_primary_key -C $file_primary_key_ctx
25
echo "createprimary fail, please check the environment or parameters!"
28
tpm2_create -g $alg_hash -G $alg_evict_key -o $file_evict_key_pub -O $file_evict_key_priv -c $file_primary_key_ctx
30
echo "create fail, please check the environment or parameters!"
33
tpm2_load -c $file_primary_key_ctx -u $file_evict_key_pub -r $file_evict_key_priv -n $file_evict_key_name -C $file_evict_key_ctx
35
echo "load fail, please check the environment or parameters!"
39
tpm2_evictcontrol -A o -c $file_evict_key_ctx -S $persistentHandle
41
echo "evictontronl persistentHandle fail, please check the environment or parameters!"
44
tpm2_evictcontrol -A o -H $persistentHandle -S $persistentHandle
46
echo "evictcontrol release Handle fail, please check the environment or parameters!"