0
点赞
收藏
分享

微信扫一扫

mobileconfig使用发布者证书动态签名

金刚豆 2022-04-16 阅读 102
移动开发

其中涉及文件

1.inf.mobileconfig

来源:导入的未签名配置文件,先通过电脑的隔空投送到手机,测试文件可正常使用。

2.outf.mobileconfig

来源:导出的已签名配置文件

3.discer.pem

来源:发布者证书导出的pem文件(服务器linux不能直接使用p12)

生成方法:首先在钥匙串中导出最新未过期的发布者证书p12文件。文件命名为discer.p12 不设置密码

在discer.p12同目录下执行命令 openssl pkcs12 -clcerts -nokeys -out discer.pem -in discer.p12

最终得到文件discer.pem

4.pkey.key

来源:发布者证书导出的密钥文件

生成方法:依然使用discer.p12文件执行命令 openssl pkcs12 -in discer.p12 -nocerts -nodes -out pkey.key

最终得到文件pkey.key

5.rootcer.pem

来源:苹果官方发布者全球开发者关系认证证书导出的pem文件(用于对discer证书的认证)

生成方法:钥匙串中导出全球开发者关系认证证书cer文件。文件命名为rootcer.cer 不设置密码,如果有多个证书选择过期最晚的,如果在登录-证书下是已经过期的,需要从Apple PKI - Apple重新下载安装

在rootcer.cer同目录下执行命令 

openssl x509 -inform DER -outform PEM -in rootcer.cer -out rootcer.pem

最终得到文件rootcer.pem

所有相关文件准备完毕后放到同目录下 执行签名命令

openssl smime -sign -in inf.mobileconfig -out outf.mobileconfig -signer discer.pem -inkey pkey.key -certfile rootcer.pem -outform der -nodetach

最终会得到通过发布者证书签名的outf.mobileconfig文件,发到手机安装查看已验证

生成文件过程中有需要密码的地方一率按回车就行。

举报

相关推荐

0 条评论