Created
January 12, 2017 06:49
-
-
Save balos1/e63a7a956a5921298768457e0916ecfd to your computer and use it in GitHub Desktop.
Useful for creating certificates for Microsoft Azure subscriptions management and many other things.
This file contains hidden or 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
#!/bin/bash | |
if [ -z "$1"] | |
then | |
echo "./create.cert <name>" | |
echo "please provide name argument" | |
exit 1 | |
else | |
name=$1 | |
fi | |
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout $name.pem -out $name.pem | |
openssl pkcs12 -export -out $name.pfx -in $name.pem -name "$name" | |
openssl x509 -inform pem -in $name.pem -outform der -out $name.cer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment