Skip to content

Instantly share code, notes, and snippets.

@cactaceae21
Last active May 20, 2021 11:50
Show Gist options
  • Save cactaceae21/a1499b2aa3215d8b33900a83e516b3c5 to your computer and use it in GitHub Desktop.
Save cactaceae21/a1499b2aa3215d8b33900a83e516b3c5 to your computer and use it in GitHub Desktop.
Crypto #crypto #encryption #hash #cert #certificate

Creating a certificate

RSA 4096 algorithm with SHA256 - will request subject details
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365

RSA 1024 algorithm with SHA1 - forcing just the Subject name without input
openssl req -x509 -newkey rsa:1024 -sha1 -keyout key.pem -out cert.pem -days 365 --subj "/CN=server"

Remove key password

openssl rsa -in original.key -out new.key

Dump cert contents

Private Key

openssl rsa -in key.pem -text

Public Cert

openssl x509 -in cert.pem -text

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