我有以下问题。
我已经创建了一个使用AesCryptoServiceProvider加密和解密某些数据的类。我在一个SharePoint WebPart中使用这个类,一切都很正常。我还在自定义SharePoint with服务中的同一个with应用程序上使用了相同的类,每次调用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 Server2008 Standard SP1 x64,带有Microsoft Office SharePoint Server2007 SP2 x64和Visual Studio2008 SP1。服务器上安装了.Net Framework3.5 SP1。
如果有人能为我指明正确的方向,我将不胜感激。
Kind尊重Rene Windegger
发布于 2009-08-24 15:33:28
来自MSDN:
PlatformNotSupportedException
-当前平台没有支持的密钥大小。[Link]
你使用的密钥大小是多少?
密钥的最小长度为128位,最大长度为256位。[Link]
发布于 2009-08-26 09:20:19
您的异常声明:
此平台不支持指定的加密算法
您需要尝试其他加密提供程序。并非所有加密提供程序在所有系统上都可用。MSDN提供了完整的列表。
发布于 2009-08-26 09:24:34
您的服务器位于何处?微软不允许在世界某些地区(中国、朝鲜等)使用高密钥强度的加密。
此外,还可以强制执行组策略设置,以防止使用某些加密(例如,政府机构要求通过组策略仅允许FIPS算法)。
https://stackoverflow.com/questions/1322816
复制相似问题