aboutsummaryrefslogtreecommitdiffstats
path: root/test/mocks/pnf-onboarding/src/main/scripts/generate-signature.sh
diff options
context:
space:
mode:
authorSzabolcs Hutvagner <szabolcs.hutvagner@ericsson.com>2019-04-05 18:42:15 +0100
committerSzabolcs Hutvagner <szabolcs.hutvagner@ericsson.com>2019-04-05 18:53:43 +0100
commit0c39410d5851c5c32046c10f6559d9a08833b165 (patch)
tree187ed50c26ac2cfb5fa8a021b873338da5431138 /test/mocks/pnf-onboarding/src/main/scripts/generate-signature.sh
parent469b46f7230d9a2512c7c2103f51c7e85f69eb5a (diff)
Provide Sample Signed PNF Package for Integration Test
This can be used for integration test of Pre-Onboarding and Onboarding of a PNF package. Issue-ID: INT-949 Change-Id: I8f193dd6968f62d801530f99c5b130b0bdc57728 Signed-off-by: Szabolcs Hutvagner <szabolcs.hutvagner@ericsson.com>
Diffstat (limited to 'test/mocks/pnf-onboarding/src/main/scripts/generate-signature.sh')
-rw-r--r--test/mocks/pnf-onboarding/src/main/scripts/generate-signature.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/mocks/pnf-onboarding/src/main/scripts/generate-signature.sh b/test/mocks/pnf-onboarding/src/main/scripts/generate-signature.sh
new file mode 100644
index 000000000..f9950cfeb
--- /dev/null
+++ b/test/mocks/pnf-onboarding/src/main/scripts/generate-signature.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+signingCertificate=$1
+signingCertPrivateKey=$2
+csarFile=$3
+signatureName=$4
+
+echo Creating signature file with following inputs
+printf "\t%s = %s\n" "signingCertificate" $signingCertificate
+printf "\t%s = %s\n" "signingCertPrivateKey" $signingCertPrivateKey
+printf "\t%s = %s\n" "csarFile" $csarFile
+
+openssl cms -sign -signer $signingCertificate -inkey $signingCertPrivateKey -outform pem -binary -nocerts < $csarFile > $signatureName
+
+retVal=$?
+if [ $retVal -eq 0 ]; then
+ echo Signature file $signatureName created successfully
+else
+ echo Failed to create Signature file $signatureName
+fi
+
+exit $retVal