Skip to main content

TPM 2.0 TSS Bindings for Python

Reason this release was yanked:

Outdated and broken, use master

Project description

tpm2-pytss

Build Status Total alerts Language grade: Python Code style: black

TPM2 TSS Python bindings for Enhanced System API (ESYS).

Supported versions of Python are

  • 3.5
  • 3.6
  • 3.7

Specification

This package primarily exposes the TPM 2.0 Enhanced System API. The specification for the ESAPI can be found here:

https://trustedcomputinggroup.org/resource/tcg-tss-2-0-enhanced-system-api-esapi-specification/

Dependencies

This has been tested against TPM2 TSS 2.3.1 and SWIG 3.

tpm2-tss

You need to install tpm2-tss prior to installing this, INSTALL.md.

pkg-config

You need to install pkg-config

swig

You need to install swig

Ubuntu

$ sudo apt-get -y install swig pkg-config

ldconfig

When you ran ./configure for tpm2-tss if you didn't supply a prefix it usually defaults to /usr/local/. When you ran make install it then installed the libraries under that path. Your pacakge manager usually installs libraries to /usr. If you properly configure the ldconfig tool, it'll make the libraries you just installed available from within /usr/local (which means they won't clash with things your package manager installs). If you don't configure it then you might get this error:

ImportError: libtss2-esys.so.0: cannot open shared object file: No such file or directory

We make a config file that tells ldconfig to look in /usr/local/lib for shared libraries, then we run ldconfig.

$ sudo mkdir -p /etc/ld.so.conf.d/
$ echo 'include /etc/ld.so.conf.d/*.conf' | sudo tee -a /etc/ld.so.conf
$ echo '/usr/local/lib' | sudo tee -a /etc/ld.so.conf.d/libc.conf
$ sudo ldconfig

More info on ldconfig error: https://stackoverflow.com/a/17653893/3969496

Install

Install from PyPi.

$ python3 -m pip install tpm2-pytss

Or install from the master branch via GitHub

$ python3 -m pip install git+https://github.com/tpm2-software/tpm2-pytss

See tests/ folder for example usage.

Testing

You need to have tpm_server installed in your path to run the tests.

Download the latest version from https://sourceforge.net/projects/ibmswtpm2/files/ and put it somewher in your $PATH.

$ python3 setup.py test

Contributing

TODO

  • Document need for ctypes for certain values, example
  • ESYS_TR_PTR should be SessionContext

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tpm2-pytss-0.0.2.tar.gz (282.9 kB view details)

Uploaded Source

File details

Details for the file tpm2-pytss-0.0.2.tar.gz.

File metadata

  • Download URL: tpm2-pytss-0.0.2.tar.gz
  • Upload date:
  • Size: 282.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5

File hashes

Hashes for tpm2-pytss-0.0.2.tar.gz
Algorithm Hash digest
SHA256 86d51af516f3a7333817f5149083b5f82bcd29ca05b8e5c445aaa362d7db8025
MD5 d2830b1cff2c678a7b9868ec0559f1c9
BLAKE2b-256 aec15659735440146baadb3ddc78ab040caf4aec821f7501f78c982112b4589f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page