我在单独的文件中有私钥和公钥。私钥错误中的参数不正确
在指令说,使用此代码:
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider();
rsa.FromXmlString(PrivateKey);
但是当代码到达第二行我得到这个错误:
型“System.Security.Cryptography.CryptographicException”未处理的异常的发生在mscorlib.dll中
附加信息:该参数不正确。
有什么问题?
从公司,我们已经拿到了关键的代码示例,它采用了样本peivate和公钥这样的:
<RSAKeyValue><Modulus>KEY VALUE</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>
即使我加入<RSAKeyValue><Modulus>
的开始和</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>
到最后,还没有作品
你能举一个例子私钥吗? –