-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #214 from Karm/tested-fixes-for-service-a-b-separa…
…tion Fixes service-a service-b separation, all servers tested
- Loading branch information
Showing
33 changed files
with
381 additions
and
441 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/sh | ||
|
||
# Generates certificates for JWT_AUTH demo examples. | ||
|
||
pushd src/main/resources/ | ||
|
||
openssl genrsa -out private.key 2048 | ||
cat << EOF | openssl req -new -key private.key \ | ||
-x509 -days 0 \ | ||
-out publickey.cer | ||
-- | ||
JWT | ||
JWT | ||
JWT | ||
JWT | ||
JWT | ||
JWT | ||
EOF | ||
|
||
keytool -import -noprompt -alias theKeyId -keystore public.jks -file publickey.cer -storepass atbash | ||
|
||
cat private.key | openssl pkcs8 -topk8 -nocrypt -out private.pem | ||
openssl rsa -in private.pem -outform PEM -pubout -out public.pem | ||
rm -rf private.key | ||
rm -rf publickey.cer | ||
mv public.jks ./files/liberty/public.jks.tpl | ||
mv private.pem ./files/privateKey.pem.tpl | ||
mv public.pem ./files/publicKey.pem.tpl | ||
|
||
# As soon as we switch to VertX JWT https://github.com/eclipse/microprofile-starter/issues/206 | ||
# This conversion won't be needed: | ||
# org.bouncycastle.asn1.pkcs.PrivateKeyInfo cannot be cast to org.bouncycastle.openssl.PEMKeyPair | ||
openssl rsa -in ./files/privateKey.pem.tpl -text -out ./files/privateKey.pem.tpl.long | ||
mv ./files/privateKey.pem.tpl.long ./files/privateKey.pem.tpl | ||
|
||
# KumuluzEE needs pub key in config | ||
KEY=`cat ./files/publicKey.pem.tpl | grep -ve '^-' | tr -d '\n'` | ||
sed -i "s~[ ]*public-key:.*~ public-key: $KEY~g" ./files/kumuluzEE/service-b/config.yaml.tpl | ||
|
||
popd |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.