MCPcopy Create free account
hub / github.com/ElementsProject/elements / GenerateAndSavePrivateKey

Method GenerateAndSavePrivateKey

src/i2p.cpp:323–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

321}
322
323void Session::GenerateAndSavePrivateKey(const Sock& sock)
324{
325 DestGenerate(sock);
326
327 // umask is set to 077 in init.cpp, which is ok (unless -sysperms is given)
328 if (!WriteBinaryFile(m_private_key_file,
329 std::string(m_private_key.begin(), m_private_key.end()))) {
330 throw std::runtime_error(
331 strprintf("Cannot save I2P private key to %s", fs::quoted(fs::PathToString(m_private_key_file))));
332 }
333}
334
335Binary Session::MyDestination() const
336{

Callers

nothing calls this directly

Calls 5

WriteBinaryFileFunction · 0.85
quotedFunction · 0.85
PathToStringFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected