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

kleopatra

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

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