Create a new IndexedDBCryptoStore
global indexedDB instance
name of db to connect to
Private
Optional
backendPrivate
Optional
backendPrivate
Readonly
dbname of db to connect to
Private
Readonly
indexedDBglobal indexedDB instance
Static
STORE_Static
STORE_Static
STORE_Static
STORE_Static
STORE_Static
STORE_Static
STORE_Static
STORE_Static
STORE_Adds an end-to-end inbound group session to the store. If there already exists an inbound group session with the same senderCurve25519Key and sessionID, the session will not be added.
The sender's curve 25519 key
The ID of the session
The session data structure
An active transaction. See doTxn().
Park a shared-history group session for a room we may be invited to later.
Optional
txn: IDBTransactionAdd a shared-history group session for a room.
The room that the key belongs to
The sender's curve 25519 key
The ID of the session
Optional
txn: IDBTransactionAn active transaction. See doTxn(). (optional)
Returns the number of end-to-end sessions in the store
An active transaction. See doTxn().
Called with the count of sessions
Look for an existing room key request by id and state, and delete it if found
resolves once the operation is completed
ID of request to update
state we expect to find the request in
Perform a transaction on the crypto store. Any store methods that require a transaction (txn) object to be passed in may only be called within a callback of either this function or one of the store functions operating on the same transaction.
Promise that resolves with the result of the func
when the transaction is complete. If the backend is
async (ie. the indexeddb backend) any of the callback
functions throwing an exception will cause this promise to
reject with that exception. On synchronous backends, the
exception will propagate to the caller of the getFoo method.
'readwrite' if you need to call setter functions with this transaction. Otherwise, 'readonly'.
List IndexedDBCryptoStore.STORE_* options representing all types of object that will be accessed or written to with this transaction.
Function called with the transaction object: an opaque object that should be passed to store functions.
Optional
log: PrefixedLoggerA possibly customised log
Fetches all inbound group sessions in the store
An active transaction. See doTxn().
Called once for each group session
in the store with an object having keys {senderKey, sessionId, sessionData}
,
then once with null to indicate the end of the list.
Retrieve all end-to-end sessions
An active transaction. See doTxn().
Called one for each session with an object with, deviceKey, lastReceivedMessageTs, sessionId and session keys.
Look for room key requests by state – unlike above, return a list of all entries in one state.
Returns an array of requests in the given state
Get the public part of the cross-signing keys (eg. self-signing key, user signing key).
An active transaction. See doTxn().
Called with the account keys object:
{ key_type: base64 encoded seed }
where key type = user_signing_key_seed or self_signing_key_seed
Get the state of all tracked devices
An active transaction. See doTxn().
Function called with the device data
Retrieve the end-to-end inbound group session for a given server key and session ID
The sender's curve 25519 key
The ID of the session
An active transaction. See doTxn().
Called with A map from sessionId to Base64 end-to-end session.
Get an object of roomId->roomInfo
for all e2e rooms in the store
An active transaction. See doTxn().
Function called with the end-to-end encrypted rooms
Retrieve a specific end-to-end session between the logged-in user and another device.
The public key of the other device.
The ID of the session to retrieve
An active transaction. See doTxn().
Called with A map from sessionId to session information object with 'session' key being the Base64 end-to-end session and lastReceivedMessageTs being the timestamp in milliseconds at which the session last received a message.
Retrieve the end-to-end sessions between the logged-in user and another device.
The public key of the other device.
An active transaction. See doTxn().
Called with A map from sessionId to session information object with 'session' key being the Base64 end-to-end session and lastReceivedMessageTs being the timestamp in milliseconds at which the session last received a message.
Look for an existing outgoing room key request, and if none is found, add a new one
resolves to OutgoingRoomKeyRequest: either the same instance as passed in, or the existing one.
Look for an existing room key request
resolves to the matching OutgoingRoomKeyRequest, or null if not found
existing request to look for
Look for room key requests by state
resolves to the a OutgoingRoomKeyRequest, or null if there are no pending requests in those states. If there are multiple requests in those states, an arbitrary one is chosen.
list of acceptable states
Look for room key requests by target device and state
resolves to a list of all the OutgoingRoomKeyRequest
Target user ID
Target device ID
list of acceptable states
An active transaction. See doTxn().
Called with the private key
A key type
Get the shared-history group session for a room.
Promise which resolves to an array of [senderKey, sessionId]
The room that the key belongs to
Optional
txn: IDBTransactionAn active transaction. See doTxn(). (optional)
Mark sessions as needing to be backed up.
resolves when the sessions are marked
The sessions that need to be backed up.
Optional
txn: IDBTransactionAn active transaction. See doTxn(). (optional)
Ensure the database exists and is up-to-date, or fall back to a local storage or in-memory store.
This must be called before the store can be used.
resolves to either an IndexedDBCryptoStoreBackend.Backend, or a MemoryCryptoStore
Write the cross-signing keys back to the store
An active transaction. See doTxn().
keys object as getCrossSigningKeys()
Store the state of all tracked devices This contains devices for each user, a tracking state for each user and a sync token matching the point in time the snapshot represents. These all need to be written out in full each time such that the snapshot is always consistent, so they are stored in one object.
An active transaction. See doTxn().
Writes an end-to-end inbound group session to the store. If there already exists an inbound group session with the same senderCurve25519Key and sessionID, it will be overwritten.
The sender's curve 25519 key
The ID of the session
The session data structure
An active transaction. See doTxn().
Store the end-to-end state for a room.
The room's ID.
The end-to-end info for the room.
An active transaction. See doTxn().
Store a session between the logged-in user and another device
The public key of the other device.
The ID for this end-to-end session.
Session information object
An active transaction. See doTxn().
Write the cross-signing private keys back to the store
An active transaction. See doTxn().
The type of cross-signing private key to store
keys object as getCrossSigningKeys()
Pop out all shared-history group sessions for a room.
Optional
txn: IDBTransactionUnmark sessions as needing to be backed up.
resolves when the sessions are unmarked
The sessions that need to be backed up.
Optional
txn: IDBTransactionAn active transaction. See doTxn(). (optional)
Look for an existing room key request by id and state, and update it if found
resolves to OutgoingRoomKeyRequest updated request, or null if no matching row was found
ID of request to update
state we expect to find the request in
name/value map of updates to apply
Static
existsGenerated using TypeDoc
An implementation of CryptoStore, which is normally backed by an indexeddb, but with fallback to MemoryCryptoStore.