Skip to content

Instantly share code, notes, and snippets.

@vjrj
Created January 28, 2021 07:46
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 vjrj/3b9c0a3cf36b9c37db71609f5eac5203 to your computer and use it in GitHub Desktop.
Save vjrj/3b9c0a3cf36b9c37db71609f5eac5203 to your computer and use it in GitHub Desktop.
CAS keys generator for LA inventories
#!/bin/bash
# Dependencies: java 8 and curl
DEST=.
if [[ ! -f $DEST/jwk-gen.jar ]]; then
curl -s -o $DEST/jwk-gen.jar --location --remote-header-name --remote-name https://raw.githubusercontent.com/apereo/cas/master/etc/jwk-gen.jar
fi
function gen {
java -jar $DEST/jwk-gen.jar -t oct -s "$1" | grep -v "Full" | jq '.k' | sed 's/^"//' | sed 's/"$//g'
}
echo pac4j_cookie_signing_key="$(gen 512)"
echo pac4j_cookie_encryption_key="$(gen 256)"
echo cas_webflow_signing_key="$(gen 512)"
echo cas_webflow_encryption_key="$(gen 128)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment