1. 程式人生 > 程式設計 >iOS mobileconfig配置檔案進行簽名的配置方法

iOS mobileconfig配置檔案進行簽名的配置方法

配置描述檔案(.mobileconfig) 是XML檔案,包含裝置安全策略、VPN配置資訊、Wi-Fi設定、APN設定、Exchange帳戶設定、郵件設定以及允許iPhone和iPod touch與企業系統配合使用的證書。本文描述了蘋果開發者如何使用SSL證書對. mobileconfig進行簽名,從而確保iOS系統上的app安全性。

前提條件

確保已經獲取SSL數字證書。有關獲取數字證書方法,可參閱如何獲取數字證書。

本文使用的SSL證書檔名為mbaike.crt。

與SSL證書對應的私鑰。本文使用的私鑰檔名為mbaike.key。

與SSL證書對應的證書鏈(中級證書)。本文使用的證書鏈檔名為ca.-bundle.pem。

iOS端生成的未簽名的需要簽名的.mobleconfig檔案。 本文使用的檔名為unsigned.mobileconfig。

OpenSSL 1.0及以上版本。

如何簽名

生成已簽名配置檔案

在linux作業系統上,通過執行OpenSSL命令列,生成簽名後的signed.mobileconfig檔案。

[root@VM_0_4_centos home]#openssl smime -sign -in unsigned.mobileconfig -out signed.mobileconfig -signer mbaike.crt -inkey mbaike.key -certfile ca-bundle.pem -outform der -nodetach

輸入私鑰密碼

將證書私鑰key檔案的密碼寫入到生成的key檔案中

[root@VM_0_4_centos home]#openssl rsa -in mbaike.key -out mbaikenopass.key

寫入簽名

[root@VM_0_4_centos home]#openssl smime -sign -in unsigned.mobileconfig -out signed.mobileconfig -signer mbaike.crt -inkey mbaikenopass.key -certfile ca-bundle.pem -outform der -nodetach

簽名效果

.mobileconfig配置描述檔案簽名前

iOS mobileconfig配置檔案進行簽名的配置方法

.mobileconfig配置描述檔案簽名後

iOS mobileconfig配置檔案進行簽名的配置方法

總結

以上所述是小編給大家介紹的iOS mobileconfig配置檔案進行簽名的配置方法,希望對大家有所幫助,也非常感謝大家對我們網站的支援!