• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdenetwork API Reference
  • KDE Home
  • Contact Us
 

kget

  • sources
  • kde-4.12
  • kdenetwork
  • kget
  • core
signature.h
Go to the documentation of this file.
1 /**************************************************************************
2 * Copyright (C) 2009-2011 Matthias Fuchs <mat69@gmx.net> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
18 ***************************************************************************/
19 
20 #ifndef KGET_SIGNATURE_H
21 #define KGET_SIGNATURE_H
22 
23 #include "../kget_export.h"
24 
25 #include <KUrl>
26 
27 class QDomElement;
28 
29 #ifdef HAVE_QGPGME
30 #include <gpgme++/verificationresult.h>
31 #endif //HAVE_QGPGME
32 
38 class KGET_EXPORT Signature : public QObject
39 {
40  Q_OBJECT
41 
42  friend class KeyDownloader;
43  friend class SignatureThread;
44 
45 //TODO also support verification and decryption of files that contain the signature?
46  public:
47  explicit Signature(const KUrl &dest, QObject *object = 0);
48  ~Signature();
49 
50  enum SignatureType
51  {
52  NoType = 0,
53  AsciiDetached, //.asc
54  BinaryDetached //.sig
55  };
56 
57  enum VerificationStatus
58  {
59  NoResult, //either not tried, or not enough information
60  NotWorked, //something during verification failed
61  NotVerified,
62  Verified,
63  VerifiedInformation, //verified, though the there is some additional information
64  VerifiedWarning //verified, though there is a warning
65  };
66 
67  KUrl destination() const;
68  void setDestination(const KUrl &destination);
69 
70  VerificationStatus status() const;
71 #ifdef HAVE_QGPGME
72  GpgME::VerificationResult verificationResult();
73 #endif //HAVE_QGPGME
74 
75  void downloadKey(QString fingerprint);
76  QByteArray signature();
77  void setAsciiDetatchedSignature(const QString &signature);
78  void setSignature(const QByteArray &signature, SignatureType type);
79 
80  SignatureType type() const;
81 
85  QString fingerprint();
86  bool isVerifyable();
87  void verify();
88 
89  void save(const QDomElement &element);
90  void load(const QDomElement &e);
91 
92  signals:
93  void verified(int verificationStatus);
94 
95  private slots:
96 #ifdef HAVE_QGPGME
97  void slotVerified(const GpgME::VerificationResult &result);
98 #endif //HAVE_QGPGME
99 
100  private:
101  class SignaturePrivate *d;
102 
103  friend class SignaturePrivate;
104 };
105 
106 #endif
KeyDownloader
Class to download Keys.
Definition: keydownloader.h:34
Signature::AsciiDetached
Definition: signature.h:53
SignaturePrivate
Definition: signature_p.h:26
Signature::SignatureType
SignatureType
Definition: signature.h:50
Signature::VerifiedInformation
Definition: signature.h:63
QObject
Signature::Verified
Definition: signature.h:62
Signature::NotWorked
Definition: signature.h:60
Signature::NoResult
Definition: signature.h:59
Signature::NotVerified
Definition: signature.h:61
SignatureThread
Definition: signaturethread.h:32
SignatureThread::verify
void verify(const KUrl &dest, const QByteArray &sig)
Definition: signaturethread.cpp:49
Signature
Class to verify signatures.
Definition: signature.h:38
KGET_EXPORT
#define KGET_EXPORT
Definition: kget_export.h:24
Signature::VerificationStatus
VerificationStatus
Definition: signature.h:57
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:17 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kget

Skip menu "kget"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

Search



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