1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-23 17:02:25 +03:00

Add AsJson forms of the key import/export methods (#4057)

This commit is contained in:
Andy Balaam
2024-02-08 13:25:22 +00:00
committed by GitHub
parent f4a796ca2f
commit 1b7695cdca
6 changed files with 95 additions and 6 deletions

View File

@@ -346,10 +346,18 @@ export class RustCrypto extends TypedEventEmitter<RustCryptoEvents, RustCryptoEv
return JSON.parse(raw);
}
public async exportRoomKeysAsJson(): Promise<string> {
return await this.olmMachine.exportRoomKeys(() => true);
}
public async importRoomKeys(keys: IMegolmSessionData[], opts?: ImportRoomKeysOpts): Promise<void> {
return await this.backupManager.importRoomKeys(keys, opts);
}
public async importRoomKeysAsJson(keys: string, opts?: ImportRoomKeysOpts): Promise<void> {
return await this.backupManager.importRoomKeysAsJson(keys, opts);
}
/**
* Implementation of {@link CryptoApi.userHasCrossSigningKeys}.
*/