I want to create a certificate programmatically within an iOS app. The closest API I could find is SecCertificateCreateWithData which requires a DER encoded binary input.
Given that I have all the data needed available as runtime objects, How can I construct the DER encoded binary data input ?
This is how it can be doen:
myCertificate.cer must be in your application bundle. I create the cer file with openssl. If you are planning to use this in iOS application, make sure your certificate contains required extensions, check here. Even though the answer is -1, it helped me to get this running.
Look at SecKeyGeneratePair I think this is what you are looking for.