问题
Trying to set/get some passwords into Keychain on MacOS, using C#. Managed to add Xamarin.iOS assembly, but can't seem to go further. This is what I have,
using System;
using Security;
using Foundation;
var query = new SecRecord(SecKind.InternetPassword)
{
Server = "bugzilla.novell.com",
Account = "miguel"
};
But get an exception, which isn't that useful. I am not sure what value is null. This above example is straight from Xamarin website, but doesn't work. New to this Keychain business, so not sure what I am missing.
Can someone help, please? Any help is greatly appreciated!
I have also tried to instantiate without the enum, but still get the same error.
回答1:
Was able to solve this by calling security
cmd - https://ss64.com/osx/security.html
But if anyone knows how this can be done via API and using C#, please let me know. Thanks in advance!
来源:https://stackoverflow.com/questions/50936376/net-core-c-sharp-macos-keychain-api