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