Created
August 25, 2020 06:28
-
-
Save fritschy/407d66c0cc8525b8aa48d23315e7665b to your computer and use it in GitHub Desktop.
openssl one liners
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# generate 2048 bit RSA private key (protected by DES3) | |
openssl genrsa -des3 -out private.pem 2048 | |
# same generation w/o DES3 | |
openssl genrsa -out private.pem 2048 | |
# convert PEM to DER | |
openssl rsa -in private.pem -pubout -outform DER > public.der | |
# generate (self signed) certificate (e.g. for use in webservers) | |
openssl req -newkey rsa:4096 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem -subj "/CN=$DOMAIN" | |
openssl req -newkey rsa:4096 -new -nodes -x509 -days 3650 -keyout key.pem -out cert.pem -subj "/C=Germany/ST=Germany/O=$ORGANIZATION/OU=Org/CN=$DOMAIN" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment