Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 282
kgreenek Avatar asked Mar 20 '23 08:03

kgreenek


1 Answers

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.

like image 95
Paul Kehrer Avatar answered Mar 22 '23 11:03

Paul Kehrer