Add note about keychain

This commit is contained in:
Manav Rathi 2024-05-07 09:43:32 +05:30
parent 939b228a0d
commit 6efbaacdd1
No known key found for this signature in database
2 changed files with 9 additions and 1 deletions

View file

@ -72,7 +72,6 @@ export const openLogDirectory = () => openDirectory(logDirectoryPath());
* - macOS: ~/Library/Logs/Electron/ente.log (dev)
*
* https://www.electronjs.org/docs/latest/api/app
*
*/
const logDirectoryPath = () => app.getPath("logs");

View file

@ -14,6 +14,15 @@ export const clearStores = () => {
watchStore.clear();
};
/**
* [Note: Safe storage keys]
*
* On macOS, `safeStorage` stores our data under a Keychain entry named
* "<app-name> Safe Storage". Which resolves to:
*
* - Electron Safe Storage (dev)
* - ente Safe Storage (prod)
*/
export const saveEncryptionKey = (encryptionKey: string) => {
const encryptedKey = safeStorage.encryptString(encryptionKey);
const b64EncryptedKey = Buffer.from(encryptedKey).toString("base64");