crypto: Document the requestRoomKey method

This commit is contained in:
Damir Jelić 2021-04-20 14:40:58 +02:00
parent 711e607fca
commit 326641a7e5
1 changed files with 11 additions and 0 deletions

View File

@ -372,6 +372,17 @@ internal class OlmMachine(user_id: String, device_id: String, path: File, device
} }
} }
/**
* Request the room key that was used to encrypt the given undecrypted
* event.
*
* @param event The that we're not able to decrypt and want to request a
* room key for.
*
* @return a key request pair, consisting of an optional key request
* cancellation and the key request itself. The cancellation *must* be sent
* out before the request, otherwise devices will ignore the key request.
*/
@Throws(DecryptionErrorException::class) @Throws(DecryptionErrorException::class)
suspend fun requestRoomKey(event: Event): KeyRequestPair = withContext(Dispatchers.IO) { suspend fun requestRoomKey(event: Event): KeyRequestPair = withContext(Dispatchers.IO) {
val adapter = MoshiProvider.providesMoshi().adapter<Event>(Event::class.java) val adapter = MoshiProvider.providesMoshi().adapter<Event>(Event::class.java)