aboutsummaryrefslogtreecommitdiffstats
path: root/tests/dcaegen2/prh-testcases/resources/cert_generation/create_certs.sh
diff options
context:
space:
mode:
authorgrabinsk <maciej.grabinski@nokia.com>2019-05-23 13:34:38 +0200
committergrabinsk <maciej.grabinski@nokia.com>2019-05-28 10:11:41 +0200
commit0fc9eab94f101a9713c951b3c159065c72a31495 (patch)
tree5f4ab15972b90b09489b1bd582b4c2ac6f40ae25 /tests/dcaegen2/prh-testcases/resources/cert_generation/create_certs.sh
parent08a9c63a95ad22472c358bd062d775d8b7b7505a (diff)
Use single PRH container with ssl configuration
Generating new certificates since the old ones have expired Change-Id: If68ceab0bea7dbc10db647af7530b39b44729c0c Issue-ID: INT-1076 Signed-off-by: grabinsk <maciej.grabinski@nokia.com>
Diffstat (limited to 'tests/dcaegen2/prh-testcases/resources/cert_generation/create_certs.sh')
-rwxr-xr-xtests/dcaegen2/prh-testcases/resources/cert_generation/create_certs.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/dcaegen2/prh-testcases/resources/cert_generation/create_certs.sh b/tests/dcaegen2/prh-testcases/resources/cert_generation/create_certs.sh
new file mode 100755
index 00000000..a105f1a0
--- /dev/null
+++ b/tests/dcaegen2/prh-testcases/resources/cert_generation/create_certs.sh
@@ -0,0 +1,41 @@
+#!/usr/bin/env bash
+
+mkdir -p private certs newcerts
+chmod 700 private
+chmod 755 certs newcerts
+touch index.txt
+echo "unique_subject = no" > index.txt.attr
+echo '01' > serial
+
+openssl genrsa -out root.key 4096
+openssl req -config openssl.conf -key root.key -new -x509 -days 36500 -sha256 -extensions v3_ca -subj /CN=RootCA/OU=OSAAF/O=ONAP/C=US -out root.crt
+
+openssl genrsa -out intermediate.key 4096
+openssl req -new -sha256 -key intermediate.key -out intermediate.csr -outform PEM -subj /CN=intermediate/OU=OSAAF/O=ONAP/C=US
+openssl ca -batch -config openssl.conf -extensions v3_intermediate_ca -days 36500 -cert root.crt -keyfile root.key -out intermediate.crt -infiles intermediate.csr
+
+#openssl genrsa -out aai.key 4096
+cp ../simulator/certs/aai.key aai.key
+openssl req -new -sha256 -key aai.key -out aai.csr -outform PEM -subj /CN=aai/OU=OSAAF/O=ONAP/C=US
+openssl ca -batch -config openssl.conf -days 36500 -cert intermediate.crt -keyfile intermediate.key -out aai.crt -policy policy_loose -infiles aai.csr
+
+
+#openssl genrsa -out dmaap-mr.key 4096
+cp ../simulator/certs/dmaap-mr.key dmaap-mr.key
+openssl req -new -sha256 -key dmaap-mr.key -out dmaap-mr.csr -outform PEM -subj /CN=dmaap-mr/OU=OSAAF/O=ONAP/C=US
+openssl ca -batch -config openssl.conf -days 36500 -cert intermediate.crt -keyfile intermediate.key -out dmaap-mr.crt -policy policy_loose -infiles dmaap-mr.csr
+
+
+openssl genrsa -out prh.key 4096
+openssl req -new -sha256 -key prh.key -out prh.csr -outform PEM -subj /CN=prh/OU=OSAAF/O=ONAP/C=US
+openssl ca -batch -config openssl.conf -extensions server_cert -days 36500 -cert intermediate.crt -keyfile intermediate.key -out prh.crt -policy policy_loose -infiles prh.csr
+
+
+cat prh.crt intermediate.crt >> merged.crt
+
+openssl pkcs12 -export -name prh-cert -in merged.crt -inkey prh.key -passout pass:$(cat ../simulator/certs/keystore.password) -out keystore.p12
+keytool -import -alias intermediate-cert -file intermediate.crt -storepass $(cat ../simulator/certs/truststore.password) -keystore truststore.jks -noprompt
+keytool -import -alias root-cert -file root.crt -storepass $(cat ../simulator/certs/truststore.password) -keystore truststore.jks -noprompt
+
+
+cp aai.crt aai.key dmaap-mr.crt dmaap-mr.key root.crt keystore.p12 truststore.jks ../simulator/certs \ No newline at end of file