57
58

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

PKCS #12 ファイルから秘密鍵,証明書,中間CAを取り出す

Posted at

hoge.pfxみたいなファイルで渡されたけどApacheで利用するのでそれぞれのファイルを抜き出す。

秘密鍵の取り出し

openssl pkcs12 -in hoge.pfx -nocerts -nodes -out sample.key

証明書の取り出し

openssl pkcs12 -in hoge.pfx -clcerts -nokeys -out sample.crt

中間証明書の取り出し

openssl pkcs12 -in hoge.pfx -cacerts -nokeys -out sample.ca-bundle

取り出したファイルは上に余計なものがついてるので
-----BEGIN CERTIFICATE----- ~ -----END CERTIFICATE----- みたいな部分以外は削除して利用する

57
58
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
57
58

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?