4

GoDaddy コード署名証明書を購入するために使用した .csr ファイルを生成した .key ファイルが 1 つあります。GoDaddy から .spc ファイルを 1 つ受け取りました。

次のコマンドを使用して、spc ファイルを pem にエクスポートしました。

openssl pkcs7 -inform DER -in mycert.spc -print_certs -out certs.pem 

次に、certs.pem ファイルを開き、最初の 2 つの証明書を cert-chain.crt というファイルにコピーし、最後の証明書 (私のもの) を server.crt というファイルにコピーしました。

このコマンドのようにファイルに署名しようとしました:

openssl smime -sign -in a.mobileconfig -out signed_a.mobileconfig -signer cert/server.crt -inkey cert/ios_apn.key -certfile cert/cert-chain.crt -outform der -nodetach

しかし、私が得たものは次のとおりです。

unable to load certificate
11911:error:0906D06C:PEM routines:PEM_read_bio:no start line:/SourceCache/OpenSSL098/OpenSSL098-41/src/crypto/pem/pem_lib.c:648:Expecting: TRUSTED CERTIFICATE

私は何を間違っていますか?通常、提供された SPC ファイルを使用して a.mobileconfig ファイルに署名するにはどうすればよいですか?

4

1 に答える 1

1

証明書はDER形式ですが、opensslはPEM形式を想定しています。コマンドに追加する必要があります-inform der

openssl smime -sign -in a.mobileconfig -out signed_a.mobileconfig -signer cert/server.crt -inkey cert/ios_apn.key -certfile cert/cert-chain.crt -inform der -outform der -nodetach
于 2011-08-04T07:54:01.210 に答える