Aleksandra Maciaga | 7a5e3f6 | 2020-03-03 12:35:16 +0100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | waitForEjbcaStartUp() { |
| 4 | sleep $1 |
| 5 | } |
| 6 | |
| 7 | configureEjbca() { |
| 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 | |
| 21 | waitForEjbcaStartUp 30 |
| 22 | configureEjbca |