37 #include "qgpgmedecryptverifyjob.h"
39 #include <qgpgme/eventloopinteractor.h>
40 #include <qgpgme/dataprovider.h>
42 #include <gpgmepp/context.h>
43 #include <gpgmepp/decryptionresult.h>
44 #include <gpgmepp/verificationresult.h>
45 #include <gpgmepp/data.h>
49 Kleo::QGpgMEDecryptVerifyJob::QGpgMEDecryptVerifyJob( GpgME::Context * context )
50 : DecryptVerifyJob( QGpgME::EventLoopInteractor::instance(),
"Kleo::QGpgMEDecryptVerifyJob" ),
51 QGpgMEJob( this, context )
56 Kleo::QGpgMEDecryptVerifyJob::~QGpgMEDecryptVerifyJob() {
59 void Kleo::QGpgMEDecryptVerifyJob::setup(
const TQByteArray & cipherText ) {
63 createInData( cipherText );
67 GpgME::Error Kleo::QGpgMEDecryptVerifyJob::start(
const TQByteArray & cipherText ) {
70 hookupContextToEventLoopInteractor();
72 const GpgME::Error err = mCtx->startCombinedDecryptionAndVerification( *mInData, *mOutData );
79 std::pair<GpgME::DecryptionResult,GpgME::VerificationResult>
80 Kleo::QGpgMEDecryptVerifyJob::exec(
const TQByteArray & cipherText, TQByteArray & plainText ) {
82 const std::pair<GpgME::DecryptionResult,GpgME::VerificationResult> result =
83 mCtx->decryptAndVerify( *mInData, *mOutData );
84 plainText = mOutDataDataProvider->data();
89 void Kleo::QGpgMEDecryptVerifyJob::doOperationDoneEvent(
const GpgME::Error & ) {
90 const GpgME::DecryptionResult dr = mCtx->decryptionResult();
91 const GpgME::VerificationResult vr = mCtx->verificationResult();
92 const TQByteArray plainText = mOutDataDataProvider->data();
94 emit result( dr, vr, plainText );
97 #include "qgpgmedecryptverifyjob.moc"