• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

KNewStuff

  • knewstuff
  • knewstuff3
  • core
knewstuff3/core/security.h
Go to the documentation of this file.
1 /*
2  This file is part of KNewStuff2.
3  Copyright (c) 2004, 2005 Andras Mantia <amantia@kde.org>
4  Copyright (c) 2007 Josef Spillner <spillner@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Lesser General Public
8  License as published by the Free Software Foundation; either
9  version 2.1 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Lesser General Public License for more details.
15 
16  You should have received a copy of the GNU Lesser General Public
17  License along with this library. If not, see <http://www.gnu.org/licenses/>.
18 */
19 #ifndef KNEWSTUFF2_SECURITY_H
20 #define KNEWSTUFF2_SECURITY_H
21 
22 //qt includes
23 #include <QtCore/QMap>
24 #include <QtCore/QObject>
25 #include <QtCore/QProcess>
26 
27 struct KeyStruct {
28  QString id;
29  QString name;
30  QString mail;
31  bool trusted;
32  bool secret;
33 };
34 
35 class KProcess;
36 namespace KNS3
37 {
38 
47 class Security : public QObject
48 {
49  Q_OBJECT
50 public:
51  static Security* ref() {
52  static Security *m_ref;
53  if (!m_ref) m_ref = new Security();
54  return m_ref;
55  }
56  ~Security();
57 
58 
64  void checkValidity(const QString &fileName);
65 
72  void signFile(const QString &fileName);
73 
80  KeyStruct signatureKey() {
81  return m_signatureKey;
82  }
83 
84  enum Results {
85  MD5_OK = 1,
86  SIGNED_OK = 2,
87  SIGNED_BAD = 4,
88  TRUSTED = 8,
89  UNKNOWN = 16,
90  SIGNED_BAD_CLEAR = 27,
91  BAD_PASSPHRASE = 32
92  };
93 
94 public Q_SLOTS:
95 
97  void readKeys();
98 
100  void readSecretKeys();
101 
104  void slotCheckValidity();
105 
109  void slotSignFile();
110 
111 private:
112  Security();
113 
114  enum RunMode {
115  List = 0,
116  ListSecret,
117  Verify,
118  Sign
119  };
120 
121  KeyStruct m_signatureKey;
122  int m_result;
123  int m_runMode;
124  bool m_gpgRunning;
125  bool m_keysRead;
126  QMap<QString, KeyStruct> m_keys;
127  QString m_fileName;
128  QString m_secretKey;
129  KProcess *m_process;
130 
131 private Q_SLOTS:
132  void slotFinished(int exitCode, QProcess::ExitStatus exitStatus);
133  void slotReadyReadStandardOutput();
134 
135 Q_SIGNALS:
140  void validityResult(int result);
141 
146  void fileSigned(int result);
147 };
148 
149 }
150 
151 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Jul 16 2013 11:49:30 by doxygen 1.8.1.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KNewStuff

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

kdelibs-4.10.5 API Reference

Skip menu "kdelibs-4.10.5 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal