Skip to content

Commit

Permalink
Merge pull request #431 from jmpsec/saml-cert-command
Browse files Browse the repository at this point in the history
Helper function for SAML certificate
  • Loading branch information
javuto authored Apr 7, 2024
2 parents 5f4aaa9 + 4ad7151 commit 7daad2f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions deploy/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -415,3 +415,19 @@ function install_go_21() {
go version
fi
}

# Generate self-signed certificate for SAML authentication
# string path_to_certs
# string certificate_name
# int rsa_bits
function self_signed_saml() {
local __certs=$1
local __name=$2
local __bits=$3

local __samlcert="$__certs/$__name.crt"
local __samlkey="$__certs/$__name.key"

sudo openssl req -x509 -newkey rsa:$__bits -sha256 -days 365 -nodes \
-keyout "$__samlkey" -out "$__samlcert" -subj "/CN=$__name"
}

0 comments on commit 7daad2f

Please sign in to comment.