25 #include <QtCore/QByteArray>
26 #include <QtCore/QString>
30 #include <QPushButton>
31 #include <QRadioButton>
33 #include <QGridLayout>
94 virtual void readConfig();
95 virtual void writeConfig(
bool sync);
100 bool decrypt(
Block& block );
103 bool verify(
Block& block );
113 const KeyID& keyId,
const QByteArray& charset = 0 );
124 const QStringList& receivers,
const KeyID& keyId,
125 bool sign,
const QByteArray& charset = 0 );
135 const QStringList& recipients,
136 const KeyID& keyId );
147 int encryptionPossible(
const QStringList& recipients );
150 int doEncSign(
Block& block,
const KeyIDList& recipientKeyIds,
bool sign );
154 bool signKey(
const KeyID& keyID );
164 void readPublicKeys(
bool reread =
false );
168 void readSecretKeys(
bool reread =
false );
171 QByteArray getAsciiPublicKey(
const KeyID& keyID );
176 Key* publicKey(
const KeyID& keyID );
181 Key* publicKey(
const QString& userID );
186 Key* secretKey(
const KeyID& keyID );
197 Validity keyTrust(
const QString& userID );
202 bool isTrusted(
const KeyID& keyID );
207 Key* rereadKey(
const KeyID& keyID,
const bool readTrust =
true );
211 bool changePassPhrase();
215 void setUser(
const KeyID& keyID);
217 const KeyID user()
const;
220 void setEncryptToSelf(
bool flag);
221 bool encryptToSelf(
void)
const;
228 void setStorePassPhrase(
bool);
229 bool storePassPhrase(
void)
const;
232 void clear(
const bool erasePassPhrase =
false);
235 const QString lastErrorMsg(
void)
const;
241 bool havePGP(
void)
const;
244 bool usePGP(
void)
const {
return (havePGP() && (pgpType != tOff)); }
247 void setShowCipherText(
const bool flag);
248 bool showCipherText(
void)
const;
251 void setShowKeyApprovalDlg(
const bool flag);
252 bool showKeyApprovalDlg(
void)
const;
258 KeyID selectSecretKey(
const QString& title,
259 const QString& text = QString(),
268 KeyID selectPublicKey(
const QString& title,
269 const QString& text = QString(),
271 const QString& address = QString(),
272 const unsigned int allowedKeys =
AllKeys );
280 KeyIDList selectPublicKeys(
const QString& title,
281 const QString& text = QString(),
283 const QString& address = QString(),
284 const unsigned int allowedKeys =
AllKeys );
291 EncryptPref encryptionPreference(
const QString& address );
296 void setEncryptionPreference(
const QString& address,
305 static KConfig *getConfig();
321 static bool prepareMessageForDecryption(
const QByteArray& msg,
327 bool haveTrustedEncryptionKey(
const QString& person );
330 KeyIDList getEncryptionKeys(
const QString& person );
333 bool setPassPhrase(
const QString &pass);
341 int prepare(
bool needPassPhrase=
false,
Block* block = 0 );
344 void cleanupPass() {
if (!storePass) wipePassPhrase(); }
348 void wipePassPhrase(
bool free=
false);
351 QString canonicalAddress(
const QString& person );
356 const QString& title,
357 const QString& text = QString(),
359 const unsigned int allowedKeys =
AllKeys );
363 KeyIDList selectKeys(
const KeyList& keys,
364 const QString& title,
365 const QString& text = QString(),
366 const KeyIDList& keyIds = KeyIDList(),
367 const unsigned int allowedKeys =
AllKeys );
373 KeyID selectKey(
bool& rememberChoice,
375 const QString& title,
376 const QString& text = QString(),
378 const unsigned int allowedKeys =
AllKeys );
384 KeyIDList selectKeys(
bool& rememberChoice,
386 const QString& title,
387 const QString& text = QString(),
388 const KeyIDList& keyIds = KeyIDList(),
389 const unsigned int allowedKeys =
AllKeys );
394 KeyIDList keysForAddress(
const QString& address );
398 void setKeysForAddress(
const QString& address,
const KeyIDList& keyIDs );
401 void removeKeyForAddress(
const QString& address );
406 void readAddressData();
411 void writeAddressData();
413 bool checkForPGP(
void);
414 void assignPGPBase(
void);
422 typedef QMap<QString, AddressData> AddressDataDict;
423 AddressDataDict addressDataDict;
426 bool mPublicKeysCached : 1;
428 bool mSecretKeysCached : 1;
432 size_t passphrase_buffer_len;
437 bool flagEncryptToSelf : 1;
442 bool havePassPhrase : 1;
443 bool showEncryptionResult : 1;
444 bool mShowKeyApprovalDlg : 1;
452 mShowKeyApprovalDlg = flag;
458 return mShowKeyApprovalDlg;
Validity
These are the possible validity values for a PGP user id and for the owner trust. ...
bool showKeyApprovalDlg(void) const
EncryptPref
These are the possible preferences for encryption.
This class is used to store information about a PGP key.
void setShowKeyApprovalDlg(const bool flag)
bool usePGP(void) const
Should PGP/GnuPG be used?