Missing System.Security.Cryptography

I want to use the HMACSHA1 class in a project, but the System.Security.Cryptography missing. If I add the System.Security link, I will find the Cryptography namespace, but without the HMACSHA1 class. And I cannot find the Windows.Security.Cryptography namespace, which seems to replace System.Security.Cryptography .

My project targets the framework of .NET 4.5 and .NET for Windows Store applications, and it uses Nuget on Visual 2012 on Windows 7 .

Does anyone have a solution to this problem?

+5
source share
2 answers

According to the MSDN entry on the HMACSHA1

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

There is no information that it is included in the Portable Class Library .

BUT: there Portable Class Libraries Contrib where there is a port HMACSHA1

+3
source

I had what looked like a similar problem in a newly created C # console application. By default, the system help system showed that the System.Security system, but not any cryptographic information. I needed to right-click "Links", "Add Link" and select "System Security", after which I had access to cryptography materials.

I am new to C #, so sorry if my description is not up to tobacco or this solution does not apply to mobile applications. Maybe helping someone else. THX

0
source

Source: https://habr.com/ru/post/1200023/


All Articles