我将plist上传到https://identity.apple.com/pushcert/时点击'无效的证书签名请求',以下是我用来生成plist的步骤:
上述步骤有什么问题吗?请指教。非常感谢!
答案 0 :(得分:4)
请参阅detailed steps and source code here以生成plist。
答案 1 :(得分:3)
我制作了一个执行供应商签名部分的python脚本,因此您不必使用java代码。
答案 2 :(得分:2)
在关注页面http://www.softhinker.com/in-the-news/iosmdmvendorcsrsigning,作为供应商 作为供应商,
执行以下openssl命令,逐个将MDM供应商证书,WWDR证书和Apple根证书转换为PEM格式:
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
然后使用http://www.softhinker.com/in-the-news/iosmdmvendorcsrsigning中附加的Java程序生成编码的plist。 现在首先验证生成的plist.xml格式,该格式应与MDM Protocol Reference文档中提供的示例plist.xml相匹配。
如果plist.xml采用适当的格式,则将encoded_plist上传到https://identity.apple.com/pushcert/。 因此我们需要注意plist.xml仅供我们参考,这不适用于upload.For upload encoded_plist only。
请记住将包中的占位符替换为您自己的占位符,因为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中删除密码短语
openssl rsa -in customerPrivateKey.pem -out PlainKey.pem
2)然后使用此命令合并从门户网站https://identity.apple.com/pushcert/下载的APNS证书(例如CustomerCompanyName.pem)
cat CustomerCompanyName.pem PlainKey.pem > PlainCert.pem
现在,这个PlainCert.pem文件可以在您的服务器中用作APNS / MDM证书,如MDM_Protocol pdf中提到的示例MDM Server。
答案 3 :(得分:0)
请参阅下面关于Apple供应商MDM CSR签名的说明。有些命令可能依赖于linux和linux标准工具,但移植到其他平台应该是微不足道的。
wget https://www.apple.com/appleca/AppleIncRootCertificate.cer
openssl x509 -inform DER -outform PEM -in AppleIncRootCertificate.der -out AppleIncRootCertificate.pem
openssl x509 -fingerprint -sha256 -noout -in AppleIncRootCertificate.pem
# SHA256 Fingerprint=B0:B1:73:0E:CB:C7:FF:45:05:14:2C:49:F1:29:5E:6E:DA:6B:CA:ED:7E:2C:68:C5:BE:91:B5:A1:10:01:F0:24
openssl x509 -fingerprint -noout -in AppleIncRootCertificate.pem
# SHA1 Fingerprint=61:1E:5B:66:2C:59:3A:08:FF:58:D1:4A:E2:24:52:D1:98:DF:6C:60
wget https://developer.apple.com/certificationauthority/AppleWWDRCA.cer
openssl x509 -inform DER -outform PEM -in AppleWWDRCA.der -out AppleWWDRCA.pem
openssl verify -verbose -CAfile AppleIncRootCertificate.pem AppleWWDRCA.pem
openssl genrsa -out apple-mdm-csr.key 2048
openssl req -new -key apple-mdm-csr.key -subj '/CN=MDM' -out apple-mdm-csr.csr
# GET apple-mdm-csr.der ('https://developer.apple.com/' -> 'Account' -> 'Certificates, IDs & Profiles')
openssl x509 -inform DER -outform PEM -in apple-mdm-csr.cer -out apple-mdm-csr.pem
openssl verify -verbose -CAfile AppleIncRootCertificate.pem -untrusted AppleWWDRCA.pem apple-mdm-csr.pem
#openssl genrsa -out customer.key 2048
#openssl req -new -key customer.key -subj '/CN=MDM' -out customer.csr
openssl req -inform PEM -outform DER -in customer.csr -out customer.csr.der
openssl sha1 -sign apple-mdm-csr.key -out customer.csr.der.sig customer.csr.der
base64 -w0 customer.csr.der >customer.csr.der.b64
base64 -w0 customer.csr.der.sig >customer.csr.der.sig.b64
cat <<EOF >customer.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PushCertCertificateChain</key>
<string>
$(<apple-mdm-csr.pem)
$(<AppleWWDRCA.pem)
$(<AppleIncRootCertificate.pem)
</string>
<key>PushCertRequestCSR</key>
<string>
$(<customer.csr.der.b64)
</string>
<key>PushCertSignature</key>
<string>
$(<customer.csr.sig.b64)
</string>
</dict>
</plist>
EOF
base64 -w0 customer.plist >customer.plist.b64
bash -e -c '
# Take CSR from STDIN and output base64 encoded plist for Apple
APPLE_MDM_CSR_CRT="apple-mdm-csr.pem"
APPLE_MDM_CSR_KEY="apple-mdm-csr.key"
APPLE_INTERMEDIATE_CRT="AppleWWDRCA.pem"
APPLE_ROOT_CRT="AppleIncRootCertificate.pem"
CUSTOMER_CSR_DER="/proc/self/fd/3"
TMP="$(mktemp -p /run)"
exec 3<> "$TMP"
rm -f "$TMP"
openssl req -inform PEM -outform DER -out "$CUSTOMER_CSR_DER"
base64 -w0 <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PushCertCertificateChain</key>
<string>
$(<$APPLE_MDM_CSR_CRT)
$(<$APPLE_INTERMEDIATE_CRT)
$(<$APPLE_ROOT_CRT)
</string>
<key>PushCertRequestCSR</key>
<string>$(base64 -w0 "$CUSTOMER_CSR_DER")</string>
<key>PushCertSignature</key>
<string>$(openssl sha1 -sign "$APPLE_MDM_CSR_KEY" "$CUSTOMER_CSR_DER" | base64 -w0)</string>
</dict>
</plist>
EOF
exec 3>&-'