【发布时间】:2017-06-27 05:49:16
【问题描述】:
我在使用 C# 的进程中添加密码凭据时遇到问题
目前看起来如下:
char[] passwordChars = {'x', 'x', 'x', '@', 'x', 'x', 'x', 'x'} ;
System.Security.SecureString ssPwd = new SecureString(passwordChars, passwordChars.Length);
我想知道如何继续将它从 char[] 转换为 char*。
【问题讨论】:
-
“此 API 支持产品基础架构,不打算直接从您的代码中使用。” 可能重复使用
AppendChar。 (您在数组中有passwordChars的事实已经部分推翻了SecureString的观点。) -
请注意,
SecureString不再被认为是安全的。见here
标签: c#