Part 5 — devices and key custody
Listing devices
Section titled “Listing devices”const devices = await engine.listDevices();// [{ deviceId, label, createdAt, revokedAt, current }]// current: true for the device you are asking fromShow this list in your UI. A ghost device — one a malicious relay inserted to wait for a grant — is only detectable if somebody can see it. skm’s defence here is visibility, not mathematics; key transparency is on the roadmap and does not exist yet.
Linking a second device
Section titled “Linking a second device”There is nothing to do. A new device registers its public keys on
SkmEngine.open, and any device that already holds the keyring grants it
during an ordinary sync (autoGrant, on by default).
From the app’s point of view: the new device shows waiting until an existing
device syncs, then flips to ok. Tell the user that: “open the app on your
laptop to finish linking.”
To drive the ceremony yourself, set autoGrant: false and call
engine.grantPending(graphId) when you choose.
What a device holds
Section titled “What a device holds”KeyStore device:<deviceId> ECDH P-256 keypair — receives wrapped graph keys sign:<deviceId> ECDSA P-256 keypair — proves authorship keyring:<graphId> { epochs: {1: key, 2: key}, current: 2 }Nothing in that list ever leaves the device except public halves.