 <p>I got some tips from the internet, and following is the steps to get iOS acceptable p12 key and certification file:</p> <ol> <li><p>convert XML to PEM<br> Shell> compile XMLSpec2PEM.java<br> Shell> XMLSpec2PEM rsa.xml<br> save the output result to rsa.pem<br> (borrow from <a href="http://www.platanus.cz/blog/converting-rsa-xml-key-to-pem" rel="nofollow">here</a>)</p></li> <li><p>convert PEM to RSA Private Key<br> OpenSSL> rsa -in rsa.pem -out rsaPrivate.key</p></li> <li><p>Generate a certification request<br> OpenSSL> req -new -key rsaPrivate.key -out rsaCertReq.crt<br> (input some basic certification data)<br></p></li> <li><p>Sign certification of the request<br> OpenSSL> x509 -req -days 3650 -in rsaCertReq.crt -signkey rsaPrivate.key -out rsaCert.crt<br></p></li> <li><p>Convert the certification file format to DER (iOS acceptable format)<br> OpenSSL> x509 -outform der -in rsaCert.crt -out rsaCert.der<br></p></li> <li><p>Generate PKCS12 Private key(iOS acceptable format)<br> OpenSSL> pkcs12 -export -out rsaPrivate.pfx -inkey rsaPrivate.key -in rsaCert.crt<br></p></li> </ol> <p>No further steps, files generated in step 5 and 6 now can be used in iOS!</p> <p>reference of OpenSSL instructions:<br> <a href="http://blogs.yaclife.com/?tag=ios%E3%80%80seckeyref%E3%80%80raw%E3%80%80key%E3%80%80rsa%E3%80%803des" rel="nofollow">http://blogs.yaclife.com/?tag=ios%E3%80%80seckeyref%E3%80%80raw%E3%80%80key%E3%80%80rsa%E3%80%803des</a></p> <p><a href="http://devsec.org/info/ssl-cert.html" rel="nofollow">http://devsec.org/info/ssl-cert.html</a></p>