Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2831357
D8998.id30477.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
732 B
Referenced Files
None
Subscribers
None
D8998.id30477.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sat, Sep 28, 11:27 PM (17 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2198276
Default Alt Text
D8998.id30477.diff (732 B)
Attached To
Mode
D8998: [client-backup] add JS function to compute BackupKey based on user credentials
Attached
Detach File
Event Timeline
Log In to Comment