Files
SuperVPN/output/Libraries/BouncyCastle.Crypto/Org/BouncyCastle/Crypto/Parameters/RsaKeyGenerationParameters.cs
2025-10-09 09:57:24 +09:00

42 lines
991 B
C#

using Org.BouncyCastle.Math;
using Org.BouncyCastle.Security;
namespace Org.BouncyCastle.Crypto.Parameters;
public class RsaKeyGenerationParameters : KeyGenerationParameters
{
private readonly BigInteger publicExponent;
private readonly int certainty;
public BigInteger PublicExponent => publicExponent;
public int Certainty => certainty;
public RsaKeyGenerationParameters(BigInteger publicExponent, SecureRandom random, int strength, int certainty)
: base(random, strength)
{
this.publicExponent = publicExponent;
this.certainty = certainty;
}
public override bool Equals(object obj)
{
if (!(obj is RsaKeyGenerationParameters rsaKeyGenerationParameters))
{
return false;
}
if (certainty == rsaKeyGenerationParameters.certainty)
{
return publicExponent.Equals(rsaKeyGenerationParameters.publicExponent);
}
return false;
}
public override int GetHashCode()
{
int num = certainty;
return num.GetHashCode() ^ publicExponent.GetHashCode();
}
}