QGIS API Documentation  3.2.0-Bonn (bc43194)
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 "qgis.h"
23 #include "ui_qgsauthimportidentitydialog.h"
24 
25 #include <QSslCertificate>
26 #include <QSslKey>
27 
28 #include "qgsauthconfig.h"
29 #include "qgis_gui.h"
30 
35 class GUI_EXPORT QgsAuthImportIdentityDialog : public QDialog, private Ui::QgsAuthImportIdentityDialog
36 {
37  Q_OBJECT
38 
39  public:
42  {
43  CertIdentity = 0,
44  };
45 
48  {
49  PkiPaths = 0,
50  PkiPkcs12 = 1,
51  };
52 
54  enum Validity
55  {
58  Unknown
59  };
60 
67  QWidget *parent SIP_TRANSFERTHIS = nullptr );
68 
71 
76  const QPair<QSslCertificate, QSslKey> certBundleToImport() SIP_SKIP;
77 
79  const QgsPkiBundle pkiBundleToImport() { return mPkiBundle; }
80 
81  private slots:
82  void populateIdentityType();
83 
84  void validateIdentity();
85 
86 
87 
88  void clearValidation();
89  void writeValidation( const QString &msg,
91  bool append = false );
92 
93  // Cert Identity - PkiPaths
94  void lePkiPathsKeyPass_textChanged( const QString &pass );
95  void chkPkiPathsPassShow_stateChanged( int state );
96 
97  void btnPkiPathsCert_clicked();
98  void btnPkiPathsKey_clicked();
99 
100  // Cert Identity - PkiPkcs#12
101  void lePkiPkcs12KeyPass_textChanged( const QString &pass );
102  void chkPkiPkcs12PassShow_stateChanged( int state );
103 
104  void btnPkiPkcs12Bundle_clicked();
105 
106  private:
107  bool validateBundle();
108  bool validatePkiPaths();
109  bool validatePkiPkcs12();
110 
111  void fileFound( bool found, QWidget *widget );
112  QString getOpenFileName( const QString &title, const QString &extfilter );
113 
114  QPushButton *okButton();
115 
117  QPair<QSslCertificate, QSslKey> mCertBundle;
118  QgsPkiBundle mPkiBundle;
119 
120  bool mDisabled;
121  QVBoxLayout *mAuthNotifyLayout = nullptr;
122  QLabel *mAuthNotify = nullptr;
123 };
124 
125 #endif // QGSAUTHIMPORTIDENTITYDIALOG_H
IdentityType
Type of identity being imported.
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:46
Widget for importing an identity certificate/key bundle into the authentication database.
Storage set for PKI bundle: SSL certificate, key, optional CA cert chain.
#define SIP_SKIP
Definition: qgis_sip.h:119
BundleTypes
Type of bundles supported.
Validity
Type of certificate/bundle validity output.