Discussion Forums  >  Xcode, Errors, Installing, Configuring

Replies: 10    Views: 143

chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
09/14/13 04:07 PM (12 years ago)

free appliation: p12 to pem conversion

Here's a free OSX AppleScript I created to convert your .p12 files to .pem when trying to set up push notifications. I suggest saving this as an "application" for easy use. on removeExtension(fileName) set n to fileName set AppleScript's text item delimiters to "." if number of text items of n > 1 then set n to text items 1 thru -2 of n as text end if return n end removeExtension tell application "Finder" activate set pathToFile to (choose file with prompt "Choose .p12 file:") set theParentFolder to quoted form of POSIX path of ((container of pathToFile) as alias) end tell tell application "Terminal" activate set finderItem to item pathToFile of application "Finder" set theAlias to finderItem as alias set fileName to my removeExtension(name of finderItem) set fileExtension to name extension of finderItem if (fileExtension is equal to "p12") then set cdScript to "cd " & theParentFolder do script cdScript in selected tab of the front window do script with command "openssl pkcs12 -in " & fileName & "." & fileExtension & " -out " & fileName & ".pem -nodes -clcerts " in selected tab of the front window delay 2 tell application "System Events" to keystroke return delay 2 tell application "System Events" to keystroke return else display dialog ("sorry, this is not a .p12 file") end if end tell tell application "Terminal" to quit
 
Joe Sprott
Code is Art
Profile
Posts: 414
Reg: Aug 20, 2011
Melbourne, FL
10,290
like
09/14/13 04:12 PM (12 years ago)
thanks Chris
 
Solver
Aspiring developer
Profile
Posts: 37
Reg: Jan 07, 2013
LOS
10,820
like
09/14/13 04:14 PM (12 years ago)
Great effort Chris
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
09/14/13 04:16 PM (12 years ago)
One thing to note: If you have problems with the Terminal window not coming to the front, remove the two lines that says: tell application "System Events" to keystroke return and remove the line that says: tell application "Terminal" to quit -then you'll need to switch to the Terminal window to manually press enter for the final step
 
Cakebit
Code is Art
Profile
Posts: 502
Reg: Dec 15, 2010
In your local b...
16,520
like
09/14/13 05:06 PM (12 years ago)
Thanks Chris! This will be super useful for expediting this process!
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
09/14/13 06:23 PM (12 years ago)
Chris Rocks!
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
09/14/13 07:02 PM (12 years ago)
@Jake has a awesome website for that too I think. http://p12pem.com/ This website just lets you upload it and it converts for you for download. David https://buzztouchmods.com/market
 
Red Dog
buzztouch Evangelist
Profile
Posts: 805
Reg: Jun 16, 2011
Southern Califo...
18,800
like
09/14/13 07:53 PM (12 years ago)
@mrdavid That website belongs to Jake Chasen?
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
09/15/13 12:26 AM (12 years ago)
Yup! Cool right? David https://buzztouchmods.com/market
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
09/15/13 05:36 AM (12 years ago)
Always a plus. Thanks Chris! :) And Jake! Cheers! -- Smug
 
Arubaman
Aspiring developer
Profile
Posts: 636
Reg: Oct 20, 2011
Akron
16,910
like
09/15/13 09:16 AM (12 years ago)
Nice solution, thanks.
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.