| 175 | } |
| 176 | |
| 177 | std::optional<std::string> CryptoModule::getUnpublishedPrekey() { |
| 178 | try { |
| 179 | std::string unpublished = |
| 180 | std::string(this->vodozemacAccount->unpublished_prekey()); |
| 181 | // NOTE: We use an empty string to represent None because cxx doesn't |
| 182 | // support Option<&str> in FFI function signatures. |
| 183 | if (unpublished.empty()) { |
| 184 | return std::nullopt; |
| 185 | } |
| 186 | return unpublished; |
| 187 | } catch (const std::exception &e) { |
| 188 | throw std::runtime_error( |
| 189 | "error getUnpublishedPrekey => " + std::string(e.what())); |
| 190 | } |
| 191 | } |
| 192 | |
| 193 | std::string CryptoModule::generateAndGetPrekey() { |
| 194 | try { |
no test coverage detected