|
@ -48,6 +48,19 @@ namespace pEp { |
|
|
|
|
|
|
|
|
const char *add(std::string passphrase); |
|
|
const char *add(std::string passphrase); |
|
|
|
|
|
|
|
|
|
|
|
// get all passphrases in cache from latest to oldest one by each call
|
|
|
|
|
|
// this function is throwing PassphraseCache::Empty when cache is empty
|
|
|
|
|
|
// and PassphraseCache::Exhausted when no passphrases are left, then
|
|
|
|
|
|
// starts over
|
|
|
|
|
|
|
|
|
|
|
|
const char *latest_passphrase(); |
|
|
|
|
|
|
|
|
|
|
|
// call this function inside the messageToSend() implementation of the adapter
|
|
|
|
|
|
// this function is using latest_passphrase() to test one passphrase after the
|
|
|
|
|
|
// other until the cache is exhausted
|
|
|
|
|
|
|
|
|
|
|
|
static PEP_STATUS messageToSend(PassphraseCache&& cache, PEP_SESSION session); |
|
|
|
|
|
|
|
|
// for each passphrase call the callee until it returns true for a
|
|
|
// for each passphrase call the callee until it returns true for a
|
|
|
// matching passphrase or no passphrases are left
|
|
|
// matching passphrase or no passphrases are left
|
|
|
// always tests empty passphrase first
|
|
|
// always tests empty passphrase first
|
|
@ -56,13 +69,6 @@ namespace pEp { |
|
|
using passphrase_callee = std::function<bool(std::string)>; |
|
|
using passphrase_callee = std::function<bool(std::string)>; |
|
|
bool for_each_passphrase(const passphrase_callee& callee); |
|
|
bool for_each_passphrase(const passphrase_callee& callee); |
|
|
|
|
|
|
|
|
// get all passphrases in cache from latest to oldest one by each call
|
|
|
|
|
|
// this function is throwing PassphraseCache::Empty when cache is empty
|
|
|
|
|
|
// and PassphraseCache::Exhausted when no passphrases are left, then
|
|
|
|
|
|
// starts over
|
|
|
|
|
|
|
|
|
|
|
|
const char *latest_passphrase(); |
|
|
|
|
|
|
|
|
|
|
|
// convenience functions
|
|
|
// convenience functions
|
|
|
// i.e.
|
|
|
// i.e.
|
|
|
// status = cache.api(::encrypt_message, session, src, extra, dst, enc_format, flags)
|
|
|
// status = cache.api(::encrypt_message, session, src, extra, dst, enc_format, flags)
|
|
|