I am developing an app with xcode8 and Swift3.
I try to use KeyChain to store username password and other sensible data. I know there are KeyChain query constants like following:
let kSecClassValue = NSString(format: kSecClass)
let kSecAttrAccountValue = NSString(format: kSecAttrAccount)
let kSecValueDataValue = NSString(format: kSecValueData)
let kSecClassGenericPasswordValue = NSString(format: kSecClassGenericPassword)
let kSecAttrServiceValue = NSString(format: kSecAttrService)
let kSecMatchLimitValue = NSString(format: kSecMatchLimit)
let kSecReturnDataValue = NSString(format: kSecReturnData)
let kSecMatchLimitOneValue = NSString(format: kSecMatchLimitOne)
I read couple of tutorials about storing data using KeyChain, they all use different query constants, some use all of above constants, some use part of it. I want to know:
- When to use what query constants?
- What are the purpose of each constant?