Skip to main content

Module directory

Module directory 

Source
Expand description

The signed device directory: how peers learn which device public keys to trust for a user, and the anti-rollback directory_version (SSoT: Cryptography — Keys § Device Directory).

Each user publishes a directory listing their devices’ public halves — the hybrid DSK (signing) and the DEK (key encapsulation) — master-signed (here, by the user IK). That one IK signature over the canonical core is the cross-signature the design means by “both are signed by the IK”: it is what lets a peer trust a device key it has never seen, for encryption (DeviceEntry::encapsulate) as much as for verification.

verify_asset reads the directory to resolve the created_by_device of a manifest and to enforce that a device’s added_at precedes the manifest timestamp. The monotonic directory_version lets readers refuse a rolled-back directory (a server hiding a revocation).

§Wire presence is signature-visible here

DirectoryCore::signing_bytes is the canonical CBOR of the whole core, so every field of every DeviceEntry is inside the IK-signed bytes and field presence is part of the signature — exactly as it is for an asset manifest. DeviceEntry::dek_public is therefore an absent-key optional (skip_serializing_if = "Option::is_none"): a present-null encoding would change signing_bytes() for every entry that has no DEK and silently break re-verification of every directory signed before the field existed, including the cross-platform fixtures. added_at/revoked_at predate that rule and keep their legacy present-null encoding — the directory carries both conventions, and reconciling them would itself be a signature-visible change to already-signed entries, not a cleanup.

Structs§

DekPublic
A device’s published DEK public encapsulation key: the bytes a peer wraps a key to so that only that device can open it (SSoT: Cryptography — Keys § Device Keys).
DeviceDirectory
A master/IK-signed device directory.
DeviceEntry
One device’s published entry. A revoked device’s entry is retained (marked with revoked_at), never deleted, so manifests it signed before revocation stay verifiable.
DirectoryCore
The unsigned core of a directory — exactly the bytes the master signature covers.

Enums§

DirectoryError
Why a device could not be cross-signed into a directory.