Add cql jar to graphadmin
[aai/graphadmin.git] / src / main / scripts / updatePem.sh
1 #!/bin/ksh
2
3 ###
4 # ============LICENSE_START=======================================================
5 # org.onap.aai
6 # ================================================================================
7 # Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
8 # ================================================================================
9 # Licensed under the Apache License, Version 2.0 (the "License");
10 # you may not use this file except in compliance with the License.
11 # You may obtain a copy of the License at
12 #
13 #      http://www.apache.org/licenses/LICENSE-2.0
14 #
15 # Unless required by applicable law or agreed to in writing, software
16 # distributed under the License is distributed on an "AS IS" BASIS,
17 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 # See the License for the specific language governing permissions and
19 # limitations under the License.
20 # ============LICENSE_END=========================================================
21 ###
22 #
23 COMMON_ENV_PATH=$( cd "$(dirname "$0")" ; pwd -P )
24 . ${COMMON_ENV_PATH}/common_functions.sh
25
26 start_date;
27 check_user;
28 source_profile;
29
30 CERTPATH=$PROJECT_HOME/resources/etc/auth/
31 KEYNAME=aaiClientPrivateKey.pem
32 CERTNAME=aaiClientPublicCert.pem
33
34 pw=$(execute_spring_jar org.onap.aai.util.AAIConfigCommandLinePropGetter "" "aai.keystore.passwd" 2> /dev/null | tail -1)
35 openssl pkcs12 -in ${CERTPATH}/aai-client-cert.p12 -out $CERTPATH$CERTNAME -clcerts -nokeys -passin pass:$pw
36 openssl pkcs12 -in ${CERTPATH}/aai-client-cert.p12 -out $CERTPATH$KEYNAME -nocerts -nodes -passin pass:$pw
37 end_date;
38 exit 0