1
/**************************************************************************
2
* Copyright (C) 2009-2011 Matthias Fuchs <mat69@gmx.net> *
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. *
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. *
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
***************************************************************************/
20
#ifndef KGET_SIGNATURE_H
21
#define KGET_SIGNATURE_H
23
#include "../kget_export.h"
30
#include <gpgme++/verificationresult.h>
36
* @short Class to verify signatures
38
class KGET_EXPORT Signature : public QObject
42
friend class KeyDownloader;
43
friend class SignatureThread;
45
//TODO also support verification and decryption of files that contain the signature?
47
explicit Signature(const KUrl &dest, QObject *object = 0);
57
enum VerificationStatus
59
NoResult, //either not tried, or not enough information
60
NotWorked, //something during verification failed
63
VerifiedInformation, //verified, though the there is some additional information
64
VerifiedWarning //verified, though there is a warning
67
KUrl destination() const;
68
void setDestination(const KUrl &destination);
70
VerificationStatus status() const;
72
GpgME::VerificationResult verificationResult();
75
void downloadKey(QString fingerprint);
76
QByteArray signature();
77
void setAsciiDetatchedSignature(const QString &signature);
78
void setSignature(const QByteArray &signature, SignatureType type);
80
SignatureType type() const;
83
* The fingerprint of the signature//TODO get even without verification??
85
QString fingerprint();
89
void save(const QDomElement &element);
90
void load(const QDomElement &e);
93
void verified(int verificationStatus);
97
void slotVerified(const GpgME::VerificationResult &result);
101
class SignaturePrivate *d;
103
friend class SignaturePrivate;