libkpgp
Kpgp::Module Class Reference
List of all members.Detailed Description
Definition at line 81 of file kpgp.h.
Public Types | |
enum | PGPType { tAuto, tGPG, tPGP2, tPGP5, tPGP6, tOff } |
Public Member Functions | |
Module () | |
virtual | ~Module () |
virtual void | readConfig () |
virtual void | writeConfig (bool sync) |
virtual void | init () |
bool | decrypt (Block &block) |
bool | verify (Block &block) |
Kpgp::Result | clearsign (Block &block, const KeyID &keyId, const QCString &charset=0) |
Kpgp::Result | encrypt (Block &block, const QStringList &receivers, const KeyID &keyId, bool sign, const QCString &charset=0) |
Kpgp::Result | getEncryptionKeys (KeyIDList &encryptionKeyIds, const QStringList &recipients, const KeyID &keyId) |
int | encryptionPossible (const QStringList &recipients) |
bool | signKey (const KeyID &keyID) |
const KeyList | publicKeys () |
const KeyList | secretKeys () |
void | readPublicKeys (bool reread=false) |
void | readSecretKeys (bool reread=false) |
QCString | getAsciiPublicKey (const KeyID &keyID) |
Key * | publicKey (const KeyID &keyID) |
Key * | publicKey (const QString &userID) |
Key * | secretKey (const KeyID &keyID) |
Validity | keyTrust (const KeyID &keyID) |
Validity | keyTrust (const QString &userID) |
bool | isTrusted (const KeyID &keyID) |
Key * | rereadKey (const KeyID &keyID, const bool readTrust=true) |
bool | changePassPhrase () |
void | setUser (const KeyID &keyID) |
const KeyID | user () const |
void | setEncryptToSelf (bool flag) |
bool | encryptToSelf (void) const |
void | setStorePassPhrase (bool) |
bool | storePassPhrase (void) const |
void | clear (const bool erasePassPhrase=FALSE) |
const QString | lastErrorMsg (void) const |
bool | havePGP (void) const |
bool | usePGP (void) const |
void | setShowCipherText (const bool flag) |
bool | showCipherText (void) const |
void | setShowKeyApprovalDlg (const bool flag) |
bool | showKeyApprovalDlg (void) const |
KeyID | selectSecretKey (const QString &title, const QString &text=QString::null, const KeyID &keyId=KeyID()) |
KeyID | selectPublicKey (const QString &title, const QString &text=QString::null, const KeyID &oldKeyId=KeyID(), const QString &address=QString::null, const unsigned int allowedKeys=AllKeys) |
KeyIDList | selectPublicKeys (const QString &title, const QString &text=QString::null, const KeyIDList &oldKeyIds=KeyIDList(), const QString &address=QString::null, const unsigned int allowedKeys=AllKeys) |
EncryptPref | encryptionPreference (const QString &address) |
void | setEncryptionPreference (const QString &address, const EncryptPref pref) |
Static Public Member Functions | |
static Kpgp::Module * | getKpgp () |
static KConfig * | getConfig () |
static bool | prepareMessageForDecryption (const QCString &msg, QPtrList< Block > &pgpBlocks, QStrList &nonPgpBlocks) |
Public Attributes | |
enum Kpgp::Module::PGPType | pgpType |
Protected Member Functions | |
int | doEncSign (Block &block, const KeyIDList &recipientKeyIds, bool sign) |
Friends | |
class | Block |
Member Function Documentation
|
Request the change of the passphrase of the actual secret key. TBI |
|
clears everything from memory
|
|
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. |
|
decrypts the given OpenPGP block if the passphrase is good. returns false otherwise |
|
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. |
|
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. |
|
Reads the encryption preference for the given address from the config file.
|
|
try to get an ascii armored key block for the given public key
|
|
get the kpgp config object
|
|
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. |
|
return the actual pgp object
|
|
Returns TRUE if the given key is at least trusted marginally. Otherwise FALSE is returned. |
|
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. |
|
Returns the trust value for the given key. This is the maximal trust value of any of the user ids of this key. |
|
returns the last error that occurred
|
|
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 |
|
Returns the first public key with the given user ID or null if no matching key is found.
|
|
Returns the public key with the given key ID or null if no matching key is found.
|
|
get the list of cached public keys.
|
|
the following virtual function form the interface to the application using Kpgp pgpType = (Module::PGPType) config->readNumEntry("pgpType", tAuto); |
|
Reads the list of public keys if necessary or if reread is true.
|
|
Reads the list of secret keys if necessary or if reread is 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. |
|
Returns the secret key with the given key ID or null if no matching key is found.
|
|
get the list of cached secret keys.
|
|
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. |
|
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. |
|
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. |
|
Writes the given encryption preference for the given address to the config file.
|
|
always encrypt message to oneself?
|
|
store passphrase in pgp object Problem: passphrase stays in memory. Advantage: you can call en-/decrypt without always passing the passphrase |
|
set a user identity to use (if you have more than one. ..) by default, pgp uses the identity which was generated last. |
|
sign a key in the keyring with users signature.
|
|
Should PGP/GnuPG be used?
|
|
Returns the actual key ID of the currently set key.
|
|
Tries to verify the given OpenPGP block.
|
|
### Why is the pgp object deleted? This is only necessary if the PGP type was changed in the config dialog. |
The documentation for this class was generated from the following files: