Skip to content

Instantly share code, notes, and snippets.

@bijukunjummen
Created February 11, 2018 05:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save bijukunjummen/cd8db7b93b1cf347c3e87bb74d718ce2 to your computer and use it in GitHub Desktop.
Save bijukunjummen/cd8db7b93b1cf347c3e87bb74d718ce2 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