Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将 DSACryptoServiceProvider 类与 C# 一起使用来创建两个 DLL:一个将能够验证和创建数字签名,另一个将能够验证。基本上,我正在尝试创建一个私钥/公钥对并相应地保存它们的密钥(到文件中)。
使用 ExportParameters() 时遇到问题。当我尝试导出包含私有信息的密钥(使用序列化)时,私有信息会自动被清除。
有没有更好的方法来存储密钥?
提前致谢。
看这里:
http://msdn.microsoft.com/en-us/library/system.security.cryptography.dsacryptoserviceprovider.exportparameters(VS.80).aspx
我想你想做的是:
ExportParameters(true)
'true' 意味着它将导出私人部分