libkpgp
#include <kpgp.h>
|
virtual | ~Module () |
|
bool | changePassPhrase () |
|
void | clear (const bool erasePassPhrase=false) |
|
Kpgp::Result | clearsign (Block &block, const KeyID &keyId, const QByteArray &charset=0) |
|
bool | decrypt (Block &block) |
|
Kpgp::Result | encrypt (Block &block, const QStringList &receivers, const KeyID &keyId, bool sign, const QByteArray &charset=0) |
|
int | encryptionPossible (const QStringList &recipients) |
|
EncryptPref | encryptionPreference (const QString &address) |
|
bool | encryptToSelf (void) const |
|
QByteArray | getAsciiPublicKey (const KeyID &keyID) |
|
Kpgp::Result | getEncryptionKeys (KeyIDList &encryptionKeyIds, const QStringList &recipients, const KeyID &keyId) |
|
bool | havePGP (void) const |
|
virtual void | init () |
|
bool | isTrusted (const KeyID &keyID) |
|
Validity | keyTrust (const KeyID &keyID) |
|
Validity | keyTrust (const QString &userID) |
|
const QString | lastErrorMsg (void) const |
|
Key * | publicKey (const KeyID &keyID) |
|
Key * | publicKey (const QString &userID) |
|
const KeyList | publicKeys () |
|
virtual void | readConfig () |
|
void | readPublicKeys (bool reread=false) |
|
void | readSecretKeys (bool reread=false) |
|
Key * | rereadKey (const KeyID &keyID, const bool readTrust=true) |
|
Key * | secretKey (const KeyID &keyID) |
|
const KeyList | secretKeys () |
|
KeyID | selectPublicKey (const QString &title, const QString &text=QString(), const KeyID &oldKeyId=KeyID(), const QString &address=QString(), const unsigned int allowedKeys=AllKeys) |
|
KeyIDList | selectPublicKeys (const QString &title, const QString &text=QString(), const KeyIDList &oldKeyIds=KeyIDList(), const QString &address=QString(), const unsigned int allowedKeys=AllKeys) |
|
KeyID | selectSecretKey (const QString &title, const QString &text=QString(), const KeyID &keyId=KeyID()) |
|
void | setEncryptionPreference (const QString &address, const EncryptPref pref) |
|
void | setEncryptToSelf (bool flag) |
|
void | setShowCipherText (const bool flag) |
|
void | setShowKeyApprovalDlg (const bool flag) |
|
void | setStorePassPhrase (bool) |
|
void | setUser (const KeyID &keyID) |
|
bool | showCipherText (void) const |
|
bool | showKeyApprovalDlg (void) const |
|
bool | signKey (const KeyID &keyID) |
|
bool | storePassPhrase (void) const |
|
bool | usePGP (void) const |
|
const KeyID | user () const |
|
bool | verify (Block &block) |
|
virtual void | writeConfig (bool sync) |
|
Definition at line 75 of file kpgp.h.
Enumerator |
---|
tAuto |
|
tGPG |
|
tPGP2 |
|
tPGP5 |
|
tPGP6 |
|
tOff |
|
Definition at line 238 of file kpgp.h.
Kpgp::Module::~Module |
( |
| ) |
|
|
virtual |
bool Kpgp::Module::changePassPhrase |
( |
| ) |
|
Request the change of the passphrase of the actual secret key.
TBI
Definition at line 935 of file kpgp.cpp.
void Kpgp::Module::clear |
( |
const bool |
erasePassPhrase = false | ) |
|
clears everything from memory
Definition at line 943 of file kpgp.cpp.
clearsigns the given OpenPGP block with the key corresponding to the given key id.
The charset is needed to display the text correctly. Returns Failure if there was an unresolvable error Canceled if signing was canceled Ok if everything is o.k.
Definition at line 327 of file kpgp.cpp.
bool Kpgp::Module::decrypt |
( |
Block & |
block | ) |
|
decrypts the given OpenPGP block if the passphrase is good.
returns false otherwise
Definition at line 283 of file kpgp.cpp.
int Kpgp::Module::doEncSign |
( |
Block & |
block, |
|
|
const KeyIDList & |
recipientKeyIds, |
|
|
bool |
sign |
|
) |
| |
|
protected |
encrypts the given OpenPGP block for a list of persons.
if sign is true then the block is clearsigned with the key corresponding to the given key id. The charset is needed to display the text correctly. Returns Failure if there was an unresolvable error Canceled if encryption was canceled Ok if everything is o.k.
Definition at line 334 of file kpgp.cpp.
int Kpgp::Module::encryptionPossible |
( |
const QStringList & |
recipients | ) |
|
checks if encrypting to the given list of persons is possible and desired, i.e.
if we have a (trusted) key for every recipient and if encryption to all keys is allowed. Returns 0 if encryption is not possible or not desired, 1 if encryption is possible and desired, 2 if encryption is possible, but the user wants to be asked and -1 if there is a conflict which can't be automatically resolved.
Definition at line 682 of file kpgp.cpp.
Reads the encryption preference for the given address from the config file.
Definition at line 1855 of file kpgp.cpp.
bool Kpgp::Module::encryptToSelf |
( |
void |
| ) |
const |
try to get an ascii armored key block for the given public key
Definition at line 893 of file kpgp.cpp.
KConfig * Kpgp::Module::getConfig |
( |
| ) |
|
|
static |
get the kpgp config object
Definition at line 1078 of file kpgp.cpp.
Determines the keys which should be used for encrypting the message to the given list of recipients.
Returns: Failure if there was an unresolvable error Canceled if encryption was canceled Ok if everything is o.k.
Definition at line 532 of file kpgp.cpp.
Module * Kpgp::Module::getKpgp |
( |
| ) |
|
|
static |
return the actual pgp object
Definition at line 1067 of file kpgp.cpp.
bool Kpgp::Module::havePGP |
( |
void |
| ) |
const |
void Kpgp::Module::init |
( |
| ) |
|
|
virtual |
bool Kpgp::Module::isTrusted |
( |
const KeyID & |
keyID | ) |
|
Returns TRUE if the given key is at least trusted marginally.
Otherwise FALSE is returned.
Definition at line 860 of file kpgp.cpp.
Returns the trust value for the given key.
This is the maximal trust value of any of the user ids of this key.
Definition at line 827 of file kpgp.cpp.
Returns the trust value of a key with the given user id.
If more than one key have this user id then the first key with this user id will be chosen.
Definition at line 842 of file kpgp.cpp.
const QString Kpgp::Module::lastErrorMsg |
( |
void |
| ) |
const |
returns the last error that occurred
Definition at line 950 of file kpgp.cpp.
Parses the given message and splits it into OpenPGP blocks and Non-OpenPGP blocks.
Returns TRUE if the message contains at least one OpenPGP block and FALSE otherwise. The format is then:
1st Non-OpenPGP block
1st OpenPGP block
2nd Non-OpenPGP block
...
n-th OpenPGP block
(n+1)-th Non-OpenPGP block
Definition at line 1085 of file kpgp.cpp.
Key * Kpgp::Module::publicKey |
( |
const KeyID & |
keyID | ) |
|
Returns the public key with the given key ID or null if no matching key is found.
Definition at line 786 of file kpgp.cpp.
Key * Kpgp::Module::publicKey |
( |
const QString & |
userID | ) |
|
Returns the first public key with the given user ID or null if no matching key is found.
Definition at line 800 of file kpgp.cpp.
const KeyList Kpgp::Module::publicKeys |
( |
| ) |
|
get the list of cached public keys.
Definition at line 756 of file kpgp.cpp.
void Kpgp::Module::readConfig |
( |
| ) |
|
|
virtual |
the following virtual function form the interface to the application using Kpgp
pgpType = (Module::PGPType) config->readEntry("pgpType", tAuto);
Definition at line 118 of file kpgp.cpp.
void Kpgp::Module::readPublicKeys |
( |
bool |
reread = false | ) |
|
Reads the list of public keys if necessary or if reread is true.
Definition at line 1562 of file kpgp.cpp.
void Kpgp::Module::readSecretKeys |
( |
bool |
reread = false | ) |
|
Reads the list of secret keys if necessary or if reread is true.
Definition at line 1605 of file kpgp.cpp.
Key * Kpgp::Module::rereadKey |
( |
const KeyID & |
keyID, |
|
|
const bool |
readTrust = true |
|
) |
| |
Rereads the key data for the given key and returns the reread data.
If readTrust is true then the trust of this key will be determined.
Definition at line 866 of file kpgp.cpp.
Key * Kpgp::Module::secretKey |
( |
const KeyID & |
keyID | ) |
|
Returns the secret key with the given key ID or null if no matching key is found.
Definition at line 813 of file kpgp.cpp.
const KeyList Kpgp::Module::secretKeys |
( |
| ) |
|
get the list of cached secret keys.
Definition at line 771 of file kpgp.cpp.
Shows a key selection dialog with all public keys and the given title and the (optional) text.
If oldKeyId is given, then the corresponding key is selected. If address is given, then the chosen key will be stored (if the user wants it to be stored). mode specifies which keys can be selected.
Definition at line 993 of file kpgp.cpp.
Shows a key selection dialog with all public keys and the given title and the (optional) text.
If oldKeyId is given, then the corresponding key is selected. If address is given, then the chosen key will be stored (if the user wants it to be stored). mode specifies which keys can be selected.
Definition at line 1029 of file kpgp.cpp.
Shows a key selection dialog with all secret keys and the given title and the (optional) text.
If keyId is given, then the corresponding key is selected.
Definition at line 974 of file kpgp.cpp.
void Kpgp::Module::setEncryptionPreference |
( |
const QString & |
address, |
|
|
const EncryptPref |
pref |
|
) |
| |
Writes the given encryption preference for the given address to the config file.
Definition at line 1867 of file kpgp.cpp.
void Kpgp::Module::setEncryptToSelf |
( |
bool |
flag | ) |
|
always encrypt message to oneself?
Definition at line 167 of file kpgp.cpp.
void Kpgp::Module::setShowCipherText |
( |
const bool |
flag | ) |
|
void Kpgp::Module::setShowKeyApprovalDlg |
( |
const bool |
flag | ) |
|
|
inline |
void Kpgp::Module::setStorePassPhrase |
( |
bool |
flag | ) |
|
store passphrase in pgp object Problem: passphrase stays in memory.
Advantage: you can call en-/decrypt without always passing the passphrase
Definition at line 180 of file kpgp.cpp.
void Kpgp::Module::setUser |
( |
const KeyID & |
keyID | ) |
|
set a user identity to use (if you have more than one...) by default, pgp uses the identity which was generated last.
Definition at line 151 of file kpgp.cpp.
bool Kpgp::Module::showCipherText |
( |
void |
| ) |
const |
bool Kpgp::Module::showKeyApprovalDlg |
( |
void |
| ) |
const |
|
inline |
bool Kpgp::Module::signKey |
( |
const KeyID & |
keyID | ) |
|
sign a key in the keyring with users signature.
Definition at line 740 of file kpgp.cpp.
bool Kpgp::Module::storePassPhrase |
( |
void |
| ) |
const |
bool Kpgp::Module::usePGP |
( |
void |
| ) |
const |
|
inline |
Should PGP/GnuPG be used?
Definition at line 244 of file kpgp.h.
const KeyID Kpgp::Module::user |
( |
void |
| ) |
const |
Returns the actual key ID of the currently set key.
Definition at line 160 of file kpgp.cpp.
bool Kpgp::Module::verify |
( |
Block & |
block | ) |
|
Tries to verify the given OpenPGP block.
Definition at line 262 of file kpgp.cpp.
void Kpgp::Module::writeConfig |
( |
bool |
sync | ) |
|
|
virtual |
Why is the pgp object deleted? This is only necessary if the
PGP type was changed in the config dialog.
Definition at line 132 of file kpgp.cpp.
The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:22 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.