• 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
newsignencryptemailcontroller.cpp
Go to the documentation of this file.
1 /* -*- mode: c++; c-basic-offset:4 -*-
2  crypto/newsignencryptemailcontroller.cpp
3 
4  This file is part of Kleopatra, the KDE keymanager
5  Copyright (c) 2009,2010 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 "newsignencryptemailcontroller.h"
36 
37 #include "encryptemailtask.h"
38 #include "signemailtask.h"
39 #include "taskcollection.h"
40 #include "sender.h"
41 #include "recipient.h"
42 
43 #include "emailoperationspreferences.h"
44 
45 #include <crypto/gui/signencryptemailconflictdialog.h>
46 
47 
48 #include <utils/input.h>
49 #include <utils/output.h>
50 #include <utils/kleo_assert.h>
51 
52 #include <kleo/stl_util.h>
53 #include <kleo/exception.h>
54 
55 #include <gpgme++/key.h>
56 
57 #include <kmime/kmime_header_parsing.h>
58 
59 #include <KLocalizedString>
60 #include <KDebug>
61 #include <KMessageBox>
62 
63 #include <QPointer>
64 #include <QTimer>
65 
66 #ifndef Q_MOC_RUN
67 #include <boost/bind.hpp>
68 #include <boost/shared_ptr.hpp>
69 #endif
70 
71 using namespace Kleo;
72 using namespace Kleo::Crypto;
73 using namespace Kleo::Crypto::Gui;
74 using namespace boost;
75 using namespace GpgME;
76 using namespace KMime::Types;
77 
78 //
79 // BEGIN Conflict Detection
80 //
81 
82 /*
83  This code implements the following conflict detection algortihm:
84 
85  1. There is no conflict if and only if we have a Perfect Match.
86  2. A Perfect Match is defined as:
87  a. either a Perfect OpenPGP-Match and not even a Partial S/MIME Match
88  b. or a Perfect S/MIME-Match and not even a Partial OpenPGP-Match
89  c. or a Perfect OpenPGP-Match and preselected protocol=OpenPGP
90  d. or a Perfect S/MIME-Match and preselected protocol=S/MIME
91  3. For Protocol \in {OpenPGP,S/MIME}, a Perfect Protocol-Match is defined as:
92  a. If signing, \foreach Sender, there is exactly one
93  Matching Protocol-Certificate with
94  i. can-sign=true
95  ii. has-secret=true
96  b. and, if encrypting, \foreach Recipient, there is exactly one
97  Matching Protocol-Certificate with
98  i. can-encrypt=true
99  ii. (validity is not considered, cf. msg 24059)
100  4. For Protocol \in {OpenPGP,S/MIME}, a Partial Protocol-Match is defined as:
101  a. If signing, \foreach Sender, there is at least one
102  Matching Protocol-Certificate with
103  i. can-sign=true
104  ii. has-secret=true
105  b. and, if encrypting, \foreach Recipient, there is at least
106  one Matching Protocol-Certificate with
107  i. can-encrypt=true
108  ii. (validity is not considered, cf. msg 24059)
109  5. For Protocol \in {OpenPGP,S/MIME}, a Matching Protocol-Certificate is
110  defined as matching by email-address. A revoked, disabled, or expired
111  certificate is not considered a match.
112  6. Sender is defined as those mailboxes that have been set with the SENDER
113  command.
114  7. Recipient is defined as those mailboxes that have been set with either the
115  SENDER or the RECIPIENT commands.
116 */
117 
118 namespace {
119 
120  struct count_signing_certificates {
121  typedef size_t result_type;
122  const Protocol proto;
123  explicit count_signing_certificates( Protocol proto ) : proto( proto ) {}
124  size_t operator()( const Sender & sender ) const {
125  const size_t result = sender.signingCertificateCandidates( proto ).size();
126  qDebug( "count_signing_certificates( %9s %20s ) == %2lu",
127  proto == OpenPGP ? "OpenPGP," : proto == CMS ? "CMS," : "<unknown>,",
128  qPrintable( sender.mailbox().prettyAddress() ), result );
129  return result;
130  }
131  };
132 
133  struct count_encrypt_certificates {
134  typedef size_t result_type;
135  const Protocol proto;
136  explicit count_encrypt_certificates( Protocol proto ) : proto( proto ) {}
137  size_t operator()( const Sender & sender ) const {
138  const size_t result = sender.encryptToSelfCertificateCandidates( proto ).size();
139  qDebug( "count_encrypt_certificates( %9s %20s ) == %2lu",
140  proto == OpenPGP ? "OpenPGP," : proto == CMS ? "CMS," : "<unknown>,",
141  qPrintable( sender.mailbox().prettyAddress() ), result );
142  return result;
143  }
144 
145  size_t operator()( const Recipient & recipient ) const {
146  const size_t result = recipient.encryptionCertificateCandidates( proto ).size();
147  qDebug( "count_encrypt_certificates( %9s %20s ) == %2lu",
148  proto == OpenPGP ? "OpenPGP," : proto == CMS ? "CMS," : "<unknown>,",
149  qPrintable( recipient.mailbox().prettyAddress() ), result );
150  return result;
151  }
152  };
153 
154 }
155 
156 static bool has_perfect_match( bool sign, bool encrypt, Protocol proto, const std::vector<Sender> & senders, const std::vector<Recipient> & recipients ) {
157  if ( sign )
158  if ( !kdtools::all( senders, boost::bind( count_signing_certificates( proto ), _1 ) == 1 ) )
159  return false;
160  if ( encrypt )
161  if ( !kdtools::all( senders, boost::bind( count_encrypt_certificates( proto ), _1 ) == 1 ) ||
162  !kdtools::all( recipients, boost::bind( count_encrypt_certificates( proto ), _1 ) == 1 ) )
163  return false;
164  return true;
165 }
166 
167 static bool has_partial_match( bool sign, bool encrypt, Protocol proto, const std::vector<Sender> & senders, const std::vector<Recipient> & recipients ) {
168  if ( sign )
169  if ( !kdtools::all( senders, boost::bind( count_signing_certificates( proto ), _1 ) >= 1 ) )
170  return false;
171  if ( encrypt )
172  if ( !kdtools::all( senders, boost::bind( count_encrypt_certificates( proto ), _1 ) >= 1 ) ||
173  !kdtools::all( recipients, boost::bind( count_encrypt_certificates( proto ), _1 ) >= 1 ) )
174  return false;
175  return true;
176 }
177 
178 static bool has_perfect_overall_match( bool sign, bool encrypt, const std::vector<Sender> & senders, const std::vector<Recipient> & recipients, Protocol presetProtocol ) {
179  return presetProtocol == OpenPGP && has_perfect_match( sign, encrypt, OpenPGP, senders, recipients )
180  || presetProtocol == CMS && has_perfect_match( sign, encrypt, CMS, senders, recipients )
181  || has_perfect_match( sign, encrypt, OpenPGP, senders, recipients ) && !has_partial_match( sign, encrypt, CMS, senders, recipients )
182  || has_perfect_match( sign, encrypt, CMS, senders, recipients ) && !has_partial_match( sign, encrypt, OpenPGP, senders, recipients ) ;
183 }
184 
185 static bool has_conflict( bool sign, bool encrypt, const std::vector<Sender> & senders, const std::vector<Recipient> & recipients, Protocol presetProtocol ) {
186  return !has_perfect_overall_match( sign, encrypt, senders, recipients, presetProtocol );
187 }
188 
189 //
190 // END Conflict Detection
191 //
192 
193 static std::vector<Sender> mailbox2sender( const std::vector<Mailbox> & mbs ) {
194  std::vector<Sender> senders;
195  senders.reserve( mbs.size() );
196  Q_FOREACH( const Mailbox & mb, mbs )
197  senders.push_back( Sender( mb ) );
198  return senders;
199 }
200 
201 static std::vector<Recipient> mailbox2recipient( const std::vector<Mailbox> & mbs ) {
202  std::vector<Recipient> recipients;
203  recipients.reserve( mbs.size() );
204  Q_FOREACH( const Mailbox & mb, mbs )
205  recipients.push_back( Recipient( mb ) );
206  return recipients;
207 }
208 
209 class NewSignEncryptEMailController::Private {
210  friend class ::Kleo::Crypto::NewSignEncryptEMailController;
211  NewSignEncryptEMailController * const q;
212 public:
213  explicit Private( NewSignEncryptEMailController * qq );
214  ~Private();
215 
216 private:
217  void slotDialogAccepted();
218  void slotDialogRejected();
219 
220 private:
221  void ensureDialogVisible();
222  void cancelAllTasks();
223 
224  void startSigning();
225  void startEncryption();
226  void schedule();
227  shared_ptr<Task> takeRunnable( GpgME::Protocol proto );
228 
229 private:
230  bool sign : 1;
231  bool encrypt : 1;
232  bool resolvingInProgress : 1;
233  bool certificatesResolved : 1;
234  bool detached : 1;
235  Protocol presetProtocol;
236  std::vector<Key> signers, recipients;
237  std::vector< shared_ptr<Task> > runnable, completed;
238  shared_ptr<Task> cms, openpgp;
239  QPointer<SignEncryptEMailConflictDialog> dialog;
240 };
241 
242 NewSignEncryptEMailController::Private::Private( NewSignEncryptEMailController * qq )
243  : q( qq ),
244  sign( false ),
245  encrypt( false ),
246  resolvingInProgress( false ),
247  certificatesResolved( false ),
248  detached( false ),
249  presetProtocol( UnknownProtocol ),
250  signers(),
251  recipients(),
252  runnable(),
253  cms(),
254  openpgp(),
255  dialog( new SignEncryptEMailConflictDialog )
256 {
257  connect( dialog, SIGNAL(accepted()), q, SLOT(slotDialogAccepted()) );
258  connect( dialog, SIGNAL(rejected()), q, SLOT(slotDialogRejected()) );
259 }
260 
261 NewSignEncryptEMailController::Private::~Private() {
262  delete dialog;
263 }
264 
265 NewSignEncryptEMailController::NewSignEncryptEMailController( const shared_ptr<ExecutionContext> & xc, QObject * p )
266  : Controller( xc, p ), d( new Private( this ) )
267 {
268 
269 }
270 
271 NewSignEncryptEMailController::NewSignEncryptEMailController( QObject * p )
272  : Controller( p ), d( new Private( this ) )
273 {
274 
275 }
276 
277 NewSignEncryptEMailController::~NewSignEncryptEMailController() { kDebug(); }
278 
279 void NewSignEncryptEMailController::setSubject( const QString & subject ) {
280  d->dialog->setSubject( subject );
281 }
282 
283 void NewSignEncryptEMailController::setProtocol( Protocol proto ) {
284  d->presetProtocol = proto;
285  d->dialog->setPresetProtocol( proto );
286 }
287 
288 Protocol NewSignEncryptEMailController::protocol() const {
289  return d->dialog->selectedProtocol();
290 }
291 
292 
293 const char * NewSignEncryptEMailController::protocolAsString() const {
294  switch ( protocol() ) {
295  case OpenPGP: return "OpenPGP";
296  case CMS: return "CMS";
297  default:
298  throw Kleo::Exception( gpg_error( GPG_ERR_INTERNAL ),
299  i18n("Call to NewSignEncryptEMailController::protocolAsString() is ambiguous.") );
300  }
301 }
302 
303 void NewSignEncryptEMailController::setSigning( bool sign ) {
304  d->sign = sign;
305  d->dialog->setSign( sign );
306 }
307 
308 bool NewSignEncryptEMailController::isSigning() const {
309  return d->sign;
310 }
311 
312 void NewSignEncryptEMailController::setEncrypting( bool encrypt ) {
313  d->encrypt = encrypt;
314  d->dialog->setEncrypt( encrypt );
315 }
316 
317 bool NewSignEncryptEMailController::isEncrypting() const {
318  return d->encrypt;
319 }
320 
321 void NewSignEncryptEMailController::setDetachedSignature( bool detached ) {
322  d->detached = detached;
323 }
324 
325 bool NewSignEncryptEMailController::isResolvingInProgress() const {
326  return d->resolvingInProgress;
327 }
328 
329 bool NewSignEncryptEMailController::areCertificatesResolved() const {
330  return d->certificatesResolved;
331 }
332 
333 static bool is_dialog_quick_mode( bool sign, bool encrypt ) {
334  const EMailOperationsPreferences prefs;
335  return ( !sign || prefs.quickSignEMail() )
336  && ( !encrypt || prefs.quickEncryptEMail() )
337  ;
338 }
339 
340 static void save_dialog_quick_mode( bool on ) {
341  EMailOperationsPreferences prefs;
342  prefs.setQuickSignEMail( on );
343  prefs.setQuickEncryptEMail( on );
344  prefs.writeConfig();
345 }
346 
347 void NewSignEncryptEMailController::startResolveCertificates( const std::vector<Mailbox> & r, const std::vector<Mailbox> & s ) {
348  d->certificatesResolved = false;
349  d->resolvingInProgress = true;
350 
351  const std::vector<Sender> senders = mailbox2sender( s );
352  const std::vector<Recipient> recipients = mailbox2recipient( r );
353  const bool quickMode = is_dialog_quick_mode( d->sign, d->encrypt );
354 
355  const bool conflict = quickMode && has_conflict( d->sign, d->encrypt, senders, recipients, d->presetProtocol );
356 
357  d->dialog->setQuickMode( quickMode );
358  d->dialog->setSenders( senders );
359  d->dialog->setRecipients( recipients );
360  d->dialog->pickProtocol();
361  d->dialog->setConflict( conflict );
362 
363  if ( quickMode && !conflict )
364  QMetaObject::invokeMethod( this, "slotDialogAccepted", Qt::QueuedConnection );
365  else
366  d->ensureDialogVisible();
367 }
368 
369 void NewSignEncryptEMailController::Private::slotDialogAccepted() {
370  if ( dialog->isQuickMode() != is_dialog_quick_mode( sign, encrypt ) )
371  save_dialog_quick_mode( dialog->isQuickMode() );
372  resolvingInProgress = false;
373  certificatesResolved = true;
374  signers = dialog->resolvedSigningKeys();
375  recipients = dialog->resolvedEncryptionKeys();
376  QMetaObject::invokeMethod( q, "certificatesResolved", Qt::QueuedConnection );
377 }
378 
379 void NewSignEncryptEMailController::Private::slotDialogRejected() {
380  resolvingInProgress = false;
381  certificatesResolved = false;
382  QMetaObject::invokeMethod( q, "error", Qt::QueuedConnection,
383  Q_ARG( int, gpg_error( GPG_ERR_CANCELED ) ),
384  Q_ARG( QString, i18n("User cancel") ) );
385 }
386 
387 void NewSignEncryptEMailController::startEncryption( const std::vector< shared_ptr<Input> > & inputs, const std::vector< shared_ptr<Output> > & outputs ) {
388 
389  kleo_assert( d->encrypt );
390  kleo_assert( !d->resolvingInProgress );
391 
392  kleo_assert( !inputs.empty() );
393  kleo_assert( outputs.size() == inputs.size() );
394 
395  std::vector< shared_ptr<Task> > tasks;
396  tasks.reserve( inputs.size() );
397 
398  kleo_assert( !d->recipients.empty() );
399 
400  for ( unsigned int i = 0, end = inputs.size() ; i < end ; ++i ) {
401 
402  const shared_ptr<EncryptEMailTask> task( new EncryptEMailTask );
403 
404  task->setInput( inputs[i] );
405  task->setOutput( outputs[i] );
406  task->setRecipients( d->recipients );
407 
408  tasks.push_back( task );
409  }
410 
411  // append to runnable stack
412  d->runnable.insert( d->runnable.end(), tasks.begin(), tasks.end() );
413 
414  d->startEncryption();
415 }
416 
417 void NewSignEncryptEMailController::Private::startEncryption() {
418  shared_ptr<TaskCollection> coll( new TaskCollection );
419  const std::vector<shared_ptr<Task> > tmp
420  = kdtools::copy< std::vector<shared_ptr<Task> > >( runnable );
421  coll->setTasks( tmp );
422 #if 0
423 #warning use a new result dialog
424  // ### use a new result dialog
425  dialog->setTaskCollection( coll );
426 #endif
427  Q_FOREACH( const shared_ptr<Task> & t, tmp )
428  q->connectTask( t );
429  schedule();
430 }
431 
432 void NewSignEncryptEMailController::startSigning( const std::vector< shared_ptr<Input> > & inputs, const std::vector< shared_ptr<Output> > & outputs ) {
433 
434  kleo_assert( d->sign );
435  kleo_assert( !d->resolvingInProgress );
436 
437  kleo_assert( !inputs.empty() );
438  kleo_assert( !outputs.empty() );
439 
440  std::vector< shared_ptr<Task> > tasks;
441  tasks.reserve( inputs.size() );
442 
443  kleo_assert( !d->signers.empty() );
444  kleo_assert( kdtools::none_of( d->signers, mem_fn( &Key::isNull ) ) );
445 
446  for ( unsigned int i = 0, end = inputs.size() ; i < end ; ++i ) {
447 
448  const shared_ptr<SignEMailTask> task( new SignEMailTask );
449 
450  task->setInput( inputs[i] );
451  task->setOutput( outputs[i] );
452  task->setSigners( d->signers );
453  task->setDetachedSignature( d->detached );
454 
455  tasks.push_back( task );
456  }
457 
458  // append to runnable stack
459  d->runnable.insert( d->runnable.end(), tasks.begin(), tasks.end() );
460 
461  d->startSigning();
462 }
463 
464 void NewSignEncryptEMailController::Private::startSigning() {
465  shared_ptr<TaskCollection> coll( new TaskCollection );
466  const std::vector<shared_ptr<Task> > tmp
467  = kdtools::copy< std::vector<shared_ptr<Task> > >( runnable );
468  coll->setTasks( tmp );
469 #if 0
470 #warning use a new result dialog
471  // ### use a new result dialog
472  dialog->setTaskCollection( coll );
473 #endif
474  Q_FOREACH( const shared_ptr<Task> & t, tmp )
475  q->connectTask( t );
476  schedule();
477 }
478 
479 void NewSignEncryptEMailController::Private::schedule() {
480 
481  if ( !cms )
482  if ( const shared_ptr<Task> t = takeRunnable( CMS ) ) {
483  t->start();
484  cms = t;
485  }
486 
487  if ( !openpgp )
488  if ( const shared_ptr<Task> t = takeRunnable( OpenPGP ) ) {
489  t->start();
490  openpgp = t;
491  }
492 
493  if ( cms || openpgp )
494  return;
495  kleo_assert( runnable.empty() );
496  q->emitDoneOrError();
497 }
498 
499 shared_ptr<Task> NewSignEncryptEMailController::Private::takeRunnable( GpgME::Protocol proto ) {
500  const std::vector< shared_ptr<Task> >::iterator it
501  = std::find_if( runnable.begin(), runnable.end(),
502  boost::bind( &Task::protocol, _1 ) == proto );
503  if ( it == runnable.end() )
504  return shared_ptr<Task>();
505 
506  const shared_ptr<Task> result = *it;
507  runnable.erase( it );
508  return result;
509 }
510 
511 void NewSignEncryptEMailController::doTaskDone( const Task * task, const shared_ptr<const Task::Result> & result ) {
512  assert( task );
513 
514  if ( result && result->hasError() ) {
515  QPointer<QObject> that = this;
516  if ( result->details().isEmpty() )
517  KMessageBox:: sorry( 0,
518  result->overview(),
519  i18nc("@title:window","Error") );
520  else
521  KMessageBox::detailedSorry( 0,
522  result->overview(),
523  result->details(),
524  i18nc("@title:window","Error") );
525  if ( !that )
526  return;
527  }
528 
529  // We could just delete the tasks here, but we can't use
530  // Qt::QueuedConnection here (we need sender()) and other slots
531  // might not yet have executed. Therefore, we push completed tasks
532  // into a burial container
533 
534  if ( task == d->cms.get() ) {
535  d->completed.push_back( d->cms );
536  d->cms.reset();
537  } else if ( task == d->openpgp.get() ) {
538  d->completed.push_back( d->openpgp );
539  d->openpgp.reset();
540  }
541 
542  QTimer::singleShot( 0, this, SLOT(schedule()) );
543 }
544 
545 void NewSignEncryptEMailController::cancel() {
546  try {
547  d->dialog->close();
548  d->cancelAllTasks();
549  } catch ( const std::exception & e ) {
550  kDebug() << "Caught exception: " << e.what();
551  }
552 }
553 
554 void NewSignEncryptEMailController::Private::cancelAllTasks() {
555 
556  // we just kill all runnable tasks - this will not result in
557  // signal emissions.
558  runnable.clear();
559 
560  // a cancel() will result in a call to
561  if ( cms )
562  cms->cancel();
563  if ( openpgp )
564  openpgp->cancel();
565 }
566 
567 void NewSignEncryptEMailController::Private::ensureDialogVisible() {
568  q->bringToForeground( dialog );
569 }
570 
571 #include "moc_newsignencryptemailcontroller.cpp"
Kleo::Crypto::NewSignEncryptEMailController::setProtocol
void setProtocol(GpgME::Protocol proto)
Definition: newsignencryptemailcontroller.cpp:283
output.h
input.h
Kleo::Crypto::NewSignEncryptEMailController::protocol
GpgME::Protocol protocol() const
Definition: newsignencryptemailcontroller.cpp:288
Kleo::Crypto::NewSignEncryptEMailController::startResolveCertificates
void startResolveCertificates(const std::vector< KMime::Types::Mailbox > &recipients, const std::vector< KMime::Types::Mailbox > &senders)
Definition: newsignencryptemailcontroller.cpp:347
Kleo::Crypto::Gui::SignEncryptEMailConflictDialog
Definition: signencryptemailconflictdialog.h:63
Kleo::Crypto::Task
Definition: task.h:57
QPointer< SignEncryptEMailConflictDialog >
Kleo::Crypto::NewSignEncryptEMailController::startEncryption
void startEncryption(const std::vector< boost::shared_ptr< Kleo::Input > > &inputs, const std::vector< boost::shared_ptr< Kleo::Output > > &outputs)
Definition: newsignencryptemailcontroller.cpp:387
Kleo::Crypto::NewSignEncryptEMailController::setSigning
void setSigning(bool sign)
Definition: newsignencryptemailcontroller.cpp:303
Kleo::Crypto::Sender::mailbox
const KMime::Types::Mailbox & mailbox() const
Definition: sender.cpp:138
Kleo::Crypto::NewSignEncryptEMailController::isEncrypting
bool isEncrypting() const
Definition: newsignencryptemailcontroller.cpp:317
Kleo::Crypto::NewSignEncryptEMailController::isResolvingInProgress
bool isResolvingInProgress() const
Definition: newsignencryptemailcontroller.cpp:325
kleo_assert.h
boost::shared_ptr
Definition: encryptemailcontroller.h:51
encryptemailtask.h
Kleo::Crypto::Recipient::encryptionCertificateCandidates
const std::vector< GpgME::Key > & encryptionCertificateCandidates(GpgME::Protocol proto) const
Definition: recipient.cpp:129
d
#define d
Definition: adduseridcommand.cpp:89
Kleo::Crypto::Recipient::mailbox
const KMime::Types::Mailbox & mailbox() const
Definition: recipient.cpp:125
mailbox2sender
static std::vector< Sender > mailbox2sender(const std::vector< Mailbox > &mbs)
Definition: newsignencryptemailcontroller.cpp:193
recipient.h
QObject
Kleo::Crypto::Sender::encryptToSelfCertificateCandidates
const std::vector< GpgME::Key > & encryptToSelfCertificateCandidates(GpgME::Protocol proto) const
Definition: sender.cpp:157
signencryptemailconflictdialog.h
Kleo::Class::OpenPGP
Definition: classify.h:49
Kleo::Crypto::SignEMailTask
Definition: signemailtask.h:60
has_perfect_match
static bool has_perfect_match(bool sign, bool encrypt, Protocol proto, const std::vector< Sender > &senders, const std::vector< Recipient > &recipients)
Definition: newsignencryptemailcontroller.cpp:156
newsignencryptemailcontroller.h
Kleo::Output
Definition: output.h:73
kdtools::pimpl_ptr::get
T * get()
Definition: pimpl_ptr.h:39
Kleo::Class::CMS
Definition: classify.h:48
Kleo::Crypto::NewSignEncryptEMailController::setDetachedSignature
void setDetachedSignature(bool detached)
Definition: newsignencryptemailcontroller.cpp:321
QString
Kleo::Crypto::NewSignEncryptEMailController::setEncrypting
void setEncrypting(bool encrypt)
Definition: newsignencryptemailcontroller.cpp:312
mailbox2recipient
static std::vector< Recipient > mailbox2recipient(const std::vector< Mailbox > &mbs)
Definition: newsignencryptemailcontroller.cpp:201
Kleo::Crypto::NewSignEncryptEMailController::~NewSignEncryptEMailController
~NewSignEncryptEMailController()
Definition: newsignencryptemailcontroller.cpp:277
Kleo::Crypto::NewSignEncryptEMailController::isSigning
bool isSigning() const
Definition: newsignencryptemailcontroller.cpp:308
Kleo::Crypto::NewSignEncryptEMailController::setSubject
void setSubject(const QString &subject)
Definition: newsignencryptemailcontroller.cpp:279
QMetaObject::invokeMethod
bool invokeMethod(QObject *obj, const char *member, Qt::ConnectionType type, QGenericReturnArgument ret, QGenericArgument val0, QGenericArgument val1, QGenericArgument val2, QGenericArgument val3, QGenericArgument val4, QGenericArgument val5, QGenericArgument val6, QGenericArgument val7, QGenericArgument val8, QGenericArgument val9)
kleo_assert
#define kleo_assert(cond)
Definition: kleo_assert.h:86
save_dialog_quick_mode
static void save_dialog_quick_mode(bool on)
Definition: newsignencryptemailcontroller.cpp:340
has_perfect_overall_match
static bool has_perfect_overall_match(bool sign, bool encrypt, const std::vector< Sender > &senders, const std::vector< Recipient > &recipients, Protocol presetProtocol)
Definition: newsignencryptemailcontroller.cpp:178
Kleo::Crypto::NewSignEncryptEMailController::cancel
void cancel()
Definition: newsignencryptemailcontroller.cpp:545
sender.h
Kleo::Crypto::TaskCollection
Definition: taskcollection.h:51
q
#define q
Definition: adduseridcommand.cpp:90
Kleo::Crypto::Sender::signingCertificateCandidates
const std::vector< GpgME::Key > & signingCertificateCandidates(GpgME::Protocol proto) const
Definition: sender.cpp:142
Kleo::Crypto::NewSignEncryptEMailController::protocolAsString
const char * protocolAsString() const
Definition: newsignencryptemailcontroller.cpp:293
Kleo::Crypto::EncryptEMailTask
Definition: encryptemailtask.h:60
signemailtask.h
has_partial_match
static bool has_partial_match(bool sign, bool encrypt, Protocol proto, const std::vector< Sender > &senders, const std::vector< Recipient > &recipients)
Definition: newsignencryptemailcontroller.cpp:167
Kleo::Crypto::Task::protocol
virtual GpgME::Protocol protocol() const =0
Kleo::Crypto::Controller
Definition: controller.h:52
Kleo::Crypto::Sender
Definition: sender.h:58
Kleo::Crypto::NewSignEncryptEMailController::areCertificatesResolved
bool areCertificatesResolved() const
Definition: newsignencryptemailcontroller.cpp:329
Kleo::Input
Definition: input.h:51
taskcollection.h
is_dialog_quick_mode
static bool is_dialog_quick_mode(bool sign, bool encrypt)
Definition: newsignencryptemailcontroller.cpp:333
Kleo::Crypto::NewSignEncryptEMailController
Definition: newsignencryptemailcontroller.h:68
Kleo::Crypto::NewSignEncryptEMailController::NewSignEncryptEMailController
NewSignEncryptEMailController(QObject *parent=0)
Definition: newsignencryptemailcontroller.cpp:271
Kleo::Crypto::Recipient
Definition: recipient.h:58
qDebug
#define qDebug
Definition: kdpipeiodevice.cpp:62
has_conflict
static bool has_conflict(bool sign, bool encrypt, const std::vector< Sender > &senders, const std::vector< Recipient > &recipients, Protocol presetProtocol)
Definition: newsignencryptemailcontroller.cpp:185
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