class Keychain {
static func openReference(called ref: Data) -> String? {
var result: CFTypeRef?
- let ret = SecItemCopyMatching([kSecClass: kSecClassGenericPassword,
- kSecValuePersistentRef: ref,
+ let ret = SecItemCopyMatching([kSecValuePersistentRef: ref,
kSecReturnData: true] as CFDictionary,
&result)
if ret != errSecSuccess || result == nil {
}
static func verifyReference(called ref: Data) -> Bool {
- return SecItemCopyMatching([kSecClass: kSecClassGenericPassword,
- kSecValuePersistentRef: ref] as CFDictionary,
+ return SecItemCopyMatching([kSecValuePersistentRef: ref] as CFDictionary,
nil) != errSecItemNotFound
}
}