Interface CryptoApi

Public interface to the cryptography parts of the js-sdk

Remarks

Currently, this is a work-in-progress. In time, more methods will be added here.

Hierarchy

Properties

globalBlacklistUnverifiedDevices: boolean

Global override for whether the client should ever send encrypted messages to unverified devices. This provides the default for rooms which do not specify a value.

If true, all unverified devices will be blacklisted by default

Methods

  • Discard any existing megolm session for the given room.

    This will ensure that a new session is created on the next call to prepareToEncrypt, or the next time a message is sent.

    This should not normally be necessary: it should only be used as a debugging tool if there has been a problem with encryption.

    Parameters

    • roomId: string

      the room to discard sessions for

    Returns Promise<void>

  • Return whether we trust other user's signatures of their devices.

    See

    setTrustCrossSignedDevices

    Returns boolean

    true if we trust cross-signed devices, otherwise false.

  • Get the device information for the given list of users.

    For any users whose device lists are cached (due to sharing an encrypted room with the user), the cached device data is returned.

    If there are uncached users, and the downloadUncached parameter is set to true, a /keys/query request is made to the server to retrieve these devices.

    Parameters

    • userIds: string[]

      The users to fetch.

    • Optional downloadUncached: boolean

      If true, download the device list for users whose device list we are not currently tracking. Defaults to false, in which case such users will not appear at all in the result map.

    Returns Promise<DeviceMap>

    A map {@link DeviceMap}.

  • Perform any background tasks that can be done before a message is ready to send, in order to speed up sending of the message.

    Parameters

    • room: Room

      the room the event is in

    Returns void

  • Set whether to trust other user's signatures of their devices.

    If false, devices will only be considered 'verified' if we have verified that device individually (effectively disabling cross-signing).

    true by default.

    Parameters

    • val: boolean

      the new value

    Returns void

  • Checks if the user has previously published cross-signing keys

    This means downloading the devicelist for the user and checking if the list includes the cross-signing pseudo-device.

    Returns Promise<boolean>

    true if the user has previously published cross-signing keys

Generated using TypeDoc