QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 "ui_qgsauthimportidentitydialog.h"
22 
23 #include <QSslCertificate>
24 #include <QSslKey>
25 
26 #include "qgsauthconfig.h"
27 
31 class GUI_EXPORT QgsAuthImportIdentityDialog : public QDialog, private Ui::QgsAuthImportIdentityDialog
32 {
33  Q_OBJECT
34 
35  public:
38  {
39  CertIdentity = 0,
40  };
41 
44  {
45  PkiPaths = 0,
46  PkiPkcs12 = 1,
47  };
48 
50  enum Validity
51  {
55  };
56 
63  QWidget *parent = nullptr );
65 
68 
72  const QPair<QSslCertificate, QSslKey> certBundleToImport();
73 
75  const QgsPkiBundle pkiBundleToImport() { return mPkiBundle; }
76 
77  private slots:
78  void populateIdentityType();
79 
80  void validateIdentity();
81 
82 
83 
84  void clearValidation();
85  void writeValidation( const QString &msg,
87  bool append = false );
88 
89  // Cert Identity - PkiPaths
90  void on_lePkiPathsKeyPass_textChanged( const QString &pass );
91  void on_chkPkiPathsPassShow_stateChanged( int state );
92 
93  void on_btnPkiPathsCert_clicked();
94  void on_btnPkiPathsKey_clicked();
95 
96  // Cert Identity - PkiPkcs#12
97  void on_lePkiPkcs12KeyPass_textChanged( const QString &pass );
98  void on_chkPkiPkcs12PassShow_stateChanged( int state );
99 
100  void on_btnPkiPkcs12Bundle_clicked();
101 
102  private:
103  bool validateBundle();
104  bool validatePkiPaths();
105  bool validatePkiPkcs12();
106 
107  void fileFound( bool found, QWidget *widget );
108  QString getOpenFileName( const QString& title, const QString& extfilter );
109 
110  QPushButton* okButton();
111 
114  QgsPkiBundle mPkiBundle;
115 
116  bool mDisabled;
117  QVBoxLayout *mAuthNotifyLayout;
118  QLabel *mAuthNotify;
119 };
120 
121 #endif // QGSAUTHIMPORTIDENTITYDIALOG_H
IdentityType
Type of identity being imported.
const QgsPkiBundle pkiBundleToImport()
Get certificate/key bundle to be imported as a PKI bundle object.
Widget for importing an identity certificate/key bundle into the authentication database.
Storage set for PKI bundle: SSL certificate, key, optional CA cert chain.
BundleTypes
Type of bundles supported.
Validity
Type of certificate/bundle validity output.