returns number of published keys
| 56 | |
| 57 | // returns number of published keys |
| 58 | size_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 | |
| 76 | bool CryptoModule::prekeyExistsAndOlderThan(uint64_t threshold) { |
| 77 | // Our fork of Vodozemac only remembers two prekeys at a time. |
no test coverage detected