0
我的代碼:試圖輸出RSA私鑰
using System.Security.Cryptography;
public class Test
{
public static void Main()
{
RSACryptoServiceProvider RSA = new RSACryptoServiceProvider();
System.Console.WriteLine(RSA.ToXMLString(false));
}
}
當我運行它,我得到以下幾點:
test.cs(10,38): error CS1061: 'RSACryptoServiceProvider' does not contain a definition for 'ToXMLString' and no extension method 'ToXMLString' accepting a first argument of type 'RSACryptoServiceProvider' could be found (are you missing a using directive or an assembly reference?)
什麼我還挺期待更多的東西是這樣的:
<?xml version="1.0" encoding="utf-16"?>
<RSAParameters xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Exponent>AQAB</Exponent>
<Modulus>sMFsHSyxAP5N85yvx/XDs9acJa30qwBjoOdDKvNOHJUYBpspwatkdtErCqM2W6tXH9rbvhIn8/nqW4OqAdLinlgkEJoQ/qnzKjYJhHl4YzKFL6Wp+iFRH6ar6ZWOE87LeNQ0nHwlXKoWkJQKV8NB38XRw6aLvNTj8Po2yaFDbQFztsJ+ILkumRh7Leu77IV+124Swc6JqLRt5z2FnDX869dRi2fqcnFa1EHEBsPEndVd2HSeJUncTQiWJ9SNRU+WLltVVewYiGheqr1ABab++3XM5qrB6fWn/RN9Fcg5nM8fachAFSX2YRrEsg7mcbNALRes6OEdpI0LBdX8Wdw6oQ==</Modulus>
</RSAParameters>
任何想法?
@ScottChamberlain - 看起來像4.6.2。 – neubert
你有一個簡單的容錯性錯誤,它是'ToXmlString(false)'not'.ToXMLString(false)' –