1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00

Support for importing megolm session keys

This commit is contained in:
Richard van der Hoff
2017-01-14 00:16:26 +00:00
parent 766d8f0ba4
commit c8b26eeac4
6 changed files with 216 additions and 13 deletions

View File

@@ -476,6 +476,18 @@ MatrixClient.prototype.exportRoomKeys = function() {
return this._crypto.exportRoomKeys();
};
/**
* Import a list of room keys previously exported by exportRoomKeys
*
* @param {Object[]} keys a list of session export objects
*/
MatrixClient.prototype.importRoomKeys = function(keys) {
if (!this._crypto) {
throw new Error("End-to-end encryption disabled");
}
this._crypto.importRoomKeys(keys);
};
/**
* Decrypt a received event according to the algorithm specified in the event.
*