Expand description
The kych container: file header, tables, records, attribute values.
Layout per the
dtformats specification,
with the details it leaves open ([yellow-background]*Unknown* fields,
padding, value encodings) pinned down against keychains written by macOS.
Everything is big-endian.
file header (20 bytes)
tables array: size, count, count x offset
table: header (28 bytes), slot array, records, index data
record: header (24 bytes), attribute offsets, key data, attribute valuesThe model keeps every field, including the ones whose meaning is unknown and
the opaque per-table index data, so that parsing and re-serializing a
macOS-written keychain reproduces it byte for byte. That round trip is the
test that this understanding of the layout is complete — see
tests/keychain_roundtrip.rs.
Structs§
Enums§
- Slot
- One entry of a table’s record-slot array.
- Table
Indexes - A table’s index region: understood, or preserved as-is.
- Value
- An attribute value, in the format the schema declares for it.
Constants§
- HEADER_
LEN - HEADER_
SIZE_ FIELD - Value of the header’s size field, which is 4 less than the header itself.
- RECORD_
HEADER_ LEN - SIGNATURE
- TABLE_
HEADER_ LEN - VERSION
- Combined major/minor version: major 1, minor 0.
Functions§
- records_
by_ type - Group the live records of every table by record type.
- trim_
nul