AdmissionProof

A joiner's answer to a Challenge: "I hold this key, and I am asking to join this room, from this host, right now." The joiner signs it with its own DeviceKey, so a host that checks it with isSignedBy knows the device asking is the device that holds that key.

It binds everything a replay could vary: the room, the host's key and peer id, the joiner's own peer id, the app's deviceId, and the hostNonce from the challenge it answers. A proof captured from one admission is therefore worth nothing in another room, to another host, or under another nonce.

Its wire form is the signed bytes themselves — the layout below, then the 64-byte signature — and two proofs are equal when their wire bytes are. The arrays it hands out are copies.

Layout tag "kuilt/admit-proof", version 1, seven fields in this order:
room id (UTF-8) ‖ host key (33-byte compressed point) ‖ host peer id (UTF-8) ‖
joiner peer id (UTF-8) ‖ device id (UTF-8, empty when absent) ‖ host nonce (16 bytes) ‖
channel binding (reserved: always empty)

The channel-binding field is reserved for a value tying the proof to the fabric connection it travels on, such as the hash of a TLS-terminating host's certificate. Nothing fills it yet, so sign writes it empty and decode refuses a proof where it is not. A binding would stop only an active relay on a member's own link: it would not stop a bystander taking a partitioned member's peer id under its own key, since that bystander binds its own link honestly.

The proof does not carry the joiner's key: the host learns that from the joiner's Hello and checks the proof under it with isSignedBy.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The app's own id for this device, or the empty string when the app supplied none.

Link copied to clipboard

The host's key, as the joiner's verified Challenge named it.

Link copied to clipboard

The nonce from the challenge this proof answers: a copy.

Link copied to clipboard

The host's peer id: the fabric sender of the challenge this answers.

Link copied to clipboard

The joiner's own peer id.

Link copied to clipboard

The room the joiner asks to join.

Link copied to clipboard

The layout followed by the joiner's signature: what is sent. A copy.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
suspend fun isSignedBy(joiner: DidKey): Boolean

Whether the signature on wire is joiner's over the layout. false, never a throw, for a bad signature or a joiner key whose point is not on the curve.

suspend fun isSignedBy(joiner: DidKey, scheme: KeyScheme): Boolean

isSignedBy, checked in scheme rather than always in KeyScheme.P256. A room passes its own DeviceKeyStore.keyScheme, so a room on the real scheme checks with ECDSA whatever was sent.

Link copied to clipboard
open override fun toString(): String