1 #ifndef __lib_base_etpm_h
2 #define __lib_base_etpm_h
4 #include <lib/base/object.h>
5 #include <lib/python/python.h>
8 #define TPMD_SOCKET "/var/run/tpmd_socket"
11 class eTPM: public Object, public iObject
16 unsigned char level2_cert[210];
17 unsigned char level3_cert[210];
18 bool level2_cert_read;
19 bool level3_cert_read;
22 TPMD_CMD_RESERVED = 0x0000,
23 TPMD_CMD_GET_DATA = 0x0001,
24 TPMD_CMD_APDU = 0x0002,
25 TPMD_CMD_COMPUTE_SIGNATURE = 0x0003,
26 TPMD_CMD_APP_CERT = 0x0004,
29 bool send_cmd(enum tpmd_cmd cmd, const void *data, unsigned int len);
30 void *recv_cmd(unsigned int *tag, unsigned int *len);
31 void parse_data(const unsigned char *data, unsigned int datalen);
39 TPMD_DT_LEVEL2_CERT = 0x04,
40 TPMD_DT_LEVEL3_CERT = 0x05
42 PyObject *getCert(cert_type type);
43 PyObject *challenge(PyObject *rnd);
46 #endif // __lib_base_etpm_h