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

knewstuff

  • knewstuff
security.h
1 /***************************************************************************
2  security.h - description
3  -------------------
4  begin : Thu Jun 24 11:22:12 2004
5  copyright : (C) 2004, 2005 by Andras Mantia <amantia@kde.org>
6  ***************************************************************************/
7 
8 /***************************************************************************
9  * *
10  * This program is free software; you can redistribute it and/or modify *
11  * it under the terms of the GNU Library General Public License as *
12  * published by the Free Software Foundation; version 2 of the License. *
13  * *
14  ***************************************************************************/
15 
16 
17 #ifndef SECURITY_H
18 #define SECURITY_H
19 
20 //qt includes
21 #include <tqmap.h>
22 #include <tqobject.h>
23 
24 class KProcIO;
25 class KProcess;
26 
27 struct KeyStruct {
28  TQString id;
29  TQString name;
30  TQString mail;
31  bool trusted;
32  bool secret;
33 };
34 
42 namespace KNS {
43 
44 class Security : public TQObject
45 {
46 Q_OBJECT
47 public:
48  static Security* const ref()
49  {
50  static Security *m_ref;
51  if (!m_ref) m_ref = new Security();
52  return m_ref;
53  }
54  ~Security();
55 
56 
62  void checkValidity(const TQString &fileName);
63 
70  void signFile(const TQString &fileName);
77  KeyStruct signatureKey() {return m_signatureKey;}
78 
79  enum Results {
80  MD5_OK = 1,
81  SIGNED_OK = 2,
82  SIGNED_BAD = 4,
83  TRUSTED = 8,
84  UNKNOWN = 16,
85  SIGNED_BAD_CLEAR = 27,
86  BAD_PASSPHRASE = 32
87  };
88 
89 public slots:
91  void readKeys();
93  void readSecretKeys();
96  void slotCheckValidity();
97 
101  void slotSignFile();
102 
103 private:
104  Security();
105 
106  enum RunMode {
107  List = 0,
108  ListSecret,
109  Verify,
110  Sign
111  };
112 
113  KeyStruct m_signatureKey;
114  int m_result;
115  int m_runMode;
116  bool m_gpgRunning;
117  bool m_keysRead;
118  TQMap<TQString, KeyStruct> m_keys;
119  TQString m_fileName;
120  TQString m_secretKey;
121 
122 private slots:
123  void slotProcessExited(KProcess *process);
124  void slotDataArrived(KProcIO *process);
125 
126 signals:
131  void validityResult(int result);
136  void fileSigned(int result);
137 };
138 
139 }
140 
141 #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.8.1.2
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |