Help us understand the problem. What is going on with this article?

Opensslの各種確認コマンド

More than 1 year has passed since last update.

パス抜き作成

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
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした