.NET Core 中是否存在 System.Security.Cryptography.Pkcs.SignedCms 类的替代方案?还是我必须深入研究 BouncyCaSTLe,就像他们在 WinRT 案例中所做的那样? Is there an alternative of SignedCMS in WinRT?
最佳答案
仅供引用,以防有帮助。似乎可以通过此 NUGET
程序包获得对 SignedCms 和 S/MIME 的其他基本 .NET 类的支持:
System.Security.Cryptography.Pkcs
即在将此 NUGET
包添加到我的 Visual Studio 2017 (VS2017) .NET Core 项目之前,我收到了以下编译错误:
Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'CmsRecipientCollection' could not be found (are you missing a using directive or an assembly reference?)
Error CS0246 The type or namespace name 'X509IssuerSerial' could not be found (are you missing a using directive or an assembly reference?)
Error CS0246 The type or namespace name 'EnvelopedCms' could not be found (are you missing a using directive or an assembly reference?)
Error CS0246 The type or namespace name 'SignedCms' could not be found (are you missing a using directive or an assembly reference?)
Error CS0246 The type or namespace name 'SignerInfoCollection' could not be found (are you missing a using directive or an assembly reference?)
Error CS0246 The type or namespace name 'ContentInfo' could not be found (are you missing a using directive or an assembly reference?)
Error CS0246 The type or namespace name 'CmsRecipient' could not be found (are you missing a using directive or an assembly reference?)
Error CS0246 The type or namespace name 'RecipientInfo' could not be found (are you missing a using directive or an assembly reference?)
Error CS0103 The name 'SubjectIdentifierType' does not exist in the current context
Error CS0246 The type or namespace name 'SignerInfo' could not be found (are you missing a using directive or an assembly reference?)
Error CS1579 foreach statement cannot operate on variables of type 'SignerInfoCollection' because 'SignerInfoCollection' does not contain a public instance definition for 'GetEnumerator'
Error CS0246 The type or namespace name 'CmsSigner' could not be found (are you missing a using directive or an assembly reference?)
添加NUGET
包后,编译成功。
关于c# - .NET Core 中的 SignedCms 替代方案,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40918396/