electron/spec/fixtures/api/safe-storage/decrypt-app/main.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
457 B
JavaScript
Raw Normal View History

const { app, safeStorage, ipcMain } = require('electron');
const { promises: fs } = require('node:fs');
const path = require('node:path');
const pathToEncryptedString = path.resolve(__dirname, '..', 'encrypted.txt');
const readFile = fs.readFile;
app.whenReady().then(async () => {
const encryptedString = await readFile(pathToEncryptedString);
const decrypted = safeStorage.decryptString(encryptedString);
console.log(decrypted);
app.quit();
});