将 plist 上传到 https://identity.apple 时,我遇到了“证书签名请求无效” .com/pushcert/ ,以下是我生成plist的步骤:
- 作为供应商,使用MacBook的KeyChain Access创建供应商CSR上传到会员中心生成MDM签名证书,并从KeyChain导出私钥以 p12 格式访问,例如,vendor.p12
- 使用 Openssl 创建客户 CSR:
- openssl genrsa -des3 -out customerPrivateKey.pem 2048
- openssl req -new -key customerPrivateKey.pem -out customer.csr
- 作为供应商,从配置门户下载 MDM 签名证书、WWDR 中间证书,并从 http://www.apple.com/appleca/AppleIncRootCertificate.cer,然后使用下面的命令将这三个证书一一转换为PEM格式,程序将作为PushCertCertificateChain读取:
- openssl x509 -inform der -in AppleWWDRCA.cer -out chain.pem
- 作为供应商,按照移动设备管理协议参考中的示例 java 代码,我使用私有密钥对 customer.csr 进行签名从vendor.p12中提取的密钥
- 使用Safari将生成的plist上传到https://identity.apple.com/pushcert/ 使用客户 Apple ID
上述步骤有什么问题吗?请指教。多谢!
I hit 'Invalid Certificate Signing Request' when uploading plist to https://identity.apple.com/pushcert/ , and below are steps I used to generate plist :
- As a vendor, create vendor CSR using KeyChain Access of the MacBook to upload to member centre to generate MDM signing certificate, and export private key from KeyChain Access in p12 format, say vendor.p12
- Create customer CSR, using Openssl :
- openssl genrsa -des3 -out customerPrivateKey.pem 2048
- openssl req -new -key customerPrivateKey.pem -out customer.csr
- As a vendor, download MDM signing certificate, WWDR intermediate certificate from provisioning portal, and download Apple root certificate from http://www.apple.com/appleca/AppleIncRootCertificate.cer, then use below command to convert these three certs to PEM format one by one which will be read by program as the PushCertCertificateChain :
- openssl x509 -inform der -in AppleWWDRCA.cer -out chain.pem
- As a vendor, following sample java code in Mobile Device Management Protocol Reference, I sign the customer.csr with the private key extracted from vendor.p12
- Using Safari to upload generated plist to https://identity.apple.com/pushcert/ with customer Apple ID
Is there anything wrong with above steps? Please advise. Thanks a lot!
发布评论
评论(4)
请参阅此处的详细步骤和源代码来生成plist。
Please see detailed steps and source code here to generate plist.
我制作了一个 python 脚本来执行供应商签名部分,因此您不必使用 java 代码。
https://github.com/grinich/mdmvendorsign
I made a python script that does the vendor signing part, so you don't have to use the java code.
https://github.com/grinich/mdmvendorsign
在关注页面时 http://www.softhinker.com/in-the-news/ iosmdmvendorcsrsigning,作为供应商
作为供应商,
将私钥导出为“vendor.p12”
执行以下openssl命令将MDM供应商证书、WWDR证书和Apple根证书一一转换为PEM格式:
openssl x509 -inform der -in mdm_identity.cer -out mdm.pem
openssl x509 -inform der -in AppleWWDRCA.cer -out middle.pem
openssl x509 -inform der -in AppleIncRootCertificate.cer -out root.pem
然后使用 http://www.softhinker.com/in-the-news/iosmdmvendorcsrsigning 生成编码的 plist。
现在,首先验证生成的 plist.xml 格式,该格式应与 MDM 协议参考文档中提供的示例 plist.xml 匹配。
如果 plist.xml 的格式适当,则将encoded_plist上传到 https://identity.apple.com/pushcert/ 。
所以我们需要注意plist.xml仅供我们参考,不适用于上传。仅用于上传encoded_plist。
请记住将包中的占位符替换为您自己的占位符,因为 java 包中提供的只是示例一个(零大小):
customer.der、vendor.p12、mdm.pem、intermediate.pem、root.pem
如果我们正在进行客户活动来为 MDM 服务器生成 MDM 证书)
作为客户,
使用任何内容创建 CSR工具包,即 openssl :
openssl genrsa -des3 -out customerPrivateKey.pem 2048
openssl req -new -key customerPrivateKey.pem -out customer.csr
将 customer.csr 转换为 der 格式:
openssl req -inform pem -outform der -in customer.csr -out customer.der
我们需要验证一些事情。
1) 使用此命令从 customerPrivateKey.pem 中删除密码
2) 然后合并从门户下载的 APNS 证书(例如 CustomerCompanyName.pem)https://identity.apple.com/pushcert/ 使用此命令
现在,此 PlainCert.pem 文件可以在您的服务器中用作 APNS/MDM 证书如示例 MDM 服务器的 MDM_Protocol pdf 中所述。
while following the page http://www.softhinker.com/in-the-news/iosmdmvendorcsrsigning, as a vendor
As a vendor,
export private key as 'vendor.p12'
execute below openssl command to convert MDM vendor certificate, WWDR certificate, and Apple root certificate to PEM format one by one :
openssl x509 -inform der -in mdm_identity.cer -out mdm.pem
openssl x509 -inform der -in AppleWWDRCA.cer -out intermediate.pem
openssl x509 -inform der -in AppleIncRootCertificate.cer -out root.pem
Then use the attached Java program in the http://www.softhinker.com/in-the-news/iosmdmvendorcsrsigning to generate encoded plist.
Now first verify the generated plist.xml format that should match with the sample plist.xml provided in MDM Protocol Reference document.
If plist.xml is in appropriate format then upload the encoded_plist to https://identity.apple.com/pushcert/ .
So we need to take care that plist.xml is just for our reference this is not for upload.For upload encoded_plist only.
remember to replace the placeholder in the package with your own ones because the provided on the java package is just sample one(zero size):
customer.der, vendor.p12, mdm.pem, intermediate.pem, root.pem
if we are doing Customer activity to generate MDM certificate for MDM Server
As a customer,
create a CSR using any toolkit, i.e. openssl :
openssl genrsa -des3 -out customerPrivateKey.pem 2048
openssl req -new -key customerPrivateKey.pem -out customer.csr
convert customer.csr to der format :
openssl req -inform pem -outform der -in customer.csr -out customer.der
then we need to verify few things.
1)remove the passphrase from customerPrivateKey.pem using this command
2)Then merge your APNS certificate (for example CustomerCompanyName.pem) downloaded from the portal https://identity.apple.com/pushcert/ using this command
Now this PlainCert.pem file can be used in your server as APNS/MDM certificate as mentioned in MDM_Protocol pdf for sample MDM Server.
请参阅下面我关于 Apple 供应商 MDM CSR 签名的注释。有些命令可能依赖于 Linux 和 Linux 标准工具,但移植到其他平台应该是微不足道的。
准备所需证书
Apple Root
Apple WWDR
供应商 MDM CSR
客户 CSR(为客户本地生成)
签署客户 CSR
...为 Apple 做准备
摘要(全部合而为一)
Please see my notes on Apple vendor MDM CSR signing below. Some commands may depend on linux and linux standard tools, but porting to other platforms should be trivial.
Prepare required certificates
Apple Root
Apple WWDR
Vendor MDM CSR
Customer CSR (generated on premise for customer)
Sign Customer CSR
... prepare for Apple
Summary (all in one)