#author("2017-06-06T01:11:13+00:00","default:kazuma","kazuma")
[[Linux全般]]

~
*秘密鍵の内容を確認 [#aeb2889a]
 # openssl rsa -text -noout -in 秘密鍵のファイル

*CSRの内容を確認 [#m6964492]
 # openssl req -text -noout -in CSRファイル

*証明書の内容を確認 [#u1711a02]
 # openssl x509 -text -noout -in 証明書ファイル

*証明書の内容とサーバーの鍵が一致するか確認 [#gdf70a63]
 # openssl x509 -noout -modulus -in test.inamuu.com.crt | md5sum
 a996d8f2415ba36dc5eew0f0d190e274  -
 # openssl rsa -noout -modulus -in test.inamuu.com.key | md5sum
 a996d8f2415ba36dc5eew0f0d190e274  -


*証明書の鍵とサーバーにある鍵が一致するかを確認 [#bf0fa096]
 openssl x509 -pubkey < server.crt
 openssl rsa -pubout < server.key
 
 -----BEGIN PUBLIC KEY----- 以降のデータが一致すればOK

*中間証明書の有効性を確認 [#af54f690]
パターン1
 openssl verify -CAfile CAファイル < 証明書
 stdin:OK
 上記表示されればOK

パターン2
 # openssl x509 -issuer_hash -noout -in test.inamuu.com.crt
 79701ca5
 # openssl x509 -subject_hash -noout -in test.inamuu.com.crt.ca
 79701ca5
 
 一致すればOK。

*opensslコマンドで簡易サーバーを起動してチェック [#k5828691]
 $ openssl s_server -key 秘密鍵 -cert 証明書 -CAfile 中間証明書 -WWW
 ※デフォルト4433ポート
 ※hostsに証明書で指定したコモンネームを127.0.0.1に向ける
 ブラウザで、 https://コモンネーム:4433 へアクセス出来るか確認する


~
参考URL:https://www.insaneworks.co.jp/kota/openssl-tips/
参考URL:https://www.insaneworks.co.jp/kota/openssl-tips/ 
~
参考URL:https://www.skyarch.net/blog/?p=3376

トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS