Skip to content

Instantly share code, notes, and snippets.

@xezpeleta
Last active November 7, 2018 10:22
Show Gist options
  • Save xezpeleta/de4d2cade0f8bab5f9d27cbe65aff728 to your computer and use it in GitHub Desktop.
Save xezpeleta/de4d2cade0f8bab5f9d27cbe65aff728 to your computer and use it in GitHub Desktop.
Certs cheatsheet

Check certificate details

openssl x509 -in ca.crt -noout -text

Check certificate expiration date

openssl x509 -in ca.crt -noout -enddate

Renew CA certificate (for 10 years, using same existing key)

openssl x509 -in ca.crt -days 3650 -out ca_new.crt -signkey ca.key

Create new csr and key

openssl req -new -out mycert.csr -keyout mycert.key

Sign csr using CA

openssl x509 -req -in mycert.csr -CA ca.crt -CAkey ca.key -CAcreateserial -out mycert.crt

(it will create mycert.crt, you can delete now the mycert.csr file)

Remove password from key

(if needed)

openssl rsa -in mycert.key -out mycert_nopass.key

More commands

https://gist.github.com/webtobesocial/5313b0d7abc25e06c2d78f8b767d4bc3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment