0
0

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 3 years have passed since last update.

openssl による SSL/TLS証明書発行準備時のコマンド覚書き

Posted at

はじめに

openssl を使って CSR を発行するのだが、頻度が開いてしまい毎回コマンドを忘れて都度ググるのでメモ書き。

秘密鍵生成

# カレントディレクトリのファイル全てを読み取ってハッシュ値計算してる
$ openssl sha256 * > rand.dat
# パスフレーズありの鍵を作成
$ openssl genrsa -rand rand.dat -des3 2048 > privkey_pass
# パスフレーズを解除 (パスフレーズを入力)
$ openssl rsa -in privkey_pass -out privkey

CSR作成

# 古いCSRの中身を確認
$ openssl req -noout -modulus -in old.csr
# CSRを作成
$ openssl req -new -key privkey -out new.csr
# ハッシュ値を比較
$ openssl rsa -noout -modulus -in privkey | openssl md5
(stdin)= *********************************
$ openssl req -noout -modulus -in new.csr | openssl md5
(stdin)= *********************************

参考

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?