SignedCms.Decode

时间:2019-01-16 14:56:48

标签: .net security cryptography pkcs#7 windows-server-2003-r2

我有一个函数可以通过以下代码读取签名文件的内容(例如[MYFILE] .xml.p7m):

 Dim signedCms As New SignedCms()

 signedCms.Decode([MYFILEBYTES])

 Dim content As Byte() = signedCms.ContentInfo.Content

不幸的是,我需要在旧的“ Windows Server 2003 R2”系统上运行该程序,但它会生成此异常:

Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Security.Cryptography.CryptographicException
Stack:
   at System.Security.Cryptography.Pkcs.SignedCms.OpenToDecode(Byte[], 
      System.Security.Cryptography.Pkcs.ContentInfo, Boolean)
   at System.Security.Cryptography.Pkcs.SignedCms.Decode(Byte[])

显示消息“未知密码算法”。

在另一台“ Windows Server 2003 R2”计算机上,它可以正常工作。

我的问题是:应该在“ Windows Server 2003 R2”上安装什么组件才能使signedCms.Decode语句正常工作?

0 个答案:

没有答案