在.NET Core中是否存在System.Security.Cryptography.Pkcs.SignedCms类的替代品?或者我必须像WinRT案例中一样深入研究BouncyCastle?WinRT中是否存在SignedCMS的替代品?
在.NET Core中是否存在System.Security.Cryptography.Pkcs.SignedCms类的替代品?或者我必须像WinRT案例中一样深入研究BouncyCastle?WinRT中是否存在SignedCMS的替代品?
如果有帮助的话,供您参考。看起来支持 SignedCms
和其他关键的 .NET 类库用于 S/MIME 的方式是通过这个 NUGET
软件包提供的:
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
软件包后,编译成功。
目前在.NET Core中没有与SignedCms等价的功能。
您可以在https://github.com/dotnet/corefx/issues上创建一个问题,表明您希望将其引入到.NET Core中。