You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-07-30 04:23:07 +03:00
Element-R: implement {get,store}SessionBackupPrivateKey
(#3622)
This commit is contained in:
committed by
GitHub
parent
29b815b678
commit
0e95df5dba
@ -503,6 +503,16 @@ describe("RustCrypto", () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("get|storeSessionBackupPrivateKey", () => {
|
||||
it("can save and restore a key", async () => {
|
||||
const key = "testtesttesttesttesttesttesttest";
|
||||
const rustCrypto = await makeTestRustCrypto();
|
||||
await rustCrypto.storeSessionBackupPrivateKey(new TextEncoder().encode(key));
|
||||
const fetched = await rustCrypto.getSessionBackupPrivateKey();
|
||||
expect(new TextDecoder().decode(fetched!)).toEqual(key);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
/** build a basic RustCrypto instance for testing
|
||||
|
Reference in New Issue
Block a user