这是我的问题:
\n在 C#/.NET-4.8 中,我在两台服务器上使用带有 RSA 私钥的 P12 证书。\n一台服务器运行 Windows Server 2016,另一台服务器运行 Windows Server 2019。\n当我比较两台服务器上同一证书的 RSA 私钥时,输出不一样。\n\n\xe2\x80\x9cprivate exponent\xe2\x80\x9d(在 \xe2\x80\x9cD\xe2\x80\x9d 属性中找到)不一样。
\n有谁知道为什么会发生这种情况?
\n额外信息:\n每次运行时,代码都会(每个系统)输出相同的密钥(这当然很好)。\n代码在 Windows 10、Windows 11 和 Windows Server 2019 上输出相同的私钥,但在 Windows 上服务器2016就不一样了。
\n读取证书密钥的代码是:
\nusing (var rsaPrivateKey = _certificate.GetRSAPrivateKey())\n{\n var parameters = rsaPrivateKey.ExportParameters(true);\n privateExponent = BitConverter.ToString(parameters.D); // privateExponent (parameters.D) is the components which is not the same on each system.\n\n privateKeyXml = rsaPrivateKey.ToXmlString(true); // In privateKeyXml, only the privateExponent changes.\n}\nRun Code Online (Sandbox Code Playgroud)\n预先感谢您的任何帮助!
\ncryptography rsa x509 windows-server-2016 windows-server-2019