Windows runtime component - System.Security.Cryptography

时光毁灭记忆、已成空白 提交于 2019-12-10 10:28:41

问题


I am working on a Windows 10 Universal App(HTML+WinJS). I need to do Sharepoint authentication in the same. I have created a Windows runtime component to write C# code for authentication. I refered below link: https://coderwall.com/p/ho2uwq/authentication-in-sharepoint-2013-using-c-csom-client

Now my problem is that When we use this C# code in ‘Windows Runtime component’ it does not recognize SecureString class which is included in ‘System.Security.Cryptography’ namespace used for creating secure password and pass it to the SharePointOnlineCredentials’ authentication service. Because System.Security.Cryptography is included in the full .NET (desktop .NET), and the .NET for UWP does not have it.

How to proceed now?


回答1:


There is no SecureString equivalent in the Universal Windows Platform at this point in time. It would need to be exposed as a WinRT API, not a .NET API, so that you could use it for input controls in XAML etc.

If you just want to encrypt the value, there are options with the Windows.Security.Cryptography namespace, but the plaintext would still be available in the memory space of the app (eg, by having it exist in the page file or a crash dump).




回答2:


Probably now we have a nuget package which you can refer and SecureString will be available in UWP app. https://www.nuget.org/packages/System.Security.SecureString



来源:https://stackoverflow.com/questions/32647296/windows-runtime-component-system-security-cryptography

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