Skip to content

Instantly share code, notes, and snippets.

Created Dec 7, 2015
What would you like to do?
kSecAttrAccesControl = new SecAccessControl(SecAccessible.WhenPasscodeSetThisDeviceOnly, SecAccessControlCreateFlags.TouchIDCurrentSet | SecAccessControlCreateFlags.PrivateKeyUsage);
var t = kSecAttrAccesControl.GetType ();
var m = t.GetMethod ("Create", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic);
if (m != null) {
// workaround needed
var handle = (IntPtr) m.Invoke (kSecAttrAccesControl, null);
t.GetProperty ("Handle").GetSetMethod (true).Invoke (kSecAttrAccesControl, new object [] { handle });
var parameters = NSDictionary.FromObjectsAndKeys (
new object[] {kSecAttrTokenIDSecureEnclave, kSecAttrAccesControl },
new object[] {kSecAttrTokenID, kSecAttrAccessControlString}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment