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 @@ -34,6 +34,9 @@ generateAndGetNotificationsPrekey(const std::string &callingProcessName); static std::string getNotificationsPrekeySignature(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 @@ -213,6 +213,18 @@ return prekeySignature; } +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,