缺少System.Security.Cryptography

Nag*_*iar 5 hmacsha1 portable-class-library

我想HMACSHA1在项目中使用该类,但System.Security.Cryptography缺少命名空间.如果我添加引用System.Security,我会找到命名空间Cryptography但没有类HMACSHA1.我找不到Windows.Security.Cryptography似乎取代的命名空间System.Security.Cryptography.

我谟目标框架.NET 4.5.NET用于Windows应用商店的应用程序,并使用他NugetVisual 2012Windows 7.

有人有解决这个问题的方法吗?

小智 3

根据 MSDN 条目HMACSHA1

http://msdn.microsoft.com/en-us/library/system.security.cryptography.hmacsha1(v=vs.110).aspx

没有任何信息表明它包含在Portable Class Library.

但是:那里有可移植类库 Contrib,其中包括HMACSHA1

  • 另请查看 PCL Crypto:https://pclcrypto.codeplex.com/ 它有一个 NuGet 包,因此可能更容易使用。 (2认同)