mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 14:37:02 +03:00
#89 decrypt using OpenPGP.js
This commit is contained in:
parent
e28c5bdbb6
commit
c012fe09f0
4 changed files with 150 additions and 131 deletions
|
|
@ -131,10 +131,15 @@ export const PgpUserStore = new class {
|
|||
*/
|
||||
async getKeyForDecryption(ids, email) {
|
||||
ids = [email].concat(ids);
|
||||
let i = ids.length,
|
||||
key = await this.getMailvelopePrivateKeyFor({email:email});
|
||||
if (key) {
|
||||
return key;
|
||||
let i = ids.length, key;
|
||||
|
||||
try {
|
||||
key = await this.getMailvelopePrivateKeyFor(email);
|
||||
if (key) {
|
||||
return key;
|
||||
}
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
}
|
||||
/* Not working, needs full fingerprint
|
||||
while (i--) {
|
||||
|
|
@ -148,13 +153,14 @@ export const PgpUserStore = new class {
|
|||
}
|
||||
i = ids.length;
|
||||
*/
|
||||
/*
|
||||
while (i--) {
|
||||
key = this.getGnuPGPrivateKeyFor(ids[i]);
|
||||
if (key) {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
|
||||
*/
|
||||
i = ids.length;
|
||||
while (i--) {
|
||||
key = this.getOpenPGPPrivateKeyFor(ids[i]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue