Security.SecKeyChain Class
Access to the operating system keychain.

See Also: SecKeyChain Members

Syntax

public class SecKeyChain : ObjCRuntime.INativeObject

Remarks

This class can be used to add, remove, update or query the iOS or MacOS keychain. MacOS is limited to a single kind of password (SecKind.InternetPassword) while iOS offers a wider range of options.

Use SecKeyChain.QueryAsData to get values from the keychain as a binary blob. Some of the overloads can also return binary blobs that are suitable to be stored on disk, or passed to another process.

Use SecKeyChain.QueryAsConcreteType to get a Security.SecCertificate, a Security.SecKey or a Security.SecIdentity back from the keychain.

Use SecKeyChain.QueryAsRecord to get a strongly typed SecRecord with the results of your query.

C# Example

var query = new SecRecord (SecKind.InternetPassword) {
   Sever = "bugzilla.novell.com",
   Account = "miguel"
};
var password = SecKeyChain.QueryAsData (query);
Console.WriteLine ("The password for the account is: {0}", password);

  

Related content

Requirements

Namespace: Security
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0