2
4

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.

複数の証明書が結合されたファイルの内容をopensslで表示する

Posted at

X.509形式の証明書が複数結合されて1つのファイルになっている場合、openssl x509 -in <証明書ファイル> -text -nooutでは、一番最初の証明書の情報しか表示されない。

すべての証明書の情報を表示する方法として、1つずつ分割してopenssl x509 ~ で表示する方法もあるが、下記の方法でも簡単に表示できる。

openssl crl2pkcs7 -nocrl -certfile <証明書ファイル> | openssl pkcs7 -print_certs -text -noout

参考

https://serverfault.com/questions/590870/how-to-view-all-ssl-certificates-in-a-bundle
こちらに載ってました。結構重要なのにあまり日本語の情報がなかったので、転載させていただきました。

  • opensslはX.509ファイルの"-----BEGIN CERTIFICATE-----"の前の文字列や"-----END CERTIFICATE-----"の後の文字列を無視して扱う。

  • X.509は単体の証明書用の形式のため、複数証明書を格納可能なPKCS#7形式に変換した上で、内容を表示している。
2
4
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
2
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?