mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
cleanup OpenPGP.js askPassphrase
This commit is contained in:
parent
c99503980f
commit
04083f478a
1 changed files with 4 additions and 4 deletions
|
|
@ -18,14 +18,14 @@ const
|
||||||
key.emails.includes(query) || query == key.id || query == key.fingerprint
|
key.emails.includes(query) || query == key.id || query == key.fingerprint
|
||||||
),
|
),
|
||||||
|
|
||||||
askPassphrase = async (privateKey, btnTxt) =>
|
|
||||||
await AskPopupView.password('OpenPGP.js key<br>' + privateKey.id + ' ' + privateKey.emails[0], 'OPENPGP/'+btnTxt),
|
|
||||||
|
|
||||||
decryptKey = async (privateKey, btnTxt = 'LABEL_SIGN') => {
|
decryptKey = async (privateKey, btnTxt = 'LABEL_SIGN') => {
|
||||||
if (privateKey.key.isDecrypted()) {
|
if (privateKey.key.isDecrypted()) {
|
||||||
return privateKey.key;
|
return privateKey.key;
|
||||||
}
|
}
|
||||||
const passphrase = await askPassphrase(privateKey, btnTxt);
|
const passphrase = await AskPopupView.password(
|
||||||
|
'OpenPGP.js key<br>' + privateKey.id + ' ' + privateKey.emails[0],
|
||||||
|
'OPENPGP/'+btnTxt
|
||||||
|
);
|
||||||
if (null !== passphrase) {
|
if (null !== passphrase) {
|
||||||
return await openpgp.decryptKey({
|
return await openpgp.decryptKey({
|
||||||
privateKey: privateKey.key,
|
privateKey: privateKey.key,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue