Advertisement
Guest User

gen crt key

a guest
Dec 14th, 2018
1,090
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.58 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. # Generate root key
  4. openssl genrsa -des3 -out CA.key 2048
  5.  
  6. # Generate root-certificate based on root-key
  7. openssl req -x509 -new -nodes -key CA.key -sha256 -days 1825 -out CA.pem \
  8. -subj "stuff here"
  9.  
  10. # Generate Certificate Signing Request (CSR) based on new private key
  11. openssl req -new -sha256 -nodes -out example.com.csr -newkey rsa:2048 -keyout example.com.key \
  12.   -subj "stuff here"
  13.  
  14. # Create certificates for web server
  15. openssl x509 -req -in example.com.csr -CA CA.pem -CAkey CA.key -CAcreateserial -out example.com.crt -days 1825 -sha256 -extfile v3.ext
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement