#89 added view GnuPG armored keys

This commit is contained in:
the-djmaze 2022-01-28 17:33:52 +01:00
parent 70f315e76e
commit fe078174ab
6 changed files with 71 additions and 20 deletions

View file

@ -187,7 +187,24 @@ export const PgpUserStore = new class {
}
);
}
}
};
key.view = () => {
let pass = isPrivate ? prompt('Passphrase') : true;
if (pass) {
Remote.request('GnupgExportKey',
(iError, oData) => {
if (oData && oData.Result) {
key.armor = oData.Result;
showScreenPopup(ViewOpenPgpKeyPopupView, [key]);
}
}, {
KeyId: key.id,
isPrivate: isPrivate,
Passphrase: isPrivate ? pass : ''
}
);
}
};
return key;
};
this.gnupgPublicKeys(oData.Result.public.map(key => initKey(key, 0)));

View file

@ -460,7 +460,7 @@ class ComposePopupView extends AbstractViewPopup {
try {
const keys = PgpUserStore.getOpenPGPPrivateKeyFor(this.currentIdentity().email());
if (keys[0]) {
keys[0].decrypt(window.prompt('Password', ''));
keys[0].decrypt(window.prompt('Passphrase'));
cfg.privateKey = privateKey = keys[0];
}
} catch (e) {