registerRecoveryKey
abstract suspend fun registerRecoveryKey(userId: UserId, publicKey: ByteArray, registeredAt: Instant): Boolean
Registers publicKey (32 bytes) as userId's recovery key:
the user never registered one: stores it at epoch 1, returns
true;the user's key was revoked at epoch N: stores it at epoch N + 1 and clears the transition IDs, returns
true; at N = Long.MAX_VALUE throws LastDeviceRecoveryKeyException.EpochExhausted;exactly this key is active: returns
false, nothing changes;another key is active: throws LastDeviceRecoveryKeyException.Conflict, nothing changes. Only rotateRecoveryKey replaces an active key.
registeredAt (server time) becomes the key's installation time. A stored key also removes any pending reset of the user (none can exist without an active key). Concurrent calls behave as if they ran one after the other.