Now that you have downloaded your development certificate from the Provisioning Portal, the final step is to convert it to a P12 certificate file.
Flash Professional will use this P12 file to digitally sign any iOS apps you create.
The process for generating a P12 certificate file differs depending on your choice of operating system.
The steps for Microsoft Windows are covered in this recipe. If you are using Mac OS X, then refer to the Creating a P12 certificate using Mac OS X recipe.
You will need the development certificate that you created and downloaded from the iOS Provisioning Portal. If you haven't already done this, then follow the steps outlined in the Obtaining your development certificate recipe.
As was the case when creating a CSR, you will need to use OpenSSL to convert your development certificate into a P12 file by executing the following steps:
Open a command session in Windows as the administrator.
Move to OpenSSL's
bin
folder by entering the following command into the command prompt:cd C:\OpenSSL-Win32\bin
The first step is to convert your development certificate file into a PEM certificate file by entering the following command line statement:
openssl x509 -in developer_identity.cer -inform DER -out developer_identity.pem -outform PEM
For this to work you will need to save the
developer_identity.cer
file, that you downloaded from the Provisioning Portal to OpenSSL'sbin
folder.Now using the PEM file and your private key, generate a valid P12 file by entering:
set RANDFILE=.rnd
followed by:
openssl pkcs12 -export -inkey mykey.key -in developer_identity.pem -out ios_dev.p12
During this process, OpenSSL will ask you to specify an export password. Flash Professional will prompt you for this password while compiling your
.swf
files into native iOS apps, so choose something you aren't likely to forget. Enter your password and confirm it when OpenSSL asks you to verify it.If successful, an
ios_dev.p12
file will be created in thebin
folder. It is important that you keep this file safe as you will need it to publish any of the examples in this book.Using Windows Explorer, navigate to your
Documents
folder and create the following folder structure within it:packt\flash-ios-cookbook\developer-files\
. This is where we will keep our P12 certificate file from now on.Copy
ios_dev.p12
fromC:\OpenSSL-Win32\bin\
to thedeveloper-files
folder you just created.
When publishing iOS apps from Flash Professional, you will be prompted for your P12 certificate file and password. Both are used to digitally sign your app allowing it to be deployed and tested on an iOS device.
The P12 certificate is the first of the two files that will be used by Flash Professional every time you make an iOS build.
Finally, a few additional words regarding certificates.
When your developer certificate eventually expires, you will need to request a new one from the Provisioning Portal before converting it to a P12 file. Any apps that were published using the old certificate will no longer run on your iOS device and will need to be republished using a new valid P12 file.
If you accidentally delete your existing P12 file, then you can simply recreate it from the steps outlined in this recipe. There is no need to request a new development certificate from the Provisioning Portal.