windows生成iOS簽名的p12證書文件

openssl下載:https://slproweb.com/products/Win32OpenSSL.html,建議下載1.1.1版本,不然生成的p12證書Mac電腦安裝不了

//生成自定義.key 私鑰
openssl genrsa -out xxx.key 2048
//生成RSA公鑰 openssl rsa -in xxx.key -pubout -out rsa_public_key.pem

  
//輸出證書注冊文件
openssl req -new -sha256 -key xxx.key -out xxx.csr -subj "/emailAddress=xxxxxxxx@163.com"
//生成證書 openssl x509 -req -days 365 -in xxx.csr -signkey xxx.key -out cert.crt
  
//生成pem文件
openssl x509 -in xxxx.cer -inform DER -out xxxx.pem -outform PEM
  
//生成p12證書,并設(shè)置證書密碼
//如果用mac電腦生成,為了兼容舊版本,可以加-legacy參數(shù)
//openssl pkcs12 -legacy -export -inkey xxx.key -in xxxx.pem -out xxxx.p12 -password pass:123456
openssl pkcs12 -export -inkey xxx.key -in xxxx.pem -out xxxx.p12 -password pass:123456

//驗證p12證書
//openssl pkcs12 -legacy -in ios_development.p12 -info
openssl pkcs12 -in ios_development.p12 -info

//查看P12證書有效期
openssl pkcs12 -in ios_development.p12 -clcerts -nodes | openssl x509 -noout -enddate

//獲取證書的序列號和subject
openssl x509 -in ios_development.cer -noout -serial -subject

//RSA由私鑰文件獲取公鑰文件
openssl rsa -in xxx.key -pubout -out xxx_pub.key

參考資料:
https://www.yii666.com/blog/394250.html
https://www.cnblogs.com/leeke98/p/17240987.html
https://www.bilibili.com/read/cv14924390

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容