CryptoService

interface CryptoService

Functions

Link copied to clipboard
abstract fun addNewSessionListener(newSessionListener: NewSessionListener)
Link copied to clipboard
Link copied to clipboard
abstract fun close()
Link copied to clipboard
Link copied to clipboard
abstract suspend fun decryptEvent(event: Event, timeline: String): MXEventDecryptionResult
Link copied to clipboard
abstract suspend fun deleteDevice(deviceId: String, userInteractiveAuthInterceptor: UserInteractiveAuthInterceptor)
Link copied to clipboard
abstract suspend fun deleteDevices(@Size(min = 1) deviceIds: List<String>, userInteractiveAuthInterceptor: UserInteractiveAuthInterceptor)
Link copied to clipboard
abstract suspend fun deviceWithIdentityKey(userId: String, senderKey: String, algorithm: String): CryptoDeviceInfo?
Link copied to clipboard
abstract fun discardOutboundSession(roomId: String)
Link copied to clipboard
abstract suspend fun downloadKeysIfNeeded(userIds: List<String>, forceDownload: Boolean = false): MXUsersDevicesMap<CryptoDeviceInfo>
Link copied to clipboard
abstract fun enableKeyGossiping(enable: Boolean)

Enable or disable key gossiping. Default is true. If set to false this device won't send key_request nor will accept key forwarded

Link copied to clipboard
abstract fun enableShareKeyOnInvite(enable: Boolean)

As per MSC3061. If true will make it possible to share part of e2ee room history on invite depending on the room visibility setting.

Link copied to clipboard
abstract suspend fun encryptEventContent(eventContent: Content, eventType: String, roomId: String): MXEncryptEventContentResult
Link copied to clipboard
abstract suspend fun exportRoomKeys(password: String): ByteArray
Link copied to clipboard
abstract suspend fun fetchDeviceInfo(deviceId: String): DeviceInfo
Link copied to clipboard
abstract suspend fun fetchDevicesList(): List<DeviceInfo>
Link copied to clipboard
abstract suspend fun getCryptoDeviceInfo(userId: String): List<CryptoDeviceInfo>
abstract suspend fun getCryptoDeviceInfo(userId: String, deviceId: String?): CryptoDeviceInfo?
Link copied to clipboard
abstract suspend fun getCryptoDeviceInfoList(userId: String): List<CryptoDeviceInfo>
Link copied to clipboard
abstract fun getEncryptionAlgorithm(roomId: String): String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract suspend fun getMyCryptoDevice(): CryptoDeviceInfo
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun getSharedWithInfo(roomId: String?, sessionId: String): MXUsersDevicesMap<Int>
Link copied to clipboard
abstract suspend fun getUserDevices(userId: String): List<CryptoDeviceInfo>
Link copied to clipboard
abstract fun getWithHeldMegolmSession(roomId: String, sessionId: String): RoomKeyWithHeldContent?
Link copied to clipboard
abstract suspend fun importRoomKeys(roomKeysAsArray: ByteArray, password: String, progressListener: ProgressListener?): ImportRoomKeysResult
Link copied to clipboard
abstract suspend fun inboundGroupSessionsCount(onlyBackedUp: Boolean): Int
Link copied to clipboard
abstract fun isCryptoEnabled(): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun isRoomEncrypted(roomId: String): Boolean
Link copied to clipboard

As per MSC3061. If true will make it possible to share part of e2ee room history on invite depending on the room visibility setting.

Link copied to clipboard
abstract fun isStarted(): Boolean
Link copied to clipboard
Link copied to clipboard
abstract fun logDbUsageInfo()
Link copied to clipboard

Can be called by the app layer to accept a request manually. Use carefully as it is prone to social attacks.

Link copied to clipboard
abstract fun name(): String
Link copied to clipboard

When LL all room members might not be loaded when setting up encryption. This is called after room members have been loaded ... not sure if shoud be API

Link copied to clipboard
abstract suspend fun onLiveEvent(roomId: String, event: Event, isInitialSync: Boolean, cryptoStoreAggregator: CryptoStoreAggregator?)
Link copied to clipboard
open suspend fun onStateEvent(roomId: String, event: Event, cryptoStoreAggregator: CryptoStoreAggregator?)
Link copied to clipboard
abstract suspend fun onSyncCompleted(syncResponse: SyncResponse, cryptoStoreAggregator: CryptoStoreAggregator)
Link copied to clipboard
abstract suspend fun onSyncWillProcess(isInitialSync: Boolean)
Link copied to clipboard
abstract suspend fun prepareToEncrypt(roomId: String)

Perform any background tasks that can be done before a message is ready to send, in order to speed up sending of the message.

Link copied to clipboard
abstract suspend fun receiveSyncChanges(toDevice: ToDeviceSyncResponse?, deviceChanges: DeviceListResponse?, keyCounts: DeviceOneTimeKeysCountSyncResponse?, deviceUnusedFallbackKeyTypes: List<String>?, nextBatch: String?)
Link copied to clipboard
Link copied to clipboard
abstract suspend fun reRequestRoomKeyForEvent(event: Event)
Link copied to clipboard
abstract suspend fun sendSharedHistoryKeys(roomId: String, userId: String, sessionInfoSet: Set<SessionInfo>?)

Share all inbound sessions of the last chunk messages to the provided userId devices.

Link copied to clipboard
abstract suspend fun setDeviceName(deviceId: String, deviceName: String)
Link copied to clipboard
abstract suspend fun setDeviceVerification(trustLevel: DeviceTrustLevel, userId: String, deviceId: String)
Link copied to clipboard
abstract fun setRoomBlockUnverifiedDevices(roomId: String, block: Boolean)
Link copied to clipboard
Link copied to clipboard
abstract fun setWarnOnUnknownDevices(warn: Boolean)
Link copied to clipboard
Link copied to clipboard
abstract fun start()
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard