libkpgp
Kpgp::Module Class Reference
#include <kpgp.h>
Detailed Description
Definition at line 75 of file kpgp.h.
Public Types | |
| enum | PGPType { tAuto, tGPG, tPGP2, tPGP5, tPGP6, tOff } |
Public Member Functions | |
| 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 QString &userID) |
| Validity | keyTrust (const KeyID &keyID) |
| const QString | lastErrorMsg (void) const |
| Module () | |
| Key * | publicKey (const QString &userID) |
| Key * | publicKey (const KeyID &keyID) |
| 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) |
| virtual | ~Module () |
Static Public Member Functions | |
| static KConfig * | getConfig () |
| static Kpgp::Module * | getKpgp () |
| static bool | prepareMessageForDecryption (const QByteArray &msg, QList< Block > &pgpBlocks, QList< QByteArray > &nonPgpBlocks) |
Public Attributes | |
| enum Kpgp::Module::PGPType | pgpType |
Protected Member Functions | |
| int | doEncSign (Block &block, const KeyIDList &recipientKeyIds, bool sign) |
Member Enumeration Documentation
Constructor & Destructor Documentation
Member Function Documentation
| bool Kpgp::Module::changePassPhrase | ( | ) |
| void Kpgp::Module::clear | ( | const bool | erasePassPhrase = false |
) |
| Kpgp::Result Kpgp::Module::clearsign | ( | Block & | block, | |
| const KeyID & | keyId, | |||
| const QByteArray & | charset = 0 | |||
| ) |
| bool Kpgp::Module::decrypt | ( | Block & | block | ) |
| Kpgp::Result Kpgp::Module::encrypt | ( | Block & | block, | |
| const QStringList & | receivers, | |||
| const KeyID & | keyId, | |||
| bool | sign, | |||
| const QByteArray & | charset = 0 | |||
| ) |
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.
| 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.
| EncryptPref Kpgp::Module::encryptionPreference | ( | const QString & | address | ) |
| QByteArray Kpgp::Module::getAsciiPublicKey | ( | const KeyID & | keyID | ) |
| KConfig * Kpgp::Module::getConfig | ( | ) | [static] |
| Kpgp::Result Kpgp::Module::getEncryptionKeys | ( | KeyIDList & | encryptionKeyIds, | |
| const QStringList & | recipients, | |||
| const KeyID & | keyId | |||
| ) |
| Module * Kpgp::Module::getKpgp | ( | ) | [static] |
| bool Kpgp::Module::isTrusted | ( | const KeyID & | keyID | ) |
| const QString Kpgp::Module::lastErrorMsg | ( | void | ) | const |
| bool Kpgp::Module::prepareMessageForDecryption | ( | const QByteArray & | msg, | |
| QList< Block > & | pgpBlocks, | |||
| QList< QByteArray > & | nonPgpBlocks | |||
| ) | [static] |
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
| const KeyList Kpgp::Module::publicKeys | ( | ) |
| void Kpgp::Module::readConfig | ( | ) | [virtual] |
the following virtual function form the interface to the application using Kpgp
pgpType = (Module::PGPType) config->readEntry("pgpType", tAuto);
| void Kpgp::Module::readPublicKeys | ( | bool | reread = false |
) |
| void Kpgp::Module::readSecretKeys | ( | bool | reread = false |
) |
| const KeyList Kpgp::Module::secretKeys | ( | ) |
| KeyID Kpgp::Module::selectPublicKey | ( | const QString & | title, | |
| const QString & | text = QString(), |
|||
| const KeyID & | oldKeyId = KeyID(), |
|||
| const QString & | address = QString(), |
|||
| const unsigned int | allowedKeys = AllKeys | |||
| ) |
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.
| KeyIDList Kpgp::Module::selectPublicKeys | ( | const QString & | title, | |
| const QString & | text = QString(), |
|||
| const KeyIDList & | oldKeyIds = KeyIDList(), |
|||
| const QString & | address = QString(), |
|||
| const unsigned int | allowedKeys = AllKeys | |||
| ) |
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.
| void Kpgp::Module::setEncryptionPreference | ( | const QString & | address, | |
| const EncryptPref | pref | |||
| ) |
| void Kpgp::Module::setEncryptToSelf | ( | bool | flag | ) |
| void Kpgp::Module::setShowKeyApprovalDlg | ( | const bool | flag | ) | [inline] |
| void Kpgp::Module::setStorePassPhrase | ( | bool | flag | ) |
| void Kpgp::Module::setUser | ( | const KeyID & | keyID | ) |
| bool Kpgp::Module::showKeyApprovalDlg | ( | void | ) | const [inline] |
| bool Kpgp::Module::signKey | ( | const KeyID & | keyID | ) |
| bool Kpgp::Module::usePGP | ( | void | ) | const [inline] |
| const KeyID Kpgp::Module::user | ( | void | ) | const |
| bool Kpgp::Module::verify | ( | Block & | block | ) |
| void Kpgp::Module::writeConfig | ( | bool | sync | ) | [virtual] |
Member Data Documentation
The documentation for this class was generated from the following files:
KDE 4.1 API Reference