KeysBackupService

interface KeysBackupService

Functions

Link copied to clipboard
abstract fun addListener(listener: KeysBackupStateListener)
Link copied to clipboard
abstract suspend fun canRestoreKeys(): Boolean

Ask if the backup on the server contains keys that we may do not have locally. This should be called when entering in the state READY_TO_BACKUP

Link copied to clipboard
abstract suspend fun checkAndStartKeysBackup()

Check the server for an active key backup.

Link copied to clipboard
abstract fun computePrivateKey(    passphrase: String,     privateKeySalt: String,     privateKeyIterations: Int,     progressListener: ProgressListener): ByteArray
Link copied to clipboard
abstract suspend fun createKeysBackupVersion(keysBackupCreationInfo: MegolmBackupCreationInfo): KeysVersion

Create a new keys backup version and enable it, using the information return from prepareKeysBackupVersion.

Link copied to clipboard
abstract suspend fun deleteBackup(version: String)

Delete a keys backup version. It will delete all backed up keys on the server, and the backup itself. If we are backing up to this version. Backup will be stopped.

Link copied to clipboard
abstract suspend fun forceUsingLastVersion(): Boolean

This method fetches the last backup version on the server, then compare to the currently backup version use. If versions are not the same, the current backup is deleted (on server or locally), then the backup may be started again, using the last version.

Link copied to clipboard
abstract suspend fun getBackupProgress(progressListener: ProgressListener)

Return the current progress of the backup.

Link copied to clipboard
abstract suspend fun getCurrentVersion(): KeysBackupLastVersionResult?

Retrieve the current version of the backup from the homeserver.

Link copied to clipboard
abstract suspend fun getKeyBackupRecoveryKeyInfo(): SavedKeyBackupKeyInfo?
Link copied to clipboard
abstract suspend fun getKeysBackupTrust(keysBackupVersion: KeysVersionResult): KeysBackupVersionTrust

Check trust on a key backup version.

Link copied to clipboard
abstract fun getState(): KeysBackupState
Link copied to clipboard
abstract suspend fun getTotalNumbersOfBackedUpKeys(): Int

Facility method to get the number of backed up keys.

Link copied to clipboard
abstract suspend fun getTotalNumbersOfKeys(): Int

Facility method to get the total number of locally stored keys.

Link copied to clipboard
abstract suspend fun getVersion(version: String): KeysVersionResult?

Get information about a backup version defined on the homeserver.

Link copied to clipboard
abstract fun isEnabled(): Boolean
Link copied to clipboard
abstract fun isStuck(): Boolean
Link copied to clipboard
abstract suspend fun isValidRecoveryKeyForCurrentVersion(recoveryKey: IBackupRecoveryKey): Boolean
Link copied to clipboard
abstract suspend fun onSecretKeyGossip(secret: String)
Link copied to clipboard
abstract suspend fun prepareKeysBackupVersion(password: String?, progressListener: ProgressListener?): MegolmBackupCreationInfo

Set up the data required to create a new backup version. The backup version will not be created and enabled until createKeysBackupVersion is called. The returned MegolmBackupCreationInfo object has a recoveryKey member with the user-facing recovery key string.

Link copied to clipboard
abstract fun removeListener(listener: KeysBackupStateListener)
Link copied to clipboard
abstract suspend fun restoreKeyBackupWithPassword(    keysBackupVersion: KeysVersionResult,     password: String,     roomId: String?,     sessionId: String?,     stepProgressListener: StepProgressListener?): ImportRoomKeysResult

Restore a backup with a password from a given backup version stored on the homeserver.

Link copied to clipboard
abstract suspend fun restoreKeysWithRecoveryKey(    keysVersionResult: KeysVersionResult,     recoveryKey: IBackupRecoveryKey,     roomId: String?,     sessionId: String?,     stepProgressListener: StepProgressListener?): ImportRoomKeysResult

Restore a backup with a recovery key from a given backup version stored on the homeserver.

Link copied to clipboard
abstract fun saveBackupRecoveryKey(recoveryKey: IBackupRecoveryKey?, version: String?)
Link copied to clipboard
abstract suspend fun trustKeysBackupVersion(keysBackupVersion: KeysVersionResult, trust: Boolean)

Set trust on a keys backup version. It adds (or removes) the signature of the current device to the authentication part of the keys backup version.

Link copied to clipboard
abstract suspend fun trustKeysBackupVersionWithPassphrase(keysBackupVersion: KeysVersionResult, password: String)

Set trust on a keys backup version.

Link copied to clipboard
abstract suspend fun trustKeysBackupVersionWithRecoveryKey(keysBackupVersion: KeysVersionResult, recoveryKey: IBackupRecoveryKey)

Set trust on a keys backup version.

Properties

Link copied to clipboard
open val currentBackupVersion: String?
Link copied to clipboard
abstract val keysBackupVersion: KeysVersionResult?