Subversion Repositories oidplus

Rev

Blame | Last modification | View Log | RSS feed

  1. #!/bin/bash
  2. # Generate private key and self-signed certificate.
  3. # Make sure script has execute permissions, if not:
  4. #  $ chmod +x ./create-cert.sh
  5. # Usage:
  6. #  $ ./create-cert.sh NAME DAYS
  7. # Where:
  8. #  NAME - Key / certificate name
  9. #  DAYS - Certificate validity days
  10.  
  11. ## Generate password protected private key:
  12. openssl genrsa -des3 -out ./prv-${1}.key 2048
  13. ## Create and self-sign certificate with private key:
  14. openssl req -x509 -sha256 -new -config ./openssl.cnf -key ./prv-${1}.key -days ${2} -out ./pub-${1}.crt
  15.