我正在嘗試使用此api SecKeychainFindGenericPassword()獲取機場網絡密碼。 但我總是得到itemnotfound錯誤。我不確定要在API中輸入帳戶名稱和服務名稱。我添加了代碼片段來顯示我在做什麼。任何幫助,將不勝感激 。 感謝使用SecKeychainFindGenericPassword獲取機場網絡密碼
OSStatus status1 ;
SecKeychainRef kychain = nil;
SecKeychainCopyDefault(&kychain);
status1 = SecKeychainFindGenericPassword (
kychain, // default keychain
15, // length of service name
"AirPort Network", // service name
38, // length of account name
"com.apple.network.wlan.ssid.xxxxxxxx", // account name
passwordLength, // length of password
&passwordData, // pointer to password data
itemRef // the item reference
);
return (status1);
我使用OSX 10.8