Package-level declarations

Types

Link copied to clipboard

Proof that a request for endpoint on behalf of address passed authentication and claimed its nonce. Only DeviceAuthenticator creates one, so a protected operation cannot run without it. registrationState is the registration whose key verified the request: an operation that must still hold when it commits (a recovery key rotation or revocation) compares against it.

Link copied to clipboard

A request that failed authentication. Nothing was changed except, for none of these, a nonce.

Link copied to clipboard

A rejected routine rotation. Nothing was changed. Messages never contain key material.

Link copied to clipboard

Verifies device-authenticated requests (docs/server-authentication.md).

Link copied to clipboard

A rejected device recovery. Nothing was changed. Messages never contain key material.

Link copied to clipboard

A successful device recovery.

The host's DeviceRegistrationAuthorizer threw instead of deciding. Nothing was registered. The message is fixed; the host's exception is the cause, for the host's own diagnostics only: the HTTP adapter answers 500 internal_error and logs neither its message nor the context.

Link copied to clipboard
class DeviceRegistrationAuthorizationRequest(val address: DeviceAddress, proposedAuthenticationPublicKey: ByteArray)

A registration that passed authentication and awaits the host's decision. address is the device address being claimed and proposedAuthenticationPublicKey the Ed25519 device authentication public key (32 bytes, a copy) whose possession the request proved. Carries no secrets and no server storage objects.

Link copied to clipboard
fun interface DeviceRegistrationAuthorizer<in C : Any>

The host application's decision whether the caller of a registration may add a device to a user (docs/server-authentication.md, "Registration authorization"). KSecureMessage has no account system: it cannot know who owns a dev.kreienbuehl.ksecuremessage.model.UserId. Every first registration of a device address, including the first device of a user, needs this authorizer's DeviceRegistrationAuthorizationResult.Authorized in addition to the proof that the registrant holds the device authentication key.

Link copied to clipboard

A submitted envelope names a sender other than the device that authenticated the submission. Nothing was queued.

Link copied to clipboard

A rejected last-device recovery or recovery key registration. Nothing was changed. Messages never contain key material.

Link copied to clipboard

A successful last-device recovery.

Link copied to clipboard
class PreKeyService(repository: PreKeyRepository)

Publication and handout of public prekeys. Treats every publication as untrusted input: its format is checked before the repository sees it. Conflict checks and atomicity belong to the repository.

Link copied to clipboard

Device-scoped operations that require the registered device's authentication. Each one fixes the HTTP method and the canonical path the signature must cover (docs/server-authentication.md).

Link copied to clipboard

A rejected recovery key rotation or revocation. Nothing was changed. Messages never contain key material.

Link copied to clipboard
Link copied to clipboard

A rejected recovery key reset operation. Nothing was changed. Messages never contain key material.

Link copied to clipboard
data class RecoveryKeyResetPolicy(val delay: Duration)

The host's policy for delayed recovery key resets (docs/recovery-key-reset.md): a reset requested at server time t can be completed from t + delay on (rounded up to whole milliseconds). The delay is the time every device of the user, and the holder of the current recovery key, has to notice and cancel a reset; choose it for how often the application checks. There is no default: a server without a policy refuses reset requests.

Link copied to clipboard

A reset request: the pending reset, created by this request or an existing one returned unchanged.

Link copied to clipboard

A successful recovery key revocation.

Link copied to clipboard

A successful recovery key rotation.

Link copied to clipboard
class SecureMessageServer<C : Any>(storage: ServerStorage, clock: Clock, deviceRegistrationAuthorizer: DeviceRegistrationAuthorizer<C>, recoveryKeyResetPolicy: RecoveryKeyResetPolicy? = null)

Blind relay: stores public prekeys and queues opaque envelopes. Never decrypts payloads and never holds client secrets.