KeyManager class
Methods
clearInboundGroupSessions ()
→ void
clear all cached inbound group sessions. useful for testing
clearOrUseOutboundGroupSession (String roomId , {bool wipe = false , bool use = true })
→ Future <bool >
Clears the existing outboundGroupSession but first checks if the participating
devices have been changed. Returns false if the session has not been cleared because
it wasn't necessary. Otherwise returns true.
clearOutboundGroupSessions ()
→ void
clear all cached inbound group sessions. useful for testing
createOutboundGroupSession (String roomId )
→ Future <OutboundGroupSession >
Creates an outbound group session for a given room id
dispose ()
→ void
getInboundGroupSession (String roomId , String sessionId )
→ SessionKey ?
getOutboundGroupSession (String roomId )
→ OutboundGroupSession ?
Get an outbound group session for a room id
getRoomKeysBackupInfo ([bool useCache = true ])
→ Future <GetRoomKeysVersionCurrentResponse >
handleToDeviceEvent (ToDeviceEvent event )
→ Future <void >
Handle an incoming to_device event that is related to key sharing
isCached ()
→ Future <bool >
loadAllKeys ()
→ Future <void >
Loads and stores all keys from the online key backup. This may take a
while for older and big accounts.
loadAllKeysFromRoom (String roomId )
→ Future <void >
Loads all room keys for a single room and stores them. This may take a
while for older and big rooms.
loadFromResponse (RoomKeys keys )
→ Future <void >
loadInboundGroupSession (String roomId , String sessionId )
→ Future <SessionKey ? >
Loads an inbound group session
loadOutboundGroupSession (String roomId )
→ Future <void >
Load an outbound group session from database
loadSingleKey (String roomId , String sessionId )
→ Future <void >
Loads a single key for the specified room from the online key backup
and stores it.
maybeAutoRequest (String roomId , String sessionId , String ? senderKey , {bool tryOnlineBackup = true , bool onlineKeyBackupOnly = true })
→ void
Attempt auto-request for a key
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
prepareOutboundGroupSession (String roomId )
→ Future <void >
Prepares an outbound group session for a given room ID. That is, load it from
the database, cycle it if needed and create it if absent.
request (Room room , String sessionId , String ? senderKey , {bool tryOnlineBackup = true , bool onlineKeyBackupOnly = false })
→ Future <void >
Request a certain key from another device
setInboundGroupSession (String roomId , String sessionId , String senderKey , Map <String , dynamic > content , {bool forwarded = false , Map <String , String > ? senderClaimedKeys , bool uploaded = false , Map <String , Map <String , int > > ? allowedAtIndex })
→ Future <void >
startAutoUploadKeys ()
→ void
storeOutboundGroupSession (String roomId , OutboundGroupSession sess )
→ Future <void >
Store an outbound group session in the database
toString ()
→ String
A string representation of this object.
inherited
uploadInboundGroupSessions ({bool skipIfInProgress = false })
→ Future <void >
This task should be performed after sync processing but should not block
the sync. To make sure that it never gets executed multiple times, it is
skipped when an upload task is already in progress. Set skipIfInProgress
to false
to await the pending upload task instead.