/* * This file is part of smolbote. It's copyrighted by the contributors recorded * in the version control history of the file, available from its original * location: https://neueland.iserlohn-fortress.net/gitea/aqua/smolbote * * SPDX-License-Identifier: GPL-3.0 */ #include class PluginLoader : public QPluginLoader { Q_OBJECT public: struct SignatureState { bool ignored; // always ignore signature bool checked; // check if available bool enforced; // always check SignatureState(bool ignore, bool check, bool enforce) { ignored = ignore; checked = check; enforced = enforce; } }; PluginLoader(const QString &fileName, SignatureState state, QObject *parent = nullptr); ~PluginLoader() = default; QString errorString() const { if(!m_sigError.isEmpty()) return m_sigError; else return QPluginLoader::errorString(); } bool verify(const char *hashName = "SHA256"); private: const SignatureState m_state; QString m_sigError; };