prepareLastDeviceRecovery

Starts or resumes a last-device recovery of this device (docs/last-device-recovery.md): for a device whose registered device authentication key is lost when no other registered device of the user can authorize a device recovery. Creates the replacement key pair once and keeps it as pending last-device recovery key, sealed at rest; later calls reuse it until the recovery completes or is cancelled. The active key (if any) is not touched. No network I/O: call completeLastDeviceRecovery with the offline recovery key.

Recovers server authentication only. Needs the local messaging identity (SecureMessageClientException.NotInitialized); throws SecureMessageClientException.DeviceAuthenticationRecoveryInProgress or SecureMessageClientException.DeviceAuthenticationRotationInProgress while another transition is pending.