2
2

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 2015-10-21

そもそも

管理しているサーバが多ければ使用頻度も多いのだが、
対象が多ければ多いで、更新日付を揃える運用に持って行くため、
結局、数えるほどしか使わない。
従って、メモを残しておくことにする。

openssl -h でわかるだろ、とツッコミは禁止。
なぜなら、自分でも毎回そう思っている・・・・。

KEY Gen


 $ openssl genrsa 2048 > mfapola.key  

CSR Gen


 $ openssl req -new -key mfapola.key > mfapola.csr  
 $ openssl req -nodes -newkey rsa:2048 -sha1 -keyout mydomain.key -out mydomain.csr  

Sign CRT


 $ openssl x509 -req -days 3650 -signkey mfapola.key < mfapola.csr > mfapola.crt  

Change type SSL cert from pkcs12(.pfx) to CER(PEM)


 $ conv to pkcs12 from cer/crt  
 $ openssl pkcs12 -export -out test.pfx -inkey mfapola.key -in mfapola.crt  

Other


 $ openssl x509 -noout -text -in   
 $ openssl x509 -noout -issuer -subject -dates -modulus -in   
 $ openssl req -noout -text -in   
 $ openssl req -noout -subject -modulus -in   
 $ openssl rsa -noout -text -in   
 $ openssl rsa -noout -modulus -in   

怠惰チェック

  • それぞれopenssl的md5を取得して一致していれば適合

server.key
    $ openssl rsa -noout -modulus -in server.key | openssl md5
    $ openssl req -noout -modulus -in server.csr | openssl md5
    $ openssl x509 -noout -modulus -in server.crt | openssl md5

    $ openssl s_server -accept 10443 -cert server.crt -key server.key -CAfile chain.crt -WWW 
2
2
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
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?