I generated an RSA key pair with SecKeyGeneratePair. The key size in bits is 2048.
NSDictionary *privateAttributes = @{(NSString *)kSecAttrIsPermanent:
Digital signature API for iOS and Java is different but the result is the same.
iOS SecKeyRawSign with kSecPaddingPKCS1SHA256 uses a SHA256 digest, but in Java Signature.sign requires the raw data and it makes digest+pkcs1. Use
SecKeyRawSign
kSecPaddingPKCS1SHA256
Signature.sign
instance.update(rawString.toString().getBytes("UTF-8"));