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

Method getOneTimeKeysForPublishing

native/cpp/CommonCpp/CryptoTools/CryptoModule.cpp:139–158  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137}
138
139std::vector<std::string>
140CryptoModule::getOneTimeKeysForPublishing(size_t oneTimeKeysAmount) {
141 try {
142 // Get current unpublished keys
143 auto oneTimeKeysVec = this->vodozemacAccount->one_time_keys();
144 size_t numUnpublishedKeys = oneTimeKeysVec.size();
145
146 // Generate more if needed
147 if (numUnpublishedKeys < oneTimeKeysAmount) {
148 this->generateOneTimeKeys(oneTimeKeysAmount - numUnpublishedKeys);
149 }
150
151 this->publishOneTimeKeys();
152
153 return this->keys.oneTimeKeys;
154 } catch (const std::exception &e) {
155 throw std::runtime_error(
156 "error getOneTimeKeysForPublishing => " + std::string(e.what()));
157 }
158}
159
160std::string CryptoModule::getPrekey() {
161 try {

Callers 1

getOneTimeKeysMethod · 0.80

Calls 3

generateOneTimeKeysMethod · 0.95
publishOneTimeKeysMethod · 0.95
one_time_keysMethod · 0.45

Tested by

no test coverage detected