Skip to content

Commit

Permalink
fix single measurement sha256 (no newline)
Browse files Browse the repository at this point in the history
  • Loading branch information
metachris committed Oct 4, 2024
1 parent 68e7385 commit c43c8b6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@ WIP Toolbox
- [Client allowing only server using the custom TLS certificate](cmd/https-client/main.go)
- [Status API server, with ability for recording and querying events](cmd/status-api/)

Canonical way to collapse a TDX [measurements.json](docs/measurements.json) file into a single hash, in a reproducible way:
---

## Collapsing a TDX measurements JSON object into a single SHA256 hash

This is our canonical method to collapse a full TDX [measurements JSON object](docs/measurements.json) into a single SHA256 hash, in a reproducible way (sort keys, remove whitespace, print without newline):

```bash
cat measurements.json | jq --sort-keys --compact-output | sha256sum
cat docs/measurements.json | jq --sort-keys --compact-output --join-output | sha256sum
59952c2557da91cdafb9361d41d6971fc2b0be1a85ad57134e38714b266ff581 -
```

---

## Usage

```bash
Expand Down

0 comments on commit c43c8b6

Please sign in to comment.