When I attempt to use SecPKCS12Import()
from the Security framework as provided by Mac OS X 10.6, the result code is always errSecUnimplemented
, regardless of the arguments provided.
Furthermore, the linker is unable to find symbols for the constants relevant to this function declared in SecImportExport.h (i.e. kSecImportExportPassphrase
, kSecImportItemIdentity
, et al.).
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?
What am I doing wrong? I'm sure this is a PEBKAC issue. :-)
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 SecPKCS12Import()
, e.g. kSecImportExportPassphrase
, kSecImportItemIdentity
, etc.
Given that I cannot use these symbols, I passed in what could have been incorrect strings (@"kSecImportItemIdentity"
, etc.), but the error code returned was errSecUnimplemented
. This led me to believe that perhaps this specific functionality has not been implemented.
I tried using the 10.5 SDK, but that didn't work, of course. :-)
EDIT: My import is just a regular #import <Security/Security.h>
. For kicks, I tried #import <Security/SecImportExport.h>
as well, but this effected no change. That said, the error is issued by the linker, not the compiler.
I ran dyldinfo -export Security.framework/Security
to list the symbols exported by the library and found many of the new symbols, but kSecImportExportPassphrase
and friends were conspicuously missing. This might explain why the linker cannot find the symbols. The symbol for SecPKCS12Import
appears in the symbol table and I can call that with no issues, it's just the functionality does not seem to be there.