Created
January 10, 2020 17:24
-
-
Save brodygov/6b0547ef1a48c1ba206b52fb81150fec to your computer and use it in GitHub Desktop.
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 | |
set -euo pipefail | |
usage() { | |
cat >&2 <<EOM | |
usage: $(basename "$0") COMMON_NAME | |
Generate saml certificate and key in the current directory for COMMON_NAME. | |
For example: | |
$(basename "$0") staging.login.gov | |
EOM | |
} | |
if [ $# -lt 1 ]; then | |
usage | |
exit 1 | |
fi | |
cn="$1" | |
year=$(date +%Y) | |
set -x | |
openssl req -newkey rsa:2048 -sha256 -x509 -days 395 \ | |
-subj "/C=US/ST=District of Columbia/L=Washington/O=GSA/OU=Login.gov/CN=$cn" \ | |
-keyout "saml$year.key.enc" -out "saml$year.crt" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment