Note that there are some explanatory texts on larger screens.

plurals
  1. POSecPKCS12Import() from Security.framework fails on OS X 10.6
    text
    copied!<p>When I attempt to use <code>SecPKCS12Import()</code> from the Security framework as provided by Mac OS X 10.6, the result code is always <code>errSecUnimplemented</code>, regardless of the arguments provided. </p> <p>Furthermore, the linker is unable to find symbols for the constants relevant to this function declared in SecImportExport.h (i.e. <code>kSecImportExportPassphrase</code>, <code>kSecImportItemIdentity</code>, et al.).</p> <p>What on Earth is going on with this library -- is the function implemented or is it not? Why can the linker resolve all other symbols in the framework, but not these? How should I convert a PKCS12-formatted binary blob to a SecIdentityRef or SecCertificateRef and SecKeyRef pair?</p> <p>What am I doing wrong? I'm sure this is a PEBKAC issue. :-)</p> <hr> <p>EDIT: I see that I was very unclear in my question. I'm aware that Security.framework is implemented, given that I am able to use the other functionality it provides without an issue. Given this, I'm fairly certain that I'm linking against the framework correctly, since if I remove the link, none of the symbols can be found -- as expected. When I relink the framework, all the symbols are found, with the exception of the constants relevant to <code>SecPKCS12Import()</code>, e.g. <code>kSecImportExportPassphrase</code>, <code>kSecImportItemIdentity</code>, etc.</p> <p>Given that I cannot use these symbols, I passed in what could have been incorrect strings (<code>@"kSecImportItemIdentity"</code>, etc.), but the error code returned was <code>errSecUnimplemented</code>. This led me to believe that perhaps this specific functionality has not been implemented.</p> <p>I tried using the 10.5 SDK, but that didn't work, of course. :-)</p> <hr> <p>EDIT: My import is just a regular <code>#import &lt;Security/Security.h&gt;</code>. For kicks, I tried <code>#import &lt;Security/SecImportExport.h&gt;</code> as well, but this effected no change. That said, the error is issued by the linker, not the compiler.</p> <p>I ran <code>dyldinfo -export Security.framework/Security</code> to list the symbols exported by the library and found many of the <a href="http://developer.apple.com/mac/library/documentation/Security/Reference/SecurityRefUpdate/Articles/Security_10.5-10.6_SymbolChanges.html#//apple_ref/doc/uid/TP40008013" rel="nofollow noreferrer">new</a> symbols, but <code>kSecImportExportPassphrase</code> and friends were conspicuously missing. This might explain why the linker cannot find the symbols. The symbol for <code>SecPKCS12Import</code> appears in the symbol table and I can call that with no issues, it's just the functionality does not seem to be there.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload