From 4bbd45fefcc611dfee69957ed8c3c500e49b6cdc Mon Sep 17 00:00:00 2001 From: sguh Date: Thu, 13 Jun 2024 09:27:15 +0530 Subject: [PATCH] [MTM-59554] allow to export only device certificate optionally --- mqtt-client/scripts/02moveCertificatesToKeystore.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mqtt-client/scripts/02moveCertificatesToKeystore.sh b/mqtt-client/scripts/02moveCertificatesToKeystore.sh index f70de43ddd..6b4f97eb14 100755 --- a/mqtt-client/scripts/02moveCertificatesToKeystore.sh +++ b/mqtt-client/scripts/02moveCertificatesToKeystore.sh @@ -6,6 +6,11 @@ set -x NAME=iot-device-0001 FILES_WITH_CERTIFICATES="$NAME-cert.pem iot-cert.pem" +# Check for the --leafonly option +if [[ "$1" == "--leafonly" ]]; then + FILES_WITH_CERTIFICATES="$NAME-cert.pem" +fi + rm chain-$NAME.pem chain-with-private-key-$NAME.p12 chain-with-private-key-$NAME.jks || echo "Nothing to remove" cat $FILES_WITH_CERTIFICATES > chain-$NAME.pem