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
Bootstrap cross-signing by creating keys if needed.
If everything is already set up, then no changes are made, so this is safe to run to ensure cross-signing is ready for use.
This function:
options object
Bootstrap the secret storage by creating a new secret storage key, add it in the secret storage and store the cross signing keys in the secret storage.
createSecretStorageKey
.
Only if setupNewSecretStorage
is set or if there is no AES key in the secret storagecryptoCallbacks.cacheSecretStorageKey
if provided.Options object.
Create a recovery key (ie, a key suitable for use with server-side secret storage).
The key can either be based on a user-supplied passphrase, or just created randomly.
Optional
password: stringOptional passphrase string to use to derive the key, which can later be entered by the user as an alternative to entering the recovery key itself. If omitted, a key is generated randomly.
Object including recovery key and server upload parameters. The private key should be disposed of after displaying to the use.
Get a list containing all of the room keys
This should be encrypted before returning it to the user.
a promise which resolves to a list of session export objects
Finds a DM verification request that is already in progress for the given room id
the room to use for verification
the VerificationRequest that is in progress, if any
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.
the room to discard sessions for
Get the ID of one of the user's cross-signing keys.
Optional
type: CrossSigningKeyThe type of key to get the ID of. One of CrossSigningKey.Master
, CrossSigningKey.SelfSigning
,
or CrossSigningKey.UserSigning
. Defaults to CrossSigningKey.Master
.
If cross-signing has been initialised on this device, the ID of the given key. Otherwise, null
Get the status of our cross-signing keys.
The current status of cross-signing keys: whether we have public and private keys cached locally, and whether the private keys are in secret storage.
Get the verification status of a given device.
The ID of the user whose device is to be checked.
The ID of the device to check
null
if the device is unknown, or has not published any encryption keys (implying it does not support
encryption); otherwise the verification status of the device.
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.
The users to fetch.
Optional
downloadUncached: booleanIf 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.
A map {@link DeviceMap}
.
Returns to-device verification requests that are already in progress for the given user id.
the ID of the user to query
the VerificationRequests that are in progress
Import a list of room keys previously exported by exportRoomKeys
a list of session export objects
Optional
opts: ImportRoomKeysOptsoptions object
a promise which resolves once the keys have been imported
Checks whether cross signing:
If this function returns false, bootstrapCrossSigning() can be used to fix things such that it returns true. That is to say, after bootstrapCrossSigning() completes successfully, this function should return true.
True if cross-signing is ready to be used on this device
Checks whether secret storage:
If this function returns false, bootstrapSecretStorage() can be used to fix things such that it returns true. That is to say, after bootstrapSecretStorage() completes successfully, this function should return true.
True if secret storage is ready to be used on this device
Perform any background tasks that can be done before a message is ready to send, in order to speed up sending of the message.
the room the event is in
Request an interactive verification with the given device.
This is normally used on one of our own devices, when the current device is already cross-signed, and we want to validate another device.
If a verification for this user/device is already in flight, returns it. Otherwise, initiates a new one.
To control the methods offered, set verificationMethods when creating the MatrixClient.
ID of the owner of the device to verify
ID of the device to verify
a VerificationRequest when the request has been sent to the other party.
Send a verification request to our other devices.
This is normally used when the current device is new, and we want to ask another of our devices to cross-sign.
If an all-devices verification is already in flight, returns it. Otherwise, initiates a new one.
To control the methods offered, set verificationMethods when creating the MatrixClient.
a VerificationRequest when the request has been sent to the other party.
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.
the new value
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.
true if the user has previously published cross-signing keys
Generated using TypeDoc
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.