I am generating an RSA private key in iOS and want to have access to it between successive runs of the application. It seems to be impossible to save a SecKeyRef type in persistent memory so I was wondering if there is any other way to be able to save and load a secKeyRef private key in NSUserDefaults. I also tried to store the privateKey in the keychain and get it back as a SecKeyRef with no luck.
Any suggestions on how to store a private key in a persistent memory location in iOS?