1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//! Safe Rust client for [wolfTPM](https://github.com/wolfSSL/wolfTPM),
//! a portable TPM 2.0 library.
//!
//! # Status
//!
//! Core API implemented: [`Device`] for TPM initialization and basic operations,
//! and [`EccKey`] for transient P-256 signing keys.
//! Advanced wolfTPM features (NV storage, attestation, HMAC sessions) are not yet wrapped.
//!
//! # Quick start
//!
//! ```no_run
//! use wolftpm::Device;
//!
//! # fn main() -> Result<(), wolftpm::Error> {
//! let mut dev = Device::open()?; // opens /dev/tpm0 or /dev/tpmrm0 via kernel driver
//! let rand = dev.get_random(32)?; // TPM-sourced random bytes
//! # let _ = rand;
//! # Ok(())
//! # }
//! ```
//!
//! # Feature flags
//!
//! | Feature | What it enables |
//! |---------|----------------|
//! | `linux-dev` | Compile wolfTPM with explicit Linux kernel driver transport; without this, wolfTPM autodetects at runtime |
//! | `swtpm` | Software TPM socket transport (`Device::open_swtpm`; swtpm / IBM TPM2 simulator) |
//!
//! `Device::open()` (kernel driver) is always available regardless of feature flags;
//! `Device::open_swtpm()` requires the `swtpm` feature.
pub use Device;
pub use Error;
pub use TpmRc;
pub use EccKey;