Add OpenPGP key passphrase changes
Allow desktop users to re-encrypt an existing key after verifying its current passphrase. Preserve key identity and revocation data, clear its cached passphrase, and document the feature. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -1319,6 +1319,12 @@ ipcMain.handle('pgp:export-private', async (event, fingerprint, passphrase) => {
|
||||
const id = pgpFingerprint(fingerprint);
|
||||
return saveKeyFile(event, `ep-mail-private-${id.slice(-16)}.asc`, await pgpKeys.exportPrivate(id, passphrase));
|
||||
});
|
||||
ipcMain.handle('pgp:change-passphrase', async (_event, input) => {
|
||||
const id = pgpFingerprint(input?.fingerprint);
|
||||
const result = await pgpKeys.changePassphrase(id, input?.currentPassphrase, input?.newPassphrase);
|
||||
pgpCache.clear(id);
|
||||
return result;
|
||||
});
|
||||
ipcMain.handle('pgp:export-revocation', async (event, fingerprint, passphrase) => {
|
||||
const id = pgpFingerprint(fingerprint);
|
||||
return saveKeyFile(event, `ep-mail-revocation-${id.slice(-16)}.asc`, await pgpKeys.exportRevocation(id, passphrase));
|
||||
|
||||
Reference in New Issue
Block a user