add a new service.in
Change-Id: I4248d0c177a76555e6b7ba3f6bae564e7650c461
diff --git a/deployment/step-1-root-ca.sh b/deployment/step-1-root-ca.sh
new file mode 100644
index 0000000..61bbe5d
--- /dev/null
+++ b/deployment/step-1-root-ca.sh
@@ -0,0 +1,25 @@
+#! /bin/bash
+
+# compile and install ndncert
+git clone https://github.com/Zhiyi-Zhang/ndncert.git
+cd ndncert
+git checkout origin/v0.3
+./waf configure
+sudo ./waf install
+sudo cp ./build/systemd/ndncert-ca.service /etc/systemd/system/
+sudo chmod 644 /etc/systemd/system/ndncert-server.service
+
+# prepare the CA root key
+sudo mkdir /var/lib/ndncert-ca
+sudo chown ndn /var/lib/ndncert-ca
+sudo HOME=/var/lib/ndncert -u ndn ndnsec-keygen /ndn
+
+# prepare CA configuration file
+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
+
+# run the CA
+sudo systemctl start ndncert-server
+sleep(2)
+
+# check the status to make sure everything is correct
+sudo systemctl status ndncert-server
\ No newline at end of file