简体   繁体   English

是否在iOS钥匙串中加密了帐户名称(kSecAttrAccount)?

[英]Are account names (kSecAttrAccount) encrypted in iOS keychain?

Apple's GenericKeychain example saves a username and password in the iOS keychain. Apple的GenericKeychain示例在iOS钥匙串中保存用户名和密码。 It does this using kSecAttrAccount for the username, and kSecValueData for the password. 它使用kSecAttrAccount作为用户名, kSecValueData作为密码。

Are all data items placed in the keychain encrypted, so including the kSecAttrAccount /username in this example? 是否对加密的钥匙串中的所有数据项进行了加密,因此在此示例中包含kSecAttrAccount / username?

I'm asking because I don't want account names to be exposed. 我问,因为我不希望公开帐户名称。

If you use kSecAttr for the username it will be encrypted. 如果您使用kSecAttr作为用户名,它将被加密。

The attributes associated with a keychain item depend on the class of the item; 与钥匙串项目相关联的属性取决于项目的类别; the item classes most used by applications ... are Internet passwords and generic passwords. 应用程序最常使用的项目类别是Internet密码和通用密码。 As you might expect, Internet passwords include attributes for such things as security domain, protocol type, and path. 正如您所料,Internet密码包含安全域,协议类型和路径等属性。 The passwords or other secrets stored as keychain items are encrypted. 存储为钥匙串项的密码或其他秘密是加密的。

(see "Structure of a Keychain" ) (参见“钥匙串的结构”

As you use kSecAttrAccount , which can only be used with the classes kSecClassInternetPassword and kSecClassGenericPassword (see Keychain Services Reference @ kSecAttrAccount ), the account name will be encrypted. 当您使用kSecAttrAccount ,它只能与类kSecClassInternetPasswordkSecClassGenericPassword (请参阅Keychain Services Reference @ kSecAttrAccount ),帐户名称将被加密。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM