Skip to content

Instantly share code, notes, and snippets.

@reflexdemon
Forked from bijukunjummen/generate_uaa_keypair.sh
Created February 19, 2019 12:33
Show Gist options
  • Save reflexdemon/59f3e7d21f33455ab08844e783937dd5 to your computer and use it in GitHub Desktop.
Save reflexdemon/59f3e7d21f33455ab08844e783937dd5 to your computer and use it in GitHub Desktop.
Generate a Signing Key and Verification Key for Cloud Foundry UAA
#!/bin/bash
openssl genrsa -out privkey.pem 2048
openssl rsa -pubout -in privkey.pem -out pubkey.pem
SIGNING_KEY=$(cat privkey.pem)
VERIFICATION_KEY=$(cat pubkey.pem)
JWT_SIGNING_KEYS=$(cat <<EOF
jwt:
token:
signing-key: |
$(echo "$SIGNING_KEY" | awk '{printf " %s\n", $0}')
verification-key: |
$(echo "$VERIFICATION_KEY" | awk '{printf " %s\n", $0}')
EOF
)
echo "$JWT_SIGNING_KEYS" > uaa_config.yml
rm privkey.pem
rm pubkey.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment