File indexing completed on 2024-06-23 05:14:03
0001 #pragma once 0002 /* dialogs/certifywidget.cpp 0003 0004 This file is part of Kleopatra, the KDE keymanager 0005 SPDX-FileCopyrightText: 2019 g 10code GmbH 0006 0007 SPDX-License-Identifier: GPL-2.0-or-later 0008 */ 0009 0010 #include <QWidget> 0011 0012 #include <memory> 0013 #include <vector> 0014 0015 namespace GpgME 0016 { 0017 class Key; 0018 class UserID; 0019 } // namespace GpgME 0020 0021 namespace Kleo 0022 { 0023 /** Widget for OpenPGP certification. */ 0024 class CertifyWidget : public QWidget 0025 { 0026 Q_OBJECT 0027 public: 0028 explicit CertifyWidget(QWidget *parent = nullptr); 0029 0030 ~CertifyWidget() override; 0031 0032 /* Set the key to certify */ 0033 void setCertificate(const GpgME::Key &key, const std::vector<GpgME::UserID> &uids); 0034 0035 /* Get the key to certify */ 0036 GpgME::Key certificate() const; 0037 0038 /* Sets the certificates to certify. Use for bulk certification. */ 0039 void setCertificates(const std::vector<GpgME::Key> &keys); 0040 std::vector<GpgME::Key> certificates() const; 0041 0042 /* Select specific user IDs. Default: all */ 0043 void selectUserIDs(const std::vector<GpgME::UserID> &uids); 0044 0045 /* The user IDs that should be signed */ 0046 std::vector<GpgME::UserID> selectedUserIDs() const; 0047 0048 /* The secret key selected */ 0049 GpgME::Key secKey() const; 0050 0051 /* Should the signature be exportable */ 0052 bool exportableSelected() const; 0053 0054 /* Additional tags for the key */ 0055 QString tags() const; 0056 0057 /* Should the signed key be be published */ 0058 bool publishSelected() const; 0059 0060 /* Whether a trust signature should be created */ 0061 bool trustSignatureSelected() const; 0062 0063 /* The domain to use to limit the scope of the trust signature */ 0064 QString trustSignatureDomain() const; 0065 0066 /* The expiration date to use for the certification */ 0067 QDate expirationDate() const; 0068 0069 bool isValid() const; 0070 0071 void saveState() const; 0072 0073 Q_SIGNALS: 0074 void changed() const; 0075 0076 private: 0077 class Private; 0078 std::unique_ptr<Private> d; 0079 }; 0080 0081 } // namespace Kleo