Page MenuHomePhabricator

D8998.id.diff
No OneTemporary

D8998.id.diff

diff --git a/native/backup/encryption.js b/native/backup/encryption.js
new file mode 100644
--- /dev/null
+++ b/native/backup/encryption.js
@@ -0,0 +1,16 @@
+// @flow
+
+import { fetchNativeKeychainCredentials } from '../account/native-credentials.js';
+import { commCoreModule } from '../native-modules.js';
+
+async function getBackupKey(backupID: string): Promise<Uint8Array> {
+ const nativeCredentials = await fetchNativeKeychainCredentials();
+ if (!nativeCredentials) {
+ throw new Error('Native credentials are missing');
+ }
+ const { password } = nativeCredentials;
+ const backupKey = await commCoreModule.computeBackupKey(password, backupID);
+ return new Uint8Array(backupKey);
+}
+
+export { getBackupKey };

File Metadata

Mime Type
text/plain
Expires
Sat, Sep 28, 11:26 PM (17 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2198276
Default Alt Text
D8998.id.diff (732 B)

Event Timeline