iossecurity-framework

What curve is used by the iOS Security Framework with kSecAttrKeyTypeEC?


I'm specifically looking into using the SecKeyGeneratePair() method in the Security framework and specifying [kSecAttrKeyType: kSecAttrKeyTypeEC] in the params dictionary.

But I haven't been able to find what EC curve is used in the Apple documentation.

Is there a way to specify what curve is used, or should I import openssl instead?


Solution

  • It appears Apple doesn't allow curve choice outside of specifying a bit length (using kSecAttrKeySizeInBits). The supported sizes are 521, 384, 256, 224, and 192. Those correspond to NIST's secp***r1 curves. To my knowledge there is no way to specify alternate (koblitz, brainpool, etc) curves.