TPM|TPM test guides
Hardware Requirement
- TPM hardware device support
- BIOS turn on tpm
- Check software and hardware support for TPM
software: cat /proc/devices | grep tpm
localhost:~$ dmesg | grep tpm
[1.173042] tpm_tis IFX0785:00: 2.0 TPM (device-id 0x1B, rev-id 22)
localhost:~$ cat /proc/devices | grep tpm
241 tpm
- Service startup
sudo systemctl starttpm2-abrmd
localhost:~$ systemctl status tpm2-abrmd.service
● tpm2-abrmd.service - TPM2 Access Broker and Resource Management Daemon
Loaded: loaded (/usr/lib/systemd/system/tpm2-abrmd.service;
disabled;
vendor preset: disabled)
Active: active (running) since 五 2020-03-20 03:33:57 UTC;
2h 2min ago
Main PID: 2973 (tpm2-abrmd)
Tasks: 6
Memory: 1.7M
CGroup: /system.slice/tpm2-abrmd.service
└─2973 /usr/sbin/tpm2-abrmd
Testing Procedure
- Set TPM related password
$ tpm2_takeownership -o ownerpass -e endorsepass -l lockpass
- Create a Primary Object
$ tpm2_createprimary -H e -K objectpass -g 0x000b -G 0x0001 -C po.ctx -P endorsepass
- Create a RSA key under the previous primary key
$ tpm2_create -c po.ctx -P objectpass -K subobjectpass -g 0x000b -G 0x0001 -u key.pub -r key.priv
- Load the created RSA key
$ tpm2_load -c po.ctx -P objectpass -u key.pub -r key.priv -n key.name -C obj.ctx
- Encrypt with RSA key
$ tpm2_rsaencrypt -c obj.ctx -o data.encrypt data.in
- Decrypt with RSA key
$ tpm2_rsadecrypt -c obj.ctx -P subobjectpass -I data.encrypted -o data.out
- Sign on data with RSA key
Sign on data with RSA key, using SHA256 as hash algorithm.
$ tpm2_sign -c obj.ctx -P subobjectpass -g 0x000b -m msg.in -s sig.out
- Verify signature with RSA key
$ tpm2_verifysignature -c obj.ctx -g 0x000b -m msg.in -s sig.out -t tk.sig
推荐阅读
- Maven|Maven test命令 中文乱码
- Git|Git branching strategy integated with testing/QA process - Stack Overflow
- IDEA|IDEA 中使用MAVEN Install 项目的时候 报 org.apache.maven.plugins:maven-surefire-plugin:2.18.1:test failed
- PentesterLab靶场-sql注入
- R语言股票收益分布一致性检验KS检验Kolmogorov-Smirnov、置换检验Permutation Test可视化
- IDEA中执行@Test单元测试时报错Class not found: “...“Empty test suite
- 上岸算法LeetCode|上岸算法LeetCode Weekly Contest 276解题报告
- 研效优化实践(WeTest提效测试)
- 对接相关 - Jenkins执行SoapUI Tests简单模式
- vue-test-utils|vue-test-utils + jest 实战代码举例