QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
qgsauthimportidentitydialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsauthimportidentitydialog.cpp
3  ---------------------
4  begin : May 9, 2015
5  copyright : (C) 2015 by Boundless Spatial, Inc. USA
6  author : Larry Shaffer
7  email : lshaffer at boundlessgeo dot com
8  ***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU General Public License as published by *
12  * the Free Software Foundation; either version 2 of the License, or *
13  * (at your option) any later version. *
14  * *
15  ***************************************************************************/
16 
17 #ifndef QGSAUTHIMPORTIDENTITYDIALOG_H
18 #define QGSAUTHIMPORTIDENTITYDIALOG_H
19 
20 #include <QDialog>
21 #include "qgis_sip.h"
22 #include "ui_qgsauthimportidentitydialog.h"
23 
24 #include <QSslCertificate>
25 #include <QSslKey>
26 
27 #include "qgsauthconfig.h"
28 #include "qgis_gui.h"
29 
34 class GUI_EXPORT QgsAuthImportIdentityDialog : public QDialog, private Ui::QgsAuthImportIdentityDialog
35 {
36  Q_OBJECT
37 
38  public:
41  {
42  CertIdentity = 0,
43  };
44 
47  {
48  PkiPaths = 0,
49  PkiPkcs12 = 1,
50  };
51 
53  enum Validity
54  {
57  Unknown
58  };
59 
66  QWidget *parent SIP_TRANSFERTHIS = nullptr );
67 
70 
75  const QPair<QSslCertificate, QSslKey> certBundleToImport() SIP_SKIP;
76 
78  const QgsPkiBundle pkiBundleToImport() { return mPkiBundle; }
79 
80  private slots:
81  void populateIdentityType();
82 
83  void validateIdentity();
84 
85 
86 
87  void clearValidation();
88  void writeValidation( const QString &msg,
90  bool append = false );
91 
92  // Cert Identity - PkiPaths
93  void lePkiPathsKeyPass_textChanged( const QString &pass );
94  void chkPkiPathsPassShow_stateChanged( int state );
95 
96  void btnPkiPathsCert_clicked();
97  void btnPkiPathsKey_clicked();
98 
99  // Cert Identity - PkiPkcs#12
100  void lePkiPkcs12KeyPass_textChanged( const QString &pass );
101  void chkPkiPkcs12PassShow_stateChanged( int state );
102 
103  void btnPkiPkcs12Bundle_clicked();
104 
105  private:
106  bool validateBundle();
107  bool validatePkiPaths();
108  bool validatePkiPkcs12();
109 
110  void fileFound( bool found, QWidget *widget );
111  QString getOpenFileName( const QString &title, const QString &extfilter );
112 
113  QPushButton *okButton();
114 
116  QPair<QSslCertificate, QSslKey> mCertBundle;
117  QgsPkiBundle mPkiBundle;
118 
119  bool mDisabled;
120  QVBoxLayout *mAuthNotifyLayout = nullptr;
121  QLabel *mAuthNotify = nullptr;
122 };
123 
124 #endif // QGSAUTHIMPORTIDENTITYDIALOG_H
qgsauthconfig.h
QgsAuthImportIdentityDialog::IdentityType
IdentityType
Type of identity being imported.
Definition: qgsauthimportidentitydialog.h:41
QgsPkiBundle
Storage set for PKI bundle: SSL certificate, key, optional CA cert chain.
Definition: qgsauthconfig.h:190
QgsAuthImportIdentityDialog::Validity
Validity
Type of certificate/bundle validity output.
Definition: qgsauthimportidentitydialog.h:54
QgsAuthImportIdentityDialog::Valid
@ Valid
Definition: qgsauthimportidentitydialog.h:55
SIP_SKIP
#define SIP_SKIP
Definition: qgis_sip.h:126
qgis_sip.h
QgsAuthImportIdentityDialog::BundleTypes
BundleTypes
Type of bundles supported.
Definition: qgsauthimportidentitydialog.h:47
QgsAuthImportIdentityDialog
Widget for importing an identity certificate/key bundle into the authentication database.
Definition: qgsauthimportidentitydialog.h:35
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53
QgsAuthImportIdentityDialog::Invalid
@ Invalid
Definition: qgsauthimportidentitydialog.h:56