here is my issue:
In C#/.NET-4.8, I use a P12 certificate with RSA private key on 2 servers. One server runs Windows Server 2016, the other Windows Server 2019. When I compare the RSA private keys of the same certificate on both servers, the output is not the same. The “private exponent” (found in the “D” property) is not the same.
Does anyone know why this happens?
Extra info: The code keeps outputting the same key (per system), every time it runs (which of course is good). The code outputs the same private key on Windows 10, Windows 11, and Windows Server 2019 but on Windows Server 2016 it is different.
The code to read out the certificates key is:
using (var rsaPrivateKey = _certificate.GetRSAPrivateKey())
{
var parameters = rsaPrivateKey.ExportParameters(true);
privateExponent = BitConverter.ToString(parameters.D); // privateExponent (parameters.D) is the components which is not the same on each system.
privateKeyXml = rsaPrivateKey.ToXmlString(true); // In privateKeyXml, only the privateExponent changes.
}
Thanks in advance for any help!