mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 19:49:20 +03:00
#89 added send OpenPGP.js signed HTML message
This commit is contained in:
parent
0cf63dab76
commit
051e78df51
3 changed files with 33 additions and 9 deletions
|
|
@ -94,6 +94,7 @@
|
|||
td:first-child {
|
||||
padding: 0 10px 0 0;
|
||||
text-align: right;
|
||||
white-space: nowrap;
|
||||
width: 4em;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -407,18 +407,15 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
params.Encrypted = draft
|
||||
? await this.mailvelope.createDraft()
|
||||
: await this.mailvelope.encrypt(recipients);
|
||||
} else if (encrypt) {
|
||||
if ('openpgp' != encrypt) {
|
||||
throw 'Encryption with ' + encrypt + ' not yet implemented';
|
||||
}
|
||||
if (sign && 'openpgp' != sign[0]) {
|
||||
throw 'Signing with ' + sign[0] + ' not yet implemented';
|
||||
}
|
||||
} else if (encrypt || sign) {
|
||||
let data = new MimePart;
|
||||
data.headers['Content-Type'] = 'text/'+(TextIsHtml?'html':'plain')+'; charset="utf-8"';
|
||||
data.headers['Content-Transfer-Encoding'] = 'base64';
|
||||
data.body = base64_encode(Text);
|
||||
if (TextIsHtml && sign && sign[1]) {
|
||||
if (sign && sign[1]) {
|
||||
if ('openpgp' != sign[0]) {
|
||||
throw 'Signing with ' + sign[0] + ' not yet implemented';
|
||||
}
|
||||
let signed = new MimePart;
|
||||
signed.headers['Content-Type'] =
|
||||
'multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"';
|
||||
|
|
@ -431,7 +428,14 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
signed.children.push(signature);
|
||||
data = signed;
|
||||
}
|
||||
params.Encrypted = await OpenPGPUserStore.encrypt(data.toString(), recipients);
|
||||
if (encrypt) {
|
||||
if ('openpgp' != encrypt) {
|
||||
throw 'Encryption with ' + encrypt + ' not yet implemented';
|
||||
}
|
||||
params.Encrypted = await OpenPGPUserStore.encrypt(data.toString(), recipients);
|
||||
} else {
|
||||
params.Signed = data.toString();
|
||||
}
|
||||
} else {
|
||||
params.Html = TextIsHtml ? Text : '';
|
||||
params.Text = TextIsHtml ? '' : Text;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue