#tpm #tss #trou-ser-s


Native bindings to the trousers library

1 unstable release

Uses old Rust 2015

0.0.0 May 17, 2015

#5 in #tss

MIT license



Rust bindings for TrouSerS, an open-source TSS implementation.


TrouSerS is compliant with the TCG Software Stack (TSS) 1.2 (with minor differences). This library attempts to wrap the lower level functionality in a more object-oriented interface, as well as reducing the burden of manual memory management, whilst retaining strong similarities to the TSS interface. (For example, implementing a singular function to extend a PCR is out of scope.)

The main trousers crate contains the wrapping interface, and depends on the trousers-sys crate, which includes direct bindings by rust-bindgen. The bindings were generated off TrouSerS, from the Ubuntu trusty/main repositories.

Please note that this library has been developed primarily as a side project. While I would like to achieve full coverage of TrouSerS, this effectively means full coverage of the TSS, a monumental task to perform alone out of spare time. The API is also not set in stone at this time, and may change drastically. Contributions are welcome!


Also todo: need to have constants.

Module Implemented Partial Missing Common methods N/A Tspi_SetAttribUint32 (for TSS_OBJECT_TYPE_RSAKEY), Tspi_SetAttribData (for TSS_OBJECT_TYPE_RSAKEY) Tspi_GetAttribUint32, Tspi_GetAttribData, Tspi_ChangeAuth, Tspi_ChangeAuthAsym, Tspi_GetPolicyObject Common context methods Tspi_Context_Create, Tspi_Context_Close, Tspi_Context_FreeMemory, Tspi_Context_GetTPMObject Tspi_Context_Connect, Tspi_Context_CreateObject (TSS_OBJECT_TYPE_PCRS, ref Tspi_Context_GetDefaultPolicy, Tspi_Context_CloseObject, Tspi_Context_GetCapability N/A N/A All Finding, Loading, and Registering Keys in a Context Tspi_Context_LoadKeyByUUID N/A Tspi_Context_LoadKeyByBlob, Tspi_Context_RegisterKey, Tspi_Context_UnregisterKey, Tspi_Context_GetKeyByUUID, Tspi_Context_GetKeyByPublicInfo, Tspi_Context_GetRegisteredKeysByUUID, Tspi_Context_GetRegisteredKeysByUUID2, Tspi_TPM_KeyControlOwner N/A N/A All N/A N/A All N/A N/A All N/A N/A All N/A N/A All N/A N/A All N/A N/A All N/A N/A All N/A N/A All N/A N/A All Old PCR commands (trivia) Tspi_TPM_PcrRead Tspi_TPM_PcrExtend Tspi_TPM_GetEvent, Tspi_TPM_GetEvents, Tspi_TPM_GetEventLog, Tspi_TPM_Quote N/A N/A All Tspi_PcrComposite Class Tspi_PcrComposite_SelectPcrIndex N/A Tspi_SetAttribUint32, Tspi_GetAttribUint32, Tspi_PcrComposite_SetPcrValue, Tspi_PcrComposite_GetPcrValue New PCR commands Tspi_TPM_PcrReset, Tspi_PcrComposite_SelectPcrIndexEx N/A Tspi_Data_Seal, Tspi_Data_SealX, Tspi_TPM_Quote2, Tspi_PcrComposite_SetPcrLocality, Tspi_PcrComposite_GetPcrLocality, Tspi_PcrComposite_GetCompositeHash N/A N/A All N/A N/A All N/A N/A All N/A N/A All N/A N/A All N/A N/A All N/A N/A All N/A N/A All N/A N/A All N/A N/A All N/A N/A All N/A N/A All N/A N/A All N/A N/A All N/A N/A All N/A N/A All N/A N/A All N/A N/A All
Others N/A N/A All