Skip to content

Instantly share code, notes, and snippets.

@brnrc
Created July 28, 2014 17:49
Show Gist options
  • Select an option

  • Save brnrc/cd9ff760e9ac9727e03b to your computer and use it in GitHub Desktop.

Select an option

Save brnrc/cd9ff760e9ac9727e03b to your computer and use it in GitHub Desktop.
## Creating a Certification Authority (CA)
openssl genrsa -aes256 -out <key file name>.key <key size>
# Creating the request (example of a DN "/O=Me/OU=MyOrganizationalUnit/CN=My CA Common Name")
openssl req -new -extensions v3_req -key <key pair file>.key -out <csr file>.csr -days <csr validity> -config ca.conf -subj <certificate subject DN>
# self-sign
openssl x509 -req -in <csr file>.csr -out <cert file>.crt -extensions ca_cert_exts -days 3650 -extfile ca.conf -signkey <key pair file>.key -CAcreateserial
# Embed private keys with the certificate.cer to create a PKCS #12 (.pfx) file
openssl pkcs12 -export -out certificate.pfx -inkey <key file name>.key -in <certificate file name>.crt -certfile <CA certificate>.crt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment