P12 file format for iOS Development in Flash Builder

Posted by Troy on October 17, 2011 under Apple, Eclipse, iOS, IT, Microsoft, Mobile, Windows 7 | Be the First to Comment

 

This post assumes that you are a member of the iOS Developer Program and that you are familiar with creating a Mobile Project in Flash Builder for Windows.     In this scenario you have created your first iPad2 application (HelloApple) and now you want to deploy and test it on the device:

image

When you first go to run the application you right-click the project and select Run As Mobile Application:

image

The first time you do this the “Launch method” needs to be configured.  In our case we want to create a package so that it can be installed on the iPad2 device.  I selected Standard Packaging method which takes awhile to compile but is useful for performance testing the application (release build).  Click “Configure package settings”

image

At first the configuration for the Digital Signature looks fairly straightforward.  You just need to provide a Certificate and Provisioning file.   These file can be downloaded from the iOS Developer Center but you must first setup these files.  

Jeanette Stallons has a great post on how to get the required certificates (the post covers Windows and Mac):

http://www.adobe.com/devnet/air/articles/packaging-air-apps-ios.html

Below is a summary of the steps outlined in the article:

  1. Enroll in the iOS Developer Program
  2. Log into the iOS Provisioning Portal
  3. Create an App ID on the iOS Provisioning Portal
  4. Use iTunes to get iOS device IDs
  5. Register your iOS device
  6. Create a certificate signing request (CSR) file (Generate a CSR on Windows)
  7. Create developer certificate (CER) on iOS Provisioning Portal
  8. Convert iOS developer certificate to P12 format (Create P12 on Windows)

Steps 1 to 5 are straight forward.  But steps 6 to 8 can be confusing depending on the current state of your provisioning portal.  If this is your first time setting everything up then I recommend reading Jeanette Stallions post with the exception of the Mac sections. 

If you have followed Jeanette’s post but are still having trouble generating the P12 files then review the notes below.  

In order to perform steps 6 to 8 on windows you need to have OpenSSL installed on your Windows Machine.  You can download OpenSSL for Windows from here:

http://gnuwin32.sourceforge.net/packages/openssl.htm

Another option for OpenSSL especially if you are looking for a Source Control tool is to download and install msysgit (Git for Windows).   Git integrates well with Flash Builder but that is a topic for another post.  When installing msysgit make sure to install Git Bash:

image

If you have Cygwin installed on  your system it can also be configured to support OpenSSL but it is probably overkill to install it just for the purpose of using the tool. 

The first thing we need to do using OpenSSL is to create a private key with a password:

openssl genrsa -out mykey.key -passout pass:mypassword 2048

Next (see Step 6) create the Certificate Signing Request (CSR) using the private key created in the previous step (mykey.key).  The signing request contains important pieces of information that you must provide:

  • emailAdress=email@domain.com
  • CN=Your Name
  • C=Your Country (two character code:  United States: US, Canada: CA)
openssl req -new -key mykey.key -out CertificateSigningRequest.certSigningReqest -subj /emailAddress=mymail@gmail.com, CN=Troy Scott, C=CA

Step 7, is creating a new developer certificate.  This is done by making a certificate request using the certificate created in Step 6.  Click the “Request Certificate” button and upload the CertificateSigningRequest.certSigningRequest file.

image image
Request Certificate Choose File and then Submit

If the process was successful you will have a new developer certificate with a status of “Approved”. 

image

Refresh the Certificates screen and you will have the option to download it.  Download the certificate file (developer_identity.cer) and convert it to pem format using OpenSSL utility:

openssl x509 -in developer_identity.cer -inform DER -out developer_identity.pem -outform PEM

This will generate the developer_identity.pem file which will be used with the mykey.key file to generate the P12 file (Step 8):

openssl pkcs12 -export -inkey mykey.key -in developer_identity.pem -out ipad_dev.p12

When you run this command you will be prompted for the private key password which was “mypassword” in this example.   Below is an example of running the command using the Git Bash prompt (openssl):

image

Next we need to configure the Provisioning File.  The developer certificate must be configured and “Approved” before this file can be downloaded.  Currently the Status of my Provisioning File is Invalid:

 image

Select Modify and you should be able to see the Developer Certificate that was created and approved.  Check the checkbox by the Certificate and click Submit:

image

Once the status is “Active” the Provisioning file can be downloaded.    Now we can configure the Digital Signatures with the following files:

  • Certificate: ipad_dev.p12   (full path to the file)
  • Provisioning File: AppDev.mobileprovision  (full path to the file)

When you select “Run” in the Run Configuration, Flash Builder will prompt you for the private key password (mypassword).    Once you enter the password it may take several minutes for the compilation to complete. 

image image
Private Key Password Packaging

Once packaging is complete follow the instructions to install ipa package on the iOS device.   Refer to the Using Flash Builder 4.5 to package applications for Apple iOS devices post for the remaining details. 

Troy

Being Linux

Posted by Troy on October 5, 2011 under IT, Linux, Open Source, Ubuntu | Be the First to Comment

I first got my introduction to Linux working in the IT Department of a Local Food Chain.  My background was in Finance but I moved to the IT department to become part of the Business Intelligence Department.  One of the DBA’s would talk about Linux during coffee breaks and so I decided to check it out.

The first Distro that I setup and installed on my 800 Mhz in 2000 was Red Hat Linux 6.1.   Linux became more of a hobby than anything else.  But over the years I have found the Linux is a great development environment.    Sure you can run most open source software today in Windows like Apache and MySql  but a client /server model is valuable when learning how to deploy and troubleshoot your solution.

Secondly, if you are developing for the internet or web applications most of today’s servers run on some distro of Linux.   With today’s virtualization software like Virtual Box it is very easy to setup and install a Linux Virtual Machine

I recommend Ubuntu, especially the Ubuntu Server edition.  It is lightweight, easy to configure and you can create a virtual machine in 10 to 15 minutes with the latest PC hardware.  Although Ubuntu does provide a solid desktop environment comparable to Windows 7 and Mac, I am afraid it just does not have the software required for most end users (Microsoft Office, iTunes, Flash Builder).  Sure if you are technically savvy or don’t mind taking a moment to read the Ubunutu online forms (excellent source of information) then Ubuntu is a great choice.    In my opinion,  I don’t think it comes down to picking one of the three operating systems (Microsoft, Apple, Linux).   I run all three environments on my network and they all have their pro’s and con’s and different uses.

If you want to get started with Linux I recommend installing some Virtualization software like Virtual Box on your main computer (Windows, Mac):

A virtual Ubuntu Desktop will require at least 1 GHz processor , 512 MB RAM and 5 GB hard drive space.  Whereas the Ubuntu Server can run on any Intel or AMD x86/AMD_64 processor with 192 MB of RAM and 1 GB of disk space.  I currently run a  small Ubuntu Server (no GUI) for my source control and it is configured to use 256 MB of RAM.  I never have any performance issues.

If you don’t enjoy reading online documentation but are interested in setting up the Ubuntu Server, I recommend the following book:

Official Ubuntu Server Book

Troy

iPad2–Wireless Printing

Posted by Troy on October 4, 2011 under Apple, Mobile, Windows 7 | Be the First to Comment

When I purchased my iPad2 a few weeks ago, at the Apple Store, it was odd that the iGenius kept mentioning that  I could  get a good deal on one of the HP Printers.  I already had a new Canon MP560 series wireless printer at home and I thought it should be fairly easy to set up.

I am know to Apple products so I searched online how to print to a wireless printer with the iPad2 and found the following information:.

http://www.apple.com/ipad/features/airprint.html

Welcome to AirPrint, “wireless printing right from your iPad”.  Unfortunately it only supports a few printers, like the ones below (I think it supports about 10 in total):

  • HP ENVY 100 e-All-in-One
  • HP Officejet 6500A Plus e-All-in-One
  • HP Photosmart Premium Fax
  • HP LaserJet Pro CM1415 Color …
  • HP Officejet Pro 8500A Plus..

 

 

