blob: 61bbe5d8c4a6600880e43a9d47cb102898755b8f [file] [log] [blame]
Zhiyi Zhang3aaf06d2020-10-17 13:05:36 -07001#! /bin/bash
2
3# compile and install ndncert
4git clone https://github.com/Zhiyi-Zhang/ndncert.git
5cd ndncert
6git checkout origin/v0.3
7./waf configure
Zhiyi Zhang79ee9442020-10-17 15:35:56 -07008sudo ./waf install
9sudo cp ./build/systemd/ndncert-ca.service /etc/systemd/system/
Zhiyi Zhang3aaf06d2020-10-17 13:05:36 -070010sudo chmod 644 /etc/systemd/system/ndncert-server.service
11
Zhiyi Zhang79ee9442020-10-17 15:35:56 -070012# prepare the CA root key
13sudo mkdir /var/lib/ndncert-ca
14sudo chown ndn /var/lib/ndncert-ca
15sudo HOME=/var/lib/ndncert -u ndn ndnsec-keygen /ndn
16
17# prepare CA configuration file
Zhiyi Zhang3aaf06d2020-10-17 13:05:36 -070018echo -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 Zhang3aaf06d2020-10-17 13:05:36 -070020# run the CA
21sudo systemctl start ndncert-server
Zhiyi Zhang79ee9442020-10-17 15:35:56 -070022sleep(2)
Zhiyi Zhang3aaf06d2020-10-17 13:05:36 -070023
24# check the status to make sure everything is correct
25sudo systemctl status ndncert-server