1 /*  view/netkeywidget.h
2 
3     This file is part of Kleopatra, the KDE keymanager
4     SPDX-FileCopyrightText: 2017 Intevation GmbH
5 
6     SPDX-License-Identifier: GPL-2.0-or-later
7 */
8 #pragma once
9 
10 #include <QWidget>
11 #include <gpgme++/error.h>
12 
13 #include <string>
14 
15 class QLabel;
16 class QPushButton;
17 class QScrollArea;
18 
19 namespace Kleo
20 {
21 class NullPinWidget;
22 class KeyTreeView;
23 
24 namespace SmartCard
25 {
26 class NetKeyCard;
27 } // namespace SmartCard
28 
29 class NetKeyWidget: public QWidget
30 {
31     Q_OBJECT
32 public:
33     explicit NetKeyWidget(QWidget *parent = nullptr);
34     ~NetKeyWidget() override;
35 
36     void setCard(const SmartCard::NetKeyCard *card);
37 
38 private:
39     void doChangePin(const std::string &keyRef);
40     void createKeyFromCardKeys();
41     void createCSR();
42 
43 private:
44     std::string mSerialNumber;
45     QLabel *mSerialNumberLabel = nullptr,
46            *mVersionLabel = nullptr,
47            *mLearnKeysLabel = nullptr,
48            *mErrorLabel = nullptr;
49     NullPinWidget *mNullPinWidget = nullptr;
50     QPushButton *mLearnKeysBtn = nullptr,
51                 *mKeyForCardKeysButton = nullptr,
52                 *mCreateCSRButton = nullptr,
53                 *mChangeNKSPINBtn = nullptr,
54                 *mChangeSigGPINBtn = nullptr;
55     KeyTreeView *mTreeView = nullptr;
56     QScrollArea *mArea = nullptr;
57 };
58 } // namespace Kleo
59 
60