Skip to content

Instantly share code, notes, and snippets.

@flameoftheforest
Created July 5, 2018 23:15
Show Gist options
  • Save flameoftheforest/75e7a3fd2afc61f5f0ba4291136b87c2 to your computer and use it in GitHub Desktop.
Save flameoftheforest/75e7a3fd2afc61f5f0ba4291136b87c2 to your computer and use it in GitHub Desktop.
Generating PEM using openssl on GitBash in Windows
#!/bin/bash
# https://stackoverflow.com/questions/34156938/openssl-hangs-during-pkcs12-export-with-loading-screen-into-random-state
# "In windows console there is some problem with terminal input/output so winpty can help if some software require unix teminal behavior."
#
# https://rietta.com/blog/2012/01/27/openssl-generating-rsa-key-from-command/
# generate private PEM file
winpty openssl genrsa -des3 -out try.private.pem 2048
# generate public PEM file
winpty openssl rsa -in try.private.pem -outform PEM -pubout -out try.public.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment