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
source
share