gpt4 book ai didi

openssl - aps_developer_identity.cer 到 p12 无需从 Key Chain 导出?

转载 作者:行者123 更新时间:2023-12-03 11:50:42 25 4
gpt4 key购买 nike

我有大量从 iPhone 开发人员门户导出的“aps_developer_identity.cer”证书。它们都是使用相同的证书签名请求和(因此)相同的私钥创建的。如果我只从 Apple Key Chain 导出私钥,那么是否可以获取私钥和​​“aps_developer_identity.cer”并使用 openssl 创建可以在我的(Windows)服务器上使用的合并 p12/pkcs#12 证书.

为了清楚起见,我知道如何通过同时导出私钥和证书来从 key 链中获取合并的 p12,但如果可以的话,我想删除所有额外的鼠标点击和输入。

最佳答案

我设法解决了这个问题,它只需要包装在一个 shell 脚本中就可以了。
我假设您已经下载并重命名了您的“apple_developer_identity.cer”证书,这里我使用“test.cer”,并且您还从钥匙串(keychain)中导出了您的开发人员 key ,在下面名为“private_dev_key.p12”的示例中。

#convert *.cer (der format) to pem
openssl x509 -in test.cer -inform DER -out test.pem -outform PEM

#convert p12 private key to pem (requires the input of a minimum 4 char password)
openssl pkcs12 -nocerts -out private_dev_key.pem -in private_dev_key.p12

# if you want remove password from the private key
openssl rsa -out private_key_noenc.pem -in private_key.pem

#take the certificate and the key (with or without password) and create a PKCS#12 format file
openssl pkcs12 -export -in test.pem -inkey private_key_noenc.pem -certfile _CertificateSigningRequest.certSigningRequest -name "test" -out test.p12

注意:如果您认为通过单击几下鼠标和输入文件名可以完成的操作有点冗长,那么请考虑您有 20 个要启用通知的应用程序的情况。每个 App 都有一个开发和生产证书,分别在 4 个月和 12 个月到期。这是一项非常无聊且容易出错的工作......

关于openssl - aps_developer_identity.cer 到 p12 无需从 Key Chain 导出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1453286/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com