creating PKCS12 at runtime on iOS without using openssl

若如初见. 提交于 2019-12-07 14:39:03

问题


My iOS app is handling x509 certificates + keys (DER encoded) at runtime. The only way I am able to successfully import them into the keychain is to use PKCS12 using the function: SecPKCS12Import()

I have been trying hard to get it running using only SecItemAdd(). I used that function for the DER encoded certificate and again for the DER encoded key. But even though the call return with success, querying the keychain afterwards didn't yield a SecIdentityRef.

So I ended up using the OpenSSL PKCS12 implementation. I am very keen on getting rid of my dependency on OpenSSL. I have been looking around for alernative implementations of PKCS12. The only alternative lib I found was hosted in apples open source repo:
https://opensource.apple.com/source/Security/Security-57031.10.10/Security/libsecurity_pkcs12/

Though this is an OS X project that has (i suppose) many dependencies to other modules of the security framework. Before I start looking deeper into this

I was wondering:

  1. Is there any chance for me to run libsecurity_pkcs12 on iOS?
  2. Or better: is there any alternative small footprint PKCS12 library that I am not aware of?
  3. Or even better: has anyone imported x509 + key into the iOS keychain (yielding a SecIdentityRef afterwards) without using PKCS12?

来源:https://stackoverflow.com/questions/40523857/creating-pkcs12-at-runtime-on-ios-without-using-openssl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!