Cross-platform TPM 2.0 wrapper service supporting Windows (x86_64, ARM64) and Linux.
- Endorsement Key (EK) management
- Attestation Identity Key (AIK) creation
- Credential activation
- Cross-platform IPC (Named Pipes on Windows, Unix Domain Sockets on Linux)
# Create virtual environment (recommended, especially on Arch Linux)
python -m venv venv
source venv/bin/activate # Linux/macOS
# OR: venv\Scripts\activate # Windows
# Install dependencies
pip install -r requirements.txtNote: On Arch Linux, you may see "externally managed" - use venv as shown above.
The service uses tpm2-pytss which is bundled with the package. All required TSS2 libraries (DLLs on Windows, .so files on Linux) are included, so no additional installation is needed.
For developers building from source: See BUILD.md for instructions on building with bundled libraries.
For detailed installation instructions, including troubleshooting, see INSTALLATION.md.
python -m tpm_wrapper_service.servicepython -m tpm_wrapper_service.service# Start the TPM wrapper service
python -m tpm_wrapper_service.serviceIf you have a server that accepts TPM registration:
# Register with server (replace with your server URL)
python tpm_client.py http://your-server-ip:port
# Or the script will prompt for server URL
python tpm_client.pyThe client will:
- Get attestation data from TPM service
- Register with the server
- Receive a challenge
- Activate the credential using TPM
- Complete the challenge
Run the comprehensive test script to test all features:
# Make sure the service is running first
python -m tpm_wrapper_service.service
# In another terminal, run the test script
python test_all_features.pyThe test script will:
- Test all three commands (getEK, getAttestationData, activateCredential)
- Test error handling
- Generate a detailed report
- Work on both Linux and Windows
- Save results to a JSON file
- Windows x86_64
- Windows ARM64
- Linux x86_64
- Linux ARM64
Additional documentation is available in the markdown/ directory:
- INSTALLATION.md - Detailed installation guide and troubleshooting
- ARCHITECTURE.md - Architecture support details
- COMPARISON.md - Detailed C# to Python comparison
- SIMPLE_EXPLANATION.md - Simple explanation of how it works
- NOT_PORTED.md - What wasn't ported and why
- TESTING.md - Testing guide
- TPM_TESTING_OPTIONS.md - Testing with fTPM and WSL
- IMPLEMENTATION_NOTES.md - Implementation details and notes