When using SecKey.GenerateKeyPair, you need to pass in an NSDictionary with the properties for the public/private key pairs being generated. Apple's documentation uses the following constants:
kSecPrivateKeyAttrs, kSecAttrKeyType, kSecKeySizeInBits, kSecAttrIsPermanent and kSecAttrApplicationTag
I see the properties exposed on SecRecord which are using these keys internally, but it appears this is primarily for keychain access, and the actual key isn't exposed.
We are currently using dlfcn to get to the constants, but it would be useful to have some public constants exposed on some of the classes to get to these.
Thanks so much for taking the time to submit this report! I can confirm using the latest Xamarin.iOS 10.12.0.14 I am able to reproduce this issue. Marking this report as CONFIRMED.
I cannot find any binding for `kSecPrivateKeyAttrs` and that is a valid key (https://developer.apple.com/documentation/security/ksecprivatekeyattrs)
The others look to be defined in `internal unsafe static partial class SecAttributeKey`:
`kSecAttryKeyType` is bound as `SecAttributeKey.KeyType`
`kSecKeySizeInBits` is bound as `SecAttributeKey.KeySizeInBits`
`kSecAttrIsPermanent` is bound as `SecAttributeKey.IsPermanent`
`kSecAttrApplicationTag` is bound as `SecAttributeKey.ApplicationTag`