Differential D6779 Diff 23324 native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.cpp
Changeset View
Changeset View
Standalone View
Standalone View
native/cpp/CommonCpp/Notifications/BackgroundDataStorage/NotificationsCryptoModule.cpp
Show First 20 Lines • Show All 166 Lines • ▼ Show 20 Lines | std::string NotificationsCryptoModule::getNotificationsIdentityKeys() { | ||||
const std::string path = | const std::string path = | ||||
PlatformSpecificTools::getNotificationsCryptoAccountPath(); | PlatformSpecificTools::getNotificationsCryptoAccountPath(); | ||||
crypto::CryptoModule cryptoModule = | crypto::CryptoModule cryptoModule = | ||||
NotificationsCryptoModule::deserializeCryptoModule( | NotificationsCryptoModule::deserializeCryptoModule( | ||||
path, picklingKey.value()); | path, picklingKey.value()); | ||||
return cryptoModule.getIdentityKeys(); | return cryptoModule.getIdentityKeys(); | ||||
} | } | ||||
void NotificationsCryptoModule::clearSensitiveData() { | |||||
std::string notificationsCryptoAccountPath = | |||||
PlatformSpecificTools::getNotificationsCryptoAccountPath(); | |||||
if (remove(notificationsCryptoAccountPath.c_str()) == -1 && errno != ENOENT) { | |||||
throw std::runtime_error( | |||||
"Unable to remove notifications crypto account. Security requirements " | |||||
"might be violated."); | |||||
} | |||||
} | |||||
} // namespace comm | } // namespace comm |