opensslで鍵を作る

まずはkeyの作成

# /usr/local/ssl/bin/openssl genrsa -des3 1024 > test.key
Generating RSA private key, 1024 bit long modulus
….++++++
………………++++++
e is 65537 (0x10001)
Enter pass phrase:
Verifying – Enter pass phrase:

こんなこと言われるのでpass phraseを入力する。
次、自己証明書の作成。
-keyにはさっき作ったkeyファイルを指定。
-outはあたらに生成されるcrtファイル名を指定。

# /usr/local/ssl/bin/openssl req -new -key test.key -x509 -days 365 -out test.crt
Enter pass phrase for test.key:(さっき設定したpass phrase)
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.