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 @@ -154,4 +154,22 @@ picklingKey, callingProcessName); } + +std::string NotificationsCryptoModule::getNotificationsIdentityKeys() { + CommSecureStore secureStore{}; + folly::Optional picklingKey = secureStore.get( + NotificationsCryptoModule::secureStoreNotificationsAccountDataKey); + if (!picklingKey.hasValue()) { + throw std::runtime_error( + "Attempt to retrieve notifications crypto account before it was " + "correctly initialized."); + } + + const std::string path = + PlatformSpecificTools::getNotificationsCryptoAccountPath(); + crypto::CryptoModule cryptoModule = + NotificationsCryptoModule::deserializeCryptoModule( + path, picklingKey.value()); + return cryptoModule.getIdentityKeys(); +} } // namespace comm