System.PlatformNotSupportedException AesCryptoServiceProvider

I have the following problem.

I created a class that uses AesCryptoServiceProvider to encrypt and decrypt some data. I use a class in SharePoint WebPart and everything works fine. I also use the same class in the same web application in the SharePoint user web service, and every time the System.Security.Cryptography.AesCryptoServiceProvider constructor is called, it throws a System.PlatformNotSupportedException exception with the following stack trace.

System.PlatformNotSupportedException: The specified cryptographic algorithm is not supported on this platform.
   at System.Security.Cryptography.CapiNative.AcquireCsp(String keyContainer, String providerName, ProviderType providerType, CryptAcquireContextFlags flags, Boolean throwPlatformException)
   at System.Security.Cryptography.AesCryptoServiceProvider..ctor()
   at m2009_wu.ProvisioningLibrary.ConfigManager..ctor()

I tried to compile webservice and a library with a class in it for different platforms without any changes.

My development environment runs Windows Server 2008 Standard SP1 x64 with Microsoft Office SharePoint Server 2007 Service Pack 2 and Visual Studio 2008 Service Pack 1 (SP1). The server has the .NET Framework 3.5 SP1 installed.

It would be great if someone could point me in the right direction.

Regards Rene Vinegger

+3
source share
4 answers

From MSDN:

PlatformNotSupportedException . There is no supported key size for the current platform. [Link]

What key size are you using?

The minimum key size is 128 bits and the maximum size is 256 bits. [Link]

0
source

Your exception:

. . MSDN .

0

? Microsoft (, ..).

, , (, , FIPS ).

0

- ASP.Net WCF, .

0

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


All Articles