title: how to encrypt and sign iphone mobile configuration file using Ruby
body: <p>I have a unsigned mobileconfig file in xml format (template) generated by iphone configuration utility. I would like to encrypt and sign it using openssl and be able to install it on iphone using Ruby on rails. I do not want to create a SCEP server to do this as I want to keep modifying this template xml file dynamically and serve it using some URL.</p>
  
  <p>Thanks for your help in advance.</p>
  
  <p>I have already checked following question but it is not clear from it how to encrypt the file that can be installed correctly on iphone - as I keep getting "config file could not be installed due to unknown error" when I tried to mimic encrypted file format from iphone configuration utility by only encrypting the  part and appending/prepending other parts of the configuration file appropriately.</p>
  
  <p><a href="https://stackoverflow.com/questions/4446247/signing-iphone-configuration-xml-profile-with-ruby-on-rails">Signing iPhone Configuration XML Profile with Ruby on Rails</a></p>
  
  <p>This manual by apple is useful but its more geared for creating a SCEP server and not for manipulating template mobileconfig file -</p>
  
  <p><a href="http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/iPhoneOTAConfiguration/profile-service/profile-service.html" rel="nofollow noreferrer">http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/iPhoneOTAConfiguration/profile-service/profile-service.html</a></p>