mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 14:37:02 +03:00
#89 added import keys to OpenPGP
This commit is contained in:
parent
fe078174ab
commit
9f125c18c3
3 changed files with 21 additions and 12 deletions
|
|
@ -223,6 +223,20 @@ export const PgpUserStore = new class {
|
|||
return !!(window.openpgp || window.mailvelope || Settings.capa(Capa.GnuPG));
|
||||
}
|
||||
|
||||
openpgpImportKey(armoredKey) {
|
||||
openpgp && openpgp.readKey({armoredKey:armoredKey}).then(key => {
|
||||
if (!key.err) {
|
||||
if (key.isPrivate()) {
|
||||
this.openpgpPrivateKeys.push(new OpenPgpKeyModel(armoredKey, key));
|
||||
storeOpenPgpKeys(this.openpgpPrivateKeys, privateKeysItem);
|
||||
} else {
|
||||
this.openpgpPublicKeys.push(new OpenPgpKeyModel(armoredKey, key));
|
||||
storeOpenPgpKeys(PgpUserStore.openpgpPublicKeys, publicKeysItem);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
gnupgImportKey(key, callback) {
|
||||
if (Settings.capa(Capa.GnuPG)) {
|
||||
Remote.request('GnupgImportKey',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue