File indexing completed on 2024-04-21 05:50:43

0001 /*
0002     SPDX-FileCopyrightText: 2009-2022 Rolf Eike Beer <kde@opensource.sf-tec.de>
0003     SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005 
0006 #ifndef KGPGSIGNKEY_H
0007 #define KGPGSIGNKEY_H
0008 
0009 #include <QObject>
0010 
0011 #include "kgpgeditkeytransaction.h"
0012 #include "kgpgsigntransactionhelper.h"
0013 
0014 class KGpgKeyNode;
0015 
0016 /**
0017  * @brief transaction class to sign all user ids of a key
0018  */
0019 class KGpgSignKey: public KGpgEditKeyTransaction, public KGpgSignTransactionHelper {
0020     Q_OBJECT
0021 
0022     Q_DISABLE_COPY(KGpgSignKey)
0023     KGpgSignKey() = delete;
0024 
0025 public:
0026     /**
0027      * @brief constructor
0028      * @param parent parent object
0029      * @param signer id of the key to sign with
0030      * @param key node to sign
0031      * @param local if signature should be local (not exportable)
0032      * @param checking how carefully the identity of the key owner was checked
0033      *
0034      * See setUid() for description of uid.
0035      */
0036     KGpgSignKey(QObject *parent, const QString &signer, KGpgKeyNode *key, const bool local, const carefulCheck checking);
0037     /**
0038      * @brief destructor
0039      */
0040     ~KGpgSignKey() override = default;
0041 
0042 protected:
0043     bool nextLine(const QString &line) override;
0044     ts_boolanswer boolQuestion(const QString &line) override;
0045     bool passphraseReceived() override;
0046 
0047     KGpgTransaction *asTransaction() override;
0048     void replaceCmd(const QString &cmd) override;
0049 };
0050 
0051 #endif // KGPGSIGNKEY_H