用例是在 c# 中保护内存编程中的字符串。
Microsoft 本身不鼓励使用 SecureString ( https://docs.microsoft.com/en-us/dotnet/api/system.security.securestring?view=netframework-4.7.2 ) 类。
我想知道它是否可以作为一个有效的替代方案:
有什么建议吗?
最佳答案
SecureString
别无选择类(class)。找到 Microsoft 鼓励的“替代方案”here :
The general approach of dealing with credentials is to avoid them and instead rely on other means to authenticate, such as certificates or Windows authentication.
因此,如果您确实需要凭据并且别无他法:在 .NET Framework 上,请使用
SecureString
.对于 .NET Core,目前别无选择。
关于c# - 如何在没有 SecureString 的情况下保护字符串?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55590869/