Open terminal and go to the path where you place p12 certificate and run this complete below command:
openssl pkcs12 -in certificateName.p12 -out certificateName.pem -nodes
This blog created for sharing iOS development examples so, a collection of helpful code could be bundled in one place, and new developers can also avail it in an easy way.