Is System.Security.Cryptography namespace supported by the Portable Class Library

限于喜欢 提交于 2019-12-04 03:04:59

No unfortunately, Portable Library does not support Crypto. However, we've added support for it in PclContrib.

I would suspect it does not support it. Members on classes in that Namespace are marked with an image:

You can find which members are supported by the Portable Class Library project in the reference topics for the .NET Framework Class Library. In the members table for a class, the following Portable Class Library icon appears next to supported members.

That image is lacking in every class I examined in the documentation.

This namespace is available in Silverlight and I am wondering why the Portable Class Library does not support it?

I can't say for sure; but it does appear to be lacking under XNA for the XBox 360 platform. Even then, I believe your conclusion is correct - it isn't an API that is very popular on a front end. Then underlying code is also extremely non-portable. A large portion of the Crypto namespace is accomplished by P/Invoking down to the operating system. I suspect they could make it portable as they did with Silverlight; but that may just not have been on their radar just yet.

I suggest you use PclCrypto. It's the simplest to use and invokes platform crypto rather than trying to implement it itself, which means less security risk and faster performance.

"You can find which members are supported by the Portable Class Library project in the reference topics for the .NET Framework Class Library. In the members table for a class, the following Portable Class Library icon appears next to supported members. "

I would recommend using the object browser, as I have found examples of classes that the MSDN indicates are supported in the PCL, but are missing from the framework. Such an example is Lazy

(as of 2011-9-11)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!