MCPcopy Create free account
hub / github.com/PurpleI2P/i2pd / SetPrivateKeys

Method SetPrivateKeys

libi2pd/Destination.cpp:1139–1154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1137 }
1138
1139 void ClientDestination::SetPrivateKeys (const i2p::data::PrivateKeys& keys)
1140 {
1141 if (m_StreamingDestination) m_StreamingDestination->Stop (); // close all streams
1142 CleanUp (); // delete sessions and tags
1143 auto pool = GetTunnelPool ();
1144 if (pool) pool->DetachTunnels ();
1145 m_Keys = keys;
1146 // update static keys
1147 for (auto it: m_EncryptionKeys)
1148 if (it.second)
1149 {
1150 it.second->GenerateKeys ();
1151 it.second->CreateDecryptor ();
1152 }
1153 if (m_StreamingDestination) m_StreamingDestination->Start ();
1154 }
1155
1156 void ClientDestination::HandleDataMessage (const uint8_t * buf, size_t len,
1157 i2p::garlic::ECIESX25519AEADRatchetSession * from)

Callers 1

ResumeMethod · 0.80

Calls 5

DetachTunnelsMethod · 0.80
StopMethod · 0.45
GenerateKeysMethod · 0.45
CreateDecryptorMethod · 0.45
StartMethod · 0.45

Tested by

no test coverage detected