diff options
author | 2019-04-10 10:32:00 +0200 | |
---|---|---|
committer | 2019-04-10 11:37:50 +0200 | |
commit | c138b700030d22ae0bdbd6992fb4a4d8a3431798 (patch) | |
tree | 35926c24ef0eb4c770f3592bedc6e4d3cf69c98e /development/ssl | |
parent | d52444107a3c62c1027e35178b76645ceb4d2c4e (diff) |
Read passwords from files
Key- and trust-store passwords should be read from files in order to
work with DCAE tls-init-container.
Change-Id: Ibe454663328268f33f8be25ef9ec129f1ce1d396
Issue-ID: DCAEGEN2-1412
Signed-off-by: Piotr Jaszczyk <piotr.jaszczyk@nokia.com>
Diffstat (limited to 'development/ssl')
-rw-r--r-- | development/ssl/.gitignore | 2 | ||||
-rwxr-xr-x | development/ssl/gen-certs.sh | 22 |
2 files changed, 22 insertions, 2 deletions
diff --git a/development/ssl/.gitignore b/development/ssl/.gitignore index 23888eb0..955c17d1 100644 --- a/development/ssl/.gitignore +++ b/development/ssl/.gitignore @@ -4,4 +4,4 @@ *.csr *.pkcs12 *.p12 - +*.pass diff --git a/development/ssl/gen-certs.sh b/development/ssl/gen-certs.sh index b4f78227..bf28ca02 100755 --- a/development/ssl/gen-certs.sh +++ b/development/ssl/gen-certs.sh @@ -1,4 +1,21 @@ #!/usr/bin/env bash +# ============LICENSE_START======================================================= +# csit-dcaegen2-collectors-hv-ves +# ================================================================================ +# Copyright (C) 2018-2019 NOKIA +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= set -eu -o pipefail -o xtrace @@ -24,6 +41,8 @@ function gen_key() { keytool -certreq -alias ${key_name} -keyalg RSA ${keystore} | \ keytool -alias ${ca} -gencert -ext "san=dns:${CN_PREFIX}-${ca}" ${store_opts} -keystore ${ca}.p12 | \ keytool -alias ${key_name} -importcert ${keystore} + + printf ${STORE_PASS} > ${key_name}.pass } @@ -36,10 +55,11 @@ function gen_ca() { function gen_truststore() { local trusted_ca="$1" keytool -import -trustcacerts -alias ca -file ${trusted_ca}.crt ${store_opts} -keystore ${TRUST}.p12 + printf ${STORE_PASS} > ${TRUST}.pass } function clean() { - rm -f *.crt *.p12 + rm -f *.crt *.p12 *.pass } if [[ $# -eq 0 ]]; then |