Skip to content

Instantly share code, notes, and snippets.

@hackugyo
Created November 14, 2014 09:33
Show Gist options
  • Select an option

  • Save hackugyo/033140560b4cb3fdee53 to your computer and use it in GitHub Desktop.

Select an option

Save hackugyo/033140560b4cb3fdee53 to your computer and use it in GitHub Desktop.
p12_to_pem openssl pkcs12 -in cert_and_key.p12 -out aps_developer_from_cert_and_key.pem -nodes -clcertsコマンドがうまく動かないので作った(いまやったらふつうに動いた。??) cert_and_key.p12ファイルは、「キーチェーンアクセス」アプリから秘密鍵・証明書を同時選択(エクスパンドして両方見えている状態でShift+クリック)した状態で右クリックし、「2個を書き出す…」を選択して生成する。このときお好きなパスワードを入れて、下記のスクリプトのYOUR_PASSWORDとして使う
#!/bin/sh
YOUR_PASSWORD=""
expect -c "
set timeout 20
spawn openssl pkcs12 -in cert_and_key.p12 -out aps_developer_from_cert_and_key.pem -nodes -clcerts
expect Password:
send \"$YOUR_PASSWORD\r\"
interact
"
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment