How to install a development environment for Trusted Platform Module (TPM) on Ubuntu
I - Install TPM emulator
TPM emulator is an Emulator for TPM with the appropriated TCG Device Driver Library (TDDL). It is a library that provides an API in order to interface with the TPM device driver.
Go on this web site: https://developer.berlios.de/project/showfiles.php?group_id=2491 and download the latest version.
Install utils to compile TPM emulator:
Compile and install TPM emulator:$> sudo apt-get install cmake libgmp3-dev
Load the tpmd module in the kernel (This need to be done at each change of kernel):$> tar -xvzf tpm_emulator-X.Y.tar.gz$> cd tpm_emulator-X.Y ; mkdir build ; cd build$> cmake ../$> make$> sudo make install
$> sudo depmod -a$> sudo modprobe tpmd_dev
II - Install TCG Software Stack and the TCG Service Provider Interface library for development
The entry point for any programmer writing a trusted computing enabled application is the Trusted Computing Group Software Stack (TSS). The TSS specifications define an architecture that makes accesses to the TPM simple and direct. TSS uses TDDL to access the TPM. TCG Service Provider Interface (TSPI) library is the part of the TSS which is directly used by applications.
The TSS installed here is TrouSers, the open-source TCG Software Stack.
Lauch TPM and TSS services (Must be done at each start):$> sudo apt-get install tpm-tools libtspi-dev
Initialize the TPM:$> sudo tpmd -d$> sudo /etc/init.d/trousers start
This command will require two passwords:$> tpm_takeownership
- The Owner password
- The SRK password
Run tpm_version command to check if everything is ok.