MCPcopy Create free account
hub / github.com/CommE2E/comm / storeAsB64

Method storeAsB64

native/cpp/CommonCpp/CryptoTools/CryptoModule.cpp:287–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

285}
286
287Persist CryptoModule::storeAsB64(const std::string &secretKey) {
288 Persist persist;
289 std::string accountPickle = this->pickleAccount(secretKey);
290 persist.account = OlmBuffer(accountPickle.begin(), accountPickle.end());
291
292 std::unordered_map<std::string, std::shared_ptr<Session>>::iterator it;
293 for (it = this->sessions.begin(); it != this->sessions.end(); ++it) {
294 std::string sessionPickle = it->second->storeAsB64(secretKey);
295 OlmBuffer buffer(sessionPickle.begin(), sessionPickle.end());
296 SessionPersist sessionPersist{buffer, it->second->getVersion()};
297 persist.sessions.insert(make_pair(it->first, sessionPersist));
298 }
299
300 return persist;
301}
302
303std::string CryptoModule::pickleAccountToString(const std::string &secretKey) {
304 return this->pickleAccount(secretKey);

Callers

nothing calls this directly

Calls 3

pickleAccountMethod · 0.95
endMethod · 0.80
getVersionMethod · 0.80

Tested by

no test coverage detected