1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 15:27:34 +00:00

CertificateSettings: Create basic Cert Store application

This commit adds a new application named CertificateSettings that
houses our Cert Store. It should be expanded in the future.
This commit is contained in:
Fabian Dellwing 2023-03-27 20:04:24 +02:00 committed by Andrew Kaster
parent 459dee1f86
commit c273784c3e
9 changed files with 237 additions and 0 deletions

View file

@ -0,0 +1,34 @@
/*
* Copyright (c) 2023, Fabian Dellwing <fabian@dellwing.net>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "CertificateStore.h"
#include <LibCore/System.h>
#include <LibGUI/Application.h>
#include <LibGUI/Icon.h>
#include <LibGUI/SettingsWindow.h>
#include <LibMain/Main.h>
#include <unistd.h>
ErrorOr<int> serenity_main(Main::Arguments args)
{
TRY(Core::System::pledge("stdio rpath wpath cpath recvfd sendfd unix"));
auto app = TRY(GUI::Application::try_create(args));
TRY(Core::System::unveil("/res", "r"));
TRY(Core::System::unveil("/etc/cacert.pem", "r"));
TRY(Core::System::unveil("/etc/timezone", "r"));
TRY(Core::System::unveil(nullptr, nullptr));
auto app_icon = GUI::Icon::default_icon("certificate"sv);
auto window = TRY(GUI::SettingsWindow::create("Certificates", GUI::SettingsWindow::ShowDefaultsButton::No));
auto cert_store_widget = TRY(window->add_tab<CertificateSettings::CertificateStoreWidget>(TRY("Certificate Store"_string), "certificate"sv));
window->set_icon(app_icon.bitmap_for_size(16));
window->show();
return app->exec();
}