-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
149 additions
and
47 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
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
Binary file not shown.
File renamed without changes.
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 @@ | ||
7XIvZiCyrx6akly_dDvOtpe7QM6ksYoH |
Binary file not shown.
File renamed without changes.
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,58 @@ | ||
#!/bin/sh | ||
|
||
set -x | ||
|
||
CERTS_DIR=$(realpath "$(dirname "$0")") | ||
|
||
SSL_KEYSTORE=cryostat-keystore.p12 | ||
|
||
SSL_KEYSTORE_PASS_FILE=keystore.pass | ||
|
||
cleanup() { | ||
cd "$CERTS_DIR" | ||
rm $SSL_KEYSTORE $SSL_KEYSTORE_PASS_FILE | ||
cd - | ||
} | ||
|
||
case "$1" in | ||
clean) | ||
cleanup | ||
exit 0 | ||
;; | ||
generate) | ||
;; | ||
*) | ||
echo "Usage: $0 [clean|generate]" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
set -e | ||
|
||
genpass() { | ||
< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c32 | ||
} | ||
|
||
SSL_KEYSTORE_PASS=$(genpass) | ||
|
||
cd "$CERTS_DIR" | ||
trap "cd -" EXIT | ||
|
||
echo "$SSL_KEYSTORE_PASS" > $SSL_KEYSTORE_PASS_FILE | ||
|
||
keytool \ | ||
-genkeypair -v \ | ||
-alias custom-cryostat \ | ||
-dname "cn=cryostat, o=Cryostat, c=CA" \ | ||
-storetype PKCS12 \ | ||
-validity 365 \ | ||
-keyalg RSA \ | ||
-storepass "$SSL_KEYSTORE_PASS" \ | ||
-keystore "$SSL_KEYSTORE" | ||
|
||
keytool \ | ||
-exportcert -v \ | ||
-alias custom-cryostat \ | ||
-keystore "$SSL_KEYSTORE" \ | ||
-storepass "$SSL_KEYSTORE_PASS" \ | ||
-file server.cer |
File renamed without changes.
File renamed without changes.