blob: cdff77def4e0a56f90a353ac2d3312bfaca160b7 [file] [log] [blame]
Aleksandra Maciaga7a5e3f62020-03-03 12:35:16 +01001#!/bin/bash
2
3waitForEjbcaStartUp() {
4 sleep $1
5}
6
7configureEjbca() {
8 ejbca.sh config cmp addalias --alias cmpRA
9 ejbca.sh config cmp updatealias --alias cmpRA --key operationmode --value ra
10 ejbca.sh ca editca --caname ManagementCA --field cmpRaAuthSecret --value mypassword
11 ejbca.sh config cmp dumpalias --alias cmpRA
12 ejbca.sh config cmp addalias --alias cmp
13 ejbca.sh config cmp updatealias --alias cmp --key allowautomatickeyupdate --value true
14 ejbca.sh ra addendentity --username Node123 --dn "CN=Node123" --caname ManagementCA --password mypassword --type 1 --token USERGENERATED
15 ejbca.sh ra setclearpwd --username Node123 --password mypassword
16 ejbca.sh config cmp updatealias --alias cmp --key extractusernamecomponent --value CN
17 ejbca.sh config cmp dumpalias --alias cmp
18 ejbca.sh ca getcacert --caname ManagementCA -f /dev/stdout > cacert.pem
19}
20
21waitForEjbcaStartUp 30
22configureEjbca