c# - .NET Core 中的 SignedCms 替代方案

标签 c# .net-core

.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/

相关文章:

c# - 自定义角色存储 asp.net

c# - MVVM 批准的方法来禁用文本框中的某些字符?

asp.net-core - ASP.NET Core修改密码后登录失败

.net - .net vNext 到底是什么。 .net core vs vNext 差异/解释

c# - .NET Core 中的 win/any 运行时是什么意思

c# - 使用 C# 找出 Azure 中的 ObjectID 是组、用户还是服务主体的最快方法

c# - 找不到 MiniProfiler ProfilingActionFilter 和 ProfilingViewEngine

c# - XML 序列化 - 绕过容器类?

c# - Spin 在 Portable Class Library 中等待多次自旋

c# - 如何在netcore1.1项目上集成Google OAuth2 MVC?