certmanager
certmanager.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef _CERTMANAGER_H_
00034 #define _CERTMANAGER_H_
00035
00036
00037
00038 #include <kmainwindow.h>
00039 #include <kdepimmacros.h>
00040 #include <kurl.h>
00041 #include <qcstring.h>
00042 #include <qptrlist.h>
00043
00044 #include <set>
00045 #include <string>
00046
00047 namespace Kleo {
00048 class KeyListView;
00049 class KeyListViewItem;
00050 class ProgressBar;
00051 class Job;
00052 }
00053
00054 namespace KIO {
00055 class Job;
00056 }
00057 class KProcess;
00058 class KToolBar;
00059 class KAction;
00060
00061 class CRLView;
00062 class HierarchyAnalyser;
00063
00064 class LineEditAction;
00065 class ComboAction;
00066
00067 class KURL;
00068 class QFile;
00069 class QStringList;
00070 class QLabel;
00071
00072 namespace GpgME {
00073 class ImportResult;
00074 class KeyListResult;
00075 class Error;
00076 class Key;
00077 }
00078
00079 class KDE_EXPORT CertManager : public KMainWindow {
00080 Q_OBJECT
00081 public:
00082 CertManager( bool remote = false, const QString& query = QString::null,
00083 const QString& import=QString::null,
00084 QWidget * parent=0, const char * name=0, WFlags f=0 );
00085 ~CertManager();
00086
00087 bool isRemote() const { return mRemote; }
00088
00089 signals:
00090 void stopOperations();
00091 void enableOperations( bool );
00092
00093 private slots:
00094 void slotStartCertificateDownload( const QString & fingerprint, const QString& displayName );
00095 void newCertificate();
00096 void revokeCertificate();
00097 void extendCertificate();
00098 void slotDeleteCertificate();
00099 void slotExportSecretKey();
00100 void slotExportCertificate();
00101 void slotUploadResult( KIO::Job* job );
00102
00103 void slotImportCertFromFile();
00104 void slotImportCertFromFile( const KURL & filename );
00105 void slotImportResult( KIO::Job* );
00106
00107 void slotCertificateImportResult( const GpgME::ImportResult & result );
00108 void slotCertificateDownloadResult( const GpgME::Error & error, const QByteArray & keyData );
00109 void slotKeyListResult( const GpgME::KeyListResult & result );
00110 void slotDeleteResult( const GpgME::Error & error, const GpgME::Key & );
00111 void slotSecretKeyExportResult( const GpgME::Error & error, const QByteArray & keyData );
00112 void slotCertificateExportResult( const GpgME::Error & error, const QByteArray & keyData );
00113 void slotClearCRLsResult();
00114
00115 void importCRLFromFile();
00116 void importCRLFromLDAP();
00117 void slotImportCRLJobFinished( KIO::Job * );
00118
00119 void slotDirmngrExited();
00120 void slotStderr( KProcess*, char*, int );
00121
00122 void slotToggleRemote(int idx);
00123 void slotToggleHierarchicalView( bool );
00124
00125 void slotViewCRLs();
00126 void slotClearCRLs();
00127
00128 void slotViewDetails();
00129 void slotViewDetails( Kleo::KeyListViewItem * item );
00130 void slotSelectionChanged();
00131 void slotDownloadCertificate();
00132 void slotStartWatchGnuPG();
00133
00134 void slotEditKeybindings();
00135 void slotShowConfigurationDialog();
00136 void slotConfigureGpgME();
00137 void slotContextMenu(Kleo::KeyListViewItem*, const QPoint& point);
00138 void slotDropped(const KURL::List&);
00141 void slotRepaint();
00144 void slotValidate() { startRedisplay( true ); }
00147 void slotRedisplay() { startRedisplay( false ); }
00150 void slotSearch();
00151
00152 void slotExpandAll();
00153 void slotCollapseAll();
00154 void slotRefreshKeys();
00155 void slotRefreshKeysResult( const GpgME::Error & );
00156
00157 private:
00158 void createStatusBar();
00159 void createActions();
00160 void updateStatusBarLabels();
00161 void updateImportActions( bool enable );
00162 void startKeyListing( bool, bool, const QStringList & );
00163 void startKeyListing( bool, bool, const std::set<std::string> & );
00164 void startCertificateImport( const QByteArray & keyData, const QString& certDisplayName );
00165 void startImportCRL( const QString& fileName, bool isTempFile );
00166 void startClearCRLs();
00167 void startSecretKeyExport( const QString & fingerprint );
00168 void startCertificateExport( const QStringList & fingerprints );
00169 bool connectAndStartDirmngr( const char*, const char* );
00170 void connectJobToStatusBarProgress( Kleo::Job * job, const QString & initialText );
00171 void disconnectJobFromStatusBarProgress( const GpgME::Error & err );
00172 void importNextURLOrRedisplay();
00173 void startRedisplay( bool validating );
00174 QString displayNameForJob( const Kleo::Job *job );
00175 void readConfig( bool noQueryGiven );
00176 void writeConfig();
00177
00178 private:
00179 Kleo::KeyListView * mKeyListView;
00180 CRLView * mCrlView;
00181 Kleo::ProgressBar * mProgressBar;
00182 QLabel * mStatusLabel;
00183
00184 KProcess * mDirmngrProc;
00185 QString mErrorbuffer;
00186 QPtrList<Kleo::KeyListViewItem> mItemsToDelete;
00187 KURL::List mURLsToImport;
00188 typedef QMap<const Kleo::Job *, QString> JobsDisplayNameMap;
00189 JobsDisplayNameMap mJobsDisplayNameMap;
00190 HierarchyAnalyser * mHierarchyAnalyser;
00191
00192 LineEditAction * mLineEditAction;
00193 ComboAction * mComboAction;
00194 KAction * mFindAction;
00195 KAction * mImportCertFromFileAction;
00196 KAction * mImportCRLFromFileAction;
00197 KAction * mExportCertificateAction;
00198 KAction * mViewCertDetailsAction;
00199 KAction * mDeleteCertificateAction;
00200 #ifdef NOT_IMPLEMENTED_ANYWAY
00201 KAction * mRevokeCertificateAction;
00202 KAction * mExtendCertificateAction;
00203 #endif
00204 KAction * mExportSecretKeyAction;
00205 KAction * mDownloadCertificateAction;
00206 KAction * mValidateCertificateAction;
00207
00208 QString mImportCRLTempFile;
00209 QString mCurrentQuery;
00210 std::set<std::string> mPreviouslySelectedFingerprints;
00211 bool mNextFindRemote : 1;
00212 bool mRemote : 1;
00213 bool mDirMngrFound : 1;
00214 bool mHierarchicalView : 1;
00215 };
00216
00217 #endif // _CERTMANAGER_H_
|