#nitro #tpm #attestation #aws #nitrotpm

app nitro-tpm-pcr-compute

Precompute NitroTPM Platform Configuration Register (PCR) values based on a Unified Kernel Image (UKI)

2 stable releases

Uses new Rust 2024

new 1.1.0 Dec 1, 2025
1.0.0 Oct 22, 2025

#163 in Hardware support

Custom license

27KB
469 lines

NitroTPM PCR Compute

This utility enables you to precompute NitroTPM Platform Configuration Register (PCR) 4, 7, and 12 values based on a Unified Kernel Image (UKI). These are the same PCR values that are included in the attestation document returned by the NitroTPM. You can use the precomputed PCR values to create AWS KMS key policies that grant or deny key access based on these values. The utility supports PE/COFF images in both standard boot and UEFI Secure Boot environments. In Secure Boot mode, these images can be signed with X.509 certificates. Measurements are precomputed according to the TCG PC Client Platform Firmware Profile Specification.

Usage

Standard boot

To precompute measurements for standard boot:

cargo run --package nitro-tpm-pcr-compute -- --image <UKI.efi>

UEFI Secure Boot

To precompute measurements with UEFI Secure Boot enabled:

cargo run --package nitro-tpm-pcr-compute -- \
    --image <UKI.efi> \
    --PK <PK.esl> \
    --KEK <KEK.esl> \
    --db <db.esl>

Output

The utility returns measurements in the following JSON format:

{
  "Measurements": {
    "HashAlgorithm": "SHA384",
    "PCR4": "<hex string>",
    "PCR7": "<hex string>",
    "PCR12": "<hex string>"
  }
}

References

Dependencies

~68MB
~2M SLoC