mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2026-05-25 20:45:02 +00:00
common LocalEncryptionKey to pass to loacl LeaseSet
This commit is contained in:
@@ -181,5 +181,21 @@ namespace crypto
|
||||
k.GetPrivateKey (priv);
|
||||
memcpy (pub, k.GetPublicKey (), 32);
|
||||
}
|
||||
|
||||
LocalEncryptionKey::LocalEncryptionKey (i2p::data::CryptoKeyType t): keyType(t)
|
||||
{
|
||||
pub.resize (GetCryptoPublicKeyLen (keyType));
|
||||
priv.resize (GetCryptoPrivateKeyLen (keyType));
|
||||
}
|
||||
|
||||
void LocalEncryptionKey::GenerateKeys ()
|
||||
{
|
||||
i2p::data::PrivateKeys::GenerateCryptoKeyPair (keyType, priv.data (), pub.data ());
|
||||
}
|
||||
|
||||
void LocalEncryptionKey::CreateDecryptor ()
|
||||
{
|
||||
decryptor = i2p::data::PrivateKeys::CreateDecryptor (keyType, priv.data ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user