Package-level declarations

Types

Link copied to clipboard

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.

Link copied to clipboard
class Challenge

A host's answer to a device asking to join: "prove you hold your key, and here is proof that I hold mine." The host signs it, so the joiner learns the host's key from the host itself, and the fresh hostNonce it carries is what the joiner's AdmissionProof must sign over.

Link copied to clipboard
interface DeviceKey

One device's own key: it signs, and its id is the public name other devices check those signatures against.

Link copied to clipboard
interface DeviceKeyStore

Where a device keeps its own DeviceKey and the Grants that let it back into rooms.

Link copied to clipboard
@Serializable(with = DidKey.Serializer::class)
value class DidKey

The public name of one device's key: a short string another device can store, compare, and check a signature against. Two devices holding the same name are talking about the same key.

Link copied to clipboard
class Grant

A host's signed pass that lets one device back in without being vetted again.

Link copied to clipboard
sealed interface GrantScope

Where a Grant is good: in one room, or in any room its issuer hosts.

Link copied to clipboard
class GrantTrust(val hostKey: DidKey, val revocations: RevocationList, scheme: KeyScheme)

Decides whether a presented Grant lets a device back into this host's room now.

Link copied to clipboard
sealed interface GrantVerdict

What a host makes of a Grant a device presents: good here and now, or the first reason it is not.

Link copied to clipboard
@RequiresOptIn(message = "kuilt's admission-protocol statements. No stability promise; they may change in any release.", level = RequiresOptIn.Level.ERROR)
annotation class IdentityInternalApi

Marks the statements only kuilt's own session protocol needs, and nothing else. It carries no stability promise for consumers.

Link copied to clipboard

A DeviceKeyStore that keeps everything in memory, and forgets everything with the process.

Link copied to clipboard
interface KeyScheme

How one device makes keys, reads a key named from outside, and checks a signature. A room uses one scheme for everything it signs and checks, and takes it from its DeviceKeyStore.keyScheme.

Link copied to clipboard

A host's record of the devices it no longer lets back in on an old pass.

Functions

Link copied to clipboard
fun requireSignableText(value: String, name: String)

Throws unless value can be signed as a string field of a statement such as a Challenge or an AdmissionProof: well-formed UTF-16, with no unpaired surrogate, whose UTF-8 fits one layout field (65 535 bytes). name says which value, in the message.

Link copied to clipboard
suspend fun DeviceKey.signApp(context: String, message: ByteArray): ByteArray

Signs message for the app, under context: the signature DidKey.verifyApp accepts for the same context and message, and never a signature over one of kuilt's own statements.

Link copied to clipboard
suspend fun DidKey.verifyApp(context: String, message: ByteArray, signature: ByteArray): Boolean

Whether signature is this key's signApp signature over message under context. false, never a throw, for a signature that is not, as with DidKey.verify.