Xamarin 安全敏感数据存储

发布于 2025-01-12 06:49:46 字数 220 浏览 5 评论 0原文

在 xamarin 应用程序上, 我可以在其中存储 dbConnection 或其他安全敏感数据。 例如,在 asp net 应用程序中,我的 DBConnection 字符串存储在 appsettings.json 文件中,并且用户无权访问该文件。 但在 xamarin 应用程序上我没有找到安全的方法, 例如,我可以在代码中硬编码 dbConnection,但用户可以反编译我的代码并获取 dbConnection 字符串

On xamarin app,
where I can store my dbConnection or other security-sensitive data.
For example in asp net application my DBConnection string i store in the appsettings.json file, and a user don't have access to that file.
But on xamarin app I don't found secure way,
For example, I can hardcode dbConnection in my code, but the user can decompile my code and get dbConnection string

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

以可爱出名 2025-01-19 06:49:46

您可以使用 Xamarin Essentials 中的 SecureStorage 来存储敏感数据。

await SecureStorage.SetAsync("oauth_token", "secret-oauth-token-value");

检查 Xamarin Essentials 的文档
https://learn.microsoft.com/en-我们/xamarin/essentials/secure-storage?tabs=ios

You can use SecureStorage from Xamarin Essentials to store sensitive data.

await SecureStorage.SetAsync("oauth_token", "secret-oauth-token-value");

Check documentation for Xamarin Essentials
https://learn.microsoft.com/en-us/xamarin/essentials/secure-storage?tabs=ios

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文