Question

I writing an OS X application that must use security framework, and not OpenSSL, To load the certificate files i have found SecCertificateCreateWithData that can be used for (DER) and SecPKCS12Import that can be used for (PKCS #12), but i have not found anything to work with PEM format.

Does exit a method to load PEM certificate using just the OS X security framework, without using OpenSSL?

Was it helpful?

Solution

SecItemImport. You may find the SecPKCS12Import source code useful in understanding how to call it (though it's not that difficult if you understand other Security framework calls).

You may also be interested in this question, just to see some more code around this: Importing a PKCS12 Using SecItemImport

The PEM import should be slightly more straightforward, however, than the PKCS#12 version. You shouldn't need to even tell it whether it's ASCII armored; it'll typically figure everything out for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top