Is there a possible way to find out the modulus and exponent of the Public Key, created with SecKeyGeneratePair (the Security Framework in general)?
Something like the following is much more reliable:
+ (NSInteger)keyModulusSize:(NSData *)keyData
{
NSString *randomTag = [NSString ptk_randomStringOfLength:32];
SecKeyRef key = [self addPublicKeyRef:keyData withTag:randomTag];
NSInteger size = 0;
if (key) {
size = SecKeyGetBlockSize(key);
[self removePublicKeyRef:randomTag];
}
return size;
}