summaryrefslogtreecommitdiffstats
path: root/ui/qt/rsa_keys_frame.h
blob: fae40e2f3811982fd60087a7e053fd5ceb37d224 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/** @file
 *
 * Copyright 2019 Peter Wu <peter@lekensteyn.nl>
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef RSA_KEYS_FRAME_H
#define RSA_KEYS_FRAME_H

#include <config.h>

#include <QFrame>

#include <ui/qt/models/uat_model.h>

namespace Ui {
class RsaKeysFrame;
}

class RsaKeysFrame : public QFrame
{
    Q_OBJECT

public:
    explicit RsaKeysFrame(QWidget *parent = NULL);
#ifdef HAVE_LIBGNUTLS
    ~RsaKeysFrame();

    void acceptChanges();
    void rejectChanges();

private:
    Ui::RsaKeysFrame *ui;

    UatModel *rsa_keys_model_;
    UatModel *pkcs11_libs_model_;

    gboolean verifyKey(const char *uri, const char *password, gboolean *need_password, QString &error);
    void addKey(const QString &uri, const QString &password);

private slots:
    void keyCurrentChanged(const QModelIndex &current, const QModelIndex &previous);
    void on_addFileButton_clicked();
    void on_addItemButton_clicked();
    void on_deleteItemButton_clicked();
    void libCurrentChanged(const QModelIndex &current, const QModelIndex &previous);
    void on_addLibraryButton_clicked();
    void on_deleteLibraryButton_clicked();
#endif  /* HAVE_LIBGNUTLS */
};

#endif  /* RSA_KEYS_FRAME_H */