-sed -i "s/LATITUDE=.*/LATITUDE=$CADI_LATITUDE/g" /opt/authz/auth/docker/d.props
-sed -i "s/LONGITUDE=.*/LONGITUDE=$CADI_LONGITUDE/g" /opt/authz/auth/docker/d.props
-
-SIGNER_P12="$CURRENT_DIR/config/sample_ca/aaf.signer.p12"
-AAF_P12="$CURRENT_DIR/config/sample_ca/aaf.bootstrap.p12"
-P12_PASSWORD="something easy"
-
-if [ ! -e "$SIGNER_P12" ]; then
- mkdir -p "$CURRENT_DIR/sample_ca"
- cp /opt/authz/conf/onap.sample.signer.p12 "$SIGNER_P12"
-fi
-
-if [ ! -e "$AAF_P12" ]; then
- mkdir -p $CURRENT_DIR/sample_ca
- cd /opt/authz/conf/CA
- /bin/bash bootstrap.sh $SIGNER_P12 "$P12_PASSWORD"
- if [ ! -e "aaf.bootstrap.p12" ]; then
- echo "Certificates NOT created. Stopping installation"
- exit
- else
- mv aaf.bootstrap.p12 $AAF_P12
- fi
- cd -
-fi
-
-if [ -e "$AAF_P12" ]; then
- sed -i "s/AAF_INITIAL_X509_P12=.*/AAF_INITIAL_X509_P12=${AAF_P12//\//\\/}/g" /opt/authz/auth/docker/d.props
- sed -i "s/AAF_INITIAL_X509_PASSWORD=.*/AAF_INITIAL_X509_PASSWORD=\"$P12_PASSWORD\"/g" /opt/authz/auth/docker/d.props
-fi
-
-if [ -e "$SIGNER_P12" ]; then
- if [ -e "/opt/config/cadi_x509_issuers.txt" ]; then
- ISSUERS=$(cat "/opt/config/cadi_x509_issuers.txt")":"
- fi
- # Pick the REAL subject off the P12
- SUBJECT=$(echo "$P12_PASSWORD" | openssl pkcs12 -info -clcerts -in $SIGNER_P12 -nokeys -passin stdin | grep subject)
- SUBJECT=${SUBJECT//\// }
- SUBJECT=${SUBJECT/subject= /}
- # Needs to be reversed, separated by ", "
- for S in $SUBJECT ; do
- if [ "$RSUBJECT" = "" ]; then
- RSUBJECT=$S
- else
- RSUBJECT="$S, $RSUBJECT"
- fi
- done
- ISSUERS="$ISSUERS$RSUBJECT"
- sed -i "s/CADI_X509_ISSUERS=.*/CADI_X509_ISSUERS=\"$ISSUERS\"/g" /opt/authz/auth/docker/d.props
- sed -i "s/AAF_SIGNER_P12=.*/AAF_SIGNER_P12=${SIGNER_P12//\//\\/}/g" /opt/authz/auth/docker/d.props
- sed -i "s/AAF_SIGNER_PASSWORD=.*/AAF_SIGNER_PASSWORD=\"$P12_PASSWORD\"/g" /opt/authz/auth/docker/d.props
-fi