Created
June 11, 2018 20:03
-
-
Save jackinloadup/afb83d69fb8ffa50e00e6120d85bff8e to your computer and use it in GitHub Desktop.
Generate SAML certificate for NISM
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 | |
readonly PROGNAME="$(basename "$0")" | |
readonly PROGDIR="$(readlink -m "$(dirname "$0")")" | |
readonly ARGS="$@" | |
HOSTNAME="$1" | |
if [ -z "$HOSTNAME" ]; then | |
echo "No hostname provided" | |
echo " This tool will generate a certificate for use with NASA SAML/ICAM/LAUNCHPAD" | |
echo | |
echo " EXAMPLE" | |
echo " ./$PROGNAME eva.nasa.gov" | |
exit 1 | |
fi | |
openssl req \ | |
-x509 \ | |
-nodes \ | |
-days 730 \ | |
-subj "/C=US/ST=DC/L=Washington/O=NASA/OU=HQ/CN=$HOSTNAME" \ | |
-config openssl.cnf \ | |
-newkey rsa:2048 \ | |
-keyout $HOSTNAME.key \ | |
-out $HOSTNAME.crt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment