Zhiyi Zhang | 3aaf06d | 2020-10-17 13:05:36 -0700 | [diff] [blame] | 1 | #! /bin/bash |
| 2 | |
| 3 | # compile and install ndncert |
| 4 | git clone https://github.com/Zhiyi-Zhang/ndncert.git |
| 5 | cd ndncert |
| 6 | git checkout origin/v0.3 |
| 7 | ./waf configure |
Zhiyi Zhang | 79ee944 | 2020-10-17 15:35:56 -0700 | [diff] [blame] | 8 | sudo ./waf install |
| 9 | sudo cp ./build/systemd/ndncert-ca.service /etc/systemd/system/ |
Zhiyi Zhang | 3aaf06d | 2020-10-17 13:05:36 -0700 | [diff] [blame] | 10 | sudo chmod 644 /etc/systemd/system/ndncert-server.service |
| 11 | |
Zhiyi Zhang | 79ee944 | 2020-10-17 15:35:56 -0700 | [diff] [blame] | 12 | # prepare the CA root key |
| 13 | sudo mkdir /var/lib/ndncert-ca |
| 14 | sudo chown ndn /var/lib/ndncert-ca |
| 15 | sudo HOME=/var/lib/ndncert -u ndn ndnsec-keygen /ndn |
| 16 | |
| 17 | # prepare CA configuration file |
Zhiyi Zhang | 3aaf06d | 2020-10-17 13:05:36 -0700 | [diff] [blame] | 18 | echo -e "{\n\"ca-prefix\": \"/ndn\",\n\"ca-info\": \"NDN testbed root CA\",\n\"max-validity-period\": \"1296000\",\n\"max-suffix-length\": \"2\",\n\"supported-challenges\":\n[\n{ \"challenge\": \"pin\" }\n]\n}" > /usr/local/etc/ndncert/ca.conf |
| 19 | |
Zhiyi Zhang | 3aaf06d | 2020-10-17 13:05:36 -0700 | [diff] [blame] | 20 | # run the CA |
| 21 | sudo systemctl start ndncert-server |
Zhiyi Zhang | 79ee944 | 2020-10-17 15:35:56 -0700 | [diff] [blame] | 22 | sleep(2) |
Zhiyi Zhang | 3aaf06d | 2020-10-17 13:05:36 -0700 | [diff] [blame] | 23 | |
| 24 | # check the status to make sure everything is correct |
| 25 | sudo systemctl status ndncert-server |