#将aps_development.cer转换成aps_development.pem格式
openssl x509 -in aps_development.cer -inform DER -out aps_development.pem -outform PEM
#将p12格式的专用密钥转换成pem,依次输入密码
openssl pkcs12 -nocerts -out APNS_Noenc.pem -in APNS.p12
#创建PKCS#12格式的p12文件
openssl pkcs12 -export -in aps_development.pem -inkey APNS_Noenc.pem -certfile APNS.certSigningRequest -name "aps_development" -out aps_development.p12
如下是验证结果:
----------------------------------------------------------------------------------------------------------------
MacBook-Air:Desktop admin$
MacBook-Air:Desktop chenruibo$ openssl x509 -in aps_development.cer -inform DER -out aps_development.pem -outform PEM
MacBook-Air:Desktop admin$ openssl pkcs12 -nocerts -out APNS_Noenc.pem -in APNS.p12
Enter Import Password:
MAC verified OK
Enter PEM pass phrase:
Verifying - Enter PEM pass phrase:
MacBook-Air:Desktop admin$ openssl pkcs12 -export -in aps_development.pem -inkey APNS_Noenc.pem -certfile APNS.certSigningRequest -name "aps_development" -out aps_development.p12
Enter pass phrase for APNS_Noenc.pem:
Enter Export Password:
Verifying - Enter Export Password:
MacBook-Air:Desktop admin$
MacBook-Air:Desktop admin$