|KeyResolver (bool encToSelf, bool showApproval, bool oppEncryption, unsigned int format, int encrKeyNearExpiryThresholdDays, int signKeyNearExpiryThresholdDays, int encrRootCertNearExpiryThresholdDays, int signRootCertNearExpiryThresholdDays, int encrChainCertNearExpiryThresholdDays, int signChainCertNearExpiryThresholdDays)|
|Action||checkEncryptionPreferences (bool encryptionRequested) const|
|Action||checkSigningPreferences (bool signingRequested) const|
|std::vector< SplitInfo >||encryptionItems (CryptoMessageFormat f) const|
|std::vector< GpgME::Key >||encryptToSelfKeysFor (CryptoMessageFormat f) const|
|Kleo::Result||resolveAllKeys (bool &signingRequested, bool &encryptionRequested)|
|void||setAkonadiLookupEnabled (bool akonadiLookupEnabled)|
|void||setAutocryptEnabled (bool autocryptEnabled)|
|Kleo::Result||setEncryptToSelfKeys (const QStringList &fingerprints)|
|void||setPrimaryRecipients (const QStringList &addresses)|
|void||setSecondaryRecipients (const QStringList &addresses)|
|Kleo::Result||setSigningKeys (const QStringList &fingerprints)|
|std::vector< GpgME::Key >||signingKeys (CryptoMessageFormat f) const|
|std::map< QByteArray, QString >||useAutocrypt () const|
A class to resolve signing/encryption keys w.r.t.
The constructor takes some basic options as arguments, such as whether or not encryption was actually requested. Recipient and sender information is then set by using
setPrimaryRecipients() (To/Cc) and
checkSigningPreferences() goes through all recipient's signing preferences, to determine whether or not to sign. It also takes into account the available signing keys and whether or not the user explicitly requested signing.
checkEncryptionPreferences() does the same for encryption preferences. If opportunistic encryption is enabled, recipients without encryption preferences set are treated as if they had a preference of
In both cases an Action code is returned, with the following meanings:
A conflict was detected. E.g. one recipient's preference was set to "always encrypt", while another one's preference was set to "never encrypt". You should ask the user what to do.
- DoIt, DontDoIt
(Some) crypto preferences request to prompt the user, so do it.
- Signing or encryption is impossible, e.g. due to missing keys or unsupported formats.
In case signing or encryption was implicitly or explicitly requested by the user,
resolveAllKeys() tries to find signing keys for each required format, as well as encryption keys for all recipients (incl. the sender, if encrypt-to-self is set).
If, after key resolving, signing is still requested and apparently possible, you can get the result of all this by iterating over the available message formats and retrieving the set of signing keys to use with a call to
If after key resolving, encryption is still requested and apparently possible, you can get the result of all this by calling
encryptionItems() with the current message format at hand as its argument.
This will return a list of recipient-list/key-list pairs that each describe a copy of the (possibly signed) message to be encrypted independently.
Note that it's only necessary to sign the message once for each message format, although it might be necessary to create more than one message when encrypting. This is because encryption allows the recipients to learn about the other recipients the message was encrypted to, so each secondary (BCC) recipient need a copy of it's own to hide the other secondary recipients.
Member Function Documentation
|std::vector< Kleo::KeyResolver::SplitInfo > Kleo::KeyResolver::encryptionItems||(||CryptoMessageFormat||f||)||const|
|Kleo::Result Kleo::KeyResolver::resolveAllKeys||(||bool &||signingRequested,|
|Kleo::Result Kleo::KeyResolver::setEncryptToSelfKeys||(||const QStringList &||fingerprints||)|
|void Kleo::KeyResolver::setPrimaryRecipients||(||const QStringList &||addresses||)|
|void Kleo::KeyResolver::setSecondaryRecipients||(||const QStringList &||addresses||)|
|Kleo::Result Kleo::KeyResolver::setSigningKeys||(||const QStringList &||fingerprints||)|
|std::vector< GpgME::Key > Kleo::KeyResolver::signingKeys||(||CryptoMessageFormat||f||)||const|
The documentation for this class was generated from the following files: