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

kleopatra

  • sources
  • kde-4.14
  • kdepim
  • kleopatra
  • crypto
signencryptfilescontroller.cpp
Go to the documentation of this file.
1 /* -*- mode: c++; c-basic-offset:4 -*-
2  crypto/signencryptfilescontroller.cpp
3 
4  This file is part of Kleopatra, the KDE keymanager
5  Copyright (c) 2007 Klarälvdalens Datakonsult AB
6 
7  Kleopatra is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  Kleopatra is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21  In addition, as a special exception, the copyright holders give
22  permission to link the code of this program with any edition of
23  the Qt library by Trolltech AS, Norway (or with modified versions
24  of Qt that use the same license as Qt), and distribute linked
25  combinations including the two. You must obey the GNU General
26  Public License in all respects for all of the code used other than
27  Qt. If you modify this file, you may extend this exception to
28  your version of the file, but you are not obligated to do so. If
29  you do not wish to do so, delete this exception statement from
30  your version.
31 */
32 
33 #include <config-kleopatra.h>
34 
35 #include "signencryptfilescontroller.h"
36 
37 #include "signencryptfilestask.h"
38 #include "certificateresolver.h"
39 
40 #include <crypto/gui/newsignencryptfileswizard.h>
41 #include <crypto/taskcollection.h>
42 
43 #include <utils/input.h>
44 #include <utils/output.h>
45 #include <utils/classify.h>
46 #include <utils/kleo_assert.h>
47 #include <utils/archivedefinition.h>
48 
49 #include <kleo/stl_util.h>
50 #include <kleo/exception.h>
51 
52 #include <kmime/kmime_header_parsing.h>
53 
54 #include <KLocalizedString>
55 #include <kdebug.h>
56 
57 #include <QPointer>
58 #include <QTimer>
59 #include <QFileInfo>
60 
61 #ifndef Q_MOC_RUN
62 #include <boost/bind.hpp>
63 #endif
64 
65 using namespace Kleo;
66 using namespace Kleo::Crypto;
67 using namespace Kleo::Crypto::Gui;
68 using namespace boost;
69 using namespace GpgME;
70 using namespace KMime::Types;
71 
72 namespace {
73 
74  struct is_dir : std::unary_function<QString,bool> {
75  bool operator()( const QString & file ) const {
76  return QFileInfo( file ).isDir();
77  }
78  };
79 
80 }
81 
82 static bool contains_dir( const QStringList & files ) {
83  return kdtools::any( files, is_dir() );
84 }
85 
86 
87 class SignEncryptFilesController::Private {
88  friend class ::Kleo::Crypto::SignEncryptFilesController;
89  SignEncryptFilesController * const q;
90 public:
91  explicit Private( SignEncryptFilesController * qq );
92  ~Private();
93 
94 private:
95  void slotWizardOperationPrepared();
96  void slotWizardCanceled();
97 
98 private:
99  void ensureWizardCreated();
100  void ensureWizardVisible();
101  void updateWizardMode();
102  void cancelAllTasks();
103  void reportError( int err, const QString & details ) {
104  q->setLastError( err, details );
105  q->emitDoneOrError();
106  }
107 
108  void schedule();
109  shared_ptr<SignEncryptFilesTask> takeRunnable( GpgME::Protocol proto );
110 
111  static void assertValidOperation( unsigned int );
112  static QString titleForOperation( unsigned int op );
113 private:
114  std::vector< shared_ptr<SignEncryptFilesTask> > runnable, completed;
115  shared_ptr<SignEncryptFilesTask> cms, openpgp;
116  QPointer<NewSignEncryptFilesWizard> wizard;
117  QStringList files;
118  unsigned int operation;
119  Protocol protocol;
120 };
121 
122 SignEncryptFilesController::Private::Private( SignEncryptFilesController * qq )
123  : q( qq ),
124  runnable(),
125  cms(),
126  openpgp(),
127  wizard(),
128  files(),
129  operation( SignAllowed|EncryptAllowed|ArchiveAllowed ),
130  protocol( UnknownProtocol )
131 {
132 
133 }
134 
135 SignEncryptFilesController::Private::~Private() { kDebug(); }
136 
137 QString SignEncryptFilesController::Private::titleForOperation( unsigned int op ) {
138  const bool signDisallowed = (op & SignMask) == SignDisallowed;
139  const bool encryptDisallowed = (op & EncryptMask) == EncryptDisallowed;
140  const bool archiveForced = (op & ArchiveMask) == ArchiveForced;
141 
142  kleo_assert( !signDisallowed || !encryptDisallowed );
143 
144  if ( !signDisallowed && encryptDisallowed ) {
145  if ( archiveForced )
146  return i18n( "Archive and Sign Files" );
147  else
148  return i18n( "Sign Files" );
149  }
150 
151  if ( signDisallowed && !encryptDisallowed ) {
152  if ( archiveForced )
153  return i18n( "Archive and Encrypt Files" );
154  else
155  return i18n( "Encrypt Files" );
156  }
157 
158  if ( archiveForced )
159  return i18n( "Archive and Sign/Encrypt Files" );
160  else
161  return i18n( "Sign/Encrypt Files" );
162 }
163 
164 SignEncryptFilesController::SignEncryptFilesController( QObject * p )
165  : Controller( p ), d( new Private( this ) )
166 {
167 
168 }
169 
170 SignEncryptFilesController::SignEncryptFilesController( const shared_ptr<const ExecutionContext> & ctx, QObject * p )
171  : Controller( ctx, p ), d( new Private( this ) )
172 {
173 
174 }
175 
176 SignEncryptFilesController::~SignEncryptFilesController() {
177  kDebug();
178  if ( d->wizard && !d->wizard->isVisible() )
179  delete d->wizard;
180  //d->wizard->close(); ### ?
181 }
182 
183 void SignEncryptFilesController::setProtocol( Protocol proto ) {
184  kleo_assert( d->protocol == UnknownProtocol ||
185  d->protocol == proto );
186  d->protocol = proto;
187  d->ensureWizardCreated();
188  d->wizard->setPresetProtocol( proto );
189 }
190 
191 Protocol SignEncryptFilesController::protocol() const {
192  return d->protocol;
193 }
194 
195 // static
196 void SignEncryptFilesController::Private::assertValidOperation( unsigned int op ) {
197  kleo_assert( ( op & SignMask ) == SignDisallowed ||
198  ( op & SignMask ) == SignAllowed ||
199  ( op & SignMask ) == SignForced );
200  kleo_assert( ( op & EncryptMask ) == EncryptDisallowed ||
201  ( op & EncryptMask ) == EncryptAllowed ||
202  ( op & EncryptMask ) == EncryptForced );
203  kleo_assert( ( op & ArchiveMask ) == ArchiveDisallowed ||
204  ( op & ArchiveMask ) == ArchiveAllowed ||
205  ( op & ArchiveMask ) == ArchiveForced );
206  kleo_assert( ( op & ~(SignMask|EncryptMask|ArchiveMask) ) == 0 );
207 }
208 
209 void SignEncryptFilesController::setOperationMode( unsigned int mode ) {
210  Private::assertValidOperation( mode );
211  if ( contains_dir( d->files ) )
212  mode = mode & ~ArchiveMask | ArchiveForced;
213  d->operation = mode;
214  d->updateWizardMode();
215 }
216 
217 void SignEncryptFilesController::Private::updateWizardMode() {
218  if ( !wizard )
219  return;
220  wizard->setWindowTitle( titleForOperation( operation ) );
221  const unsigned int signOp = (operation & SignMask);
222  const unsigned int encrOp = (operation & EncryptMask);
223  const unsigned int archOp = (operation & ArchiveMask);
224  switch ( signOp ) {
225  case SignForced:
226  case SignDisallowed:
227  wizard->setSigningPreset( signOp == SignForced );
228  wizard->setSigningUserMutable( false );
229  break;
230  default:
231  assert( !"Should not happen" );
232  case SignAllowed:
233  wizard->setSigningPreset( encrOp == EncryptDisallowed );
234  wizard->setSigningUserMutable( true );
235  break;
236  }
237  switch ( encrOp ) {
238  case EncryptForced:
239  case EncryptDisallowed:
240  wizard->setEncryptionPreset( encrOp == EncryptForced );
241  wizard->setEncryptionUserMutable( false );
242  break;
243  default:
244  assert( !"Should not happen" );
245  case EncryptAllowed:
246  wizard->setEncryptionPreset( true );
247  wizard->setEncryptionUserMutable( true );
248  break;
249  }
250  switch ( archOp ) {
251  case ArchiveForced:
252  case ArchiveDisallowed:
253  wizard->setCreateArchivePreset( archOp == ArchiveForced );
254  wizard->setCreateArchiveUserMutable( false );
255  break;
256  default:
257  assert( !"Shouldn't happen" );
258  case ArchiveAllowed:
259  wizard->setCreateArchivePreset( false );
260  wizard->setEncryptionUserMutable( true );
261  break;
262  };
263 }
264 
265 unsigned int SignEncryptFilesController::operationMode() const {
266  return d->operation;
267 }
268 
269 void SignEncryptFilesController::setFiles( const QStringList & files ) {
270  kleo_assert( !files.empty() );
271  d->files = files;
272  if ( contains_dir( files ) )
273  setOperationMode( ( operationMode() & ~ArchiveMask ) | ArchiveForced );
274  d->ensureWizardCreated();
275  d->wizard->setFiles( files );
276 }
277 
278 void SignEncryptFilesController::Private::slotWizardCanceled() {
279  kDebug();
280  reportError( gpg_error( GPG_ERR_CANCELED ), i18n("User cancel") );
281 }
282 
283 void SignEncryptFilesController::start() {
284  d->ensureWizardVisible();
285 }
286 
287 static const char * extension( bool pgp, bool sign, bool encrypt, bool ascii, bool detached ) {
288  unsigned int cls = pgp ? Class::OpenPGP : Class::CMS ;
289  if ( encrypt )
290  cls |= Class::CipherText;
291  else if ( sign )
292  cls |= detached ? Class::DetachedSignature : Class::OpaqueSignature ;
293  cls |= ascii ? Class::Ascii : Class::Binary ;
294  if ( const char * const ext = outputFileExtension( cls ) )
295  return ext;
296  else
297  return "out";
298 }
299 
300 static shared_ptr<SignEncryptFilesTask>
301 createSignEncryptTaskForFileInfo( const QFileInfo & fi, bool pgp, bool sign, bool encrypt, bool ascii, bool removeUnencrypted, const std::vector<Key> & recipients, const std::vector<Key> & signers ) {
302  const shared_ptr<SignEncryptFilesTask> task( new SignEncryptFilesTask );
303  task->setSign( sign );
304  task->setEncrypt( encrypt );
305  task->setAsciiArmor( ascii );
306  task->setRemoveInputFileOnSuccess( removeUnencrypted );
307  if ( sign ) {
308  task->setSigners( signers );
309  task->setDetachedSignature( true );
310  }
311  if ( encrypt )
312  task->setRecipients( recipients );
313 
314  const QString input = fi.absoluteFilePath();
315  task->setInputFileName( input );
316  task->setInput( Input::createFromFile( input ) );
317 
318  const char * const ext = extension( pgp, sign, encrypt, ascii, true );
319  kleo_assert( ext );
320 
321  const QString output = input + QLatin1Char('.') + QLatin1String(ext);
322  task->setOutputFileName( output );
323 
324  return task;
325 }
326 
327 static shared_ptr<SignEncryptFilesTask>
328 createArchiveSignEncryptTaskForFiles( const QStringList & files, const QString & outputFileBaseName, const shared_ptr<ArchiveDefinition> & ad, bool pgp, bool sign, bool encrypt, bool ascii, bool removeUnencrypted, const std::vector<Key> & recipients, const std::vector<Key> & signers ) {
329  const shared_ptr<SignEncryptFilesTask> task( new SignEncryptFilesTask );
330  task->setSign( sign );
331  task->setEncrypt( encrypt );
332  task->setAsciiArmor( ascii );
333  task->setRemoveInputFileOnSuccess( removeUnencrypted );
334  if ( sign ) {
335  task->setSigners( signers );
336  task->setDetachedSignature( false );
337  }
338  if ( encrypt )
339  task->setRecipients( recipients );
340 
341  kleo_assert( ad );
342 
343  const Protocol proto = pgp ? OpenPGP : CMS ;
344 
345  task->setInputFileNames( files );
346  task->setInput( ad->createInputFromPackCommand( proto, files ) );
347 
348  const char * const ext = extension( pgp, sign, encrypt, ascii, false );
349  kleo_assert( ext );
350  kleo_assert( !ad->extensions( proto ).empty() );
351 
352  task->setOutputFileName( outputFileBaseName + QLatin1Char('.') + QLatin1String(ext) );
353 
354  return task;
355 }
356 
357 static std::vector< shared_ptr<SignEncryptFilesTask> >
358 createSignEncryptTasksForFileInfo( const QFileInfo & fi, bool sign, bool encrypt, bool ascii, bool removeUnencrypted, const std::vector<Key> & pgpRecipients, const std::vector<Key> & pgpSigners, const std::vector<Key> & cmsRecipients, const std::vector<Key> & cmsSigners ) {
359  std::vector< shared_ptr<SignEncryptFilesTask> > result;
360 
361  const bool shallPgpSign = sign && !pgpSigners.empty();
362  const bool shallPgpEncrypt = encrypt && !pgpRecipients.empty();
363  const bool pgp = ( shallPgpEncrypt && ( !sign || shallPgpSign ) ) || ( !encrypt && shallPgpSign );
364 
365  const bool shallCmsSign = sign && !cmsSigners.empty();
366  const bool shallCmsEncrypt = encrypt && !cmsRecipients.empty();
367  const bool cms = ( shallCmsEncrypt && ( !sign || shallCmsSign ) ) || ( !encrypt && shallCmsSign );
368 
369  result.reserve( pgp + cms );
370 
371  if ( pgp )
372  result.push_back( createSignEncryptTaskForFileInfo( fi, true, sign, encrypt, ascii, removeUnencrypted, pgpRecipients, pgpSigners ) );
373  if ( cms )
374  result.push_back( createSignEncryptTaskForFileInfo( fi, false, sign, encrypt, ascii, removeUnencrypted, cmsRecipients, cmsSigners ) );
375 
376  return result;
377 }
378 
379 static std::vector< shared_ptr<SignEncryptFilesTask> >
380 createArchiveSignEncryptTasksForFiles( const QStringList & files, const QString & pgpOutputFileBaseName, const QString & cmsOutputFileBaseName, const shared_ptr<ArchiveDefinition> & ad, bool sign, bool encrypt, bool ascii, bool removeUnencrypted, const std::vector<Key> & pgpRecipients, const std::vector<Key> & pgpSigners, const std::vector<Key> & cmsRecipients, const std::vector<Key> & cmsSigners ) {
381  std::vector< shared_ptr<SignEncryptFilesTask> > result;
382 
383  const bool shallPgpSign = sign && !pgpSigners.empty();
384  const bool shallPgpEncrypt = encrypt && !pgpRecipients.empty();
385  const bool pgp = ( shallPgpEncrypt && ( !sign || shallPgpSign )) || ( !encrypt && shallPgpSign );
386 
387  const bool shallCmsSign = sign && !cmsSigners.empty();
388  const bool shallCmsEncrypt = encrypt && !cmsRecipients.empty();
389  const bool cms = ( shallCmsEncrypt && ( !sign || shallCmsSign )) || ( !encrypt && shallCmsSign );
390 
391  result.reserve( pgp + cms );
392 
393  if ( pgp )
394  result.push_back( createArchiveSignEncryptTaskForFiles( files, pgpOutputFileBaseName, ad, true, sign, encrypt, ascii, removeUnencrypted, pgpRecipients, pgpSigners ) );
395  if ( cms )
396  result.push_back( createArchiveSignEncryptTaskForFiles( files, cmsOutputFileBaseName, ad, false, sign, encrypt, ascii, removeUnencrypted, cmsRecipients, cmsSigners ) );
397 
398  return result;
399 }
400 
401 void SignEncryptFilesController::Private::slotWizardOperationPrepared() {
402 
403  try {
404 
405  kleo_assert( wizard );
406  kleo_assert( !files.empty() );
407 
408  const bool archive = wizard->isCreateArchiveSelected();
409 
410  const bool sign = wizard->isSigningSelected();
411  const bool encrypt = wizard->isEncryptionSelected();
412 
413  const bool ascii = wizard->isAsciiArmorEnabled();
414  const bool removeUnencrypted = wizard->isRemoveUnencryptedFilesEnabled();
415 
416  std::vector<Key> pgpRecipients, cmsRecipients, pgpSigners, cmsSigners;
417  if ( encrypt ) {
418  const std::vector<Key> recipients = wizard->resolvedRecipients();
419  kdtools::copy_if( recipients.begin(), recipients.end(),
420  std::back_inserter( pgpRecipients ),
421  boost::bind( &Key::protocol, _1 ) == GpgME::OpenPGP );
422  kdtools::copy_if( recipients.begin(), recipients.end(),
423  std::back_inserter( cmsRecipients ),
424  boost::bind( &Key::protocol, _1 ) == GpgME::CMS );
425  kleo_assert( pgpRecipients.size() + cmsRecipients.size() == recipients.size() );
426  }
427  if ( sign ) {
428  const std::vector<Key> signers = wizard->resolvedSigners();
429  kdtools::copy_if( signers.begin(), signers.end(),
430  std::back_inserter( pgpSigners ),
431  boost::bind( &Key::protocol, _1 ) == GpgME::OpenPGP );
432  kdtools::copy_if( signers.begin(), signers.end(),
433  std::back_inserter( cmsSigners ),
434  boost::bind( &Key::protocol, _1 ) == GpgME::CMS );
435  kleo_assert( pgpSigners.size() + cmsSigners.size() == signers.size() );
436  }
437 
438  std::vector< shared_ptr<SignEncryptFilesTask> > tasks;
439  if ( !archive )
440  tasks.reserve( files.size() );
441 
442  if ( archive )
443  tasks = createArchiveSignEncryptTasksForFiles( files,
444  wizard->archiveFileName( OpenPGP ),
445  wizard->archiveFileName( CMS ),
446  wizard->selectedArchiveDefinition(),
447  sign, encrypt, ascii, removeUnencrypted,
448  pgpRecipients, pgpSigners, cmsRecipients, cmsSigners );
449  else
450  Q_FOREACH( const QString & file, files ) {
451  const std::vector< shared_ptr<SignEncryptFilesTask> > created =
452  createSignEncryptTasksForFileInfo( QFileInfo( file ), sign, encrypt, ascii, removeUnencrypted, pgpRecipients, pgpSigners, cmsRecipients, cmsSigners );
453  tasks.insert( tasks.end(), created.begin(), created.end() );
454  }
455 
456  const shared_ptr<OverwritePolicy> overwritePolicy( new OverwritePolicy( wizard ) );
457  Q_FOREACH( const shared_ptr<SignEncryptFilesTask> & i, tasks )
458  i->setOverwritePolicy( overwritePolicy );
459 
460  kleo_assert( runnable.empty() );
461 
462  runnable.swap( tasks );
463 
464  Q_FOREACH( const shared_ptr<Task> task, runnable )
465  q->connectTask( task );
466 
467  shared_ptr<TaskCollection> coll( new TaskCollection );
468  std::vector<shared_ptr<Task> > tmp;
469  std::copy( runnable.begin(), runnable.end(), std::back_inserter( tmp ) );
470  coll->setTasks( tmp );
471  wizard->setTaskCollection( coll );
472 
473  QTimer::singleShot( 0, q, SLOT(schedule()) );
474 
475  } catch ( const Kleo::Exception & e ) {
476  reportError( e.error().encodedError(), e.message() );
477  } catch ( const std::exception & e ) {
478  reportError( gpg_error( GPG_ERR_UNEXPECTED ),
479  i18n("Caught unexpected exception in SignEncryptFilesController::Private::slotWizardOperationPrepared: %1",
480  QString::fromLocal8Bit( e.what() ) ) );
481  } catch ( ... ) {
482  reportError( gpg_error( GPG_ERR_UNEXPECTED ),
483  i18n("Caught unknown exception in SignEncryptFilesController::Private::slotWizardOperationPrepared") );
484  }
485 }
486 
487 void SignEncryptFilesController::Private::schedule() {
488 
489  if ( !cms )
490  if ( const shared_ptr<SignEncryptFilesTask> t = takeRunnable( CMS ) ) {
491  t->start();
492  cms = t;
493  }
494 
495  if ( !openpgp )
496  if ( const shared_ptr<SignEncryptFilesTask> t = takeRunnable( OpenPGP ) ) {
497  t->start();
498  openpgp = t;
499  }
500 
501  if ( !cms && !openpgp ) {
502  kleo_assert( runnable.empty() );
503  q->emitDoneOrError();
504  }
505 }
506 
507 shared_ptr<SignEncryptFilesTask> SignEncryptFilesController::Private::takeRunnable( GpgME::Protocol proto ) {
508  const std::vector< shared_ptr<SignEncryptFilesTask> >::iterator it
509  = std::find_if( runnable.begin(), runnable.end(),
510  boost::bind( &Task::protocol, _1 ) == proto );
511  if ( it == runnable.end() )
512  return shared_ptr<SignEncryptFilesTask>();
513 
514  const shared_ptr<SignEncryptFilesTask> result = *it;
515  runnable.erase( it );
516  return result;
517 }
518 
519 void SignEncryptFilesController::doTaskDone( const Task * task, const shared_ptr<const Task::Result> & result )
520 {
521  Q_UNUSED( result )
522  assert( task );
523 
524  // We could just delete the tasks here, but we can't use
525  // Qt::QueuedConnection here (we need sender()) and other slots
526  // might not yet have executed. Therefore, we push completed tasks
527  // into a burial container
528 
529  if ( task == d->cms.get() ) {
530  d->completed.push_back( d->cms );
531  d->cms.reset();
532  } else if ( task == d->openpgp.get() ) {
533  d->completed.push_back( d->openpgp );
534  d->openpgp.reset();
535  }
536 
537  QTimer::singleShot( 0, this, SLOT(schedule()) );
538 }
539 
540 void SignEncryptFilesController::cancel() {
541  kDebug();
542  try {
543  if ( d->wizard )
544  d->wizard->close();
545  d->cancelAllTasks();
546  } catch ( const std::exception & e ) {
547  kDebug() << "Caught exception: " << e.what();
548  }
549 }
550 
551 void SignEncryptFilesController::Private::cancelAllTasks() {
552 
553  // we just kill all runnable tasks - this will not result in
554  // signal emissions.
555  runnable.clear();
556 
557  // a cancel() will result in a call to
558  if ( cms )
559  cms->cancel();
560  if ( openpgp )
561  openpgp->cancel();
562 }
563 
564 void SignEncryptFilesController::Private::ensureWizardCreated() {
565  if ( wizard )
566  return;
567 
568  std::auto_ptr<NewSignEncryptFilesWizard> w( new NewSignEncryptFilesWizard );
569  w->setAttribute( Qt::WA_DeleteOnClose );
570 
571  connect( w.get(), SIGNAL(operationPrepared()), q, SLOT(slotWizardOperationPrepared()), Qt::QueuedConnection );
572  connect( w.get(), SIGNAL(rejected()), q, SLOT(slotWizardCanceled()), Qt::QueuedConnection );
573  wizard = w.release();
574 
575  updateWizardMode();
576 }
577 
578 void SignEncryptFilesController::Private::ensureWizardVisible() {
579  ensureWizardCreated();
580  q->bringToForeground( wizard );
581 }
582 
583 #include "moc_signencryptfilescontroller.cpp"
584 
585 
Kleo::Crypto::SignEncryptFilesController::setOperationMode
void setOperationMode(unsigned int mode)
Definition: signencryptfilescontroller.cpp:209
Kleo::outputFileExtension
const char * outputFileExtension(unsigned int classification)
Definition: classify.cpp:294
output.h
input.h
contains_dir
static bool contains_dir(const QStringList &files)
Definition: signencryptfilescontroller.cpp:82
Kleo::Class::DetachedSignature
Definition: classify.h:62
newsignencryptfileswizard.h
Kleo::Crypto::Task
Definition: task.h:57
QPointer< NewSignEncryptFilesWizard >
classify.h
Kleo::Class::CipherText
Definition: classify.h:68
Kleo::Crypto::SignEncryptFilesController::setFiles
void setFiles(const QStringList &files)
Definition: signencryptfilescontroller.cpp:269
Kleo::OverwritePolicy
Definition: output.h:52
Kleo::Class::Ascii
Definition: classify.h:56
Kleo::Crypto::SignEncryptFilesController::start
void start()
Definition: signencryptfilescontroller.cpp:283
kleo_assert.h
boost::shared_ptr
Definition: encryptemailcontroller.h:51
QString::fromLocal8Bit
QString fromLocal8Bit(const char *str, int size)
d
#define d
Definition: adduseridcommand.cpp:89
Kleo::Crypto::SignEncryptFilesController::~SignEncryptFilesController
~SignEncryptFilesController()
Definition: signencryptfilescontroller.cpp:176
QList::empty
bool empty() const
QTimer
QFileInfo::isDir
bool isDir() const
QObject
signencryptfilescontroller.h
Kleo::Class::OpenPGP
Definition: classify.h:49
QFileInfo::absoluteFilePath
QString absoluteFilePath() const
Kleo::Crypto::SignEncryptFilesController::protocol
GpgME::Protocol protocol() const
Definition: signencryptfilescontroller.cpp:191
kdtools::pimpl_ptr::get
T * get()
Definition: pimpl_ptr.h:39
Kleo::Class::CMS
Definition: classify.h:48
Kleo::Input::createFromFile
static boost::shared_ptr< Input > createFromFile(const QString &filename, bool dummy=false)
Definition: input.cpp:199
QString
Kleo::Class::OpaqueSignature
Definition: classify.h:63
QStringList
archivedefinition.h
createArchiveSignEncryptTasksForFiles
static std::vector< shared_ptr< SignEncryptFilesTask > > createArchiveSignEncryptTasksForFiles(const QStringList &files, const QString &pgpOutputFileBaseName, const QString &cmsOutputFileBaseName, const shared_ptr< ArchiveDefinition > &ad, bool sign, bool encrypt, bool ascii, bool removeUnencrypted, const std::vector< Key > &pgpRecipients, const std::vector< Key > &pgpSigners, const std::vector< Key > &cmsRecipients, const std::vector< Key > &cmsSigners)
Definition: signencryptfilescontroller.cpp:380
createArchiveSignEncryptTaskForFiles
static shared_ptr< SignEncryptFilesTask > createArchiveSignEncryptTaskForFiles(const QStringList &files, const QString &outputFileBaseName, const shared_ptr< ArchiveDefinition > &ad, bool pgp, bool sign, bool encrypt, bool ascii, bool removeUnencrypted, const std::vector< Key > &recipients, const std::vector< Key > &signers)
Definition: signencryptfilescontroller.cpp:328
QFileInfo
QLatin1Char
Kleo::Class::Binary
Definition: classify.h:55
kleo_assert
#define kleo_assert(cond)
Definition: kleo_assert.h:86
Kleo::Crypto::SignEncryptFilesController::setProtocol
void setProtocol(GpgME::Protocol proto)
Definition: signencryptfilescontroller.cpp:183
QLatin1String
Kleo::Crypto::SignEncryptFilesController::SignEncryptFilesController
SignEncryptFilesController(QObject *parent=0)
Definition: signencryptfilescontroller.cpp:164
Kleo::Crypto::SignEncryptFilesController::operationMode
unsigned int operationMode() const
Definition: signencryptfilescontroller.cpp:265
Kleo::Crypto::TaskCollection
Definition: taskcollection.h:51
q
#define q
Definition: adduseridcommand.cpp:90
Kleo::Crypto::SignEncryptFilesTask
Definition: signencryptfilestask.h:62
Kleo::Crypto::SignEncryptFilesController::cancel
void cancel()
Definition: signencryptfilescontroller.cpp:540
Kleo::Crypto::SignEncryptFilesController
Definition: signencryptfilescontroller.h:52
createSignEncryptTasksForFileInfo
static std::vector< shared_ptr< SignEncryptFilesTask > > createSignEncryptTasksForFileInfo(const QFileInfo &fi, bool sign, bool encrypt, bool ascii, bool removeUnencrypted, const std::vector< Key > &pgpRecipients, const std::vector< Key > &pgpSigners, const std::vector< Key > &cmsRecipients, const std::vector< Key > &cmsSigners)
Definition: signencryptfilescontroller.cpp:358
certificateresolver.h
Kleo::Crypto::Gui::NewSignEncryptFilesWizard
Definition: newsignencryptfileswizard.h:71
extension
static const char * extension(bool pgp, bool sign, bool encrypt, bool ascii, bool detached)
Definition: signencryptfilescontroller.cpp:287
Kleo::Crypto::SignEncryptFilesController::ArchiveForced
Definition: signencryptfilescontroller.h:78
Kleo::Crypto::Task::protocol
virtual GpgME::Protocol protocol() const =0
signencryptfilestask.h
Kleo::Crypto::Controller
Definition: controller.h:52
taskcollection.h
createSignEncryptTaskForFileInfo
static shared_ptr< SignEncryptFilesTask > createSignEncryptTaskForFileInfo(const QFileInfo &fi, bool pgp, bool sign, bool encrypt, bool ascii, bool removeUnencrypted, const std::vector< Key > &recipients, const std::vector< Key > &signers)
Definition: signencryptfilescontroller.cpp:301
QTimer::singleShot
singleShot
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:33:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kleopatra

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

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

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