Merge pull request #6944 from element-hq/feature/custom-recovery-key-wellknown

Add well-known parsing and extension seam for custom recovery passphrase
This commit is contained in:
Benoit Marty
2026-06-17 13:58:22 +02:00
committed by GitHub
29 changed files with 525 additions and 116 deletions
@@ -24,9 +24,15 @@ interface EncryptionService {
suspend fun enableBackups(): Result<Unit>
/**
* Enable recovery. Observe enableProgressStateFlow to get progress and recovery key.
* Enable recovery and return the SDK-generated recovery key on success.
* Observe [enableRecoveryProgressStateFlow] for in-progress UI updates.
*
* @param waitForBackupsToUpload when true, suspends until existing room keys finish uploading.
* @param passphrase optional user-supplied passphrase. When set, the SDK derives the
* secret-storage key from it instead of a random base58 key; the passphrase can later be
* passed to [recover], and the returned base58 key should not be surfaced to the user.
*/
suspend fun enableRecovery(waitForBackupsToUpload: Boolean): Result<Unit>
suspend fun enableRecovery(waitForBackupsToUpload: Boolean, passphrase: String? = null): Result<String>
/**
* Change the recovery and return the new recovery key.