But luckily there are a few alternatives.  First off, if you just want to print your photos from your iPad2 to a Canon wireless printer you can install Canon Easy – PhotoPrint  (its Free!).

http://itunes.apple.com/us/app/canon-easy-photoprint/id331269951?mt=8

image

It allows you to print photos and scan from the device but you will not be able to print documents from applications like Mail, Safari and QuickOffice Confused smile

This brings us to this post from CarlosTheJackl at:

http://www.ifans.com/forums/showthread.php?t=322605

It explains how to enable AirPrint on Windows 7, Vista and Windows XP.  This post provides a great workaround for using AirPrint with the Canon MP560 Series and other wireless printers.

I tried it out on a Windows 7 64 bit Machine.  A few things to note before trying it out.  The setup for Windows 7 64 bit is slightly different than Windows 7 32 bit.   When you open the command prompt you should “runas” Administrator:

image

Once the command prompt is up change the directory to C:\Windows.  Below is a summary of the two sc.exe commands that you need to run:

Create the AirPrint Service

sc create AirPrint binPath= "C:\Program Files (x86)\Airprint\airprint.exe -s" depend= "Bonjour Service" start= auto

Start AirPrint Service

sc start AirPrint

Before you can access the printer you need to share it and you will have to open Port 631 on the PC’s firewall.  Opening the port is important.  If you share the printer on the PC but you don’t open the port, you will be able to see the printer but you will not be able to logon and use it from the iPad.   I created a Inbound and Outbound rule for TCP Port 631:

 image

If you try to print a document from the iPad2 you should see the wireless printer.  The first time the printer is selected it will prompt you for a username and password.  I recommend creating a separate account for this especially if your account has Administrative privileges (e.g. username: ipad) .   The account will be added to the Users group by default. 

Now you can print to the wireless printer or you are thinking that it might have been easier to get one of HP Printers at the Apple Store Smile.

Joomla! Configuration Error – JFTP::write: Bad response

Posted by Troy on November 19, 2010 under IT, Open Source, Social Networking, Web | Be the First to Comment

 

I just installed Joomla! version 1.5.22 the other day for a Not-For-Profit organization.   I tried to change the Color Variation and Background Variation property from Black to Blue in the Template Manager:

image

When I applied the change I received the following errors:

  • JFTP::write: Bad Response
  • Operation Failed!: failed to open /home/user/public_html/imagearts/…/params.ini for writing

Many time when there is a problem with file write permissions people have a tendency to perform a chmod 777.   Sure this approach works but it allows any to have access to the file.   So I took a conservative approach and started by looking at the existing permissions which was 555 and change it to 755 which gives the Owner Write access. 

image

I used Filezilla to modify the file permissions.  Once the permissions were modified to 755 the changes were applied successfully:

image

I also experienced a similar situation with the configuration.php file but in this case it was the Group that required Write permissions (the Owner already had Write).  You need to set the permissions to chmod 664 :

image

The web server is hosted by Host Papa and it is a Linux/Apache server. 

Troy

FAT32 Format in Windows 7

Posted by Troy on August 22, 2010 under Microsoft, Sony, Windows 7 | Be the First to Comment

I was trying to backup some videos on my Sony PS3 the other day so I grabbed one of my old 80 GB hard drives.  Of course the Sony PS3 didn’t recognize the NTFS file system, it needs to be FAT32.  Simple enough, I thought, I’ll just backup the old files and format the drive as FAT32.

If you right click on the drive you and click Format there are two options

  • NTFS
  • exFat

But there was no FAT32 option.

image

This was a job for Disk Manager not the simple format tool.   Click Start and search for “Computer Management”.  Then select the Device Manager.

image image

Click on the drive you want to format and delete the old Volume. Make sure you have selected the correct drive.

image

Right-click on the disk to create a new volume.   This will take you through a wizard that will allow you to select FAT32 to format the drive.  The volume must be less than or equal to 32,768 MB.

image image

Once I formatted the drive FAT32 the Sony PS3 recognized the device an I could backup the files.

If you want to get around the 32 GB limitation you could format the drive using Linux or a Linux Live CD like Knoppix.

Troy