# Exporting a Certificate and Private Key from Keychain



## chrisgrange (Aug 3, 2009)

I've recently upgraded our web server and wanted to export the SSL certs from our old one to our new one. When I tried to export the certs and keys (as .p12 files) from our old server it kept asking me for a password. No matter which password I put in (including no password) it said that I had entered it incorrectly. The strange thing is that when I created the certificate requests and submitted them to our Cert provider (IPSCA) I did not create a private key password. I can't find any good documentation for certs in Leopard Server. Any ideas?


----------



## Scoops98 (Aug 3, 2009)

I've had the same issue with exporting the root certificate.  No help from me I'm afraid.  Apple's support documents for sever leave much to be desired.


----------



## chrisgrange (Aug 4, 2009)

Solved! Although not the most intuitive solution. You have to run Keychain Access as root. Open up a Terminal window and type:-

sudo /Applications/Utilities/Keychain\ Access.app/Contents/MacOS/Keychain\ Access

Enter your password and keychain will launch. You can now export Certs and private keys. It will still ask you for a password but you can leave it blank.

Hope this helps someone.


----------



## ajpro (Aug 14, 2009)

Thank you! That helped me, after about an hour of staring at my screen and trying all the passwords I could think of.

"Not the most intuitive solution". Hehe. And not explained in the online help either, so thanks again!


----------



## jim2011 (Oct 9, 2011)

Thanks for the tip, because I was struggling with this.  Launching Keychain Access your way got the job done, and I just dragged the file over to Lion Server's Server.app with the "Edit..." dialog open on the Hardware for my server, Settings pane.


----------



## Minia (Jun 28, 2012)

Hi There

I have try your advise to solve the same issue we are having

but I get this message in Terminal when copy/paste the code you gave us
2012-06-28 14:32:47.488 Keychain Access[226:507] Could not find image named 'ToolbarArrangeByTemplate'.

Then when we tried to export our key, it still does not work

Any idea ? Please help we are struggling with that



chrisgrange said:


> Solved! Although not the most intuitive solution. You have to run Keychain Access as root. Open up a Terminal window and type:-
> 
> sudo /Applications/Utilities/Keychain\ Access.app/Contents/MacOS/Keychain\ Access
> 
> ...


----------

