• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • knewstuff
 

knewstuff

security.h
00001 /***************************************************************************
00002                           security.h  -  description
00003                              -------------------
00004     begin                : Thu Jun 24 11:22:12 2004
00005     copyright          : (C) 2004, 2005 by Andras Mantia <amantia@kde.org>
00006  ***************************************************************************/
00007 
00008 /***************************************************************************
00009  *                                                                         *
00010  *   This program is free software; you can redistribute it and/or modify  *
00011  *   it under the terms of the GNU Library General Public License as       *
00012  *   published by the Free Software Foundation; version 2 of the License.  *
00013  *                                                                         *
00014  ***************************************************************************/
00015 
00016 
00017 #ifndef SECURITY_H
00018 #define SECURITY_H
00019 
00020 //qt includes
00021 #include <tqmap.h>
00022 #include <tqobject.h>
00023 
00024 class KProcIO;
00025 class KProcess;
00026 
00027 struct KeyStruct {
00028    TQString id;
00029    TQString name;
00030    TQString mail;
00031    bool trusted;
00032    bool secret;
00033 };
00034 
00042 namespace KNS {
00043 
00044 class Security : public TQObject
00045 {
00046 Q_OBJECT
00047 public:
00048   static Security* const ref()
00049   {
00050     static Security *m_ref;
00051     if (!m_ref) m_ref = new Security();
00052     return m_ref;
00053   }
00054   ~Security();
00055 
00056 
00062   void checkValidity(const TQString &fileName);
00063 
00070   void signFile(const TQString &fileName);
00077   KeyStruct signatureKey() {return m_signatureKey;}
00078 
00079   enum Results {
00080      MD5_OK = 1, 
00081      SIGNED_OK = 2, 
00082      SIGNED_BAD = 4, 
00083      TRUSTED = 8, 
00084      UNKNOWN = 16, 
00085      SIGNED_BAD_CLEAR = 27, 
00086      BAD_PASSPHRASE = 32 
00087   };
00088 
00089 public slots:
00091   void readKeys();
00093   void readSecretKeys();
00096   void slotCheckValidity();
00097 
00101   void slotSignFile();
00102 
00103 private:
00104    Security();
00105 
00106    enum RunMode {
00107        List = 0, 
00108        ListSecret, 
00109        Verify, 
00110        Sign 
00111    };
00112 
00113    KeyStruct m_signatureKey;
00114    int m_result;
00115    int m_runMode;
00116    bool m_gpgRunning; 
00117    bool m_keysRead; 
00118    TQMap<TQString, KeyStruct> m_keys; 
00119    TQString m_fileName; 
00120    TQString m_secretKey; 
00121 
00122 private slots:
00123    void slotProcessExited(KProcess *process);
00124    void slotDataArrived(KProcIO *process);
00125 
00126 signals:
00131     void validityResult(int result);
00136     void fileSigned(int result);
00137 };
00138 
00139 }
00140 
00141 #endif

knewstuff

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

knewstuff

Skip menu "knewstuff"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for knewstuff by doxygen 1.7.6.1
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |