mirror of
https://github.com/PurpleI2P/i2pd
synced 2024-11-10 00:00:29 +03:00
LeaseSet keys
This commit is contained in:
parent
e832734d94
commit
7f08f782e0
@ -13,6 +13,10 @@ namespace i2p
|
|||||||
if (!Load ())
|
if (!Load ())
|
||||||
CreateNewRouter ();
|
CreateNewRouter ();
|
||||||
Save ();
|
Save ();
|
||||||
|
|
||||||
|
// we generate LeaseSet at every start-up
|
||||||
|
CryptoPP::DH dh (i2p::crypto::elgp, i2p::crypto::elgg);
|
||||||
|
dh.GenerateKeyPair(m_Rnd, m_LeaseSetPrivateKey, m_LeaseSetPublicKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
const uint8_t * RouterContext::GetSigningPrivateKey () const
|
const uint8_t * RouterContext::GetSigningPrivateKey () const
|
||||||
|
@ -20,6 +20,8 @@ namespace i2p
|
|||||||
i2p::data::RouterInfo& GetRouterInfo () { return m_RouterInfo; };
|
i2p::data::RouterInfo& GetRouterInfo () { return m_RouterInfo; };
|
||||||
const uint8_t * GetPrivateKey () const { return m_PrivateKey; };
|
const uint8_t * GetPrivateKey () const { return m_PrivateKey; };
|
||||||
const uint8_t * GetSigningPrivateKey () const;
|
const uint8_t * GetSigningPrivateKey () const;
|
||||||
|
const uint8_t * GetLeaseSetPrivateKey () const { return m_LeaseSetPrivateKey; };
|
||||||
|
const uint8_t * GetLeaseSetPublicKey () const { return m_LeaseSetPublicKey; };
|
||||||
const i2p::data::RouterIdentity& GetRouterIdentity () const { return m_RouterInfo.GetRouterIdentity (); };
|
const i2p::data::RouterIdentity& GetRouterIdentity () const { return m_RouterInfo.GetRouterIdentity (); };
|
||||||
CryptoPP::RandomNumberGenerator& GetRandomNumberGenerator () { return m_Rnd; };
|
CryptoPP::RandomNumberGenerator& GetRandomNumberGenerator () { return m_Rnd; };
|
||||||
|
|
||||||
@ -37,7 +39,8 @@ namespace i2p
|
|||||||
|
|
||||||
i2p::data::RouterInfo m_RouterInfo;
|
i2p::data::RouterInfo m_RouterInfo;
|
||||||
CryptoPP::DSA::PrivateKey m_SigningPrivateKey;
|
CryptoPP::DSA::PrivateKey m_SigningPrivateKey;
|
||||||
uint8_t m_PrivateKey[256], m_SigningPrivateKeyStr[20];
|
uint8_t m_PrivateKey[256], m_SigningPrivateKeyStr[20],
|
||||||
|
m_LeaseSetPublicKey[256], m_LeaseSetPrivateKey[256];
|
||||||
CryptoPP::AutoSeededRandomPool m_Rnd;
|
CryptoPP::AutoSeededRandomPool m_Rnd;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user