openssl genrsa -des3 -out abc.key 2048
[root@localhost]# openssl req -new -key abc.key -out abc.csr
Enter pass phrase for abc.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.
-----
# 国家代码,2位,中国CN
Country Name (2 letter code) [XX]:CN
# 机构所在省份
State or Province Name (full name) []:BJ
# 机构所在城市
Locality Name (eg, city) [Default City]:BJ
# 机构名称
Organization Name (eg, company) [Default Company Ltd]:bj company
# 机构部门
Organizational Unit Name (eg, section) []:center
# 机构域名 或 服务域名
Common Name (eg, your name or your server's hostname) []:abc.com
# 邮箱
Email Address []:
# 额外的属性
Please enter the following 'extra' attributes
to be sent with your certificate request
# 验证密码
A challenge password []:
# 公司名称
An optional company name []:
openssl rsa -in abc.key -out abc_np.key
openssl req -new -x509 -days 3650 -key abc_np.key -out abc.crt