Created
April 3, 2016 22:02
-
-
Save christopher-baek/7a94ea1a9492cec7d908dc896ee551d1 to your computer and use it in GitHub Desktop.
.Certificate Management Examples
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
# Names | |
ORGANIZATION="MyOrganization" | |
# Files | |
CSR=${ORGANIZATION}.csr | |
KEY=${ORGANIZATION}.key | |
openssl req -new -newkey rsa:4096 -nodes -out ${CSR} -keyout ${KEY} -subj "/C=US/ST=Illinois/L=Chicago/O=${ORGANIZATION}/CN=myorganization.com" |
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
OPENSSL_CMD=$(which openssl) | |
EXPIRATION_DAYS=365 | |
RSA_BITS=2048 | |
KEY_FILENAME=certificate.key | |
CERTIFICATE_FILENAME=certificate.pem | |
${OPENSSL_CMD} req -x509 -nodes -days ${EXPIRATION_DAYS} -newkey rsa:${RSA_BITS} -keyout ${KEY_FILENAME} -out ${CERTIFICATE_FILENAME} |
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
openssl rsa -in ${ENCRYPTED_KEY} -out ${DECRYPTED_KEY} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment