Added button to import keys from server into OpenPGP.js #89

This commit is contained in:
the-djmaze 2024-02-07 02:29:22 +01:00
parent 6c01db395d
commit f8002151be
41 changed files with 76 additions and 1 deletions

View file

@ -15,7 +15,7 @@ import { showScreenPopup } from 'Knoin/Knoin';
import { OpenPgpImportPopupView } from 'View/Popup/OpenPgpImport';
import { OpenPgpGeneratePopupView } from 'View/Popup/OpenPgpGenerate';
//import Remote from 'Remote/User/Fetch';
import Remote from 'Remote/User/Fetch';
export class UserSettingsSecurity extends AbstractViewSettings {
constructor() {
@ -56,6 +56,16 @@ export class UserSettingsSecurity extends AbstractViewSettings {
showScreenPopup(OpenPgpGeneratePopupView);
}
importToOpenPGP() {
OpenPGPUserStore.isSupported() && Remote.request('GetPGPKeys',
(iError, oData) => {
if (!iError && oData.Result) {
oData.Result.forEach(key => OpenPGPUserStore.importKey(key));
}
}
);
}
onBuild() {
/**
* Create an iframe to display the Mailvelope keyring settings.