Skip to content

Instantly share code, notes, and snippets.

@jackinloadup
Created June 11, 2018 20:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jackinloadup/afb83d69fb8ffa50e00e6120d85bff8e to your computer and use it in GitHub Desktop.
Save jackinloadup/afb83d69fb8ffa50e00e6120d85bff8e to your computer and use it in GitHub Desktop.
Generate SAML certificate for NISM
#!/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