$ openssl genrsa -aes128 2048 > server.key
Generating RSA private key, 2048 bit long modulus
.......................+++
...........+++
e is 65537 (0x10001)
Enter pass phrase:
Verifying - Enter pass phrase:
$ openssl req -new -key server.key > server.csr
Enter pass phrase for server.key:
140545351714720:error:28069065:lib(40):UI_set_result:result too small:ui_lib.c:831:You must type in 4 to 1023 characters
Enter pass phrase for server.key:
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.
-----
Country Name (2 letter code) [XX]:JP
State or Province Name (full name) []:Fukuoka
Locality Name (eg, city) [Default City]:Fukuoka
Organization Name (eg, company) [Default Company Ltd]:TEST
Organizational Unit Name (eg, section) []:test
Common Name (eg, your name or your server's hostname) []:
Email Address []:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
デジタル証明書(CRT)の作成
上記で作成した、秘密鍵と公開鍵を使用し、証明書(CRT)を作成します。
$ openssl x509 -in server.csr -days 365000 -req -signkey server.key > server.crt
Signature ok
subject=/C=JP/ST=Fukuoka/L=Fukuoka/O=TEST/OU=test
Getting Private key
Enter pass phrase for server.key:
コメント