37#include "qgpgmeverifydetachedjob.h"
39#include <qgpgme/eventloopinteractor.h>
40#include <qgpgme/dataprovider.h>
42#include <gpgmepp/context.h>
43#include <gpgmepp/verificationresult.h>
44#include <gpgmepp/data.h>
48Kleo::QGpgMEVerifyDetachedJob::QGpgMEVerifyDetachedJob( GpgME::Context * context )
49 : VerifyDetachedJob( QGpgME::EventLoopInteractor::instance(),
"Kleo::QGpgMEVerifyDetachedJob" ),
50 QGpgMEJob( this, context )
55Kleo::QGpgMEVerifyDetachedJob::~QGpgMEVerifyDetachedJob() {
58void Kleo::QGpgMEVerifyDetachedJob::setup(
const TQByteArray & signature,
const TQByteArray & signedData ) {
62 createInData( signature );
65 mOutDataDataProvider =
new QGpgME::TQByteArrayDataProvider( signedData );
66 mOutData =
new GpgME::Data( mOutDataDataProvider );
67 assert( !mOutData->isNull() );
70GpgME::Error Kleo::QGpgMEVerifyDetachedJob::start(
const TQByteArray & signature,
71 const TQByteArray & signedData ) {
72 setup( signature, signedData );
74 hookupContextToEventLoopInteractor();
76 const GpgME::Error err = mCtx->startDetachedSignatureVerification( *mInData, *mOutData );
83GpgME::VerificationResult Kleo::QGpgMEVerifyDetachedJob::exec(
const TQByteArray & signature,
84 const TQByteArray & signedData ) {
85 setup( signature, signedData );
86 const GpgME::VerificationResult r = mCtx->verifyDetachedSignature( *mInData, *mOutData );
91void Kleo::QGpgMEVerifyDetachedJob::doOperationDoneEvent(
const GpgME::Error & ) {
92 const GpgME::VerificationResult res = mCtx->verificationResult();
98#include "qgpgmeverifydetachedjob.moc"