PreKeyService

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.

The server does not verify the signed prekey signature. Initiators do that before X3DH, so a tampering server cannot make them accept a bundle.

Constructors

Link copied to clipboard
constructor(repository: PreKeyRepository)

Functions

Link copied to clipboard

The bundle for a first contact with address, or null for an unknown device. Hands out and consumes at most one one-time prekey.

Link copied to clipboard
suspend fun publish(publication: PreKeyPublication)

Stores publication or throws a PreKeyPublicationException and changes nothing. Safe to retry.