CryptoService

interface CryptoService

Functions

Link copied to clipboard
abstract fun addNewSessionListener(newSessionListener: NewSessionListener)
Link copied to clipboard
abstract fun addRoomKeysRequestListener(listener: GossipingRequestListener)
Link copied to clipboard
abstract fun close()
Link copied to clipboard
abstract fun crossSigningService(): CrossSigningService
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 getCryptoVersion(context: Context, longFormat: Boolean): String
Link copied to clipboard
abstract fun getEncryptionAlgorithm(roomId: String): String?
Link copied to clipboard
abstract fun getGlobalBlacklistUnverifiedDevices(): Boolean
Link copied to clipboard
abstract fun getGossipingEvents(): List<AuditTrail>
Link copied to clipboard
abstract fun getGossipingEventsTrail(): LiveData<PagedList<AuditTrail>>
Link copied to clipboard
abstract fun getIncomingRoomKeyRequests(): List<IncomingRoomKeyRequest>
Link copied to clipboard
abstract fun getIncomingRoomKeyRequestsPaged(): LiveData<PagedList<IncomingRoomKeyRequest>>
Link copied to clipboard
abstract fun getLiveBlockUnverifiedDevices(roomId: String): LiveData<Boolean>
Link copied to clipboard
abstract fun getLiveCryptoDeviceInfo(): LiveData<List<CryptoDeviceInfo>>
abstract fun getLiveCryptoDeviceInfo(userId: String): LiveData<List<CryptoDeviceInfo>>
abstract fun getLiveCryptoDeviceInfo(userIds: List<String>): LiveData<List<CryptoDeviceInfo>>
Link copied to clipboard
abstract fun getLiveCryptoDeviceInfoWithId(deviceId: String): LiveData<Optional<CryptoDeviceInfo>>
Link copied to clipboard
abstract fun getLiveGlobalCryptoConfig(): LiveData<GlobalCryptoConfig>
Link copied to clipboard
abstract suspend fun getMyCryptoDevice(): CryptoDeviceInfo
Link copied to clipboard
abstract fun getMyDevicesInfo(): List<DeviceInfo>
Link copied to clipboard
abstract fun getMyDevicesInfoLive(): LiveData<List<DeviceInfo>>
abstract fun getMyDevicesInfoLive(deviceId: String): LiveData<Optional<DeviceInfo>>
Link copied to clipboard
abstract fun getOutgoingRoomKeyRequests(): List<OutgoingKeyRequest>
Link copied to clipboard
abstract fun getOutgoingRoomKeyRequestsPaged(): LiveData<PagedList<OutgoingKeyRequest>>
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
abstract fun isKeyGossipingEnabled(): Boolean
Link copied to clipboard
abstract fun isRoomBlacklistUnverifiedDevices(roomId: String?): Boolean
Link copied to clipboard
abstract fun isRoomEncrypted(roomId: String): Boolean
Link copied to clipboard
abstract fun isShareKeysOnInviteEnabled(): 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 fun isStarted(): Boolean
Link copied to clipboard
abstract fun keysBackupService(): KeysBackupService
Link copied to clipboard
abstract fun logDbUsageInfo()
Link copied to clipboard
abstract suspend fun manuallyAcceptRoomKeyRequest(request: IncomingRoomKeyRequest)

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
abstract fun onE2ERoomMemberLoadedFromServer(roomId: String)

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
abstract fun removeRoomKeysRequestListener(listener: GossipingRequestListener)
Link copied to clipboard
abstract fun removeSessionListener(listener: NewSessionListener)
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 setGlobalBlacklistUnverifiedDevices(block: Boolean)
Link copied to clipboard
abstract fun setRoomBlockUnverifiedDevices(roomId: String, block: Boolean)
Link copied to clipboard
abstract fun setRoomUnBlockUnverifiedDevices(roomId: String)
Link copied to clipboard
abstract fun setWarnOnUnknownDevices(warn: Boolean)
Link copied to clipboard
abstract fun shouldEncryptForInvitedMembers(roomId: String): Boolean
Link copied to clipboard
abstract fun start()
Link copied to clipboard
abstract fun supportKeyRequestInspection(): Boolean
Link copied to clipboard
abstract fun supportsDisablingKeyGossiping(): Boolean
Link copied to clipboard
abstract fun supportsForwardedKeyWiththeld(): Boolean
Link copied to clipboard
abstract fun supportsKeyWithheld(): Boolean
Link copied to clipboard
abstract fun supportsShareKeysOnInvite(): Boolean
Link copied to clipboard
abstract fun verificationService(): VerificationService