The keyring
Worked example: footer revision 4 file
The keyring is the first thing a reader needs, because every other region is sealed with a data key that lives in it. The fixture’s keys file is 86 bytes. Its layout is described on Keyring file.
- magic4 B"STKR"
- version2 B01 00
- nonce12 B
- sealed body52 B
- tag16 B
| Offset | Size | Field | Value |
|---|---|---|---|
| 0 | 4 | magic | "STKR" |
| 4 | 2 | version | 01 00, version 1 |
| 6 | 12 | nonce | random, fresh on every rewrite |
| 18 | 52 | sealed body | AES-256-GCM ciphertext |
| 70 | 16 | tag | GCM tag, appended after the body |
The body is sealed with the master key and the AAD "strata-keyring-v1"; see AAD per object. Decrypted, it is 52 bytes:
| Field | Value |
|---|---|
epoch |
3 |
next_id |
2 |
current |
1 |
count |
1 |
| key id | 1 |
| key | 32 bytes (not reproduced) |
The epoch of 3 is the nonce epoch last handed out. Opening a keyring persists epoch + 1, so each process lifetime owns a fresh epoch; see Nonces and epochs.