Skip to content

Instantly share code, notes, and snippets.

@Luavis
Created January 20, 2014 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Luavis/8521550 to your computer and use it in GitHub Desktop.
Save Luavis/8521550 to your computer and use it in GitHub Desktop.
#!/bin/sh
echo "Certification password:"
read -s password
read -p "Domain(www.xxx.xxx): `echo $'\n> '`" domain
read -p "Country(KR, US): `echo $'\n> '`" country
read -p "State/Province: `echo $'\n> '`" state
read -p "City: `echo $'\n> '`" city
read -p "Organization: `echo $'\n> '`" org
read -p "Team: `echo $'\n> '`" team
read -p "Email: `echo $'\n> '`" email
openssl genrsa -des3 -out $domain.key.tmp -passout pass:"$password" 2048
openssl rsa -in $domain.key.tmp -passin pass:"" -out $domain.key
openssl req -new -key $domain.key.tmp -passin pass:"$password" -out $domain.csr -subj "/C=$country/ST=$state/L=$city/O=$org/OU=$team/CN=$domain/emailAddress=$email"
openssl req -noout -text -in $domain.csr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment