openssl の使い方
非対称鍵を作る
private key を作る
% openssl genrsa -des 1024 > private.pem
1120 semi-random bytes loaded
Generating RSA private key, 1024 bit long modulus
...................+++++
.............+++++
e is 65537 (0x10001)
Enter PEM pass phrase:
Verifying password - Enter PEM pass phrase:
% ls
private.pem
create key to be submitted to CA
% openssl req -new -key private.pem -out csr.pem
Using configuration from /usr/local/ssl/openssl.cnf
Enter PEM 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.
-----
Country Name (2 letter code) [AU]:JP
State or Province Name (full name) [Some-State]:Hokkaido
Locality Name (eg, city) []:Sapporo
Organization Name (eg, company) [Internet Widgits Pty Ltd]:fml project
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:beth.fml.org
Email Address []:fukachan@fml.org
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
% ls
csr.pem private.pem
sign signature by CA
(here myself == private.pem, but it is meaningless).
% openssl x509 -in csr.pem -out crt.pem -req -signkey private.pem
Signature ok
subject=/C=JP/ST=Hokkaido/L=Sapporo/O=fml project/CN=beth.fml.org/Email=fukachan@fml.org
Getting Private key
Enter PEM pass phrase:
% ls
crt.pem csr.pem private.pem