一个钥匙串条目中包含多个秘密
我要在 Mac OS 钥匙串中存储三个秘密。目前,我将它们存储在单独的钥匙串条目中。这样做的缺点是,如果我的应用程序更新,用户会看到三个“允许访问”对话框,每个条目一个。我想做的是将所有三个秘密存储在一个钥匙串条目中。这些秘密之一是用户提供的密码。
执行此操作的标准方法是什么?我是否应该将所有数据塞入密码字段(这意味着用户提供的密码这一秘密在 KeychainAccess.app 中不太可读),或者是否有其他方法来添加多个“密码”(即,加密字段)到一个钥匙串条目中?
I have three secrets to store in the Mac OS keychain. Currenly I store each of these in a separate keychain entry. The drawback to this is that if my application is updated the user sees three "allow access" dialogs, one for each entry. What I'd like to do is store all three secrets in one keychain entry. One of these secrets is a user-supplied password.
What is the standard method for doing this? Should I just cram all data into the password field (which means the one secret that is a user-supplied password won't be very readable in KeychainAccess.app), or is there some other way to add multiple "passwords" (i.e., encrypted fields) into one keychain entry?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为没有标准方法,但如果您的秘密相当短,那么您可以将它们放在开头,例如“base64-encoded-secret-1 base64-encoded-secret-2 密码”,这很容易解析(即使密码包含空格)并且意味着用户可以在必要时在“钥匙串访问”中看到密码。
I don't think there's a standard method, but if your secrets are reasonably short then you can stick them at the beginning, e.g. "base64-encoded-secret-1 base64-encoded-secret-2 password", which is easy to parse (even if the password contains spaces) and means that the user can see the password in Keychain Access if necessary.