Linux(openssl):创建selfsign证书

1.创建key文件

openssl ecparam -genkey -out ss.key -name prime256v1

完成后可以在当前目录下查看生成了文件ss.key

2.创建selfsign证书

openssl req -x509 -days 1095 -key ss.key -out selfsign.pem -outform pem -sha256
输入相关信息
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]:CN

State or Province Name (full name) [Some-State]:S 

Locality Name (eg, city) []:H

Organization Name (eg, company) [Internet Widgits Pty Ltd]:L

Organizational Unit Name (eg, section) []:V

Common Name (e.g. server FQDN or YOUR name) []:P

Email Address []:[email protected] 

 完成后可以在当前目录下查看已经生成了selfsign

你可能感兴趣的:(Linux开发,linux)