The following code fails with OSStatus -50 (secParam) both in my manual code and in other libraries (SwiftyRSA, Heimdall) on XCode 9.0, ios 10+. Any ideas as to why or any way to obtain more info?
let keyDict: [CFString: Any] = [
kSecAttrKeyType: kSecAttrKeyTypeRSA,
kSecAttrKeyClass: kSecAttrKeyClassPublic,
kSecAttrKeySizeInBits: NSNumber(value: 4096),
kSecAttrIsSensitive: false,
kSecAttrIsExtractable: true,
kSecAttrCanEncrypt: true
]
var errP: Unmanaged<CFError>?
key = SecKeyCreateWithData(
publicKeyData as CFData, keyDict as CFDictionary, &errP
)