Skip to content

Instantly share code, notes, and snippets.

@spouliot
Created December 7, 2015 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spouliot/c55e1cc04e3899788107 to your computer and use it in GitHub Desktop.
Save spouliot/c55e1cc04e3899788107 to your computer and use it in GitHub Desktop.
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