我已经从iPhone开发门户出口 'aps_developer_identity.cer' 证书的棚负载。他们使用相同的证书签名请求和(因此)相同的私钥创建的所有。如果我出口刚刚从苹果钥匙扣私钥是它,然后可能采取的私钥和“aps_developer_identity.cer”,并使用OpenSSL创建合并P12 / PKCS#12证书,我可以在我的(Windows)中的服务器上使用

只是要清楚,我知道如何导出两个私钥和证书一起获得从钥匙扣合并P12,但我想,如果我可以删除所有额外的鼠标点击和打字。

有帮助吗?

解决方案

我设法在shell脚本工作了这一点,它只是需要结束了,这是好去。 我假设你已经下载并改名为你的“apple_developer_identity.cer”证书,这里我用“test.cer”,而且你也出口从您的钥匙串开发许可证,在下面的例子中名为“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个月分别到期。这是一个非常枯燥,容易出错的工作...

其他提示

这里真棒工作。感谢您的真正的帮助球员。我在shell脚本跌破,可能帮助别人。我有几个按键的处理,并希望脚本为好。该脚本将输出为输出文件的静态名(虽然这将是简单的改变)。

我希望它可以帮助别人。

示例用法(假设脚本名):

$ . thisScript request_file.cer priv_key.p12 aps_dev.cer

在脚本:

if [ $# -ne 3 ]
then
echo "Error in $0 - Invalid Argument Count"
echo "Syntax: $0 request_cer_file p12_file app_cer_file output_filename"
echo "  - request_cer_file      is the request file you sent to apple"
echo "  - p12_file          is found in your keychain (it's the private key)"
echo "  - app_cer_file          is found on App ID screen from Apple"
else

reqFile=$1
p12File=$2
cerFile=$3

certPEM='apn_cert.pem'
pKeyPEM='apn_pkey.pem'
pKeyNoEncPEM='apn_pkey_noenc.pem'
p12FileOut='apn_cert_key.p12'

# remove old
rm $certPEM
rm $pKeyPEM
rm $pKeyNoEncPEM
rm $p12FileOut

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

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

# if you want remove password from the private key
openssl rsa -out $pKeyNoEncPEM -in $pKeyPEM

#take the certificate and the key (with or without password) and create a PKCS#12 format file
openssl pkcs12 -export -in $certPEM -inkey $pKeyNoEncPEM -certfile $reqFile  -name "apn_identity" -out $p12FileOut

#
#   
#   If all things worked then the following should work as a test
#   openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert apn_cert.pem -key apn_pkey_noenc.pem 
#
#
echo "Looks like everything was successful"
echo "Test command:"
echo "openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert apn_cert.pem -key apn_pkey_noenc.pem"
echo
fi

可以在钥匙扣使P12 / PKCS#12的证书直接。 无需执行任何命令的

从苹果开发网站下载你的开发/生产证书文件1.双击点击。(它会在钥匙串添加)

2。我假定你有你导出私钥

有.p12文件

3。至下钥匙扣我的证书标签。

只要按一下对APN.it你的开发/生产证书应该表现出与它相关的私钥

4.Right点击和导出证书中的.p12格式

这就是最终.p12文件!!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top