I am generating a valid iPhone Configuration XML Profile and delivering it via a Rails page.
I am trying to figure out how to programmatically sign the XML file with an x509 certificate so that the iPhone recognizes it as a signed profile
This is a good tutorial about what’s involved in signing an iPhone Config Profile
http://www.rootmanager.com/iphone-ota-configuration/iphone-ota-setup-with-signed-mobileconfig.html
Specifically, doing this on the command line would sign the unsigned file company.mobileconfig
openssl smime -sign -in company.mobileconfig -out signed.mobileconfig -signer server.crt -inkey server.key -certfile cert-chain.crt -outform der -nodetach
What would the equivalent command be in Ruby on Rails, assuming I have the XML file in a string? I can find alot of documentation about serving content over a SSL connection with rails, but not alot about signing arbitrary content before delivery.
Below lines of code will sign the iPhone configuration XML Profile.