1 #ifndef __lib_base_etpm_h
2 #define __lib_base_etpm_h
5 #define TPMD_SOCKET "/var/run/tpmd_socket"
14 unsigned char level2_cert[210];
15 unsigned char level3_cert[210];
16 bool level2_cert_read;
17 bool level3_cert_read;
20 TPMD_CMD_RESERVED = 0x0000,
21 TPMD_CMD_GET_DATA = 0x0001,
22 TPMD_CMD_APDU = 0x0002,
23 TPMD_CMD_COMPUTE_SIGNATURE = 0x0003,
24 TPMD_CMD_APP_CERT = 0x0004,
27 bool send_cmd(enum tpmd_cmd cmd, const void *data, size_t len);
28 void *recv_cmd(unsigned int *tag, size_t *len);
29 void parse_data(const unsigned char *data, size_t datalen);
37 TPMD_DT_LEVEL2_CERT = 0x04,
38 TPMD_DT_LEVEL3_CERT = 0x05
40 std::string getCert(cert_type type);
41 std::string challenge(std::string rnd);
44 #endif // __lib_base_etpm_h