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の各種確認コマンド

Last updated at Posted at 2018-01-18

パス抜き作成

openssl rsa -in server.key -out server.key

keyfileの内容を確認(パス抜きの確認可能)

openssl rsa -text -in server.key

PEM形式の証明書の内容をテキストで表示する

openssl x509 -noout -text -in server.crt

認証書の設定値を確認する場合

openssl asn1parse -in server.crt

csrの内容確認

openssl req -in server.csr -text

CERTIFICATEと書かれている場合: X.509
CERTIFICATEの部分にPKCS7と書かれている場合: PKCS7

OpenSSL を使ってこの形式の証明書ファイルの情報を見るには以下のようにする

X.509 の場合:
$ openssl x509 -in ファイル名 -text
PKCS7 の場合:
openssl pkcs7 -in ファイル名 -text

modulusの内容を見るとき

両者のModulusを比較することで、証明書と認証鍵が一致していることを確認することが出来る

openssl rsa -noout -modulus -in server.key
Modulus=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
openssl x509 -noout -modulus -in server.crt
Modulus=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

■ diffで比較する

openssl rsa -noout -modulus -in server.key  > t1 ;openssl x509 -noout -modulus -in server.crt > t2 ;diff t1 t2 ;rm -f t1 t2

期限を確認

openssl x509 -dates -noout -in server.crt
notBefore=May 10 00:00:00 2008 GMT
notAfter=May 10 23:59:59 2009 GMT
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?