Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SecRequestSharedWebCredential(nil, nil){ credentials, error in
- guard let credentials = credentials else { print("Keychain: No credentials found"); return }
- guard error == nil else { print("Keychain Error:", error?.localizedDescription ?? "no error description"); return }
- let credential = CFArrayGetValueAtIndex(credentials, 0) as! CFDictionary
- let server = unsafeBitCast(CFDictionaryGetValue(credential, unsafeBitCast(kSecAttrServer, to: UnsafeRawPointer<Void>.self)), to: CFString.self)
- let account = unsafeBitCast(CFDictionaryGetValue(credential, unsafeBitCast(kSecAttrAccount, to: UnsafeRawPointer<Void>.self)), to: CFString.self)
- let password = unsafeBitCast(CFDictionaryGetValue(credential, unsafeBitCast(kSecSharedPassword, to: UnsafeRawPointer<Void>.self)), to: CFString.self)
- print("Keychain OK:", server, account, password)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement