title: Generating a self-signed certificate with iOS Security.framework?
body: <p>Is it possible, and if so how? I'm working with a protocol that needs a client certificate, so I want to generate one once and store it in the keychain for future use.</p>
  
  <p>I'm currently using the Security framework to generate key pairs via SecKeyGeneratePair, but is there any way to package up that generated public key in an X.509 certificate and add it with the private key to create a new SecIdentity? I figure there should be a way since the Security framework is supposed to be the same on iOS and Mac, and Keychain Access on the Mac can generate self signed certificates.</p>
  
  <p>OpenSSL is an option, but I'd much rather use the built in Security framework if at all possible.  Thanks.</p>