トップ «前の日記(Tue May 21 2002) 最新 次の日記(Sun May 26 2002)» 編集

よこいまさる日記



Thu May 23 2002 [長年日記]

[Computer] SSL の RSA 鍵の作りかた

今年の2月ごろにやっていたopenssl での鍵のつくりかたなんだけど、すんげぇ勘違いしていた。秘密鍵を openssl genrsa で作って、公開鍵を openssl req でつくるときに指定するCommon Name (CN) なんだけど、今まで "Masaru Yokoi" とか名前を指定していたんだけど、本当は masaruyokoi.com という具合に domain name を指定しなければいけないことが判明。ということで作りなおした。

結局、以下のような手順で、自己証明な鍵がつくれる。

## 秘密鍵の生成:
##  ファイル名は masaruyokoi.com.key。 鍵の長さは 1024bit
$ openssl genrsa -out masaruyokoi.com.key 1024
## 公開鍵の生成:
##  ファイル名は masaruyokoi.com.cer。 有効期間は 10年 (365 × 10 + 4)
$ openssl req -new -x509 -days 3654 -out masaruyokoi.com.cer -in masaruyokoi.com.key

んで、Windows なマシンに鍵を取り込むには、*.cer の方をダブルクリックして「証明書のインストール」を行なう。


2000|10|
2002|01|02|03|04|05|06|07|08|09|10|11|12|
2003|01|02|03|04|05|06|07|08|09|10|11|12|
2004|01|02|03|04|05|06|07|08|09|10|11|12|
2005|01|02|03|04|05|06|07|08|09|10|11|12|
2006|01|02|03|04|05|06|07|08|09|10|11|12|
2007|01|02|03|04|05|06|07|08|09|10|11|12|
2008|01|02|03|04|05|06|07|08|09|10|11|12|
2009|01|02|03|04|05|06|07|08|09|10|11|12|
2010|01|02|03|04|05|06|07|08|09|10|11|12|
2011|01|02|03|04|05|06|07|08|09|10|11|12|
2012|01|02|