我遇到了以下问题。
我创建了一个使用AesCryptoServiceProvider加密和解密一些数据的类。我在SharePoint WebPart中使用这个类,一切都很顺利。我还在同一个Web应用程序中的自定义SharePoint Web服务中使用相同的类,但每次调用System.Security.Cryptography.AesCryptoServiceProvider的构造函数时,它都会抛出System.PlatformNotSupportedException并显示以下堆栈跟踪。
我创建了一个使用AesCryptoServiceProvider加密和解密一些数据的类。我在SharePoint WebPart中使用这个类,一切都很顺利。我还在同一个Web应用程序中的自定义SharePoint Web服务中使用相同的类,但每次调用System.Security.Cryptography.AesCryptoServiceProvider的构造函数时,它都会抛出System.PlatformNotSupportedException并显示以下堆栈跟踪。
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()
我已经尝试在不同平台上编译包含类的webservice和库,但没有任何变化。
我的开发环境运行在Windows Server 2008 Standard SP1 x64上,安装了Microsoft Office SharePoint Server 2007 SP2 x64和Visual Studio 2008 SP1。服务器上安装了.Net Framework 3.5 SP1。
如果有人能指点我正确的方向,我将不胜感激。
谢谢 Rene Windegger