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:

$> sudo apt-get install cmake libgmp3-dev

Compile and install TPM emulator:
$> tar -xvzf tpm_emulator-X.Y.tar.gz
$> cd tpm_emulator-X.Y ; mkdir build ; cd build
$> cmake ../
$> make
$> sudo make install

Load the tpmd module in the kernel (This need to be done at each change of kernel):
$> 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.
$> sudo apt-get install tpm-tools libtspi-dev
Lauch TPM and TSS services (Must be done at each start):
$> sudo tpmd -d
$> sudo /etc/init.d/trousers start
Initialize the TPM:
$> tpm_takeownership
This command will require two passwords:
- The Owner password
- The SRK password

Run tpm_version command to check if everything is ok.

Design downloaded from free website templates.