<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Gavin Adams Information Blog &#187; OS X</title>
	<atom:link href="http://www.gavinadams.org/blog/category/tech-tips/os-x/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gavinadams.org/blog</link>
	<description>Musings on hobbies, technology and topics of interest</description>
	<lastBuildDate>Sat, 25 Jun 2011 14:22:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Snow Leopard Certificate Sillyness</title>
		<link>http://www.gavinadams.org/blog/2010/01/05/snow-leopard-certificate-sillyness/</link>
		<comments>http://www.gavinadams.org/blog/2010/01/05/snow-leopard-certificate-sillyness/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 22:10:46 +0000</pubDate>
		<dc:creator>me@gavinadams.org</dc:creator>
				<category><![CDATA[OS X]]></category>
		<category><![CDATA[PKI / Certificates]]></category>
		<category><![CDATA[pkcs12]]></category>
		<category><![CDATA[startssl.com]]></category>

		<guid isPermaLink="false">http://www.gavinadams.org/blog/?p=132</guid>
		<description><![CDATA[<p>I love OS X and every iteration has gotten better and better. But every once in a while tasks that should be simple&#8211;aren&#8217;t. Take the case of trying to add a S/MIME certificate to the Keychain.</p> <p>In the past, simply double-clicking on the .p12 file would prompt for the passphrase and import it into the [...]]]></description>
			<content:encoded><![CDATA[<p>I love OS X and every iteration has gotten better and better. But every once in a while tasks that should be simple&#8211;aren&#8217;t. Take the case of trying to add a S/MIME certificate to the Keychain.</p>
<p>In the past, simply double-clicking on the .p12 file would prompt for the passphrase and import it into the login chain. After getting my certificate issued by StartSSL and stored in Firefox, I exported the certificate and private key, set a passphrase, double-clicked, and&#8230;.</p>
<p><a href="http://www.gavinadams.org/blog/wp-content/uploads/2010/01/hate-the-keychain.png"><img class="aligncenter size-full wp-image-133" title="hate-the-keychain" src="http://www.gavinadams.org/blog/wp-content/uploads/2010/01/hate-the-keychain.png" alt="" width="750" height="385" /></a></p>
<p><strong>An error has occurred. Unable to import an item. The contents of this item cannot be retrieved. You failed to provide the necessary administrator authorization.</strong> <em>(Added so the search engines will pick this up)</em></p>
<p><span id="more-132"></span>And so the battle commenced. There really isn&#8217;t a lot out there discussing when Keychain Access fails. The closest similar discussion was by Midori Green (email thread <a href="http://www.mail-archive.com/openssl-users@openssl.org/msg59442.html">here</a>). The error was different, but it was the same attempt to import a PKCS12 file.</p>
<p>I tried using openssl to rearrange the certificates in the file (after exporting into PEM format), tried adding/removing/changing the private key passphrase, import/export from a Windows machine in .PFX format, and even trying to recreate the PKCS12 file from its&#8217; constituent parts.</p>
<p>Luckily, I ran across this post on <a href="http://krypted.com/mac-os-x/basic-pkcs12-management-with-security/">krypted.com</a> that mentioned the CLI command <em>security</em>. After placing the exported .p12 file (from Firefox) in a directory and launching terminal, I was able to use the command:</p>
<pre>linus:gadams$ <strong>security import startssl-smime-cert.p12 -f pkcs12 ~/Library/Keychains/login.keychain</strong>
1 identity imported.
2 certificates imported.
</pre>
<p>And <em>bam!</em>, the certificate loaded. Composing a new message in Mail.app showed the signing and encryption boxes. Although I still get invalid signatures when sending rich text format messages, plain text are properly getting signed.</p>
<p>I am curious exactly what command is executed when you double-click on a certificate file. I assume the <em>Keychain access </em>application makes underly calls to <em>security</em>, but I&#8217;d like to be able to trace the steps it takes.</p>
<p>Side note, I&#8217;m going to do an opinion piece of certificate authorities in general and digital certificates, SSL, S/MIME, and all that rot. There are some great options for small companies and individuals to get certificates at a cheap or free price. No Verisign or GTE Cybertrust (err Verizon Business) $$$$$ prices need apply!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gavinadams.org/blog/2010/01/05/snow-leopard-certificate-sillyness/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>

