3 # ===========LICENSE_START====================================================
4 # Copyright (C) 2021 AT&T Intellectual Property. All rights reserved.
5 # ============================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 # ============LICENSE_END=====================================================
21 # Generates a self-signed keystore for use by the various policy docker
30 ALIAS="policy@policy.onap.org"
33 dn="C=US, O=ONAP, OU=OSAAF, OU=policy@policy.onap.org:DEV, CN=policy"
37 keytool -genkeypair -alias "${ALIAS}" -validity 30 \
38 -keyalg RSA -dname "${dn}" -keystore "${OUTFILE}" \
39 -keypass "${PASS}" -storepass "${PASS}"
41 keytool -certreq -alias "${ALIAS}" -keystore ks.jks -file ks.csr \
44 openssl x509 -CA caroot.cer -CAkey cakey.pem -CAserial caserial.txt \
45 -req -in ks.csr -out ks.cer -passin "pass:${PASS}" \
46 -extfile dns_ssl.txt -days 30
48 keytool -import -noprompt -file caroot.cer -keystore ks.jks \
51 keytool -import -alias "${ALIAS}" -file ks.cer -keystore ks.jks \