I am trying to implement an rsa encryption and decryption algorithm as a part of my app in iphone.(xcode 4.2,ios sdk 5.0) I am generating keys using SecKeyGeneratePair and encrypting using SecKeyEncrypt. Both these return OSStatus 0.
But while decrypting using SecKeyDecrypt ,I get OSStatus as -9809. Please help; where have i gone wrong.
Edit: Thanks for the quick response. I copied and pasted the code from the following link: