diff --git a/native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.h b/native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.h --- a/native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.h +++ b/native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.h @@ -32,6 +32,9 @@ getNotificationsIdentityKeys(const std::string &callingProcessName); static std::string generateAndGetNotificationsPrekey(const std::string &callingProcessName); + static std::string getNotificationsOneTimeKeys( + const size_t oneTimeKeysAmount, + const std::string &callingProcessName); static crypto::EncryptedData initializeNotificationsSession( const std::string &identityKeys, const std::string &prekey, diff --git a/native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.cpp b/native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.cpp --- a/native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.cpp +++ b/native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.cpp @@ -202,6 +202,18 @@ return prekey; } +std::string NotificationsCryptoModule::getNotificationsOneTimeKeys( + const size_t oneTimeKeysAmount, + const std::string &callingProcessName) { + std::string oneTimeKeys; + auto caller = [&oneTimeKeys, + oneTimeKeysAmount](crypto::CryptoModule cryptoModule) { + oneTimeKeys = cryptoModule.getOneTimeKeys(oneTimeKeysAmount); + }; + NotificationsCryptoModule::callCryptoModule(caller, callingProcessName); + return oneTimeKeys; +} + crypto::EncryptedData NotificationsCryptoModule::initializeNotificationsSession( const std::string &identityKeys, const std::string &prekey,