• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KNewStuff

security.h

Go to the documentation of this file.
00001 /*
00002     This file is part of KNewStuff2.
00003     Copyright (c) 2004, 2005 Andras Mantia <amantia@kde.org>
00004     Copyright (c) 2007 Josef Spillner <spillner@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 */
00021 #ifndef KNEWSTUFF2_SECURITY_H
00022 #define KNEWSTUFF2_SECURITY_H
00023 
00024 //qt includes
00025 #include <QtCore/QMap>
00026 #include <QtCore/QObject>
00027 #include <QtCore/QProcess>
00028 
00029 struct KeyStruct {
00030     QString id;
00031     QString name;
00032     QString mail;
00033     bool trusted;
00034     bool secret;
00035 };
00036 
00037 class KProcess;
00038 namespace KNS
00039 {
00040 
00049 class Security : public QObject
00050 {
00051     Q_OBJECT
00052 public:
00053     static Security* ref() {
00054         static Security *m_ref;
00055         if (!m_ref) m_ref = new Security();
00056         return m_ref;
00057     }
00058     ~Security();
00059 
00060 
00066     void checkValidity(const QString &fileName);
00067 
00074     void signFile(const QString &fileName);
00075 
00082     KeyStruct signatureKey() {
00083         return m_signatureKey;
00084     }
00085 
00086     enum Results {
00087         MD5_OK = 1, 
00088         SIGNED_OK = 2, 
00089         SIGNED_BAD = 4, 
00090         TRUSTED = 8, 
00091         UNKNOWN = 16, 
00092         SIGNED_BAD_CLEAR = 27, 
00093         BAD_PASSPHRASE = 32 
00094     };
00095 
00096 public Q_SLOTS:
00097 
00099     void readKeys();
00100 
00102     void readSecretKeys();
00103 
00106     void slotCheckValidity();
00107 
00111     void slotSignFile();
00112 
00113 private:
00114     Security();
00115 
00116     enum RunMode {
00117         List = 0, 
00118         ListSecret, 
00119         Verify, 
00120         Sign 
00121     };
00122 
00123     KeyStruct m_signatureKey;
00124     int m_result;
00125     int m_runMode;
00126     bool m_gpgRunning; 
00127     bool m_keysRead; 
00128     QMap<QString, KeyStruct> m_keys; 
00129     QString m_fileName; 
00130     QString m_secretKey; 
00131     KProcess *m_process;
00132 
00133 private Q_SLOTS:
00134     void slotFinished(int exitCode, QProcess::ExitStatus exitStatus);
00135     void slotReadyReadStandardOutput();
00136 
00137 Q_SIGNALS:
00142     void validityResult(int result);
00143 
00148     void fileSigned(int result);
00149 };
00150 
00151 }
00152 
00153 #endif

KNewStuff

Skip menu "KNewStuff"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal