MCPcopy Create free account
hub / github.com/CommE2E/comm / publishOneTimeKeys

Method publishOneTimeKeys

native/cpp/CommonCpp/CryptoTools/CryptoModule.cpp:58–74  ·  view source on GitHub ↗

returns number of published keys

Source from the content-addressed store, hash-verified

56
57// returns number of published keys
58size_t CryptoModule::publishOneTimeKeys() {
59 try {
60 auto oneTimeKeysVec = this->vodozemacAccount->one_time_keys();
61
62 this->keys.oneTimeKeys.clear();
63 for (const auto &key : oneTimeKeysVec) {
64 this->keys.oneTimeKeys.push_back(std::string(key));
65 }
66
67 this->vodozemacAccount->mark_keys_as_published();
68
69 return oneTimeKeysVec.size();
70 } catch (const std::exception &e) {
71 throw std::runtime_error(
72 "error publishOneTimeKeys => " + std::string(e.what()));
73 }
74}
75
76bool CryptoModule::prekeyExistsAndOlderThan(uint64_t threshold) {
77 // Our fork of Vodozemac only remembers two prekeys at a time.

Callers 1

Calls 3

clearMethod · 0.65
one_time_keysMethod · 0.45

Tested by

no test coverage detected