aheinecke@404: /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik aheinecke@404: * Software engineering by Intevation GmbH aheinecke@404: * aheinecke@404: * This file is Free Software under the GNU GPL (v>=2) aheinecke@404: * and comes with ABSOLUTELY NO WARRANTY! aheinecke@404: * See LICENSE.txt for details. aheinecke@404: */ rrenkert@367: #ifndef CREATECERTLISTDIALOG_H rrenkert@367: #define CREATECERTLISTDIALOG_H rrenkert@367: rrenkert@367: #include rrenkert@367: #include rrenkert@367: #include aheinecke@454: aheinecke@466: #include "certificate.h" aheinecke@466: aheinecke@454: #include rrenkert@367: /** rrenkert@367: * @file createinstallerdialog.h andre@1255: * @brief The dialog to select the signing certificate and create a certificate list. rrenkert@367: */ rrenkert@367: rrenkert@367: class QListWidget; aheinecke@454: class AdministratorWindow; rrenkert@367: andre@1255: /** @brief The dialog to select the signing certificate and create a certificate list.*/ rrenkert@367: class CreateCertListDialog : public QDialog rrenkert@367: { rrenkert@367: Q_OBJECT rrenkert@367: public: rrenkert@367: /** @brief Create a dialog showing settings for the create certificate list rrenkert@367: * process rrenkert@367: * */ aheinecke@454: CreateCertListDialog(AdministratorWindow *parent); aheinecke@465: ~CreateCertListDialog(); rrenkert@367: aheinecke@466: /** @brief write a signed certificate list. aheinecke@466: * aheinecke@466: * @param [in] certs The certificates to include in the list aheinecke@466: * @param [in] filePath The path where the list should be written to aheinecke@466: * @param [in] listDate The date to write in the list aheinecke@466: * @param [in] pk The private key to sign with. aheinecke@466: * aheinecke@466: * @returns true on success false on error. aheinecke@466: */ aheinecke@466: static bool writeList(const QList& certs, aheinecke@466: const QString& filePath, const QDateTime& listDate, pk_context *pk); aheinecke@466: andre@1317: signals: andre@1317: /** @brief signal that is emited when the creation of a new list was successful.*/ andre@1317: void creationSuccessful(); aheinecke@466: rrenkert@367: private: rrenkert@367: void setupGUI(); rrenkert@367: aheinecke@465: QLineEdit *mKeyFile; aheinecke@465: QLineEdit *mSaveDir; aheinecke@454: AdministratorWindow *mAdminWindow; aheinecke@454: aheinecke@454: pk_context *mPk; rrenkert@367: aheinecke@465: /** @brief show an error message with QMessageBox aheinecke@465: * aheinecke@465: * @param [in] msg The message to show aheinecke@465: */ aheinecke@465: void showErrorMessage(const QString &msg); aheinecke@465: aheinecke@465: /** @brief load a file into mPk aheinecke@465: * aheinecke@465: * If the file is not a valid key or an error aheinecke@465: * occurs mPk will be NULL after a call to this function. aheinecke@465: * emanuel@1053: * @param [in] fileName the file to load aheinecke@465: */ aheinecke@465: void loadKeyFile(const QString& fileName); aheinecke@465: rrenkert@367: private slots: aheinecke@454: /** @brief Open the certificate selection dialog and parse the certificate aheinecke@454: * aheinecke@454: * If the certificate can be parsed mPk is replaced by the new key aheinecke@454: * otherwise an error message is shown to the user. aheinecke@454: */ rrenkert@367: void openCertificateSelect(); rrenkert@367: void openSaveLocation(); aheinecke@454: /** @brief create a valid certificate list file aheinecke@454: * aheinecke@465: * The contents of the certificate list are the certificates aheinecke@465: * shown in the adminWindow. It is signed with the currently aheinecke@454: * loaded certificate in mPk. On errors the user is aheinecke@454: * informed with showErrorMessage */ rrenkert@367: void createList(); rrenkert@367: }; rrenkert@367: rrenkert@367: #endif // CREATECERTLISTDIALOG_H