Abstraction of things that can store data required for end-to-end encryption

interface CryptoStore {
    addEndToEndInboundGroupSession(senderCurve25519Key, sessionId, sessionData, txn): void;
    addParkedSharedHistory(roomId, data, txn?): void;
    addSharedHistoryInboundGroupSession(roomId, senderKey, sessionId, txn?): void;
    containsData(): Promise<boolean>;
    countEndToEndInboundGroupSessions(): Promise<number>;
    countEndToEndSessions(txn, func): void;
    countSessionsNeedingBackup(txn?): Promise<number>;
    deleteAllData(): Promise<void>;
    deleteEndToEndInboundGroupSessionsBatch(sessions): Promise<void>;
    deleteEndToEndSessionsBatch(sessions): Promise<void>;
    deleteOutgoingRoomKeyRequest(requestId, expectedState): Promise<null | OutgoingRoomKeyRequest>;
    doTxn<T>(mode, stores, func, log?): Promise<T>;
    filterOutNotifiedErrorDevices(devices): Promise<IOlmDevice<DeviceInfo>[]>;
    getAccount(txn, func): void;
    getAllEndToEndInboundGroupSessions(txn, func): void;
    getAllEndToEndSessions(txn, func): void;
    getAllOutgoingRoomKeyRequestsByState(wantedState): Promise<OutgoingRoomKeyRequest[]>;
    getCrossSigningKeys(txn, func): void;
    getEndToEndDeviceData(txn, func): void;
    getEndToEndInboundGroupSession(senderCurve25519Key, sessionId, txn, func): void;
    getEndToEndInboundGroupSessionsBatch(): Promise<null | SessionExtended[]>;
    getEndToEndRooms(txn, func): void;
    getEndToEndSession(deviceKey, sessionId, txn, func): void;
    getEndToEndSessionProblem(deviceKey, timestamp): Promise<null | IProblem>;
    getEndToEndSessions(deviceKey, txn, func): void;
    getEndToEndSessionsBatch(): Promise<null | ISessionInfo[]>;
    getMigrationState(): Promise<MigrationState>;
    getOrAddOutgoingRoomKeyRequest(request): Promise<OutgoingRoomKeyRequest>;
    getOutgoingRoomKeyRequest(requestBody): Promise<null | OutgoingRoomKeyRequest>;
    getOutgoingRoomKeyRequestByState(wantedStates): Promise<null | OutgoingRoomKeyRequest>;
    getOutgoingRoomKeyRequestsByTarget(userId, deviceId, wantedStates): Promise<OutgoingRoomKeyRequest[]>;
    getSecretStorePrivateKey<K>(txn, func, type): void;
    getSessionsNeedingBackup(limit): Promise<ISession[]>;
    getSharedHistoryInboundGroupSessions(roomId, txn?): Promise<[senderKey: string, sessionId: string][]>;
    markSessionsNeedingBackup(sessions, txn?): Promise<void>;
    setMigrationState(migrationState): Promise<void>;
    startup(): Promise<CryptoStore>;
    storeAccount(txn, accountPickle): void;
    storeCrossSigningKeys(txn, keys): void;
    storeEndToEndDeviceData(deviceData, txn): void;
    storeEndToEndInboundGroupSession(senderCurve25519Key, sessionId, sessionData, txn): void;
    storeEndToEndInboundGroupSessionWithheld(senderCurve25519Key, sessionId, sessionData, txn): void;
    storeEndToEndRoom(roomId, roomInfo, txn): void;
    storeEndToEndSession(deviceKey, sessionId, sessionInfo, txn): void;
    storeEndToEndSessionProblem(deviceKey, type, fixed): Promise<void>;
    storeSecretStorePrivateKey<K>(txn, type, key): void;
    takeParkedSharedHistory(roomId, txn?): Promise<ParkedSharedHistory[]>;
    unmarkSessionsNeedingBackup(sessions, txn?): Promise<void>;
    updateOutgoingRoomKeyRequest(requestId, expectedState, updates): Promise<null | OutgoingRoomKeyRequest>;
}

Implemented by

Methods

  • Parameters

    • roomId: string
    • senderKey: string
    • sessionId: string
    • Optional txn: unknown

    Returns void

  • Parameters

    • txn: unknown
    • func: ((count) => void)
        • (count): void
        • Parameters

          • count: number

          Returns void

    Returns void

  • Internal

    Delete a batch of Megolm sessions from the database.

    Any sessions in the list which are not found are silently ignored.

    Parameters

    • sessions: {
          senderKey: string;
          sessionId: string;
      }[]

    Returns Promise<void>

  • Internal

    Delete a batch of end-to-end sessions from the database.

    Any sessions in the list which are not found are silently ignored.

    Parameters

    • sessions: {
          deviceKey?: string;
          sessionId?: string;
      }[]

    Returns Promise<void>

  • Parameters

    • txn: unknown
    • func: ((accountPickle) => void)
        • (accountPickle): void
        • Parameters

          • accountPickle: null | string

          Returns void

    Returns void

  • Parameters

    • txn: unknown
    • func: ((session) => void)
        • (session): void
        • Parameters

          Returns void

    Returns void

  • Parameters

    • txn: unknown
    • func: ((session) => void)
        • (session): void
        • Parameters

          Returns void

    Returns void

  • Parameters

    • txn: unknown
    • func: ((deviceData) => void)
        • (deviceData): void
        • Parameters

          Returns void

    Returns void

  • Parameters

    • senderCurve25519Key: string
    • sessionId: string
    • txn: unknown
    • func: ((groupSession, groupSessionWithheld) => void)

    Returns void

  • Parameters

    • deviceKey: string
    • sessionId: string
    • txn: unknown
    • func: ((session) => void)
        • (session): void
        • Parameters

          Returns void

    Returns void

  • Parameters

    • deviceKey: string
    • txn: unknown
    • func: ((sessions) => void)
        • (sessions): void
        • Parameters

          Returns void

    Returns void

  • Parameters

    • roomId: string
    • Optional txn: unknown

    Returns Promise<[senderKey: string, sessionId: string][]>

  • Initialise this crypto store.

    Typically, this involves provisioning storage, and migrating any existing data to the current version of the storage schema where appropriate.

    Must be called before any of the rest of the methods in this interface.

    Returns Promise<CryptoStore>

  • Parameters

    • senderCurve25519Key: string
    • sessionId: string
    • sessionData: IWithheld
    • txn: unknown

    Returns void

Generated using TypeDoc