通用Windows应用程序System.Security.Cryptography

本文关键字:Security Cryptography System 应用程序 Windows 通用 | 更新日期: 2023-09-27 18:08:49

我目前正在为Windows 10开发一个应用程序,并且遇到了一个问题。

我正在使用JS和HTML的UI,并希望使用c#的代码后面。从这个平台的有限文档中,我的理解是,我必须使用一个Windows运行时组件,然后由JS项目引用,以便我可以从中调用托管代码。然后,我还需要创建一个运行时组件将引用的通用类库。

我遇到的问题是,我使用的代码在很大程度上依赖于一个广泛使用System.Security.Cryptography的库,从我收集的UWP和。net Core或任何只有Windows.Security.Cryptography.Core的库,这是一个非常充实的版本,包含在。net框架中。

我的问题是,是否有可能以某种方式包括调用和使用System.Security.Cryptography在我的应用程序?或者我必须找到某种变通方法,使其适用于UWP?

通用Windows应用程序System.Security.Cryptography

我的问题是,是否有可能以某种方式包括call和useSystem.Security.Cryptography在我的应用程序?还是我自己去找一种变通方法,使它适用于UWP?

不,你不能在通用Windows平台应用程序中使用System.Security.Cryptography。它包含在完整的。net(桌面。net)中,而UWP的。net没有它。Windows. security . cryptography . core由Windows Runtime提供,你可以在Windows Runtime组件中使用它。恐怕你必须更改使用过的代码。系统。安全。密码学。

您可以下载System.Security.Cryptography.Algorithms nuget包到您的解决方案中。

情况有变!我在Build 14393上有一个通用Windows类库,可以让我使用System.Security.Cryptography.