ios 使用服务器证书签署iPhone配置文件

siotufzp  于 2023-06-07  发布在  iOS
关注(0)|答案(2)|浏览(312)

我已经找到了一个类似主题的帖子,但我无法用这种方式解决我的问题,所以我希望在这里得到帮助。
我正尝试在Mac OS X上使用我的服务器SSL证书签署iPhone配置文件:

openssl smime -sign -in company.mobileconfig -out signed.mobileconfig -signer server.crt -inkey server.key -certfile ca.crt -outform der -nodetach

我得到以下错误

unable to load certificate

我不知道我做错了什么-我使用以下证书:
server.crt:

-----BEGIN CERTIFICATE-----
MIIHV.....
-----END CERTIFICATE-----

server.key:

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-256-CBC, .....

sHK1......
-----END RSA PRIVATE KEY-----

ca.crt:from http://www.startssl.com/certs/
所有证书都在同一个文件夹中'iPhone'我改变了与

ch /Volumes/Daten/.../iphone

所以现在我上场了

localhost:iphone Stefan$

非常感谢您的帮助提前!
问候斯特凡

kninwzqo

kninwzqo1#

答案是:
openssl smime -sign -signer cert.pem -inkey key.pem -certfile ca-bundle.pem -nodetach -outform der -in profile-uns.mobileconfig -out profile-sig.mobileconfig
pem是CA的证书链。

f1tvaqid

f1tvaqid2#

让我们假设你正在使用Let's Enrcypt,你可能会得到certificate.pem,privatekey.pem,chain.pem,fullchain.pem。
-signer应该是certificate.pem,它是服务器的证书。
-inkey应该是服务器的私钥。
-certfile应该是fullchain。pem
chain.pem是包含CA ROOT的证书链,不包含certificate.pem,而fullchain.pem包含所有内容。

相关问题