Welcome to mirror list, hosted at ThFree Co, Russian Federation.

Cert.h « mumble « src - github.com/mumble-voip/mumble.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8e47ca3905185714b8647986fac72fa205e693df (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
58
59
60
61
62
63
64
// Copyright 2005-2016 The Mumble Developers. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file at the root of the
// Mumble source tree or at <https://www.mumble.info/LICENSE>.

#ifndef MUMBLE_MUMBLE_CERT_H_
#define MUMBLE_MUMBLE_CERT_H_

#include <QtCore/QtGlobal>
#include <QtCore/QString>
#if QT_VERSION >= 0x050000
# include <QtWidgets/QGroupBox>
#else
# include <QtGui/QGroupBox>
#endif

#include <QtNetwork/QHostInfo>
#include <QtNetwork/QSslCertificate>

#include "Settings.h"

class QLabel;
class QWidget;

class CertView : public QGroupBox {
	private:
		Q_OBJECT
		Q_DISABLE_COPY(CertView)
	protected:
		QList<QSslCertificate> qlCert;
		QLabel *qlSubjectName, *qlSubjectEmail, *qlIssuerName, *qlExpiry;
	public:
		CertView(QWidget *p);
		void setCert(const QList<QSslCertificate> &cert);
};

#include "ui_Cert.h"

class CertWizard : public QWizard, public Ui::Certificates {
	private:
		Q_OBJECT
		Q_DISABLE_COPY(CertWizard)
	protected:
		Settings::KeyPair kpCurrent, kpNew;
	public:
		CertWizard(QWidget *p = NULL);
		int nextId() const Q_DECL_OVERRIDE;
		void initializePage(int) Q_DECL_OVERRIDE;
		bool validateCurrentPage() Q_DECL_OVERRIDE;
		static bool validateCert(const Settings::KeyPair &);
		static Settings::KeyPair generateNewCert(QString name = QString(), const QString &email = QString());
		static QByteArray exportCert(const Settings::KeyPair &cert);
		static Settings::KeyPair importCert(QByteArray, const QString & = QString());
	public slots:
		void on_qleEmail_textChanged(const QString &);
		void on_qpbExportFile_clicked();
		void on_qleExportFile_textChanged(const QString &);
		void on_qpbImportFile_clicked();
		void on_qleImportFile_textChanged(const QString &);
		void on_qlePassword_textChanged(const QString &);
		void on_qlIntroText_linkActivated(const QString &);
};

#endif