mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
#89 Decrypt and verify with OpenPGP.js and GnuPG
This commit is contained in:
parent
85f9209176
commit
e0e490c64f
8 changed files with 354 additions and 315 deletions
|
|
@ -214,9 +214,14 @@ export const OpenPGPUserStore = new class {
|
|||
data.Folder = message.folder;
|
||||
data.Uid = message.uid;
|
||||
data.GnuPG = 0;
|
||||
let response = data.SigPartId
|
||||
? await Remote.post('MessagePgpVerify', null, data)
|
||||
: { Result: { text: message.plain(), signature: null } };
|
||||
let response;
|
||||
if (data.SigPartId) {
|
||||
response = await Remote.post('MessagePgpVerify', null, data);
|
||||
} else if (data.BodyPart) {
|
||||
response = { Result: { text: data.BodyPart.raw, signature: data.SigPart.body } };
|
||||
} else {
|
||||
response = { Result: { text: message.plain(), signature: null } };
|
||||
}
|
||||
if (response) {
|
||||
const signature = response.Result.signature
|
||||
? await openpgp.readSignature({ armoredSignature: response.Result.signature })
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue