mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-25 18:19:22 +03:00
Cleanup PGP PUBLIC KEY handling
This commit is contained in:
parent
6ce08726b4
commit
ca12655e5f
3 changed files with 5 additions and 13 deletions
|
|
@ -24,7 +24,7 @@ export class MimeHeaderAutocryptModel/* extends AbstractModel*/
|
||||||
return `addr=${this.addr}; keydata=${this.keydata}`;
|
return `addr=${this.addr}; keydata=${this.keydata}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
key() {
|
pem() {
|
||||||
return '-----BEGIN PGP PUBLIC KEY BLOCK-----\n\n'
|
return '-----BEGIN PGP PUBLIC KEY BLOCK-----\n\n'
|
||||||
+ this.keydata
|
+ this.keydata
|
||||||
+ '\n-----END PGP PUBLIC KEY BLOCK-----';
|
+ '\n-----END PGP PUBLIC KEY BLOCK-----';
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@ export const
|
||||||
BEGIN_PGP_MESSAGE = '-----BEGIN PGP MESSAGE-----',
|
BEGIN_PGP_MESSAGE = '-----BEGIN PGP MESSAGE-----',
|
||||||
// BEGIN_PGP_SIGNATURE = '-----BEGIN PGP SIGNATURE-----',
|
// BEGIN_PGP_SIGNATURE = '-----BEGIN PGP SIGNATURE-----',
|
||||||
// BEGIN_PGP_SIGNED = '-----BEGIN PGP SIGNED MESSAGE-----',
|
// 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 {
|
PgpUserStore = new class {
|
||||||
init() {
|
init() {
|
||||||
|
|
|
||||||
|
|
@ -903,18 +903,8 @@ export class ComposePopupView extends AbstractViewPopup {
|
||||||
let autocrypt = new MimeHeaderAutocryptModel(value);
|
let autocrypt = new MimeHeaderAutocryptModel(value);
|
||||||
if (autocrypt.addr && autocrypt.keydata) {
|
if (autocrypt.addr && autocrypt.keydata) {
|
||||||
PgpUserStore.hasPublicKeyForEmails([autocrypt.addr]).then(result =>
|
PgpUserStore.hasPublicKeyForEmails([autocrypt.addr]).then(result =>
|
||||||
result || PgpUserStore.importKey(
|
result || PgpUserStore.importKey(autocrypt.pem(), true, true)
|
||||||
'-----BEGIN PGP PUBLIC KEY BLOCK-----\n\n'
|
// result || showScreenPopup(OpenPgpImportPopupView, [autocrypt.pem()])
|
||||||
+ 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-----']
|
|
||||||
)
|
|
||||||
*/
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue