tpm 规范

Compatibility with Existing Applications

The most correct and convenient way to access the tpm emulator is to use the provided device driver library (tddl). For a comprehensive description of its functionality we refer to the official TCG specification, an example of use is given by the test application tddl/test_tddl.

Note that on Windows the tddl is called ifxtpm.dll as many applications (e.g., TPM/J) expect this name and do not support alternative drivers.

For backward compatibility with existing Unix applications, the kernel module tpmd_dev forwards any command sent to the device /dev/tpm to the tpm emulator daemon. In order to access the emulator directly (i.e., without using the device driver library or the device /dev/tpm) all one has to do is to include the header files sys/socket.h and sys/un.h and to replace the open("/dev/tpm") call with something like:

 

struct sockaddr_un addr;

fh = socket(PF_UNIX, SOCK_STREAM, 0);

if (fh <= 0) {

/* handle error */

}

addr.sun_family = AF_UNIX;

strncpy(addr.sun_path, "/var/run/tpm/tpmd_socket:0", sizeof(addr.sun_path));

 res = connect(fh, (struct sockaddr*)&addr, sizeof(struct sockaddr_un));

 if (res <= 0) { /* handle error */ }

 

All subsequent calls of read(), write(), and close() should work as expected.

 

 

references:http://tpm-emulator.berlios.de/documentation.html

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值