以下来自: testattest.sh
使用之前需要先定义,不然报错:
echo "NV Define Space"
${PREFIX}nvdefinespace -hi o -ha 01000000 -pwdn nnn -sz 16 > run.out
checkSuccess $?
echo "NV Read Public, unwritten Name"
${PREFIX}nvreadpublic -ha 01000000 > run.out
checkSuccess $?
echo "NV write"
${PREFIX}nvwrite -ha 01000000 -pwdn nnn -if msg.bin > run.out
checkSuccess $?
删除掉:
echo "NV Undefine Space"
${PREFIX}nvundefinespace -hi o -ha 01000000 > run.out
checkSuccess $?
删除后重新read:
nvdefinespace -hi o -ha 01c0000c -pwdn nnn -sz 16 EK Template
nvdefinespace -hi o -ha 01c0000a -pwdn nnn -sz 200 证书
nvdefinespace -hi o -ha 01c0000b -pwdn nnn -sz 16 EK Nonce
nvreadpublic -ha 01c0000b
from :
testcredential.sh
把 cakey.pem 拷贝到Debug目录下面
输出EK公钥: tmp.der
hierarchychangeauth -hi e -pwdn eee
hierarchychangeauth -hi p -pwdn ppp
createekcert -high -rsa 2048 -cakey cakey.pem -capwd rrrr -pwdp ppp -pwde eee -of tmp.der
读取EK证书:
echo "Read the ${CALG[i]} EK certificate"
${PREFIX}createek -high ${CALG[i]} -ce > run.out
checkSuccess $?
createek -high -rsa 2048 -ce >myEK.der
myEK.der 是解析后的文本, myEK.der 和 tmp.der 比较: (是同一个)
打印EK模板信息(应该失败):
createek -high -rsa 2048 -te -pwde eee
打印nonce信息(应该失败):
createek -high -rsa 2048 -no -pwde eee
CreatePrimary 80000002 and validate the ${CALG[i]} EK against the EK certificate:
createek -high -pwde eee -pwdk kkk -rsa 2048 -cp -noflush
这个密钥就是上面的 tmp.der
把 ibmtss1.6.0\utils\certificates 中的 certificates 目录拷贝到 Debug下面和D盘根目录下面:
更改 Debug/certificates/rootcerts.txt 中的内容为
然后执行:
createek -high -rsa 2048 -root certificates/rootcerts.txt
读取EK证书:
nvread -ha 01c00012
在EK 80000001下面创建 sign key
create -hp 80000001 -si -pwdp kkk