简体   繁体   English

如何将证书添加到 iOS 应用程序沙箱中

[英]How to add certificates into iOS app Sandbox

I want to add certificates into my iOS app project to communicate with a server.我想将证书添加到我的 iOS 应用程序项目中以与服务器通信。

  1. Could you tell me how to add CAs into iOS app Sandbox?您能告诉我如何将 CA 添加到 iOS 应用程序沙箱中吗? I added a resource directory which includes CAs in Xcode.我添加了一个资源目录,其中包括 Xcode 中的 CA。 But I'm not sure this is a right way....但我不确定这是一个正确的方法......
  2. Is there any way that I can access to the Sandbox to change them without using Xcode?有什么方法可以在不使用 Xcode 的情况下访问沙盒来更改它们? I want to know how to update CAs after releasing the app.我想知道在发布应用程序后如何更新 CA。

[Environment] [环境]

  • Xcode 12.4 Xcode 12.4
  • Language: Objective-C语言:Objective-C

Keeping Push Certificates in Bundle won't work.将推送证书保存在 Bundle 中将不起作用。 You need to have the certificates, first in your keychain and when you archive the build make sure you use these certificates for signing.您需要首先在您的钥匙串中拥有证书,并且在归档构建时确保使用这些证书进行签名。

Also, you need to send a copy of your push certificate either.p12 or.p8 to the backend developer for communication with APNs.此外,您需要将您的推送证书的副本发送给后端开发人员,无论是.p12 还是.p8,以便与 APN 进行通信。

Follow the link for steps to generate Certificate:按照链接获取生成证书的步骤:

https://medium.com/zero-equals-false/generate-apns-certificate-for-ios-push-notifications-85e4a917d522 https://medium.com/zero-equals-false/generate-apns-certificate-for-ios-push-notifications-85e4a917d522

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM