diff --git a/dev/Model/MimeHeaderAutocrypt.js b/dev/Model/MimeHeaderAutocrypt.js index 1b88c69b9..b1e65271a 100644 --- a/dev/Model/MimeHeaderAutocrypt.js +++ b/dev/Model/MimeHeaderAutocrypt.js @@ -24,7 +24,7 @@ export class MimeHeaderAutocryptModel/* extends AbstractModel*/ return `addr=${this.addr}; keydata=${this.keydata}`; } - key() { + pem() { return '-----BEGIN PGP PUBLIC KEY BLOCK-----\n\n' + this.keydata + '\n-----END PGP PUBLIC KEY BLOCK-----'; diff --git a/dev/Stores/User/Pgp.js b/dev/Stores/User/Pgp.js index e41bc28a1..3895c4194 100644 --- a/dev/Stores/User/Pgp.js +++ b/dev/Stores/User/Pgp.js @@ -18,6 +18,8 @@ export const BEGIN_PGP_MESSAGE = '-----BEGIN PGP MESSAGE-----', // BEGIN_PGP_SIGNATURE = '-----BEGIN PGP SIGNATURE-----', // BEGIN_PGP_SIGNED = '-----BEGIN PGP SIGNED MESSAGE-----', +// BEGIN_PGP_PUBLIC_KEY = '-----BEGIN PGP PUBLIC KEY BLOCK-----', +// END_PGP_PUBLIC_KEY = '-----END PGP PUBLIC KEY BLOCK-----', PgpUserStore = new class { init() { diff --git a/dev/View/Popup/Compose.js b/dev/View/Popup/Compose.js index 95ecb4833..45a09c844 100644 --- a/dev/View/Popup/Compose.js +++ b/dev/View/Popup/Compose.js @@ -903,18 +903,8 @@ export class ComposePopupView extends AbstractViewPopup { let autocrypt = new MimeHeaderAutocryptModel(value); if (autocrypt.addr && autocrypt.keydata) { PgpUserStore.hasPublicKeyForEmails([autocrypt.addr]).then(result => - result || PgpUserStore.importKey( - '-----BEGIN PGP PUBLIC KEY BLOCK-----\n\n' - + autocrypt.keydata - + '\n-----END PGP PUBLIC KEY BLOCK-----', - true, true) -/* - result || showScreenPopup(OpenPgpImportPopupView, - ['-----BEGIN PGP PUBLIC KEY BLOCK-----\n\n' - + autocrypt.keydata - + '\n-----END PGP PUBLIC KEY BLOCK-----'] - ) -*/ + result || PgpUserStore.importKey(autocrypt.pem(), true, true) +// result || showScreenPopup(OpenPgpImportPopupView, [autocrypt.pem()]) ); } });