OPENSSL

openssl genrsa -out ca.key 4096

 openssl req -x509 -new -nodes -sha512 -days 3650  -subj "/C=CN/ST=Beijing/L=Beijing/O=example/OU=Personal/CN=dke.com"  -key ca.key  -out ca.crt


 openssl genrsa -out reg.dke.com.key 4096




 openssl req -sha512 -new  -subj "/C=CN/ST=Beijing/L=Beijing/O=example/OU=Personal/CN=dke.com"  -key reg.dke.com.key  -out reg.dke.com.csr

cat > v3.ext <<-EOF
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
extendedKeyUsage = serverAuth
subjectAltName = @alt_names

[alt_names]
DNS.1=dke.com
DNS.2=dke
DNS.3=hostname
EOF


 openssl x509 -req -sha512 -days 3650  -extfile v3.ext    -CA ca.crt -CAkey ca.key -CAcreateserial   -in reg.dke.com.csr   -out reg.dke.com.crt

  

posted @ 2020-07-31 16:53  Boks  阅读(159)  评论(0编辑  收藏  举报