Rust bindings for the NVIDIA Attestation SDK (NVAT), providing safe, idiomatic interfaces for GPU and NVSwitch device attestation.
| Crate | Description |
|---|---|
nvat |
High-level safe Rust API |
nvat-sys |
Low-level FFI bindings generated via bindgen |
- libnvat -- NVIDIA Attestation C library (headers and shared library)
- libxmlsec1-dev (>= 1.2.0)
- zlib1g-dev (>= 1.3.0)
- A C/C++ toolchain (for
bindgen) pkg-config
| Variable | Purpose |
|---|---|
NVAT_LIBRARY |
Additional library search path for libnvat |
NVAT_INCLUDE_DIR |
Additional include path for NVAT headers |
PKG_CONFIG_PATH |
Help pkg-config find .pc files |
cargo builduse nvat::{SdkHandle, attestation::AttestationBuilder, nonce::NvatNonce, prelude::AttestationContext};
fn main() -> anyhow::Result<()> {
env_logger::builder()
.filter_level(log::LevelFilter::Debug)
.init();
let sdk = SdkHandle::get_handle().unwrap();
let mut attestation = AttestationContext::builder(&sdk)?
.gpu()
.verifier_remote()
.build();
let nonce = NvatNonce::generate(&sdk, 32)?;
let result = attestation.attest_device(&nonce)?;
dbg!(result);
Ok(())
}Tests should be run through cargo-nextest since the SDK does not support double initialization within a single process:
cargo nextest runSee LICENSE for details.