Skip to content

Instantly share code, notes, and snippets.

@igomez10
Last active December 10, 2018 10:49
Show Gist options
  • Save igomez10/e1e1b13ea68e0fddd26b0558de4b0596 to your computer and use it in GitHub Desktop.
Save igomez10/e1e1b13ea68e0fddd26b0558de4b0596 to your computer and use it in GitHub Desktop.
Generate private key, public key and sign a csr using the keypair

1. Generate .pem private key

 openssl genrsa -des3 -out private.pem 4096

2. Generate .pem public key from ./private.pem created in previous step.

Basically extracting a public key from the private key

openssl rsa -in private.pem -outform PEM -pubout -out public.pem

3. Sign a csr using the private.pem file

openssl req -new -key private.pem -out req.csr

4. Verify csr

openssl req -in req.csr -noout -text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment