Skip to content

Instantly share code, notes, and snippets.

@akirattii
Created April 11, 2018 01:48
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 akirattii/4815b29102248cac8027797fcb80f2ea to your computer and use it in GitHub Desktop.
Save akirattii/4815b29102248cac8027797fcb80f2ea to your computer and use it in GitHub Desktop.
Generate a private/public key pem file using `openssl`

Generate a private/public key pem file

# First, create a file as random seed, written as you like:
$ echo "<input_many_charactors_for_random_seed>" > random.txt

# Generate a private key:
$ openssl genrsa -rand random.txt 2048 > private.pem

# Generate a public key from above private key:
$ openssl rsa -in ./private.pem -pubout -out public.pem

Now you got 2 pem files. One is private.pem as private key pem, another is public.pem as public.

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