Introduction#

The NVIDIA Attestation SDK Rust bindings provide idiomatic and safe Rust interfaces to the NVIDIA Attestation SDK. These bindings enable Rust developers to implement and validate Trusted Computing Solutions on NVIDIA hardware with full type safety and automatic memory management.

Development Requirements:

  • Rust 1.80 or later

  • NVIDIA Attestation SDK C library (libnvat.so.1)

  • Clang/LLVM (for bindgen)

Workspace Structure#

The SDK is organized as a Cargo workspace with two crates:

nv-attestation-sdk-sys#

FFI bindings to the C library. This crate:

  • Automatically generates bindings at build time using bindgen

  • Exposes raw C types and functions with unsafe interfaces

  • Should not be used directly unless you need low-level access

nv-attestation-sdk#

Safe wrapper that provides:

  • Type-safe wrappers around C API objects

  • Automatic memory management using Rust’s ownership system

  • Result-based error handling

  • Safe abstractions over unsafe C operations

  • Optional logging integration with the log crate

Installation#

Prerequisites#

  • Rust 1.80 or later: Install from rustup.rs

  • NVIDIA Attestation SDK C library: Either from system packages or built from source

  • Clang/LLVM: Required by bindgen for generating FFI bindings

    sudo apt-get install clang libclang-dev
    

Adding as a Dependency#

This crate is not published to crates.io. Add it to your Cargo.toml using Git:

[dependencies]
nv-attestation-sdk = { git = "https://github.com/NVIDIA/attestation-sdk", branch = "main", subdirectory = "nv-attestation-sdk-rust/nv-attestation-sdk" }

Note: The subdirectory parameter requires Cargo 1.75 or later.

Or use a path dependency for local development:

[dependencies]
nv-attestation-sdk = { path = "/path/to/attestation-sdk/nv-attestation-sdk-rust/nv-attestation-sdk" }

Optional Features#

Enable the logging feature to integrate C SDK logs with Rust’s log facade:

[dependencies]
nv-attestation-sdk = { git = "https://github.com/NVIDIA/attestation-sdk", subdirectory = "nv-attestation-sdk-rust/nv-attestation-sdk", features = ["logging"] }

Using System-Installed Library#

If the SDK is installed via package manager:

export NVAT_USE_SYSTEM_LIB=1
cargo build

The library will be found in standard system paths (/usr/lib, /usr/local/lib, etc.).

Using Local C++ Build#

If building from source:

  1. Build the C++ SDK:

    cd nv-attestation-sdk-cpp
    cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
    cmake --build build
    cmake --install build
    sudo ldconfig
    
  2. Build the Rust workspace:

    cd ../nv-attestation-sdk-rust
    cargo build --workspace
    
  3. Set library path for runtime:

    export LD_LIBRARY_PATH=$(pwd)/../nv-attestation-sdk-cpp/build:$LD_LIBRARY_PATH
    

License#

This repository is licensed under Apache License v2.0 except where otherwise noted.

This project will download and install additional third-party open source software projects. Review the license terms of these open source projects before use.

Support#

For issues or questions, please raise an issue on GitHub. For additional support, contact us at attestation-support@nvidia.com.

Next Steps#

  • User Guide: See the User Guide for detailed examples and common usage patterns

  • Configuration: Learn about configuration options in the Configuration Guide

  • Claims Schema: Understand attestation results in the Claims Schema Reference

  • Development: Contribute to the SDK using the Development Guide

  • Examples: Explore the examples in the nv-attestation-sdk/examples/ directory