@unwanted/matrix-sdk-mini 34.12.0-2 → 34.12.0-4
Sign up to get free protection for your applications and to get access to all the features.
- package/git-revision.txt +1 -1
- package/lib/@types/global.d.js +0 -2
- package/lib/@types/global.d.js.map +1 -1
- package/lib/browser-index.d.ts.map +1 -1
- package/lib/browser-index.js +0 -11
- package/lib/browser-index.js.map +1 -1
- package/lib/client.d.ts +2 -1221
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +331 -2821
- package/lib/client.js.map +1 -1
- package/lib/embedded.d.ts +0 -22
- package/lib/embedded.d.ts.map +1 -1
- package/lib/embedded.js +24 -166
- package/lib/embedded.js.map +1 -1
- package/lib/event-mapper.d.ts.map +1 -1
- package/lib/event-mapper.js +0 -4
- package/lib/event-mapper.js.map +1 -1
- package/lib/matrix.d.ts +0 -19
- package/lib/matrix.d.ts.map +1 -1
- package/lib/matrix.js +1 -26
- package/lib/matrix.js.map +1 -1
- package/lib/models/MSC3089Branch.d.ts.map +1 -1
- package/lib/models/MSC3089Branch.js +0 -3
- package/lib/models/MSC3089Branch.js.map +1 -1
- package/lib/models/event.d.ts +0 -94
- package/lib/models/event.d.ts.map +1 -1
- package/lib/models/event.js +0 -274
- package/lib/models/event.js.map +1 -1
- package/lib/models/poll.d.ts.map +1 -1
- package/lib/models/poll.js +1 -5
- package/lib/models/poll.js.map +1 -1
- package/lib/models/relations-container.d.ts.map +1 -1
- package/lib/models/relations-container.js +1 -7
- package/lib/models/relations-container.js.map +1 -1
- package/lib/models/relations.d.ts +0 -1
- package/lib/models/relations.d.ts.map +1 -1
- package/lib/models/relations.js +0 -8
- package/lib/models/relations.js.map +1 -1
- package/lib/models/room-state.d.ts.map +1 -1
- package/lib/models/room-state.js +10 -26
- package/lib/models/room-state.js.map +1 -1
- package/lib/models/room.d.ts +0 -18
- package/lib/models/room.d.ts.map +1 -1
- package/lib/models/room.js +94 -148
- package/lib/models/room.js.map +1 -1
- package/lib/models/thread.d.ts.map +1 -1
- package/lib/models/thread.js +0 -1
- package/lib/models/thread.js.map +1 -1
- package/lib/sliding-sync-sdk.d.ts +2 -3
- package/lib/sliding-sync-sdk.d.ts.map +1 -1
- package/lib/sliding-sync-sdk.js +41 -90
- package/lib/sliding-sync-sdk.js.map +1 -1
- package/lib/sync.d.ts +0 -12
- package/lib/sync.d.ts.map +1 -1
- package/lib/sync.js +1 -73
- package/lib/sync.js.map +1 -1
- package/lib/testing.d.ts +0 -48
- package/lib/testing.d.ts.map +1 -1
- package/lib/testing.js +0 -105
- package/lib/testing.js.map +1 -1
- package/lib/types.d.ts +0 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js.map +1 -1
- package/package.json +1 -3
- package/src/@types/global.d.ts +0 -3
- package/src/browser-index.ts +0 -11
- package/src/client.ts +60 -2882
- package/src/embedded.ts +3 -130
- package/src/event-mapper.ts +0 -4
- package/src/matrix.ts +0 -28
- package/src/models/MSC3089Branch.ts +0 -3
- package/src/models/event.ts +0 -289
- package/src/models/poll.ts +0 -6
- package/src/models/relations-container.ts +1 -8
- package/src/models/relations.ts +0 -8
- package/src/models/room-state.ts +2 -8
- package/src/models/room.ts +0 -62
- package/src/models/thread.ts +0 -1
- package/src/sliding-sync-sdk.ts +2 -72
- package/src/sync.ts +1 -98
- package/src/testing.ts +0 -108
- package/src/types.ts +0 -1
- package/CHANGELOG.md +0 -5910
- package/lib/@types/AESEncryptedSecretStoragePayload.d.ts +0 -14
- package/lib/@types/AESEncryptedSecretStoragePayload.d.ts.map +0 -1
- package/lib/@types/AESEncryptedSecretStoragePayload.js +0 -1
- package/lib/@types/AESEncryptedSecretStoragePayload.js.map +0 -1
- package/lib/@types/crypto.d.ts +0 -47
- package/lib/@types/crypto.d.ts.map +0 -1
- package/lib/@types/crypto.js +0 -1
- package/lib/@types/crypto.js.map +0 -1
- package/lib/@types/matrix-sdk-crypto-wasm.d.js +0 -1
- package/lib/@types/matrix-sdk-crypto-wasm.d.js.map +0 -1
- package/lib/common-crypto/CryptoBackend.d.ts +0 -240
- package/lib/common-crypto/CryptoBackend.d.ts.map +0 -1
- package/lib/common-crypto/CryptoBackend.js +0 -73
- package/lib/common-crypto/CryptoBackend.js.map +0 -1
- package/lib/common-crypto/key-passphrase.d.ts +0 -14
- package/lib/common-crypto/key-passphrase.d.ts.map +0 -1
- package/lib/common-crypto/key-passphrase.js +0 -33
- package/lib/common-crypto/key-passphrase.js.map +0 -1
- package/lib/crypto/CrossSigning.d.ts +0 -184
- package/lib/crypto/CrossSigning.d.ts.map +0 -1
- package/lib/crypto/CrossSigning.js +0 -718
- package/lib/crypto/CrossSigning.js.map +0 -1
- package/lib/crypto/DeviceList.d.ts +0 -216
- package/lib/crypto/DeviceList.d.ts.map +0 -1
- package/lib/crypto/DeviceList.js +0 -892
- package/lib/crypto/DeviceList.js.map +0 -1
- package/lib/crypto/EncryptionSetup.d.ts +0 -152
- package/lib/crypto/EncryptionSetup.d.ts.map +0 -1
- package/lib/crypto/EncryptionSetup.js +0 -356
- package/lib/crypto/EncryptionSetup.js.map +0 -1
- package/lib/crypto/OlmDevice.d.ts +0 -457
- package/lib/crypto/OlmDevice.d.ts.map +0 -1
- package/lib/crypto/OlmDevice.js +0 -1241
- package/lib/crypto/OlmDevice.js.map +0 -1
- package/lib/crypto/OutgoingRoomKeyRequestManager.d.ts +0 -109
- package/lib/crypto/OutgoingRoomKeyRequestManager.d.ts.map +0 -1
- package/lib/crypto/OutgoingRoomKeyRequestManager.js +0 -415
- package/lib/crypto/OutgoingRoomKeyRequestManager.js.map +0 -1
- package/lib/crypto/RoomList.d.ts +0 -26
- package/lib/crypto/RoomList.d.ts.map +0 -1
- package/lib/crypto/RoomList.js +0 -71
- package/lib/crypto/RoomList.js.map +0 -1
- package/lib/crypto/SecretSharing.d.ts +0 -24
- package/lib/crypto/SecretSharing.d.ts.map +0 -1
- package/lib/crypto/SecretSharing.js +0 -194
- package/lib/crypto/SecretSharing.js.map +0 -1
- package/lib/crypto/SecretStorage.d.ts +0 -55
- package/lib/crypto/SecretStorage.d.ts.map +0 -1
- package/lib/crypto/SecretStorage.js +0 -118
- package/lib/crypto/SecretStorage.js.map +0 -1
- package/lib/crypto/aes.d.ts +0 -6
- package/lib/crypto/aes.d.ts.map +0 -1
- package/lib/crypto/aes.js +0 -24
- package/lib/crypto/aes.js.map +0 -1
- package/lib/crypto/algorithms/base.d.ts +0 -156
- package/lib/crypto/algorithms/base.d.ts.map +0 -1
- package/lib/crypto/algorithms/base.js +0 -187
- package/lib/crypto/algorithms/base.js.map +0 -1
- package/lib/crypto/algorithms/index.d.ts +0 -4
- package/lib/crypto/algorithms/index.d.ts.map +0 -1
- package/lib/crypto/algorithms/index.js +0 -20
- package/lib/crypto/algorithms/index.js.map +0 -1
- package/lib/crypto/algorithms/megolm.d.ts +0 -385
- package/lib/crypto/algorithms/megolm.d.ts.map +0 -1
- package/lib/crypto/algorithms/megolm.js +0 -1822
- package/lib/crypto/algorithms/megolm.js.map +0 -1
- package/lib/crypto/algorithms/olm.d.ts +0 -5
- package/lib/crypto/algorithms/olm.d.ts.map +0 -1
- package/lib/crypto/algorithms/olm.js +0 -299
- package/lib/crypto/algorithms/olm.js.map +0 -1
- package/lib/crypto/api.d.ts +0 -32
- package/lib/crypto/api.d.ts.map +0 -1
- package/lib/crypto/api.js +0 -22
- package/lib/crypto/api.js.map +0 -1
- package/lib/crypto/backup.d.ts +0 -227
- package/lib/crypto/backup.d.ts.map +0 -1
- package/lib/crypto/backup.js +0 -824
- package/lib/crypto/backup.js.map +0 -1
- package/lib/crypto/crypto.d.ts +0 -3
- package/lib/crypto/crypto.d.ts.map +0 -1
- package/lib/crypto/crypto.js +0 -19
- package/lib/crypto/crypto.js.map +0 -1
- package/lib/crypto/dehydration.d.ts +0 -34
- package/lib/crypto/dehydration.d.ts.map +0 -1
- package/lib/crypto/dehydration.js +0 -252
- package/lib/crypto/dehydration.js.map +0 -1
- package/lib/crypto/device-converter.d.ts +0 -9
- package/lib/crypto/device-converter.d.ts.map +0 -1
- package/lib/crypto/device-converter.js +0 -42
- package/lib/crypto/device-converter.js.map +0 -1
- package/lib/crypto/deviceinfo.d.ts +0 -99
- package/lib/crypto/deviceinfo.d.ts.map +0 -1
- package/lib/crypto/deviceinfo.js +0 -148
- package/lib/crypto/deviceinfo.js.map +0 -1
- package/lib/crypto/index.d.ts +0 -1209
- package/lib/crypto/index.d.ts.map +0 -1
- package/lib/crypto/index.js +0 -4097
- package/lib/crypto/index.js.map +0 -1
- package/lib/crypto/key_passphrase.d.ts +0 -14
- package/lib/crypto/key_passphrase.d.ts.map +0 -1
- package/lib/crypto/key_passphrase.js +0 -44
- package/lib/crypto/key_passphrase.js.map +0 -1
- package/lib/crypto/keybackup.d.ts +0 -18
- package/lib/crypto/keybackup.d.ts.map +0 -1
- package/lib/crypto/keybackup.js +0 -1
- package/lib/crypto/keybackup.js.map +0 -1
- package/lib/crypto/olmlib.d.ts +0 -129
- package/lib/crypto/olmlib.d.ts.map +0 -1
- package/lib/crypto/olmlib.js +0 -492
- package/lib/crypto/olmlib.js.map +0 -1
- package/lib/crypto/recoverykey.d.ts +0 -2
- package/lib/crypto/recoverykey.d.ts.map +0 -1
- package/lib/crypto/recoverykey.js +0 -19
- package/lib/crypto/recoverykey.js.map +0 -1
- package/lib/crypto/store/base.d.ts +0 -252
- package/lib/crypto/store/base.d.ts.map +0 -1
- package/lib/crypto/store/base.js +0 -64
- package/lib/crypto/store/base.js.map +0 -1
- package/lib/crypto/store/indexeddb-crypto-store-backend.d.ts +0 -187
- package/lib/crypto/store/indexeddb-crypto-store-backend.d.ts.map +0 -1
- package/lib/crypto/store/indexeddb-crypto-store-backend.js +0 -1145
- package/lib/crypto/store/indexeddb-crypto-store-backend.js.map +0 -1
- package/lib/crypto/store/indexeddb-crypto-store.d.ts +0 -432
- package/lib/crypto/store/indexeddb-crypto-store.d.ts.map +0 -1
- package/lib/crypto/store/indexeddb-crypto-store.js +0 -728
- package/lib/crypto/store/indexeddb-crypto-store.js.map +0 -1
- package/lib/crypto/store/localStorage-crypto-store.d.ts +0 -119
- package/lib/crypto/store/localStorage-crypto-store.d.ts.map +0 -1
- package/lib/crypto/store/localStorage-crypto-store.js +0 -531
- package/lib/crypto/store/localStorage-crypto-store.js.map +0 -1
- package/lib/crypto/store/memory-crypto-store.d.ts +0 -215
- package/lib/crypto/store/memory-crypto-store.d.ts.map +0 -1
- package/lib/crypto/store/memory-crypto-store.js +0 -622
- package/lib/crypto/store/memory-crypto-store.js.map +0 -1
- package/lib/crypto/verification/Base.d.ts +0 -105
- package/lib/crypto/verification/Base.d.ts.map +0 -1
- package/lib/crypto/verification/Base.js +0 -372
- package/lib/crypto/verification/Base.js.map +0 -1
- package/lib/crypto/verification/Error.d.ts +0 -35
- package/lib/crypto/verification/Error.d.ts.map +0 -1
- package/lib/crypto/verification/Error.js +0 -86
- package/lib/crypto/verification/Error.js.map +0 -1
- package/lib/crypto/verification/IllegalMethod.d.ts +0 -15
- package/lib/crypto/verification/IllegalMethod.d.ts.map +0 -1
- package/lib/crypto/verification/IllegalMethod.js +0 -43
- package/lib/crypto/verification/IllegalMethod.js.map +0 -1
- package/lib/crypto/verification/QRCode.d.ts +0 -51
- package/lib/crypto/verification/QRCode.d.ts.map +0 -1
- package/lib/crypto/verification/QRCode.js +0 -277
- package/lib/crypto/verification/QRCode.js.map +0 -1
- package/lib/crypto/verification/SAS.d.ts +0 -27
- package/lib/crypto/verification/SAS.d.ts.map +0 -1
- package/lib/crypto/verification/SAS.js +0 -485
- package/lib/crypto/verification/SAS.js.map +0 -1
- package/lib/crypto/verification/SASDecimal.d.ts +0 -8
- package/lib/crypto/verification/SASDecimal.d.ts.map +0 -1
- package/lib/crypto/verification/SASDecimal.js +0 -34
- package/lib/crypto/verification/SASDecimal.js.map +0 -1
- package/lib/crypto/verification/request/Channel.d.ts +0 -18
- package/lib/crypto/verification/request/Channel.d.ts.map +0 -1
- package/lib/crypto/verification/request/Channel.js +0 -1
- package/lib/crypto/verification/request/Channel.js.map +0 -1
- package/lib/crypto/verification/request/InRoomChannel.d.ts +0 -113
- package/lib/crypto/verification/request/InRoomChannel.d.ts.map +0 -1
- package/lib/crypto/verification/request/InRoomChannel.js +0 -351
- package/lib/crypto/verification/request/InRoomChannel.js.map +0 -1
- package/lib/crypto/verification/request/ToDeviceChannel.d.ts +0 -105
- package/lib/crypto/verification/request/ToDeviceChannel.d.ts.map +0 -1
- package/lib/crypto/verification/request/ToDeviceChannel.js +0 -328
- package/lib/crypto/verification/request/ToDeviceChannel.js.map +0 -1
- package/lib/crypto/verification/request/VerificationRequest.d.ts +0 -227
- package/lib/crypto/verification/request/VerificationRequest.d.ts.map +0 -1
- package/lib/crypto/verification/request/VerificationRequest.js +0 -937
- package/lib/crypto/verification/request/VerificationRequest.js.map +0 -1
- package/lib/crypto-api/CryptoEvent.d.ts +0 -69
- package/lib/crypto-api/CryptoEvent.d.ts.map +0 -1
- package/lib/crypto-api/CryptoEvent.js +0 -33
- package/lib/crypto-api/CryptoEvent.js.map +0 -1
- package/lib/crypto-api/CryptoEventHandlerMap.d.ts +0 -16
- package/lib/crypto-api/CryptoEventHandlerMap.d.ts.map +0 -1
- package/lib/crypto-api/CryptoEventHandlerMap.js +0 -22
- package/lib/crypto-api/CryptoEventHandlerMap.js.map +0 -1
- package/lib/crypto-api/index.d.ts +0 -978
- package/lib/crypto-api/index.d.ts.map +0 -1
- package/lib/crypto-api/index.js +0 -304
- package/lib/crypto-api/index.js.map +0 -1
- package/lib/crypto-api/key-passphrase.d.ts +0 -11
- package/lib/crypto-api/key-passphrase.d.ts.map +0 -1
- package/lib/crypto-api/key-passphrase.js +0 -51
- package/lib/crypto-api/key-passphrase.js.map +0 -1
- package/lib/crypto-api/keybackup.d.ts +0 -88
- package/lib/crypto-api/keybackup.d.ts.map +0 -1
- package/lib/crypto-api/keybackup.js +0 -1
- package/lib/crypto-api/keybackup.js.map +0 -1
- package/lib/crypto-api/recovery-key.d.ts +0 -11
- package/lib/crypto-api/recovery-key.d.ts.map +0 -1
- package/lib/crypto-api/recovery-key.js +0 -65
- package/lib/crypto-api/recovery-key.js.map +0 -1
- package/lib/crypto-api/verification.d.ts +0 -344
- package/lib/crypto-api/verification.d.ts.map +0 -1
- package/lib/crypto-api/verification.js +0 -91
- package/lib/crypto-api/verification.js.map +0 -1
- package/lib/rendezvous/MSC4108SignInWithQR.d.ts +0 -112
- package/lib/rendezvous/MSC4108SignInWithQR.d.ts.map +0 -1
- package/lib/rendezvous/MSC4108SignInWithQR.js +0 -392
- package/lib/rendezvous/MSC4108SignInWithQR.js.map +0 -1
- package/lib/rendezvous/RendezvousChannel.d.ts +0 -27
- package/lib/rendezvous/RendezvousChannel.d.ts.map +0 -1
- package/lib/rendezvous/RendezvousChannel.js +0 -1
- package/lib/rendezvous/RendezvousChannel.js.map +0 -1
- package/lib/rendezvous/RendezvousCode.d.ts +0 -9
- package/lib/rendezvous/RendezvousCode.d.ts.map +0 -1
- package/lib/rendezvous/RendezvousCode.js +0 -1
- package/lib/rendezvous/RendezvousCode.js.map +0 -1
- package/lib/rendezvous/RendezvousError.d.ts +0 -6
- package/lib/rendezvous/RendezvousError.d.ts.map +0 -1
- package/lib/rendezvous/RendezvousError.js +0 -23
- package/lib/rendezvous/RendezvousError.js.map +0 -1
- package/lib/rendezvous/RendezvousFailureReason.d.ts +0 -31
- package/lib/rendezvous/RendezvousFailureReason.d.ts.map +0 -1
- package/lib/rendezvous/RendezvousFailureReason.js +0 -38
- package/lib/rendezvous/RendezvousFailureReason.js.map +0 -1
- package/lib/rendezvous/RendezvousIntent.d.ts +0 -5
- package/lib/rendezvous/RendezvousIntent.d.ts.map +0 -1
- package/lib/rendezvous/RendezvousIntent.js +0 -22
- package/lib/rendezvous/RendezvousIntent.js.map +0 -1
- package/lib/rendezvous/RendezvousTransport.d.ts +0 -36
- package/lib/rendezvous/RendezvousTransport.d.ts.map +0 -1
- package/lib/rendezvous/RendezvousTransport.js +0 -1
- package/lib/rendezvous/RendezvousTransport.js.map +0 -1
- package/lib/rendezvous/channels/MSC4108SecureChannel.d.ts +0 -58
- package/lib/rendezvous/channels/MSC4108SecureChannel.d.ts.map +0 -1
- package/lib/rendezvous/channels/MSC4108SecureChannel.js +0 -246
- package/lib/rendezvous/channels/MSC4108SecureChannel.js.map +0 -1
- package/lib/rendezvous/channels/index.d.ts +0 -2
- package/lib/rendezvous/channels/index.d.ts.map +0 -1
- package/lib/rendezvous/channels/index.js +0 -18
- package/lib/rendezvous/channels/index.js.map +0 -1
- package/lib/rendezvous/index.d.ts +0 -10
- package/lib/rendezvous/index.d.ts.map +0 -1
- package/lib/rendezvous/index.js +0 -23
- package/lib/rendezvous/index.js.map +0 -1
- package/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts +0 -61
- package/lib/rendezvous/transports/MSC4108RendezvousSession.d.ts.map +0 -1
- package/lib/rendezvous/transports/MSC4108RendezvousSession.js +0 -253
- package/lib/rendezvous/transports/MSC4108RendezvousSession.js.map +0 -1
- package/lib/rendezvous/transports/index.d.ts +0 -2
- package/lib/rendezvous/transports/index.d.ts.map +0 -1
- package/lib/rendezvous/transports/index.js +0 -18
- package/lib/rendezvous/transports/index.js.map +0 -1
- package/lib/rust-crypto/CrossSigningIdentity.d.ts +0 -33
- package/lib/rust-crypto/CrossSigningIdentity.d.ts.map +0 -1
- package/lib/rust-crypto/CrossSigningIdentity.js +0 -157
- package/lib/rust-crypto/CrossSigningIdentity.js.map +0 -1
- package/lib/rust-crypto/DehydratedDeviceManager.d.ts +0 -98
- package/lib/rust-crypto/DehydratedDeviceManager.d.ts.map +0 -1
- package/lib/rust-crypto/DehydratedDeviceManager.js +0 -285
- package/lib/rust-crypto/DehydratedDeviceManager.js.map +0 -1
- package/lib/rust-crypto/KeyClaimManager.d.ts +0 -33
- package/lib/rust-crypto/KeyClaimManager.d.ts.map +0 -1
- package/lib/rust-crypto/KeyClaimManager.js +0 -82
- package/lib/rust-crypto/KeyClaimManager.js.map +0 -1
- package/lib/rust-crypto/OutgoingRequestProcessor.d.ts +0 -43
- package/lib/rust-crypto/OutgoingRequestProcessor.d.ts.map +0 -1
- package/lib/rust-crypto/OutgoingRequestProcessor.js +0 -195
- package/lib/rust-crypto/OutgoingRequestProcessor.js.map +0 -1
- package/lib/rust-crypto/OutgoingRequestsManager.d.ts +0 -47
- package/lib/rust-crypto/OutgoingRequestsManager.d.ts.map +0 -1
- package/lib/rust-crypto/OutgoingRequestsManager.js +0 -148
- package/lib/rust-crypto/OutgoingRequestsManager.js.map +0 -1
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts +0 -120
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.d.ts.map +0 -1
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.js +0 -467
- package/lib/rust-crypto/PerSessionKeyBackupDownloader.js.map +0 -1
- package/lib/rust-crypto/RoomEncryptor.d.ts +0 -98
- package/lib/rust-crypto/RoomEncryptor.d.ts.map +0 -1
- package/lib/rust-crypto/RoomEncryptor.js +0 -299
- package/lib/rust-crypto/RoomEncryptor.js.map +0 -1
- package/lib/rust-crypto/backup.d.ts +0 -254
- package/lib/rust-crypto/backup.d.ts.map +0 -1
- package/lib/rust-crypto/backup.js +0 -837
- package/lib/rust-crypto/backup.js.map +0 -1
- package/lib/rust-crypto/constants.d.ts +0 -3
- package/lib/rust-crypto/constants.d.ts.map +0 -1
- package/lib/rust-crypto/constants.js +0 -19
- package/lib/rust-crypto/constants.js.map +0 -1
- package/lib/rust-crypto/device-converter.d.ts +0 -28
- package/lib/rust-crypto/device-converter.d.ts.map +0 -1
- package/lib/rust-crypto/device-converter.js +0 -123
- package/lib/rust-crypto/device-converter.js.map +0 -1
- package/lib/rust-crypto/index.d.ts +0 -61
- package/lib/rust-crypto/index.d.ts.map +0 -1
- package/lib/rust-crypto/index.js +0 -152
- package/lib/rust-crypto/index.js.map +0 -1
- package/lib/rust-crypto/libolm_migration.d.ts +0 -81
- package/lib/rust-crypto/libolm_migration.d.ts.map +0 -1
- package/lib/rust-crypto/libolm_migration.js +0 -459
- package/lib/rust-crypto/libolm_migration.js.map +0 -1
- package/lib/rust-crypto/rust-crypto.d.ts +0 -556
- package/lib/rust-crypto/rust-crypto.d.ts.map +0 -1
- package/lib/rust-crypto/rust-crypto.js +0 -2016
- package/lib/rust-crypto/rust-crypto.js.map +0 -1
- package/lib/rust-crypto/secret-storage.d.ts +0 -22
- package/lib/rust-crypto/secret-storage.d.ts.map +0 -1
- package/lib/rust-crypto/secret-storage.js +0 -63
- package/lib/rust-crypto/secret-storage.js.map +0 -1
- package/lib/rust-crypto/verification.d.ts +0 -319
- package/lib/rust-crypto/verification.d.ts.map +0 -1
- package/lib/rust-crypto/verification.js +0 -816
- package/lib/rust-crypto/verification.js.map +0 -1
- package/lib/secret-storage.d.ts +0 -370
- package/lib/secret-storage.d.ts.map +0 -1
- package/lib/secret-storage.js +0 -466
- package/lib/secret-storage.js.map +0 -1
- package/lib/utils/decryptAESSecretStorageItem.d.ts +0 -12
- package/lib/utils/decryptAESSecretStorageItem.d.ts.map +0 -1
- package/lib/utils/decryptAESSecretStorageItem.js +0 -50
- package/lib/utils/decryptAESSecretStorageItem.js.map +0 -1
- package/lib/utils/encryptAESSecretStorageItem.d.ts +0 -16
- package/lib/utils/encryptAESSecretStorageItem.d.ts.map +0 -1
- package/lib/utils/encryptAESSecretStorageItem.js +0 -68
- package/lib/utils/encryptAESSecretStorageItem.js.map +0 -1
- package/lib/utils/internal/deriveKeys.d.ts +0 -10
- package/lib/utils/internal/deriveKeys.d.ts.map +0 -1
- package/lib/utils/internal/deriveKeys.js +0 -60
- package/lib/utils/internal/deriveKeys.js.map +0 -1
- package/src/@types/AESEncryptedSecretStoragePayload.ts +0 -29
- package/src/@types/crypto.ts +0 -73
- package/src/@types/matrix-sdk-crypto-wasm.d.ts +0 -44
- package/src/common-crypto/CryptoBackend.ts +0 -302
- package/src/common-crypto/README.md +0 -4
- package/src/common-crypto/key-passphrase.ts +0 -43
- package/src/crypto/CrossSigning.ts +0 -773
- package/src/crypto/DeviceList.ts +0 -989
- package/src/crypto/EncryptionSetup.ts +0 -351
- package/src/crypto/OlmDevice.ts +0 -1500
- package/src/crypto/OutgoingRoomKeyRequestManager.ts +0 -485
- package/src/crypto/RoomList.ts +0 -70
- package/src/crypto/SecretSharing.ts +0 -240
- package/src/crypto/SecretStorage.ts +0 -136
- package/src/crypto/aes.ts +0 -23
- package/src/crypto/algorithms/base.ts +0 -236
- package/src/crypto/algorithms/index.ts +0 -20
- package/src/crypto/algorithms/megolm.ts +0 -2216
- package/src/crypto/algorithms/olm.ts +0 -381
- package/src/crypto/api.ts +0 -70
- package/src/crypto/backup.ts +0 -922
- package/src/crypto/crypto.ts +0 -18
- package/src/crypto/dehydration.ts +0 -272
- package/src/crypto/device-converter.ts +0 -45
- package/src/crypto/deviceinfo.ts +0 -158
- package/src/crypto/index.ts +0 -4414
- package/src/crypto/key_passphrase.ts +0 -42
- package/src/crypto/keybackup.ts +0 -47
- package/src/crypto/olmlib.ts +0 -539
- package/src/crypto/recoverykey.ts +0 -18
- package/src/crypto/store/base.ts +0 -348
- package/src/crypto/store/indexeddb-crypto-store-backend.ts +0 -1250
- package/src/crypto/store/indexeddb-crypto-store.ts +0 -845
- package/src/crypto/store/localStorage-crypto-store.ts +0 -579
- package/src/crypto/store/memory-crypto-store.ts +0 -680
- package/src/crypto/verification/Base.ts +0 -409
- package/src/crypto/verification/Error.ts +0 -76
- package/src/crypto/verification/IllegalMethod.ts +0 -50
- package/src/crypto/verification/QRCode.ts +0 -310
- package/src/crypto/verification/SAS.ts +0 -494
- package/src/crypto/verification/SASDecimal.ts +0 -37
- package/src/crypto/verification/request/Channel.ts +0 -34
- package/src/crypto/verification/request/InRoomChannel.ts +0 -371
- package/src/crypto/verification/request/ToDeviceChannel.ts +0 -354
- package/src/crypto/verification/request/VerificationRequest.ts +0 -976
- package/src/crypto-api/CryptoEvent.ts +0 -93
- package/src/crypto-api/CryptoEventHandlerMap.ts +0 -32
- package/src/crypto-api/index.ts +0 -1175
- package/src/crypto-api/key-passphrase.ts +0 -58
- package/src/crypto-api/keybackup.ts +0 -115
- package/src/crypto-api/recovery-key.ts +0 -69
- package/src/crypto-api/verification.ts +0 -408
- package/src/rendezvous/MSC4108SignInWithQR.ts +0 -444
- package/src/rendezvous/RendezvousChannel.ts +0 -48
- package/src/rendezvous/RendezvousCode.ts +0 -25
- package/src/rendezvous/RendezvousError.ts +0 -26
- package/src/rendezvous/RendezvousFailureReason.ts +0 -49
- package/src/rendezvous/RendezvousIntent.ts +0 -20
- package/src/rendezvous/RendezvousTransport.ts +0 -58
- package/src/rendezvous/channels/MSC4108SecureChannel.ts +0 -270
- package/src/rendezvous/channels/index.ts +0 -17
- package/src/rendezvous/index.ts +0 -25
- package/src/rendezvous/transports/MSC4108RendezvousSession.ts +0 -270
- package/src/rendezvous/transports/index.ts +0 -17
- package/src/rust-crypto/CrossSigningIdentity.ts +0 -183
- package/src/rust-crypto/DehydratedDeviceManager.ts +0 -306
- package/src/rust-crypto/KeyClaimManager.ts +0 -86
- package/src/rust-crypto/OutgoingRequestProcessor.ts +0 -236
- package/src/rust-crypto/OutgoingRequestsManager.ts +0 -143
- package/src/rust-crypto/PerSessionKeyBackupDownloader.ts +0 -501
- package/src/rust-crypto/RoomEncryptor.ts +0 -352
- package/src/rust-crypto/backup.ts +0 -881
- package/src/rust-crypto/constants.ts +0 -18
- package/src/rust-crypto/device-converter.ts +0 -128
- package/src/rust-crypto/index.ts +0 -237
- package/src/rust-crypto/libolm_migration.ts +0 -530
- package/src/rust-crypto/rust-crypto.ts +0 -2205
- package/src/rust-crypto/secret-storage.ts +0 -60
- package/src/rust-crypto/verification.ts +0 -830
- package/src/secret-storage.ts +0 -693
- package/src/utils/decryptAESSecretStorageItem.ts +0 -54
- package/src/utils/encryptAESSecretStorageItem.ts +0 -73
- package/src/utils/internal/deriveKeys.ts +0 -63
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/crypto-api/index.ts"],"names":[],"mappings":"AAgBA,OAAO,K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AAC;CAC1C;AAED;;GAEG;AACH,oBAAY,iBAAiB;IACzB,IAAI,IAAA;IACJ,IAAI,IAAA;IACJ,GAAG,IAAA;CACN;AAED;;GAEG;AACH,oBAAY,iBAAiB;IACzB,iGAAiG;IACjG,OAAO,IAAA;IAEP,yCAAyC;IACzC,mBAAmB,IAAA;IAEnB,yDAAyD;IACzD,eAAe,IAAA;IAEf,mDAAmD;IACnD,cAAc,IAAA;IAEd;;;;OAIG;IACH,2BAA2B,IAAA;IAE3B;;;OAGG;IACH,qBAAqB,IAAA;CACxB;AAED,iEAAiE;AACjE,MAAM,WAAW,aAAa;IAC1B,yFAAyF;IACzF,OAAO,EAAE,MAAM,CAAC;IAChB,yFAAyF;IACzF,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,cAAc,mBAAmB,CAAC;AAClC,mBAAmB,gBAAgB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,mBAAmB,4BAA4B,CAAC"}
|
package/lib/crypto-api/index.js
DELETED
@@ -1,304 +0,0 @@
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
2
|
-
/*
|
3
|
-
Copyright 2023 The Matrix.org Foundation C.I.C.
|
4
|
-
|
5
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
-
you may not use this file except in compliance with the License.
|
7
|
-
You may obtain a copy of the License at
|
8
|
-
|
9
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
10
|
-
|
11
|
-
Unless required by applicable law or agreed to in writing, software
|
12
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
-
See the License for the specific language governing permissions and
|
15
|
-
limitations under the License.
|
16
|
-
*/
|
17
|
-
|
18
|
-
/**
|
19
|
-
* `matrix-js-sdk/lib/crypto-api`: End-to-end encryption support.
|
20
|
-
*
|
21
|
-
* The most important type is {@link CryptoApi}, an instance of which can be retrieved via
|
22
|
-
* {@link MatrixClient.getCrypto}.
|
23
|
-
*
|
24
|
-
* @packageDocumentation
|
25
|
-
*/
|
26
|
-
|
27
|
-
/**
|
28
|
-
* Public interface to the cryptography parts of the js-sdk
|
29
|
-
*
|
30
|
-
* @remarks Currently, this is a work-in-progress. In time, more methods will be added here.
|
31
|
-
*/
|
32
|
-
|
33
|
-
/** A reason code for a failure to decrypt an event. */
|
34
|
-
export var DecryptionFailureCode = /*#__PURE__*/function (DecryptionFailureCode) {
|
35
|
-
DecryptionFailureCode["MEGOLM_UNKNOWN_INBOUND_SESSION_ID"] = "MEGOLM_UNKNOWN_INBOUND_SESSION_ID";
|
36
|
-
DecryptionFailureCode["MEGOLM_KEY_WITHHELD"] = "MEGOLM_KEY_WITHHELD";
|
37
|
-
DecryptionFailureCode["MEGOLM_KEY_WITHHELD_FOR_UNVERIFIED_DEVICE"] = "MEGOLM_KEY_WITHHELD_FOR_UNVERIFIED_DEVICE";
|
38
|
-
DecryptionFailureCode["OLM_UNKNOWN_MESSAGE_INDEX"] = "OLM_UNKNOWN_MESSAGE_INDEX";
|
39
|
-
DecryptionFailureCode["HISTORICAL_MESSAGE_NO_KEY_BACKUP"] = "HISTORICAL_MESSAGE_NO_KEY_BACKUP";
|
40
|
-
DecryptionFailureCode["HISTORICAL_MESSAGE_BACKUP_UNCONFIGURED"] = "HISTORICAL_MESSAGE_BACKUP_UNCONFIGURED";
|
41
|
-
DecryptionFailureCode["HISTORICAL_MESSAGE_WORKING_BACKUP"] = "HISTORICAL_MESSAGE_WORKING_BACKUP";
|
42
|
-
DecryptionFailureCode["HISTORICAL_MESSAGE_USER_NOT_JOINED"] = "HISTORICAL_MESSAGE_USER_NOT_JOINED";
|
43
|
-
DecryptionFailureCode["SENDER_IDENTITY_PREVIOUSLY_VERIFIED"] = "SENDER_IDENTITY_PREVIOUSLY_VERIFIED";
|
44
|
-
DecryptionFailureCode["UNSIGNED_SENDER_DEVICE"] = "UNSIGNED_SENDER_DEVICE";
|
45
|
-
DecryptionFailureCode["UNKNOWN_SENDER_DEVICE"] = "UNKNOWN_SENDER_DEVICE";
|
46
|
-
DecryptionFailureCode["UNKNOWN_ERROR"] = "UNKNOWN_ERROR";
|
47
|
-
DecryptionFailureCode["MEGOLM_BAD_ROOM"] = "MEGOLM_BAD_ROOM";
|
48
|
-
DecryptionFailureCode["MEGOLM_MISSING_FIELDS"] = "MEGOLM_MISSING_FIELDS";
|
49
|
-
DecryptionFailureCode["OLM_DECRYPT_GROUP_MESSAGE_ERROR"] = "OLM_DECRYPT_GROUP_MESSAGE_ERROR";
|
50
|
-
DecryptionFailureCode["OLM_BAD_ENCRYPTED_MESSAGE"] = "OLM_BAD_ENCRYPTED_MESSAGE";
|
51
|
-
DecryptionFailureCode["OLM_BAD_RECIPIENT"] = "OLM_BAD_RECIPIENT";
|
52
|
-
DecryptionFailureCode["OLM_BAD_RECIPIENT_KEY"] = "OLM_BAD_RECIPIENT_KEY";
|
53
|
-
DecryptionFailureCode["OLM_BAD_ROOM"] = "OLM_BAD_ROOM";
|
54
|
-
DecryptionFailureCode["OLM_BAD_SENDER_CHECK_FAILED"] = "OLM_BAD_SENDER_CHECK_FAILED";
|
55
|
-
DecryptionFailureCode["OLM_BAD_SENDER"] = "OLM_BAD_SENDER";
|
56
|
-
DecryptionFailureCode["OLM_FORWARDED_MESSAGE"] = "OLM_FORWARDED_MESSAGE";
|
57
|
-
DecryptionFailureCode["OLM_MISSING_CIPHERTEXT"] = "OLM_MISSING_CIPHERTEXT";
|
58
|
-
DecryptionFailureCode["OLM_NOT_INCLUDED_IN_RECIPIENTS"] = "OLM_NOT_INCLUDED_IN_RECIPIENTS";
|
59
|
-
DecryptionFailureCode["UNKNOWN_ENCRYPTION_ALGORITHM"] = "UNKNOWN_ENCRYPTION_ALGORITHM";
|
60
|
-
return DecryptionFailureCode;
|
61
|
-
}({});
|
62
|
-
|
63
|
-
/** Base {@link DeviceIsolationMode} kind. */
|
64
|
-
export var DeviceIsolationModeKind = /*#__PURE__*/function (DeviceIsolationModeKind) {
|
65
|
-
DeviceIsolationModeKind[DeviceIsolationModeKind["AllDevicesIsolationMode"] = 0] = "AllDevicesIsolationMode";
|
66
|
-
DeviceIsolationModeKind[DeviceIsolationModeKind["OnlySignedDevicesIsolationMode"] = 1] = "OnlySignedDevicesIsolationMode";
|
67
|
-
return DeviceIsolationModeKind;
|
68
|
-
}({});
|
69
|
-
|
70
|
-
/**
|
71
|
-
* A type of {@link DeviceIsolationMode}.
|
72
|
-
*
|
73
|
-
* Message encryption keys are shared with all devices in the room, except in case of
|
74
|
-
* verified user problems (see {@link errorOnVerifiedUserProblems}).
|
75
|
-
*
|
76
|
-
* Events from all senders are always decrypted (and should be decorated with message shields in case
|
77
|
-
* of authenticity warnings, see {@link EventEncryptionInfo}).
|
78
|
-
*/
|
79
|
-
export class AllDevicesIsolationMode {
|
80
|
-
/**
|
81
|
-
*
|
82
|
-
* @param errorOnVerifiedUserProblems - Behavior when sharing keys to remote devices.
|
83
|
-
*
|
84
|
-
* If set to `true`, sharing keys will fail (i.e. message sending will fail) with an error if:
|
85
|
-
* - The user was previously verified but is not anymore, or:
|
86
|
-
* - A verified user has some unverified devices (not cross-signed).
|
87
|
-
*
|
88
|
-
* If `false`, the keys will be distributed as usual. In this case, the client UX should display
|
89
|
-
* warnings to inform the user about problematic devices/users, and stop them hitting this case.
|
90
|
-
*/
|
91
|
-
constructor(errorOnVerifiedUserProblems) {
|
92
|
-
this.errorOnVerifiedUserProblems = errorOnVerifiedUserProblems;
|
93
|
-
_defineProperty(this, "kind", DeviceIsolationModeKind.AllDevicesIsolationMode);
|
94
|
-
}
|
95
|
-
}
|
96
|
-
|
97
|
-
/**
|
98
|
-
* A type of {@link DeviceIsolationMode}.
|
99
|
-
*
|
100
|
-
* Message encryption keys are only shared with devices that have been cross-signed by their owner.
|
101
|
-
* Encryption will throw an error if a verified user replaces their identity.
|
102
|
-
*
|
103
|
-
* Events are decrypted only if they come from a cross-signed device. Other events will result in a decryption
|
104
|
-
* failure. (To access the failure reason, see {@link MatrixEvent.decryptionFailureReason}.)
|
105
|
-
*/
|
106
|
-
export class OnlySignedDevicesIsolationMode {
|
107
|
-
constructor() {
|
108
|
-
_defineProperty(this, "kind", DeviceIsolationModeKind.OnlySignedDevicesIsolationMode);
|
109
|
-
}
|
110
|
-
}
|
111
|
-
|
112
|
-
/**
|
113
|
-
* DeviceIsolationMode represents the mode of device isolation used when encrypting or decrypting messages.
|
114
|
-
* It can be one of two types: {@link AllDevicesIsolationMode} or {@link OnlySignedDevicesIsolationMode}.
|
115
|
-
*
|
116
|
-
* Only supported by rust Crypto.
|
117
|
-
*/
|
118
|
-
|
119
|
-
/**
|
120
|
-
* Options object for `CryptoApi.bootstrapCrossSigning`.
|
121
|
-
*/
|
122
|
-
|
123
|
-
/**
|
124
|
-
* Represents the ways in which we trust a user
|
125
|
-
*/
|
126
|
-
export class UserVerificationStatus {
|
127
|
-
constructor(crossSigningVerified, crossSigningVerifiedBefore, tofu) {
|
128
|
-
var needsUserApproval = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
129
|
-
this.crossSigningVerified = crossSigningVerified;
|
130
|
-
this.crossSigningVerifiedBefore = crossSigningVerifiedBefore;
|
131
|
-
this.tofu = tofu;
|
132
|
-
/**
|
133
|
-
* Indicates if the identity has changed in a way that needs user approval.
|
134
|
-
*
|
135
|
-
* This happens if the identity has changed since we first saw it, *unless* the new identity has also been verified
|
136
|
-
* by our user (eg via an interactive verification).
|
137
|
-
*
|
138
|
-
* To rectify this, either:
|
139
|
-
*
|
140
|
-
* * Conduct a verification of the new identity via {@link CryptoApi.requestVerificationDM}.
|
141
|
-
* * Pin the new identity, via {@link CryptoApi.pinCurrentUserIdentity}.
|
142
|
-
*
|
143
|
-
* @returns true if the identity has changed in a way that needs user approval.
|
144
|
-
*/
|
145
|
-
_defineProperty(this, "needsUserApproval", void 0);
|
146
|
-
this.needsUserApproval = needsUserApproval;
|
147
|
-
}
|
148
|
-
|
149
|
-
/**
|
150
|
-
* @returns true if this user is verified via any means
|
151
|
-
*/
|
152
|
-
isVerified() {
|
153
|
-
return this.isCrossSigningVerified();
|
154
|
-
}
|
155
|
-
|
156
|
-
/**
|
157
|
-
* @returns true if this user is verified via cross signing
|
158
|
-
*/
|
159
|
-
isCrossSigningVerified() {
|
160
|
-
return this.crossSigningVerified;
|
161
|
-
}
|
162
|
-
|
163
|
-
/**
|
164
|
-
* @returns true if we ever verified this user before (at least for
|
165
|
-
* the history of verifications observed by this device).
|
166
|
-
*/
|
167
|
-
wasCrossSigningVerified() {
|
168
|
-
return this.crossSigningVerifiedBefore;
|
169
|
-
}
|
170
|
-
|
171
|
-
/**
|
172
|
-
* @returns true if this user's key is trusted on first use
|
173
|
-
*
|
174
|
-
* @deprecated No longer supported, with the Rust crypto stack.
|
175
|
-
*/
|
176
|
-
isTofu() {
|
177
|
-
return this.tofu;
|
178
|
-
}
|
179
|
-
}
|
180
|
-
export class DeviceVerificationStatus {
|
181
|
-
constructor(opts) {
|
182
|
-
var _opts$signedByOwner, _opts$crossSigningVer, _opts$tofu, _opts$localVerified, _opts$trustCrossSigne;
|
183
|
-
/**
|
184
|
-
* True if this device has been signed by its owner (and that signature verified).
|
185
|
-
*
|
186
|
-
* This doesn't necessarily mean that we have verified the device, since we may not have verified the
|
187
|
-
* owner's cross-signing key.
|
188
|
-
*/
|
189
|
-
_defineProperty(this, "signedByOwner", void 0);
|
190
|
-
/**
|
191
|
-
* True if this device has been verified via cross signing.
|
192
|
-
*
|
193
|
-
* This does *not* take into account `trustCrossSignedDevices`.
|
194
|
-
*/
|
195
|
-
_defineProperty(this, "crossSigningVerified", void 0);
|
196
|
-
/**
|
197
|
-
* TODO: tofu magic wtf does this do?
|
198
|
-
*/
|
199
|
-
_defineProperty(this, "tofu", void 0);
|
200
|
-
/**
|
201
|
-
* True if the device has been marked as locally verified.
|
202
|
-
*/
|
203
|
-
_defineProperty(this, "localVerified", void 0);
|
204
|
-
/**
|
205
|
-
* True if the client has been configured to trust cross-signed devices via {@link CryptoApi#setTrustCrossSignedDevices}.
|
206
|
-
*/
|
207
|
-
_defineProperty(this, "trustCrossSignedDevices", void 0);
|
208
|
-
this.signedByOwner = (_opts$signedByOwner = opts.signedByOwner) !== null && _opts$signedByOwner !== void 0 ? _opts$signedByOwner : false;
|
209
|
-
this.crossSigningVerified = (_opts$crossSigningVer = opts.crossSigningVerified) !== null && _opts$crossSigningVer !== void 0 ? _opts$crossSigningVer : false;
|
210
|
-
this.tofu = (_opts$tofu = opts.tofu) !== null && _opts$tofu !== void 0 ? _opts$tofu : false;
|
211
|
-
this.localVerified = (_opts$localVerified = opts.localVerified) !== null && _opts$localVerified !== void 0 ? _opts$localVerified : false;
|
212
|
-
this.trustCrossSignedDevices = (_opts$trustCrossSigne = opts.trustCrossSignedDevices) !== null && _opts$trustCrossSigne !== void 0 ? _opts$trustCrossSigne : false;
|
213
|
-
}
|
214
|
-
|
215
|
-
/**
|
216
|
-
* Check if we should consider this device "verified".
|
217
|
-
*
|
218
|
-
* A device is "verified" if either:
|
219
|
-
* * it has been manually marked as such via {@link matrix.MatrixClient.setDeviceVerified}.
|
220
|
-
* * it has been cross-signed with a verified signing key, **and** the client has been configured to trust
|
221
|
-
* cross-signed devices via {@link CryptoApi.setTrustCrossSignedDevices}.
|
222
|
-
*
|
223
|
-
* @returns true if this device is verified via any means.
|
224
|
-
*/
|
225
|
-
isVerified() {
|
226
|
-
return this.localVerified || this.trustCrossSignedDevices && this.crossSigningVerified;
|
227
|
-
}
|
228
|
-
}
|
229
|
-
|
230
|
-
/**
|
231
|
-
* Room key import progress report.
|
232
|
-
* Used when calling {@link CryptoApi#importRoomKeys},
|
233
|
-
* {@link CryptoApi#importRoomKeysAsJson} or {@link CryptoApi#restoreKeyBackup} as the parameter of
|
234
|
-
* the progressCallback. Used to display feedback.
|
235
|
-
*/
|
236
|
-
|
237
|
-
/**
|
238
|
-
* Options object for {@link CryptoApi#importRoomKeys} and
|
239
|
-
* {@link CryptoApi#importRoomKeysAsJson}.
|
240
|
-
*/
|
241
|
-
|
242
|
-
/**
|
243
|
-
* The result of a call to {@link CryptoApi.getCrossSigningStatus}.
|
244
|
-
*/
|
245
|
-
|
246
|
-
/**
|
247
|
-
* Crypto callbacks provided by the application
|
248
|
-
*/
|
249
|
-
|
250
|
-
/**
|
251
|
-
* Parameter of {@link CryptoApi#bootstrapSecretStorage}
|
252
|
-
*/
|
253
|
-
|
254
|
-
/** Types of cross-signing key */
|
255
|
-
export var CrossSigningKey = /*#__PURE__*/function (CrossSigningKey) {
|
256
|
-
CrossSigningKey["Master"] = "master";
|
257
|
-
CrossSigningKey["SelfSigning"] = "self_signing";
|
258
|
-
CrossSigningKey["UserSigning"] = "user_signing";
|
259
|
-
return CrossSigningKey;
|
260
|
-
}({});
|
261
|
-
|
262
|
-
/**
|
263
|
-
* Information on one of the cross-signing keys.
|
264
|
-
* @see https://spec.matrix.org/v1.7/client-server-api/#post_matrixclientv3keysdevice_signingupload
|
265
|
-
*/
|
266
|
-
|
267
|
-
/**
|
268
|
-
* Recovery key created by {@link CryptoApi#createRecoveryKeyFromPassphrase} or {@link CreateSecretStorageOpts#createSecretStorageKey}.
|
269
|
-
*/
|
270
|
-
|
271
|
-
/**
|
272
|
-
* Result type of {@link CryptoApi#getEncryptionInfoForEvent}.
|
273
|
-
*/
|
274
|
-
|
275
|
-
/**
|
276
|
-
* Types of shield to be shown for {@link EventEncryptionInfo#shieldColour}.
|
277
|
-
*/
|
278
|
-
export var EventShieldColour = /*#__PURE__*/function (EventShieldColour) {
|
279
|
-
EventShieldColour[EventShieldColour["NONE"] = 0] = "NONE";
|
280
|
-
EventShieldColour[EventShieldColour["GREY"] = 1] = "GREY";
|
281
|
-
EventShieldColour[EventShieldColour["RED"] = 2] = "RED";
|
282
|
-
return EventShieldColour;
|
283
|
-
}({});
|
284
|
-
|
285
|
-
/**
|
286
|
-
* Reason codes for {@link EventEncryptionInfo#shieldReason}.
|
287
|
-
*/
|
288
|
-
export var EventShieldReason = /*#__PURE__*/function (EventShieldReason) {
|
289
|
-
EventShieldReason[EventShieldReason["UNKNOWN"] = 0] = "UNKNOWN";
|
290
|
-
EventShieldReason[EventShieldReason["UNVERIFIED_IDENTITY"] = 1] = "UNVERIFIED_IDENTITY";
|
291
|
-
EventShieldReason[EventShieldReason["UNSIGNED_DEVICE"] = 2] = "UNSIGNED_DEVICE";
|
292
|
-
EventShieldReason[EventShieldReason["UNKNOWN_DEVICE"] = 3] = "UNKNOWN_DEVICE";
|
293
|
-
EventShieldReason[EventShieldReason["AUTHENTICITY_NOT_GUARANTEED"] = 4] = "AUTHENTICITY_NOT_GUARANTEED";
|
294
|
-
EventShieldReason[EventShieldReason["MISMATCHED_SENDER_KEY"] = 5] = "MISMATCHED_SENDER_KEY";
|
295
|
-
return EventShieldReason;
|
296
|
-
}({});
|
297
|
-
|
298
|
-
/** The result of a call to {@link CryptoApi.getOwnDeviceKeys} */
|
299
|
-
|
300
|
-
export * from "./verification.js";
|
301
|
-
export * from "./recovery-key.js";
|
302
|
-
export * from "./key-passphrase.js";
|
303
|
-
export * from "./CryptoEvent.js";
|
304
|
-
//# sourceMappingURL=index.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":["DecryptionFailureCode","DeviceIsolationModeKind","AllDevicesIsolationMode","constructor","errorOnVerifiedUserProblems","_defineProperty","OnlySignedDevicesIsolationMode","UserVerificationStatus","crossSigningVerified","crossSigningVerifiedBefore","tofu","needsUserApproval","arguments","length","undefined","isVerified","isCrossSigningVerified","wasCrossSigningVerified","isTofu","DeviceVerificationStatus","opts","_opts$signedByOwner","_opts$crossSigningVer","_opts$tofu","_opts$localVerified","_opts$trustCrossSigne","signedByOwner","localVerified","trustCrossSignedDevices","CrossSigningKey","EventShieldColour","EventShieldReason"],"sources":["../../src/crypto-api/index.ts"],"sourcesContent":["/*\nCopyright 2023 The Matrix.org Foundation C.I.C.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*/\n\nimport type { SecretsBundle } from \"@matrix-org/matrix-sdk-crypto-wasm\";\nimport type { IMegolmSessionData } from \"../@types/crypto.ts\";\nimport type { ToDeviceBatch, ToDevicePayload } from \"../models/ToDeviceMessage.ts\";\nimport { Room } from \"../models/room.ts\";\nimport { DeviceMap } from \"../models/device.ts\";\nimport { UIAuthCallback } from \"../interactive-auth.ts\";\nimport { PassphraseInfo, SecretStorageCallbacks, SecretStorageKeyDescription } from \"../secret-storage.ts\";\nimport { VerificationRequest } from \"./verification.ts\";\nimport {\n BackupTrustInfo,\n KeyBackupCheck,\n KeyBackupInfo,\n KeyBackupRestoreOpts,\n KeyBackupRestoreResult,\n} from \"./keybackup.ts\";\nimport { ISignatures } from \"../@types/signed.ts\";\nimport { MatrixEvent } from \"../models/event.ts\";\n\n/**\n * `matrix-js-sdk/lib/crypto-api`: End-to-end encryption support.\n *\n * The most important type is {@link CryptoApi}, an instance of which can be retrieved via\n * {@link MatrixClient.getCrypto}.\n *\n * @packageDocumentation\n */\n\n/**\n * Public interface to the cryptography parts of the js-sdk\n *\n * @remarks Currently, this is a work-in-progress. In time, more methods will be added here.\n */\nexport interface CryptoApi {\n /**\n * Global override for whether the client should ever send encrypted\n * messages to unverified devices. This provides the default for rooms which\n * do not specify a value.\n *\n * If true, all unverified devices will be blacklisted by default\n */\n globalBlacklistUnverifiedDevices: boolean;\n\n /**\n * The {@link DeviceIsolationMode} mode to use.\n */\n setDeviceIsolationMode(isolationMode: DeviceIsolationMode): void;\n\n /**\n * Return the current version of the crypto module.\n * For example: `Rust SDK ${versions.matrix_sdk_crypto} (${versions.git_sha}), Vodozemac ${versions.vodozemac}`.\n * @returns the formatted version\n */\n getVersion(): string;\n\n /**\n * Get the public part of the device keys for the current device.\n *\n * @returns The public device keys.\n */\n getOwnDeviceKeys(): Promise<OwnDeviceKeys>;\n\n /**\n * Check if we believe the given room to be encrypted.\n *\n * This method returns true if the room has been configured with encryption. The setting is persistent, so that\n * even if the encryption event is removed from the room state, it still returns true. This helps to guard against\n * a downgrade attack wherein a server admin attempts to remove encryption.\n *\n * @returns `true` if the room with the supplied ID is encrypted. `false` if the room is not encrypted, or is unknown to\n * us.\n */\n isEncryptionEnabledInRoom(roomId: string): Promise<boolean>;\n\n /**\n * Perform any background tasks that can be done before a message is ready to\n * send, in order to speed up sending of the message.\n *\n * @param room - the room the event is in\n */\n prepareToEncrypt(room: Room): void;\n\n /**\n * Discard any existing megolm session for the given room.\n *\n * This will ensure that a new session is created on the next call to {@link prepareToEncrypt},\n * or the next time a message is sent.\n *\n * This should not normally be necessary: it should only be used as a debugging tool if there has been a\n * problem with encryption.\n *\n * @param roomId - the room to discard sessions for\n */\n forceDiscardSession(roomId: string): Promise<void>;\n\n /**\n * Get a list containing all of the room keys\n *\n * This should be encrypted before returning it to the user.\n *\n * @returns a promise which resolves to a list of\n * session export objects\n */\n exportRoomKeys(): Promise<IMegolmSessionData[]>;\n\n /**\n * Get a JSON list containing all of the room keys\n *\n * This should be encrypted before returning it to the user.\n *\n * @returns a promise which resolves to a JSON string\n * encoding a list of session export objects,\n * each of which is an IMegolmSessionData\n */\n exportRoomKeysAsJson(): Promise<string>;\n\n /**\n * Import a list of room keys previously exported by exportRoomKeys\n *\n * @param keys - a list of session export objects\n * @param opts - options object\n * @returns a promise which resolves once the keys have been imported\n */\n importRoomKeys(keys: IMegolmSessionData[], opts?: ImportRoomKeysOpts): Promise<void>;\n\n /**\n * Import a JSON string encoding a list of room keys previously\n * exported by exportRoomKeysAsJson\n *\n * @param keys - a JSON string encoding a list of session export\n * objects, each of which is an IMegolmSessionData\n * @param opts - options object\n * @returns a promise which resolves once the keys have been imported\n */\n importRoomKeysAsJson(keys: string, opts?: ImportRoomKeysOpts): Promise<void>;\n\n /**\n * Check if the given user has published cross-signing keys.\n *\n * - If the user is tracked, a `/keys/query` request is made to update locally the cross signing keys.\n * - If the user is not tracked locally and downloadUncached is set to true,\n * a `/keys/query` request is made to the server to retrieve the cross signing keys.\n * - Otherwise, return false\n *\n * @param userId - the user ID to check. Defaults to the local user.\n * @param downloadUncached - If true, download the device list for users whose device list we are not\n * currently tracking. Defaults to false, in which case `false` will be returned for such users.\n *\n * @returns true if the cross signing keys are available.\n */\n userHasCrossSigningKeys(userId?: string, downloadUncached?: boolean): Promise<boolean>;\n\n /**\n * Get the device information for the given list of users.\n *\n * For any users whose device lists are cached (due to sharing an encrypted room with the user), the\n * cached device data is returned.\n *\n * If there are uncached users, and the `downloadUncached` parameter is set to `true`,\n * a `/keys/query` request is made to the server to retrieve these devices.\n *\n * @param userIds - The users to fetch.\n * @param downloadUncached - If true, download the device list for users whose device list we are not\n * currently tracking. Defaults to false, in which case such users will not appear at all in the result map.\n *\n * @returns A map `{@link DeviceMap}`.\n */\n getUserDeviceInfo(userIds: string[], downloadUncached?: boolean): Promise<DeviceMap>;\n\n /**\n * Set whether to trust other user's signatures of their devices.\n *\n * If false, devices will only be considered 'verified' if we have\n * verified that device individually (effectively disabling cross-signing).\n *\n * `true` by default.\n *\n * @param val - the new value\n */\n setTrustCrossSignedDevices(val: boolean): void;\n\n /**\n * Return whether we trust other user's signatures of their devices.\n *\n * @see {@link CryptoApi.setTrustCrossSignedDevices}\n *\n * @returns `true` if we trust cross-signed devices, otherwise `false`.\n */\n getTrustCrossSignedDevices(): boolean;\n\n /**\n * Get the verification status of a given user.\n *\n * @param userId - The ID of the user to check.\n *\n */\n getUserVerificationStatus(userId: string): Promise<UserVerificationStatus>;\n\n /**\n * \"Pin\" the current identity of the given user, accepting it as genuine.\n *\n * This is useful if the user has changed identity since we first saw them (leading to\n * {@link UserVerificationStatus.needsUserApproval}), and we are now accepting their new identity.\n *\n * Throws an error if called on our own user ID, or on a user ID that we don't have an identity for.\n */\n pinCurrentUserIdentity(userId: string): Promise<void>;\n\n /**\n * Get the verification status of a given device.\n *\n * @param userId - The ID of the user whose device is to be checked.\n * @param deviceId - The ID of the device to check\n *\n * @returns `null` if the device is unknown, or has not published any encryption keys (implying it does not support\n * encryption); otherwise the verification status of the device.\n */\n getDeviceVerificationStatus(userId: string, deviceId: string): Promise<DeviceVerificationStatus | null>;\n\n /**\n * Mark the given device as locally verified.\n *\n * Marking a device as locally verified has much the same effect as completing the verification dance, or receiving\n * a cross-signing signature for it.\n *\n * @param userId - owner of the device\n * @param deviceId - unique identifier for the device.\n * @param verified - whether to mark the device as verified. Defaults to 'true'.\n *\n * @throws an error if the device is unknown, or has not published any encryption keys.\n *\n * @remarks Fires {@link matrix.CryptoEvent.DeviceVerificationChanged}\n */\n setDeviceVerified(userId: string, deviceId: string, verified?: boolean): Promise<void>;\n\n /**\n * Cross-sign one of our own devices.\n *\n * This will create a signature for the device using our self-signing key, and publish that signature.\n * Cross-signing a device indicates, to our other devices and to other users, that we have verified that it really\n * belongs to us.\n *\n * Requires that cross-signing has been set up on this device (normally by calling {@link bootstrapCrossSigning}).\n *\n * *Note*: Do not call this unless you have verified, somehow, that the device is genuine!\n *\n * @param deviceId - ID of the device to be signed.\n */\n crossSignDevice(deviceId: string): Promise<void>;\n\n /**\n * Checks whether cross signing:\n * - is enabled on this account and trusted by this device\n * - has private keys either cached locally or stored in secret storage\n *\n * If this function returns false, bootstrapCrossSigning() can be used\n * to fix things such that it returns true. That is to say, after\n * bootstrapCrossSigning() completes successfully, this function should\n * return true.\n *\n * @returns True if cross-signing is ready to be used on this device\n *\n * @throws May throw {@link matrix.ClientStoppedError} if the `MatrixClient` is stopped before or during the call.\n */\n isCrossSigningReady(): Promise<boolean>;\n\n /**\n * Get the ID of one of the user's cross-signing keys, if both private and matching\n * public parts of that key are available (ie. cached in the local crypto store).\n *\n * The public part may not be available if a `/keys/query` request has not yet been\n * performed, or if the device that created the keys failed to publish them.\n *\n * If either part of the keypair is not available, this will return `null`.\n *\n * @param type - The type of key to get the ID of. One of `CrossSigningKey.Master`, `CrossSigningKey.SelfSigning`,\n * or `CrossSigningKey.UserSigning`. Defaults to `CrossSigningKey.Master`.\n *\n * @returns If cross-signing has been initialised on this device, the ID of the given key. Otherwise, null\n */\n getCrossSigningKeyId(type?: CrossSigningKey): Promise<string | null>;\n\n /**\n * Bootstrap cross-signing by creating keys if needed.\n *\n * If everything is already set up, then no changes are made, so this is safe to run to ensure\n * cross-signing is ready for use.\n *\n * This function:\n * - creates new cross-signing keys if they are not found locally cached nor in\n * secret storage (if it has been set up)\n * - publishes the public keys to the server if they are not already published\n * - stores the private keys in secret storage if secret storage is set up.\n *\n * @param opts - options object\n */\n bootstrapCrossSigning(opts: BootstrapCrossSigningOpts): Promise<void>;\n\n /**\n * Checks whether secret storage:\n * - is enabled on this account\n * - is storing cross-signing private keys\n * - is storing session backup key (if enabled)\n *\n * If this function returns false, bootstrapSecretStorage() can be used\n * to fix things such that it returns true. That is to say, after\n * bootstrapSecretStorage() completes successfully, this function should\n * return true.\n *\n * @returns True if secret storage is ready to be used on this device\n */\n isSecretStorageReady(): Promise<boolean>;\n\n /**\n * Bootstrap the secret storage by creating a new secret storage key, add it in the secret storage and\n * store the cross signing keys in the secret storage.\n *\n * - Generate a new key {@link GeneratedSecretStorageKey} with `createSecretStorageKey`.\n * Only if `setupNewSecretStorage` is set or if there is no AES key in the secret storage\n * - Store this key in the secret storage and set it as the default key.\n * - Call `cryptoCallbacks.cacheSecretStorageKey` if provided.\n * - Store the cross signing keys in the secret storage if\n * - the cross signing is ready\n * - a new key was created during the previous step\n * - or the secret storage already contains the cross signing keys\n *\n * @param opts - Options object.\n */\n bootstrapSecretStorage(opts: CreateSecretStorageOpts): Promise<void>;\n\n /**\n * Get the status of our cross-signing keys.\n *\n * @returns The current status of cross-signing keys: whether we have public and private keys cached locally, and\n * whether the private keys are in secret storage.\n *\n * @throws May throw {@link matrix.ClientStoppedError} if the `MatrixClient` is stopped before or during the call.\n */\n getCrossSigningStatus(): Promise<CrossSigningStatus>;\n\n /**\n * Create a recovery key (ie, a key suitable for use with server-side secret storage).\n *\n * The key can either be based on a user-supplied passphrase, or just created randomly.\n *\n * @param password - Optional passphrase string to use to derive the key,\n * which can later be entered by the user as an alternative to entering the\n * recovery key itself. If omitted, a key is generated randomly.\n *\n * @returns Object including recovery key and server upload parameters.\n * The private key should be disposed of after displaying to the use.\n */\n createRecoveryKeyFromPassphrase(password?: string): Promise<GeneratedSecretStorageKey>;\n\n /**\n * Get information about the encryption of the given event.\n *\n * @param event - the event to get information for\n *\n * @returns `null` if the event is not encrypted, or has not (yet) been successfully decrypted. Otherwise, an\n * object with information about the encryption of the event.\n */\n getEncryptionInfoForEvent(event: MatrixEvent): Promise<EventEncryptionInfo | null>;\n\n /**\n * Encrypts a given payload object via Olm to-device messages to a given\n * set of devices.\n *\n * @param eventType - the type of the event to send.\n * @param devices - an array of devices to encrypt the payload for.\n * @param payload - the payload to encrypt.\n *\n * @returns the batch of encrypted payloads which can then be sent via {@link matrix.MatrixClient#queueToDevice}.\n */\n encryptToDeviceMessages(\n eventType: string,\n devices: { userId: string; deviceId: string }[],\n payload: ToDevicePayload,\n ): Promise<ToDeviceBatch>;\n\n ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n //\n // Device/User verification\n //\n ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n /**\n * Returns to-device verification requests that are already in progress for the given user id.\n *\n * @param userId - the ID of the user to query\n *\n * @returns the VerificationRequests that are in progress\n */\n getVerificationRequestsToDeviceInProgress(userId: string): VerificationRequest[];\n\n /**\n * Finds a DM verification request that is already in progress for the given room id\n *\n * @param roomId - the room to use for verification\n *\n * @returns the VerificationRequest that is in progress, if any\n * @deprecated prefer `userId` parameter variant.\n */\n findVerificationRequestDMInProgress(roomId: string): VerificationRequest | undefined;\n\n /**\n * Finds a DM verification request that is already in progress for the given room and user.\n *\n * @param roomId - the room to use for verification.\n * @param userId - search for a verification request for the given user.\n *\n * @returns the VerificationRequest that is in progress, if any.\n */\n findVerificationRequestDMInProgress(roomId: string, userId?: string): VerificationRequest | undefined;\n\n /**\n * Request a key verification from another user, using a DM.\n *\n * @param userId - the user to request verification with.\n * @param roomId - the room to use for verification.\n *\n * @returns resolves to a VerificationRequest when the request has been sent to the other party.\n */\n requestVerificationDM(userId: string, roomId: string): Promise<VerificationRequest>;\n\n /**\n * Send a verification request to our other devices.\n *\n * This is normally used when the current device is new, and we want to ask another of our devices to cross-sign.\n *\n * If an all-devices verification is already in flight, returns it. Otherwise, initiates a new one.\n *\n * To control the methods offered, set {@link matrix.ICreateClientOpts.verificationMethods} when creating the\n * `MatrixClient`.\n *\n * @returns a VerificationRequest when the request has been sent to the other party.\n */\n requestOwnUserVerification(): Promise<VerificationRequest>;\n\n /**\n * Request an interactive verification with the given device.\n *\n * This is normally used on one of our own devices, when the current device is already cross-signed, and we want to\n * validate another device.\n *\n * If a verification for this user/device is already in flight, returns it. Otherwise, initiates a new one.\n *\n * To control the methods offered, set {@link matrix.ICreateClientOpts.verificationMethods} when creating the\n * `MatrixClient`.\n *\n * @param userId - ID of the owner of the device to verify\n * @param deviceId - ID of the device to verify\n *\n * @returns a VerificationRequest when the request has been sent to the other party.\n */\n requestDeviceVerification(userId: string, deviceId: string): Promise<VerificationRequest>;\n\n ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n //\n // Secure key backup\n //\n ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n /**\n * Fetch the backup decryption key we have saved in our store.\n *\n * This can be used for gossiping the key to other devices.\n *\n * @returns the key, if any, or null\n */\n getSessionBackupPrivateKey(): Promise<Uint8Array | null>;\n\n /**\n * Store the backup decryption key.\n *\n * This should be called if the client has received the key from another device via secret sharing (gossiping).\n * It is the responsability of the caller to check that the decryption key is valid for the current backup version.\n *\n * @param key - the backup decryption key\n *\n * @deprecated prefer the variant with a `version` parameter.\n */\n storeSessionBackupPrivateKey(key: Uint8Array): Promise<void>;\n\n /**\n * Store the backup decryption key.\n *\n * This should be called if the client has received the key from another device via secret sharing (gossiping).\n * It is the responsability of the caller to check that the decryption key is valid for the given backup version.\n *\n * @param key - the backup decryption key\n * @param version - the backup version corresponding to this decryption key\n */\n storeSessionBackupPrivateKey(key: Uint8Array, version: string): Promise<void>;\n\n /**\n * Attempt to fetch the backup decryption key from secret storage.\n *\n * If the key is found in secret storage, checks it against the latest backup on the server;\n * if they match, stores the key in the crypto store by calling {@link storeSessionBackupPrivateKey},\n * which enables automatic restore of individual keys when an Unable-to-decrypt error is encountered.\n *\n * If we are unable to fetch the key from secret storage, there is no backup on the server, or the key\n * does not match, throws an exception.\n */\n loadSessionBackupPrivateKeyFromSecretStorage(): Promise<void>;\n\n /**\n * Get the current status of key backup.\n *\n * @returns If automatic key backups are enabled, the `version` of the active backup. Otherwise, `null`.\n */\n getActiveSessionBackupVersion(): Promise<string | null>;\n\n /**\n * Determine if a key backup can be trusted.\n *\n * @param info - key backup info dict from {@link matrix.MatrixClient.getKeyBackupVersion}.\n */\n isKeyBackupTrusted(info: KeyBackupInfo): Promise<BackupTrustInfo>;\n\n /**\n * Return the details of the latest backup on the server, when we last checked.\n *\n * This normally returns a cached value, but if we haven't yet made a request to the server, it will fire one off.\n * It will always return the details of the active backup if key backup is enabled.\n *\n * Return null if there is no backup.\n *\n * @returns the key backup information\n */\n getKeyBackupInfo(): Promise<KeyBackupInfo | null>;\n\n /**\n * Force a re-check of the key backup and enable/disable it as appropriate.\n *\n * Fetches the current backup information from the server. If there is a backup, and it is trusted, starts\n * backing up to it; otherwise, disables backups.\n *\n * @returns `null` if there is no backup on the server. Otherwise, data on the backup as returned by the server,\n * and trust information (as returned by {@link isKeyBackupTrusted}).\n */\n checkKeyBackupAndEnable(): Promise<KeyBackupCheck | null>;\n\n /**\n * Creates a new key backup version.\n *\n * If there are existing backups they will be replaced.\n *\n * The decryption key will be saved in Secret Storage (the {@link matrix.SecretStorage.SecretStorageCallbacks.getSecretStorageKey} Crypto\n * callback will be called)\n * and the backup engine will be started.\n */\n resetKeyBackup(): Promise<void>;\n\n /**\n * Deletes the given key backup.\n *\n * @param version - The backup version to delete.\n */\n deleteKeyBackupVersion(version: string): Promise<void>;\n\n /**\n * Download and restore the full key backup from the homeserver.\n *\n * Before calling this method, a decryption key, and the backup version to restore,\n * must have been saved in the crypto store. This happens in one of the following ways:\n *\n * - When a new backup version is created with {@link CryptoApi.resetKeyBackup}, a new key is created and cached.\n * - The key can be loaded from secret storage with {@link CryptoApi.loadSessionBackupPrivateKeyFromSecretStorage}.\n * - The key can be received from another device via secret sharing, typically as part of the interactive verification flow.\n * - The key and backup version can also be set explicitly via {@link CryptoApi.storeSessionBackupPrivateKey},\n * though this is not expected to be a common operation.\n *\n * Warning: the full key backup may be quite large, so this operation may take several hours to complete.\n * Use of {@link KeyBackupRestoreOpts.progressCallback} is recommended.\n *\n * @param opts\n */\n restoreKeyBackup(opts?: KeyBackupRestoreOpts): Promise<KeyBackupRestoreResult>;\n\n /**\n * Restores a key backup using a passphrase.\n * The decoded key (derived from the passphrase) is stored locally by calling {@link CryptoApi#storeSessionBackupPrivateKey}.\n *\n * @param passphrase - The passphrase to use to restore the key backup.\n * @param opts\n *\n * @deprecated Deriving a backup key from a passphrase is not part of the matrix spec. Instead, a random key is generated and stored/shared via 4S.\n */\n restoreKeyBackupWithPassphrase(passphrase: string, opts?: KeyBackupRestoreOpts): Promise<KeyBackupRestoreResult>;\n\n ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n //\n // Dehydrated devices\n //\n ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n /**\n * Returns whether MSC3814 dehydrated devices are supported by the crypto\n * backend and by the server.\n *\n * This should be called before calling `startDehydration`, and if this\n * returns `false`, `startDehydration` should not be called.\n */\n isDehydrationSupported(): Promise<boolean>;\n\n /**\n * Start using device dehydration.\n *\n * - Rehydrates a dehydrated device, if one is available.\n * - Creates a new dehydration key, if necessary, and stores it in Secret\n * Storage.\n * - If `createNewKey` is set to true, always creates a new key.\n * - If a dehydration key is not available, creates a new one.\n * - Creates a new dehydrated device, and schedules periodically creating\n * new dehydrated devices.\n *\n * This function must not be called unless `isDehydrationSupported` returns\n * `true`, and must not be called until after cross-signing and secret\n * storage have been set up.\n *\n * @param createNewKey - whether to force creation of a new dehydration key.\n * This can be used, for example, if Secret Storage is being reset. Defaults\n * to false.\n */\n startDehydration(createNewKey?: boolean): Promise<void>;\n\n ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n //\n // Import/export of secret keys\n //\n ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////\n\n /**\n * Export secrets bundle for transmitting to another device as part of OIDC QR login\n */\n exportSecretsBundle?(): Promise<Awaited<ReturnType<SecretsBundle[\"to_json\"]>>>;\n\n /**\n * Import secrets bundle transmitted from another device.\n * @param secrets - The secrets bundle received from the other device\n */\n importSecretsBundle?(secrets: Awaited<ReturnType<SecretsBundle[\"to_json\"]>>): Promise<void>;\n}\n\n/** A reason code for a failure to decrypt an event. */\nexport enum DecryptionFailureCode {\n /** Message was encrypted with a Megolm session whose keys have not been shared with us. */\n MEGOLM_UNKNOWN_INBOUND_SESSION_ID = \"MEGOLM_UNKNOWN_INBOUND_SESSION_ID\",\n\n /** A special case of {@link MEGOLM_UNKNOWN_INBOUND_SESSION_ID}: the sender has told us it is withholding the key. */\n MEGOLM_KEY_WITHHELD = \"MEGOLM_KEY_WITHHELD\",\n\n /** A special case of {@link MEGOLM_KEY_WITHHELD}: the sender has told us it is withholding the key, because the current device is unverified. */\n MEGOLM_KEY_WITHHELD_FOR_UNVERIFIED_DEVICE = \"MEGOLM_KEY_WITHHELD_FOR_UNVERIFIED_DEVICE\",\n\n /** Message was encrypted with a Megolm session which has been shared with us, but in a later ratchet state. */\n OLM_UNKNOWN_MESSAGE_INDEX = \"OLM_UNKNOWN_MESSAGE_INDEX\",\n\n /**\n * Message was sent before the current device was created; there is no key backup on the server, so this\n * decryption failure is expected.\n */\n HISTORICAL_MESSAGE_NO_KEY_BACKUP = \"HISTORICAL_MESSAGE_NO_KEY_BACKUP\",\n\n /**\n * Message was sent before the current device was created; there was a key backup on the server, but we don't\n * seem to have access to the backup. (Probably we don't have the right key.)\n */\n HISTORICAL_MESSAGE_BACKUP_UNCONFIGURED = \"HISTORICAL_MESSAGE_BACKUP_UNCONFIGURED\",\n\n /**\n * Message was sent before the current device was created; there was a (usable) key backup on the server, but we\n * still can't decrypt. (Either the session isn't in the backup, or we just haven't gotten around to checking yet.)\n */\n HISTORICAL_MESSAGE_WORKING_BACKUP = \"HISTORICAL_MESSAGE_WORKING_BACKUP\",\n\n /**\n * Message was sent when the user was not a member of the room.\n */\n HISTORICAL_MESSAGE_USER_NOT_JOINED = \"HISTORICAL_MESSAGE_USER_NOT_JOINED\",\n\n /**\n * The sender's identity is not verified, but was previously verified.\n */\n SENDER_IDENTITY_PREVIOUSLY_VERIFIED = \"SENDER_IDENTITY_PREVIOUSLY_VERIFIED\",\n\n /**\n * The sender device is not cross-signed. This will only be used if the\n * device isolation mode is set to `OnlySignedDevicesIsolationMode`.\n */\n UNSIGNED_SENDER_DEVICE = \"UNSIGNED_SENDER_DEVICE\",\n\n /**\n * We weren't able to link the message back to any known device. This will\n * only be used if the device isolation mode is set to `OnlySignedDevicesIsolationMode`.\n */\n UNKNOWN_SENDER_DEVICE = \"UNKNOWN_SENDER_DEVICE\",\n\n /** Unknown or unclassified error. */\n UNKNOWN_ERROR = \"UNKNOWN_ERROR\",\n\n /** @deprecated only used in legacy crypto */\n MEGOLM_BAD_ROOM = \"MEGOLM_BAD_ROOM\",\n\n /** @deprecated only used in legacy crypto */\n MEGOLM_MISSING_FIELDS = \"MEGOLM_MISSING_FIELDS\",\n\n /** @deprecated only used in legacy crypto */\n OLM_DECRYPT_GROUP_MESSAGE_ERROR = \"OLM_DECRYPT_GROUP_MESSAGE_ERROR\",\n\n /** @deprecated only used in legacy crypto */\n OLM_BAD_ENCRYPTED_MESSAGE = \"OLM_BAD_ENCRYPTED_MESSAGE\",\n\n /** @deprecated only used in legacy crypto */\n OLM_BAD_RECIPIENT = \"OLM_BAD_RECIPIENT\",\n\n /** @deprecated only used in legacy crypto */\n OLM_BAD_RECIPIENT_KEY = \"OLM_BAD_RECIPIENT_KEY\",\n\n /** @deprecated only used in legacy crypto */\n OLM_BAD_ROOM = \"OLM_BAD_ROOM\",\n\n /** @deprecated only used in legacy crypto */\n OLM_BAD_SENDER_CHECK_FAILED = \"OLM_BAD_SENDER_CHECK_FAILED\",\n\n /** @deprecated only used in legacy crypto */\n OLM_BAD_SENDER = \"OLM_BAD_SENDER\",\n\n /** @deprecated only used in legacy crypto */\n OLM_FORWARDED_MESSAGE = \"OLM_FORWARDED_MESSAGE\",\n\n /** @deprecated only used in legacy crypto */\n OLM_MISSING_CIPHERTEXT = \"OLM_MISSING_CIPHERTEXT\",\n\n /** @deprecated only used in legacy crypto */\n OLM_NOT_INCLUDED_IN_RECIPIENTS = \"OLM_NOT_INCLUDED_IN_RECIPIENTS\",\n\n /** @deprecated only used in legacy crypto */\n UNKNOWN_ENCRYPTION_ALGORITHM = \"UNKNOWN_ENCRYPTION_ALGORITHM\",\n}\n\n/** Base {@link DeviceIsolationMode} kind. */\nexport enum DeviceIsolationModeKind {\n AllDevicesIsolationMode,\n OnlySignedDevicesIsolationMode,\n}\n\n/**\n * A type of {@link DeviceIsolationMode}.\n *\n * Message encryption keys are shared with all devices in the room, except in case of\n * verified user problems (see {@link errorOnVerifiedUserProblems}).\n *\n * Events from all senders are always decrypted (and should be decorated with message shields in case\n * of authenticity warnings, see {@link EventEncryptionInfo}).\n */\nexport class AllDevicesIsolationMode {\n public readonly kind = DeviceIsolationModeKind.AllDevicesIsolationMode;\n\n /**\n *\n * @param errorOnVerifiedUserProblems - Behavior when sharing keys to remote devices.\n *\n * If set to `true`, sharing keys will fail (i.e. message sending will fail) with an error if:\n * - The user was previously verified but is not anymore, or:\n * - A verified user has some unverified devices (not cross-signed).\n *\n * If `false`, the keys will be distributed as usual. In this case, the client UX should display\n * warnings to inform the user about problematic devices/users, and stop them hitting this case.\n */\n public constructor(public readonly errorOnVerifiedUserProblems: boolean) {}\n}\n\n/**\n * A type of {@link DeviceIsolationMode}.\n *\n * Message encryption keys are only shared with devices that have been cross-signed by their owner.\n * Encryption will throw an error if a verified user replaces their identity.\n *\n * Events are decrypted only if they come from a cross-signed device. Other events will result in a decryption\n * failure. (To access the failure reason, see {@link MatrixEvent.decryptionFailureReason}.)\n */\nexport class OnlySignedDevicesIsolationMode {\n public readonly kind = DeviceIsolationModeKind.OnlySignedDevicesIsolationMode;\n}\n\n/**\n * DeviceIsolationMode represents the mode of device isolation used when encrypting or decrypting messages.\n * It can be one of two types: {@link AllDevicesIsolationMode} or {@link OnlySignedDevicesIsolationMode}.\n *\n * Only supported by rust Crypto.\n */\nexport type DeviceIsolationMode = AllDevicesIsolationMode | OnlySignedDevicesIsolationMode;\n\n/**\n * Options object for `CryptoApi.bootstrapCrossSigning`.\n */\nexport interface BootstrapCrossSigningOpts {\n /** Optional. Reset the cross-signing keys even if keys already exist. */\n setupNewCrossSigning?: boolean;\n\n /**\n * An application callback to collect the authentication data for uploading the keys. If not given, the keys\n * will not be uploaded to the server (which seems like a bad thing?).\n */\n authUploadDeviceSigningKeys?: UIAuthCallback<void>;\n}\n\n/**\n * Represents the ways in which we trust a user\n */\nexport class UserVerificationStatus {\n /**\n * Indicates if the identity has changed in a way that needs user approval.\n *\n * This happens if the identity has changed since we first saw it, *unless* the new identity has also been verified\n * by our user (eg via an interactive verification).\n *\n * To rectify this, either:\n *\n * * Conduct a verification of the new identity via {@link CryptoApi.requestVerificationDM}.\n * * Pin the new identity, via {@link CryptoApi.pinCurrentUserIdentity}.\n *\n * @returns true if the identity has changed in a way that needs user approval.\n */\n public readonly needsUserApproval: boolean;\n\n public constructor(\n private readonly crossSigningVerified: boolean,\n private readonly crossSigningVerifiedBefore: boolean,\n private readonly tofu: boolean,\n needsUserApproval: boolean = false,\n ) {\n this.needsUserApproval = needsUserApproval;\n }\n\n /**\n * @returns true if this user is verified via any means\n */\n public isVerified(): boolean {\n return this.isCrossSigningVerified();\n }\n\n /**\n * @returns true if this user is verified via cross signing\n */\n public isCrossSigningVerified(): boolean {\n return this.crossSigningVerified;\n }\n\n /**\n * @returns true if we ever verified this user before (at least for\n * the history of verifications observed by this device).\n */\n public wasCrossSigningVerified(): boolean {\n return this.crossSigningVerifiedBefore;\n }\n\n /**\n * @returns true if this user's key is trusted on first use\n *\n * @deprecated No longer supported, with the Rust crypto stack.\n */\n public isTofu(): boolean {\n return this.tofu;\n }\n}\n\nexport class DeviceVerificationStatus {\n /**\n * True if this device has been signed by its owner (and that signature verified).\n *\n * This doesn't necessarily mean that we have verified the device, since we may not have verified the\n * owner's cross-signing key.\n */\n public readonly signedByOwner: boolean;\n\n /**\n * True if this device has been verified via cross signing.\n *\n * This does *not* take into account `trustCrossSignedDevices`.\n */\n public readonly crossSigningVerified: boolean;\n\n /**\n * TODO: tofu magic wtf does this do?\n */\n public readonly tofu: boolean;\n\n /**\n * True if the device has been marked as locally verified.\n */\n public readonly localVerified: boolean;\n\n /**\n * True if the client has been configured to trust cross-signed devices via {@link CryptoApi#setTrustCrossSignedDevices}.\n */\n private readonly trustCrossSignedDevices: boolean;\n\n public constructor(\n opts: Partial<DeviceVerificationStatus> & {\n /**\n * True if cross-signed devices should be considered verified for {@link DeviceVerificationStatus#isVerified}.\n */\n trustCrossSignedDevices?: boolean;\n },\n ) {\n this.signedByOwner = opts.signedByOwner ?? false;\n this.crossSigningVerified = opts.crossSigningVerified ?? false;\n this.tofu = opts.tofu ?? false;\n this.localVerified = opts.localVerified ?? false;\n this.trustCrossSignedDevices = opts.trustCrossSignedDevices ?? false;\n }\n\n /**\n * Check if we should consider this device \"verified\".\n *\n * A device is \"verified\" if either:\n * * it has been manually marked as such via {@link matrix.MatrixClient.setDeviceVerified}.\n * * it has been cross-signed with a verified signing key, **and** the client has been configured to trust\n * cross-signed devices via {@link CryptoApi.setTrustCrossSignedDevices}.\n *\n * @returns true if this device is verified via any means.\n */\n public isVerified(): boolean {\n return this.localVerified || (this.trustCrossSignedDevices && this.crossSigningVerified);\n }\n}\n\n/**\n * Room key import progress report.\n * Used when calling {@link CryptoApi#importRoomKeys},\n * {@link CryptoApi#importRoomKeysAsJson} or {@link CryptoApi#restoreKeyBackup} as the parameter of\n * the progressCallback. Used to display feedback.\n */\nexport interface ImportRoomKeyProgressData {\n stage: string; // TODO: Enum\n successes?: number;\n failures?: number;\n total?: number;\n}\n\n/**\n * Options object for {@link CryptoApi#importRoomKeys} and\n * {@link CryptoApi#importRoomKeysAsJson}.\n */\nexport interface ImportRoomKeysOpts {\n /** Reports ongoing progress of the import process. Can be used for feedback. */\n progressCallback?: (stage: ImportRoomKeyProgressData) => void;\n /** @deprecated the rust SDK will always such imported keys as untrusted */\n untrusted?: boolean;\n /** @deprecated not useful externally */\n source?: string;\n}\n\n/**\n * The result of a call to {@link CryptoApi.getCrossSigningStatus}.\n */\nexport interface CrossSigningStatus {\n /**\n * True if the public master, self signing and user signing keys are available on this device.\n */\n publicKeysOnDevice: boolean;\n /**\n * True if the private keys are stored in the secret storage.\n */\n privateKeysInSecretStorage: boolean;\n /**\n * True if the private keys are stored locally.\n */\n privateKeysCachedLocally: {\n masterKey: boolean;\n selfSigningKey: boolean;\n userSigningKey: boolean;\n };\n}\n\n/**\n * Crypto callbacks provided by the application\n */\nexport interface CryptoCallbacks extends SecretStorageCallbacks {\n /** @deprecated: unused with the Rust crypto stack. */\n getCrossSigningKey?: (keyType: string, pubKey: string) => Promise<Uint8Array | null>;\n /** @deprecated: unused with the Rust crypto stack. */\n saveCrossSigningKeys?: (keys: Record<string, Uint8Array>) => void;\n /** @deprecated: unused with the Rust crypto stack. */\n shouldUpgradeDeviceVerifications?: (users: Record<string, any>) => Promise<string[]>;\n /**\n * Called by {@link CryptoApi#bootstrapSecretStorage}\n * @param keyId - secret storage key id\n * @param keyInfo - secret storage key info\n * @param key - private key to store\n */\n cacheSecretStorageKey?: (keyId: string, keyInfo: SecretStorageKeyDescription, key: Uint8Array) => void;\n\n /** @deprecated: unused with the Rust crypto stack. */\n onSecretRequested?: (\n userId: string,\n deviceId: string,\n requestId: string,\n secretName: string,\n deviceTrust: DeviceVerificationStatus,\n ) => Promise<string | undefined>;\n\n /** @deprecated: unused with the Rust crypto stack. */\n getDehydrationKey?: (\n keyInfo: SecretStorageKeyDescription,\n checkFunc: (key: Uint8Array) => void,\n ) => Promise<Uint8Array>;\n\n /** @deprecated: unused with the Rust crypto stack. */\n getBackupKey?: () => Promise<Uint8Array>;\n}\n\n/**\n * Parameter of {@link CryptoApi#bootstrapSecretStorage}\n */\nexport interface CreateSecretStorageOpts {\n /**\n * Function called to await a secret storage key creation flow.\n * @returns Promise resolving to an object with public key metadata, encoded private\n * recovery key which should be disposed of after displaying to the user,\n * and raw private key to avoid round tripping if needed.\n */\n createSecretStorageKey?: () => Promise<GeneratedSecretStorageKey>;\n\n /**\n * The current key backup object. If passed,\n * the passphrase and recovery key from this backup will be used.\n * @deprecated Not used by the Rust crypto stack.\n */\n keyBackupInfo?: KeyBackupInfo;\n\n /**\n * If true, a new key backup version will be\n * created and the private key stored in the new SSSS store. Ignored if keyBackupInfo\n * is supplied.\n */\n setupNewKeyBackup?: boolean;\n\n /**\n * Reset even if keys already exist.\n */\n setupNewSecretStorage?: boolean;\n\n /**\n * Function called to get the user's current key backup passphrase.\n *\n * Should return a promise that resolves with a Uint8Array\n * containing the key, or rejects if the key cannot be obtained.\n *\n * Only used when the client has existing key backup, but no secret storage.\n *\n * @deprecated Not used by the Rust crypto stack.\n */\n getKeyBackupPassphrase?: () => Promise<Uint8Array>;\n}\n\n/** Types of cross-signing key */\nexport enum CrossSigningKey {\n Master = \"master\",\n SelfSigning = \"self_signing\",\n UserSigning = \"user_signing\",\n}\n\n/**\n * Information on one of the cross-signing keys.\n * @see https://spec.matrix.org/v1.7/client-server-api/#post_matrixclientv3keysdevice_signingupload\n */\nexport interface CrossSigningKeyInfo {\n keys: { [algorithm: string]: string };\n signatures?: ISignatures;\n usage: string[];\n user_id: string;\n}\n\n/**\n * Recovery key created by {@link CryptoApi#createRecoveryKeyFromPassphrase} or {@link CreateSecretStorageOpts#createSecretStorageKey}.\n */\nexport interface GeneratedSecretStorageKey {\n keyInfo?: {\n /** If the key was derived from a passphrase, information (algorithm, salt, etc) on that derivation. */\n passphrase?: PassphraseInfo;\n /** Optional human-readable name for the key, to be stored in account_data. */\n name?: string;\n };\n /** The raw generated private key. */\n privateKey: Uint8Array;\n /** The generated key, encoded for display to the user per https://spec.matrix.org/v1.7/client-server-api/#key-representation. */\n encodedPrivateKey?: string;\n}\n\n/**\n * Result type of {@link CryptoApi#getEncryptionInfoForEvent}.\n */\nexport interface EventEncryptionInfo {\n /** \"Shield\" to be shown next to this event representing its verification status */\n shieldColour: EventShieldColour;\n\n /**\n * `null` if `shieldColour` is `EventShieldColour.NONE`; otherwise a reason code for the shield in `shieldColour`.\n */\n shieldReason: EventShieldReason | null;\n}\n\n/**\n * Types of shield to be shown for {@link EventEncryptionInfo#shieldColour}.\n */\nexport enum EventShieldColour {\n NONE,\n GREY,\n RED,\n}\n\n/**\n * Reason codes for {@link EventEncryptionInfo#shieldReason}.\n */\nexport enum EventShieldReason {\n /** An unknown reason from the crypto library (if you see this, it is a bug in matrix-js-sdk). */\n UNKNOWN,\n\n /** \"Encrypted by an unverified user.\" */\n UNVERIFIED_IDENTITY,\n\n /** \"Encrypted by a device not verified by its owner.\" */\n UNSIGNED_DEVICE,\n\n /** \"Encrypted by an unknown or deleted device.\" */\n UNKNOWN_DEVICE,\n\n /**\n * \"The authenticity of this encrypted message can't be guaranteed on this device.\"\n *\n * ie: the key has been forwarded, or retrieved from an insecure backup.\n */\n AUTHENTICITY_NOT_GUARANTEED,\n\n /**\n * The (deprecated) sender_key field in the event does not match the Ed25519 key of the device that sent us the\n * decryption keys.\n */\n MISMATCHED_SENDER_KEY,\n}\n\n/** The result of a call to {@link CryptoApi.getOwnDeviceKeys} */\nexport interface OwnDeviceKeys {\n /** Public part of the Ed25519 fingerprint key for the current device, base64 encoded. */\n ed25519: string;\n /** Public part of the Curve25519 identity key for the current device, base64 encoded. */\n curve25519: string;\n}\n\nexport * from \"./verification.ts\";\nexport type * from \"./keybackup.ts\";\nexport * from \"./recovery-key.ts\";\nexport * from \"./key-passphrase.ts\";\nexport * from \"./CryptoEvent.ts\";\nexport type * from \"./CryptoEventHandlerMap.ts\";\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAoBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAsmBA;AACA,WAAYA,qBAAqB,0BAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAArBA,qBAAqB;EAAA,OAArBA,qBAAqB;AAAA;;AAgGjC;AACA,WAAYC,uBAAuB,0BAAvBA,uBAAuB;EAAvBA,uBAAuB,CAAvBA,uBAAuB;EAAvBA,uBAAuB,CAAvBA,uBAAuB;EAAA,OAAvBA,uBAAuB;AAAA;;AAKnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,CAAC;EAGjC;AACJ;AACA;AACA;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;AAQA;AACA;AACA;;AAcA;AACA;AACA;;AAWA;AACA;AACA;AACA,WAAYC,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA;;AAM7B;AACA;AACA;AACA,WAAYC,iBAAiB,0BAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAjBA,iBAAiB,CAAjBA,iBAAiB;EAAA,OAAjBA,iBAAiB;AAAA;;AA2B7B;;AAQA,cAAc,mBAAmB;AAEjC,cAAc,mBAAmB;AACjC,cAAc,qBAAqB;AACnC,cAAc,kBAAkB","ignoreList":[]}
|
@@ -1,11 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* Derive a recovery key from a passphrase and salt using PBKDF2.
|
3
|
-
* @see https://spec.matrix.org/v1.11/client-server-api/#deriving-keys-from-passphrases
|
4
|
-
*
|
5
|
-
* @param passphrase - The passphrase to derive the key from
|
6
|
-
* @param salt - The salt to use in the derivation
|
7
|
-
* @param iterations - The number of iterations to use in the derivation
|
8
|
-
* @param numBits - The number of bits to derive
|
9
|
-
*/
|
10
|
-
export declare function deriveRecoveryKeyFromPassphrase(passphrase: string, salt: string, iterations: number, numBits?: number): Promise<Uint8Array>;
|
11
|
-
//# sourceMappingURL=key-passphrase.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"key-passphrase.d.ts","sourceRoot":"","sources":["../../src/crypto-api/key-passphrase.ts"],"names":[],"mappings":"AAkBA;;;;;;;;GAQG;AACH,wBAAsB,+BAA+B,CACjD,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,OAAO,SAAmB,GAC3B,OAAO,CAAC,UAAU,CAAC,CAyBrB"}
|
@@ -1,51 +0,0 @@
|
|
1
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
|
-
/*
|
3
|
-
* Copyright 2024 The Matrix.org Foundation C.I.C.
|
4
|
-
*
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
-
* you may not use this file except in compliance with the License.
|
7
|
-
* You may obtain a copy of the License at
|
8
|
-
*
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
-
*
|
11
|
-
* Unless required by applicable law or agreed to in writing, software
|
12
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
-
* See the License for the specific language governing permissions and
|
15
|
-
* limitations under the License.
|
16
|
-
*/
|
17
|
-
|
18
|
-
var DEFAULT_BIT_SIZE = 256;
|
19
|
-
|
20
|
-
/**
|
21
|
-
* Derive a recovery key from a passphrase and salt using PBKDF2.
|
22
|
-
* @see https://spec.matrix.org/v1.11/client-server-api/#deriving-keys-from-passphrases
|
23
|
-
*
|
24
|
-
* @param passphrase - The passphrase to derive the key from
|
25
|
-
* @param salt - The salt to use in the derivation
|
26
|
-
* @param iterations - The number of iterations to use in the derivation
|
27
|
-
* @param numBits - The number of bits to derive
|
28
|
-
*/
|
29
|
-
export function deriveRecoveryKeyFromPassphrase(_x, _x2, _x3) {
|
30
|
-
return _deriveRecoveryKeyFromPassphrase.apply(this, arguments);
|
31
|
-
}
|
32
|
-
function _deriveRecoveryKeyFromPassphrase() {
|
33
|
-
_deriveRecoveryKeyFromPassphrase = _asyncToGenerator(function* (passphrase, salt, iterations) {
|
34
|
-
var numBits = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : DEFAULT_BIT_SIZE;
|
35
|
-
if (!globalThis.crypto.subtle || !TextEncoder) {
|
36
|
-
throw new Error("Password-based backup is not available on this platform");
|
37
|
-
}
|
38
|
-
var key = yield globalThis.crypto.subtle.importKey("raw", new TextEncoder().encode(passphrase), {
|
39
|
-
name: "PBKDF2"
|
40
|
-
}, false, ["deriveBits"]);
|
41
|
-
var keybits = yield globalThis.crypto.subtle.deriveBits({
|
42
|
-
name: "PBKDF2",
|
43
|
-
salt: new TextEncoder().encode(salt),
|
44
|
-
iterations: iterations,
|
45
|
-
hash: "SHA-512"
|
46
|
-
}, key, numBits);
|
47
|
-
return new Uint8Array(keybits);
|
48
|
-
});
|
49
|
-
return _deriveRecoveryKeyFromPassphrase.apply(this, arguments);
|
50
|
-
}
|
51
|
-
//# sourceMappingURL=key-passphrase.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"key-passphrase.js","names":["DEFAULT_BIT_SIZE","deriveRecoveryKeyFromPassphrase","_x","_x2","_x3","_deriveRecoveryKeyFromPassphrase","apply","arguments","_asyncToGenerator","passphrase","salt","iterations","numBits","length","undefined","globalThis","crypto","subtle","TextEncoder","Error","key","importKey","encode","name","keybits","deriveBits","hash","Uint8Array"],"sources":["../../src/crypto-api/key-passphrase.ts"],"sourcesContent":["/*\n * Copyright 2024 The Matrix.org Foundation C.I.C.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst DEFAULT_BIT_SIZE = 256;\n\n/**\n * Derive a recovery key from a passphrase and salt using PBKDF2.\n * @see https://spec.matrix.org/v1.11/client-server-api/#deriving-keys-from-passphrases\n *\n * @param passphrase - The passphrase to derive the key from\n * @param salt - The salt to use in the derivation\n * @param iterations - The number of iterations to use in the derivation\n * @param numBits - The number of bits to derive\n */\nexport async function deriveRecoveryKeyFromPassphrase(\n passphrase: string,\n salt: string,\n iterations: number,\n numBits = DEFAULT_BIT_SIZE,\n): Promise<Uint8Array> {\n if (!globalThis.crypto.subtle || !TextEncoder) {\n throw new Error(\"Password-based backup is not available on this platform\");\n }\n\n const key = await globalThis.crypto.subtle.importKey(\n \"raw\",\n new TextEncoder().encode(passphrase),\n { name: \"PBKDF2\" },\n false,\n [\"deriveBits\"],\n );\n\n const keybits = await globalThis.crypto.subtle.deriveBits(\n {\n name: \"PBKDF2\",\n salt: new TextEncoder().encode(salt),\n iterations: iterations,\n hash: \"SHA-512\",\n },\n key,\n numBits,\n );\n\n return new Uint8Array(keybits);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,IAAMA,gBAAgB,GAAG,GAAG;;AAE5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,gBAAsBC,+BAA+BA,CAAAC,EAAA,EAAAC,GAAA,EAAAC,GAAA;EAAA,OAAAC,gCAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA;AA8BpD,SAAAF,iCAAA;EAAAA,gCAAA,GAAAG,iBAAA,CA9BM,WACHC,UAAkB,EAClBC,IAAY,EACZC,UAAkB,EAEC;IAAA,IADnBC,OAAO,GAAAL,SAAA,CAAAM,MAAA,QAAAN,SAAA,QAAAO,SAAA,GAAAP,SAAA,MAAGP,gBAAgB;IAE1B,IAAI,CAACe,UAAU,CAACC,MAAM,CAACC,MAAM,IAAI,CAACC,WAAW,EAAE;MAC3C,MAAM,IAAIC,KAAK,CAAC,yDAAyD,CAAC;IAC9E;IAEA,IAAMC,GAAG,SAASL,UAAU,CAACC,MAAM,CAACC,MAAM,CAACI,SAAS,CAChD,KAAK,EACL,IAAIH,WAAW,CAAC,CAAC,CAACI,MAAM,CAACb,UAAU,CAAC,EACpC;MAAEc,IAAI,EAAE;IAAS,CAAC,EAClB,KAAK,EACL,CAAC,YAAY,CACjB,CAAC;IAED,IAAMC,OAAO,SAAST,UAAU,CAACC,MAAM,CAACC,MAAM,CAACQ,UAAU,CACrD;MACIF,IAAI,EAAE,QAAQ;MACdb,IAAI,EAAE,IAAIQ,WAAW,CAAC,CAAC,CAACI,MAAM,CAACZ,IAAI,CAAC;MACpCC,UAAU,EAAEA,UAAU;MACtBe,IAAI,EAAE;IACV,CAAC,EACDN,GAAG,EACHR,OACJ,CAAC;IAED,OAAO,IAAIe,UAAU,CAACH,OAAO,CAAC;EAClC,CAAC;EAAA,OAAAnB,gCAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA","ignoreList":[]}
|
@@ -1,88 +0,0 @@
|
|
1
|
-
import { ISigned } from "../@types/signed.ts";
|
2
|
-
import { AESEncryptedSecretStoragePayload } from "../@types/AESEncryptedSecretStoragePayload.ts";
|
3
|
-
import { ImportRoomKeyProgressData } from "./index.ts";
|
4
|
-
export interface Curve25519AuthData {
|
5
|
-
public_key: string;
|
6
|
-
private_key_salt?: string;
|
7
|
-
private_key_iterations?: number;
|
8
|
-
private_key_bits?: number;
|
9
|
-
}
|
10
|
-
export interface Aes256AuthData {
|
11
|
-
iv: string;
|
12
|
-
mac: string;
|
13
|
-
private_key_salt?: string;
|
14
|
-
private_key_iterations?: number;
|
15
|
-
}
|
16
|
-
/**
|
17
|
-
* Information about a server-side key backup.
|
18
|
-
*
|
19
|
-
* Returned by [`GET /_matrix/client/v3/room_keys/version`](https://spec.matrix.org/v1.7/client-server-api/#get_matrixclientv3room_keysversion)
|
20
|
-
* and hence {@link matrix.MatrixClient.getKeyBackupVersion}.
|
21
|
-
*/
|
22
|
-
export interface KeyBackupInfo {
|
23
|
-
algorithm: string;
|
24
|
-
auth_data: ISigned & (Curve25519AuthData | Aes256AuthData);
|
25
|
-
count?: number;
|
26
|
-
etag?: string;
|
27
|
-
version?: string;
|
28
|
-
}
|
29
|
-
/**
|
30
|
-
* Information on whether a given server-side backup is trusted.
|
31
|
-
*/
|
32
|
-
export interface BackupTrustInfo {
|
33
|
-
/**
|
34
|
-
* Is this backup trusted?
|
35
|
-
*
|
36
|
-
* True if, and only if, there is a valid signature on the backup from a trusted device.
|
37
|
-
*/
|
38
|
-
readonly trusted: boolean;
|
39
|
-
/**
|
40
|
-
* True if this backup matches the stored decryption key.
|
41
|
-
*/
|
42
|
-
readonly matchesDecryptionKey: boolean;
|
43
|
-
}
|
44
|
-
/**
|
45
|
-
* The result of {@link CryptoApi.checkKeyBackupAndEnable}.
|
46
|
-
*/
|
47
|
-
export interface KeyBackupCheck {
|
48
|
-
backupInfo: KeyBackupInfo;
|
49
|
-
trustInfo: BackupTrustInfo;
|
50
|
-
}
|
51
|
-
export interface Curve25519SessionData {
|
52
|
-
ciphertext: string;
|
53
|
-
ephemeral: string;
|
54
|
-
mac: string;
|
55
|
-
}
|
56
|
-
export interface KeyBackupSession<T = Curve25519SessionData | AESEncryptedSecretStoragePayload> {
|
57
|
-
first_message_index: number;
|
58
|
-
forwarded_count: number;
|
59
|
-
is_verified: boolean;
|
60
|
-
session_data: T;
|
61
|
-
}
|
62
|
-
export interface KeyBackupRoomSessions {
|
63
|
-
[sessionId: string]: KeyBackupSession;
|
64
|
-
}
|
65
|
-
/**
|
66
|
-
* Extra parameters for {@link CryptoApi.restoreKeyBackup} and {@link CryptoApi.restoreKeyBackupWithPassphrase}.
|
67
|
-
*/
|
68
|
-
export interface KeyBackupRestoreOpts {
|
69
|
-
/**
|
70
|
-
* A callback which, if defined, will be called periodically to report ongoing progress of the backup restore process.
|
71
|
-
* @param progress
|
72
|
-
*/
|
73
|
-
progressCallback?: (progress: ImportRoomKeyProgressData) => void;
|
74
|
-
}
|
75
|
-
/**
|
76
|
-
* The result of {@link CryptoApi.restoreKeyBackup}.
|
77
|
-
*/
|
78
|
-
export interface KeyBackupRestoreResult {
|
79
|
-
/**
|
80
|
-
* The total number of keys that were found in the backup.
|
81
|
-
*/
|
82
|
-
total: number;
|
83
|
-
/**
|
84
|
-
* The number of keys that were imported.
|
85
|
-
*/
|
86
|
-
imported: number;
|
87
|
-
}
|
88
|
-
//# sourceMappingURL=keybackup.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"keybackup.d.ts","sourceRoot":"","sources":["../../src/crypto-api/keybackup.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,gCAAgC,EAAE,MAAM,+CAA+C,CAAC;AACjG,OAAO,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,WAAW,kBAAkB;IAC/B,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACnC;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,GAAG,CAAC,kBAAkB,GAAG,cAAc,CAAC,CAAC;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,oBAAoB,EAAE,OAAO,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC3B,UAAU,EAAE,aAAa,CAAC;IAC1B,SAAS,EAAE,eAAe,CAA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