How can I access identity profiles and certificates with iPhone SDK?

孤者浪人 提交于 2019-12-04 12:01:29

问题


I am trying to verify the user identity on my application using a certificate / identity that the user has stored by opening a .cer / .p12 attached to an email. The certificate appears on the settings app of the phone under the group "Configuration Profiles".

Is there any way of accessing the certificate using the iphone SDK (I have tried to use the Security Framework, but it seems that it is only possible to access certificates stored in the application keychain or other keychains from its group)?


回答1:


You talked about the Security framework already, but did you try the following functions in the doc?

I personally never tried/had to do this myself, but anyway it seems that there are some functions like SecCertificateCreateWithData in the framework, so you should be able to build a SecCertificateRef from some NSData/CFDataRef… data which is the content of your mail attachment.

From there you may use it as any other certificate using the other functions (like you would do for a certificate extracted from the Keychain)

Well this is only a guess after simply reading the documentation but let's give it a try as the doc seems to indicate it is the way to go.



来源:https://stackoverflow.com/questions/1945058/how-can-i-access-identity-profiles-and-certificates-with-iphone-sdk

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