initialize

suspend fun initialize()

Makes sure the local identity, a current signed prekey and PreKeyConfiguration.oneTimePreKeyTarget one-time prekeys exist, and runs signed prekey maintenance: rotation of a current key that reached PreKeyConfiguration.signedPreKeyRotationAge, deletion of replaced keys whose grace period is over, and removal of retired session initiations that only those keys could accept. All in one transaction. An existing identity is never replaced. Safe to call repeatedly. No network I/O: call publishPreKeys afterwards, a rotation changes the published signed prekey.

Also makes sure the device authentication key exists: it is created with the identity, or once for storage from before milestone 12. If an initialized storage lost the key, this throws SecureMessageClientException.InconsistentStorage instead of creating a new one, which the server would never accept. Never registers the device: call registerDevice.