mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-11 08:24:50 +03:00
#89 added view GnuPG armored keys
This commit is contained in:
parent
70f315e76e
commit
fe078174ab
6 changed files with 71 additions and 20 deletions
|
|
@ -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)));
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue