• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kleopatra

decryptverifytask.h

Go to the documentation of this file.
00001 /* -*- mode: c++; c-basic-offset:4 -*-
00002     decryptverifytask.h
00003 
00004     This file is part of Kleopatra, the KDE keymanager
00005     Copyright (c) 2008 Klarälvdalens Datakonsult AB
00006 
00007     Kleopatra is free software; you can redistribute it and/or modify
00008     it under the terms of the GNU General Public License as published by
00009     the Free Software Foundation; either version 2 of the License, or
00010     (at your option) any later version.
00011 
00012     Kleopatra is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program; if not, write to the Free Software
00019     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00020 
00021     In addition, as a special exception, the copyright holders give
00022     permission to link the code of this program with any edition of
00023     the Qt library by Trolltech AS, Norway (or with modified versions
00024     of Qt that use the same license as Qt), and distribute linked
00025     combinations including the two.  You must obey the GNU General
00026     Public License in all respects for all of the code used other than
00027     Qt.  If you modify this file, you may extend this exception to
00028     your version of the file, but you are not obligated to do so.  If
00029     you do not wish to do so, delete this exception statement from
00030     your version.
00031 */
00032 
00033 #ifndef __KLEOPATRA_CRYPTO_DECRYPTVERIFYTASK_H__
00034 #define __KLEOPATRA_CRYPTO_DECRYPTVERIFYTASK_H__
00035 
00036 #include "task.h"
00037 
00038 #include <utils/types.h>
00039 
00040 #include <gpgme++/verificationresult.h>
00041 
00042 #include <boost/shared_ptr.hpp>
00043 
00044 
00045 namespace KMime {
00046 namespace Types {
00047     class Mailbox;
00048 }
00049 }
00050 namespace GpgME {
00051     class DecryptionResult;
00052     class VerificationResult;
00053     class Key;
00054     class Signature;
00055 }
00056 
00057 namespace Kleo {
00058 
00059 class Input;
00060 class Output;
00061 
00062 namespace Crypto {
00063 
00064     class DecryptVerifyResult;
00065 
00066     class AbstractDecryptVerifyTask : public Task {
00067         Q_OBJECT
00068     public:
00069         explicit AbstractDecryptVerifyTask( QObject* parent = 0 );
00070         virtual ~AbstractDecryptVerifyTask();
00071         virtual void autodetectProtocolFromInput() = 0;
00072 
00073         KMime::Types::Mailbox informativeSender() const;
00074         void setInformativeSender( const KMime::Types::Mailbox & senders );
00075 
00076     Q_SIGNALS:
00077         void decryptVerifyResult( const boost::shared_ptr<const Kleo::Crypto::DecryptVerifyResult> & );
00078 
00079     protected:
00080         boost::shared_ptr<DecryptVerifyResult> fromDecryptResult( const GpgME::DecryptionResult & dr, const QByteArray & plaintext, const QString & auditLog );
00081         boost::shared_ptr<DecryptVerifyResult> fromDecryptResult( const GpgME::Error & err, const QString& details, const QString & auditLog  );
00082         boost::shared_ptr<DecryptVerifyResult> fromDecryptVerifyResult( const GpgME::DecryptionResult & dr, const GpgME::VerificationResult & vr, const QByteArray & plaintext, const QString & auditLog );
00083         boost::shared_ptr<DecryptVerifyResult> fromDecryptVerifyResult( const GpgME::Error & err, const QString & what, const QString & auditLog  );
00084         boost::shared_ptr<DecryptVerifyResult> fromVerifyOpaqueResult( const GpgME::VerificationResult & vr, const QByteArray & plaintext, const QString & auditLog  );
00085         boost::shared_ptr<DecryptVerifyResult> fromVerifyOpaqueResult( const GpgME::Error & err, const QString & details, const QString & auditLog  );
00086         boost::shared_ptr<DecryptVerifyResult> fromVerifyDetachedResult( const GpgME::VerificationResult & vr, const QString & auditLog  );
00087         boost::shared_ptr<DecryptVerifyResult> fromVerifyDetachedResult( const GpgME::Error & err, const QString & details, const QString & auditLog  );
00088 
00089         virtual QString inputLabel() const = 0;
00090         virtual QString outputLabel() const = 0;
00091 
00092     private:
00093          class Private;
00094          kdtools::pimpl_ptr<Private> d;
00095     };
00096 
00097     class DecryptTask : public AbstractDecryptVerifyTask {
00098         Q_OBJECT
00099     public:
00100         explicit DecryptTask( QObject* parent = 0 );
00101         ~DecryptTask();
00102 
00103         void setInput( const boost::shared_ptr<Input> & input );
00104         void setOutput( const boost::shared_ptr<Output> & output );
00105 
00106         void setProtocol( GpgME::Protocol prot );
00107         void autodetectProtocolFromInput();
00108 
00109         /* reimp */ QString label() const;
00110 
00111         /* reimp */ GpgME::Protocol protocol() const;
00112 
00113     public Q_SLOTS:
00114          /* reimp */ void cancel();
00115 
00116     private:
00117         /* reimp */ void doStart();
00118         /* reimp */ QString inputLabel() const;
00119         /* reimp */ QString outputLabel() const;
00120         /* reimp */ unsigned long long inputSize() const;
00121 
00122     private:
00123          class Private;
00124          kdtools::pimpl_ptr<Private> d;
00125          Q_PRIVATE_SLOT( d, void slotResult( GpgME::DecryptionResult, QByteArray ) )
00126     };
00127 
00128     class VerifyDetachedTask : public AbstractDecryptVerifyTask {
00129         Q_OBJECT
00130     public:
00131         explicit VerifyDetachedTask( QObject* parent = 0 );
00132         ~VerifyDetachedTask();
00133 
00134         void setInput( const boost::shared_ptr<Input> & input );
00135         void setSignedData( const boost::shared_ptr<Input> & signedData );
00136 
00137         void setProtocol( GpgME::Protocol prot );
00138         void autodetectProtocolFromInput();
00139 
00140         /* reimp */ QString label() const;
00141 
00142         /* reimp */ GpgME::Protocol protocol() const;
00143 
00144     public Q_SLOTS:
00145          /* reimp */ void cancel();
00146 
00147     private:
00148         /* reimp */ void doStart();
00149         /* reimp */ QString inputLabel() const;
00150         /* reimp */ QString outputLabel() const;
00151         /* reimp */ unsigned long long inputSize() const;
00152 
00153     private:
00154          class Private;
00155          kdtools::pimpl_ptr<Private> d;
00156          Q_PRIVATE_SLOT( d, void slotResult( GpgME::VerificationResult ) )
00157     };
00158 
00159     class VerifyOpaqueTask : public AbstractDecryptVerifyTask {
00160         Q_OBJECT
00161     public:
00162         explicit VerifyOpaqueTask( QObject* parent = 0 );
00163         ~VerifyOpaqueTask();
00164 
00165         void setInput( const boost::shared_ptr<Input> & input );
00166         void setOutput( const boost::shared_ptr<Output> & output );
00167 
00168         void setProtocol( GpgME::Protocol prot );
00169         void autodetectProtocolFromInput();
00170 
00171         /* reimp */ QString label() const;
00172 
00173         /* reimp */ GpgME::Protocol protocol() const;
00174 
00175     public Q_SLOTS:
00176          /* reimp */ void cancel();
00177 
00178     private:
00179         /* reimp */ void doStart();
00180         /* reimp */ QString inputLabel() const;
00181         /* reimp */ QString outputLabel() const;
00182         /* reimp */ unsigned long long inputSize() const;
00183 
00184     private:
00185          class Private;
00186          kdtools::pimpl_ptr<Private> d;
00187          Q_PRIVATE_SLOT( d, void slotResult( GpgME::VerificationResult, QByteArray ) )
00188     };
00189 
00190     class DecryptVerifyTask : public AbstractDecryptVerifyTask {
00191         Q_OBJECT
00192     public:
00193         explicit DecryptVerifyTask( QObject* parent = 0 );
00194         ~DecryptVerifyTask();
00195 
00196         void setInput( const boost::shared_ptr<Input> & input );
00197         void setSignedData( const boost::shared_ptr<Input> & signedData );
00198         void setOutput( const boost::shared_ptr<Output> & output );
00199 
00200         void setProtocol( GpgME::Protocol prot );
00201         void autodetectProtocolFromInput();
00202 
00203         /* reimp */ QString label() const;
00204 
00205         /* reimp */ GpgME::Protocol protocol() const;
00206 
00207     public Q_SLOTS:
00208          /* reimp */ void cancel();
00209 
00210     private:
00211         /* reimp */ void doStart();
00212         /* reimp */ QString inputLabel() const;
00213         /* reimp */ QString outputLabel() const;
00214         /* reimp */ unsigned long long inputSize() const;
00215 
00216     private:
00217          class Private;
00218          kdtools::pimpl_ptr<Private> d;
00219          Q_PRIVATE_SLOT( d, void slotResult( GpgME::DecryptionResult, GpgME::VerificationResult, QByteArray ) )
00220     };
00221 
00222     class DecryptVerifyResult : public Task::Result {
00223         friend class ::Kleo::Crypto::AbstractDecryptVerifyTask;
00224     public:
00225         class SenderInfo;
00226 
00227         /* reimp */ QString overview() const;
00228         /* reimp */ QString details() const;
00229         /* reimp */ bool hasError() const;
00230         /* reimp */ int errorCode() const;
00231         /* reimp */ QString errorString() const;
00232         /* reimp */ VisualCode code() const;
00233         /* reimp */ QString auditLogAsHtml() const;
00234 
00235         GpgME::VerificationResult verificationResult() const;
00236 
00237         static const GpgME::Key & keyForSignature( const GpgME::Signature & sig, const std::vector<GpgME::Key> & keys );
00238 
00239 private:
00240         static QString keyToString( const GpgME::Key & key );
00241 
00242     private:
00243         DecryptVerifyResult();
00244         DecryptVerifyResult( const DecryptVerifyResult& );
00245         DecryptVerifyResult& operator=( const DecryptVerifyResult& other );
00246 
00247         DecryptVerifyResult( DecryptVerifyOperation op,
00248                   const GpgME::VerificationResult& vr,
00249                   const GpgME::DecryptionResult& dr,
00250                   const QByteArray& stuff,
00251                   int errCode,
00252                   const QString & errString,
00253                   const QString & inputLabel,
00254                   const QString & outputLabel,
00255                   const QString & auditLog,
00256                   const KMime::Types::Mailbox & informativeSender );
00257 
00258     private:
00259         class Private;
00260         kdtools::pimpl_ptr<Private> d;
00261     };
00262 }
00263 }
00264 
00265 #endif //__KLEOPATRA_CRYPTO_DECRYPTVERIFYTASK_H__

kleopatra

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

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  •   doc
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal