QGIS API Documentation  2.12.0-Lyon
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 = 0 );
65 
68 
70  const QPair<QSslCertificate, QSslKey> certBundleToImport();
71 
73  const QgsPkiBundle pkiBundleToImport() { return mPkiBundle; }
74 
75  private slots:
76  void populateIdentityType();
77 
78  void validateIdentity();
79 
80 
81 
82  void clearValidation();
83  void writeValidation( const QString &msg,
85  bool append = false );
86 
87  // Cert Identity - PkiPaths
88  void on_lePkiPathsKeyPass_textChanged( const QString &pass );
89  void on_chkPkiPathsPassShow_stateChanged( int state );
90 
91  void on_btnPkiPathsCert_clicked();
92  void on_btnPkiPathsKey_clicked();
93 
94  // Cert Identity - PkiPkcs#12
95  void on_lePkiPkcs12KeyPass_textChanged( const QString &pass );
96  void on_chkPkiPkcs12PassShow_stateChanged( int state );
97 
98  void on_btnPkiPkcs12Bundle_clicked();
99 
100  private:
101  bool validateBundle();
102  bool validatePkiPaths();
103  bool validatePkiPkcs12();
104 
105  void fileFound( bool found, QWidget *widget );
106  QString getOpenFileName( const QString& title, const QString& extfilter );
107 
108  QPushButton* okButton();
109 
112  QgsPkiBundle mPkiBundle;
113 
114  bool mDisabled;
115  QVBoxLayout *mAuthNotifyLayout;
116  QLabel *mAuthNotify;
117 };
118 
119 #endif // QGSAUTHIMPORTIDENTITYDIALOG_H
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.
IdentityType
Type of identity being imported.
Storage set for PKI bundle: SSL certificate, key, optional CA cert chain.
Validity
Type of certificate/bundle validity output.
BundleTypes
Type of bundles supported.