port NAC to security v2

This commit is based on Lei Pi's commit, which changed certificate version from v1 to v2.
The later changes fix some bugs and refactor algo part of the library to get rid of cryptopp.

Change-Id: I3be7e0341fe85ee69f1b5f1c3ed7421a6c61d0b5
diff --git a/src/group-manager.hpp b/src/group-manager.hpp
index 2e19ab1..56feb28 100644
--- a/src/group-manager.hpp
+++ b/src/group-manager.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2015,  Regents of the University of California
+ * Copyright (c) 2014-2018,  Regents of the University of California
  *
  * This file is part of ndn-group-encrypt (Group-based Encryption Protocol for NDN).
  * See AUTHORS.md for complete list of ndn-group-encrypt authors and contributors.
@@ -16,7 +16,7 @@
  * You should have received a copy of the GNU General Public License along with
  * ndn-group-encrypt, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  *
- * @author Zhiyi Zhang <dreamerbarrychang@gmail.com>
+ * @author Zhiyi Zhang <zhiyi@cs.ucla.edu>
  */
 
 #ifndef NDN_GEP_GROUP_MANAGER_HPP
@@ -36,8 +36,7 @@
   class Error : public std::runtime_error
   {
   public:
-    explicit
-    Error(const std::string& what)
+    explicit Error(const std::string& what)
       : std::runtime_error(what)
     {
     }
@@ -53,8 +52,11 @@
    * The group key will be an RSA key with @p paramLength bits.
    * The FreshnessPeriod of data packet carrying the keys will be set to @p freshPeriod hours.
    */
-  GroupManager(const Name& prefix, const Name& dataType, const std::string& dbPath,
-               const int paramLength, const int freshPeriod);
+  GroupManager(const Name& prefix,
+               const Name& dataType,
+               const std::string& dbPath,
+               const int paramLength,
+               const int freshPeriod);
 
   /**
    * @brief Create a group key for interval which
@@ -90,6 +92,9 @@
   void
   addMember(const std::string& scheduleName, const Data& memCert);
 
+  void
+  addMember(const std::string& scheduleName, const Name& keyName, const Buffer& key);
+
   /// @brief Remove member with name @p identity from the group.
   void
   removeMember(const Name& identity);
@@ -99,7 +104,7 @@
   updateMemberSchedule(const Name& identity, const std::string& scheduleName);
 
 
-PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+PUBLIC_WITH_TESTS_ELSE_PRIVATE :
   /**
    * @brief Calculate interval that covers @p timeslot
    * and fill @p memberKeys with the info of members who is allowed to access the interval.
@@ -117,13 +122,15 @@
 
   /// @brief Create E-KEY data.
   Data
-  createEKeyData(const std::string& startTs, const std::string& endTs,
-                 const Buffer& pubKeyBuf);
+  createEKeyData(const std::string& startTs, const std::string& endTs, const Buffer& pubKeyBuf);
 
   /// @brief Create D-KEY data.
   Data
-  createDKeyData(const std::string& startTs, const std::string& endTs, const Name& keyName,
-                 const Buffer& priKeyBuf, const Buffer& certKey);
+  createDKeyData(const std::string& startTs,
+                 const std::string& endTs,
+                 const Name& keyName,
+                 const Buffer& priKeyBuf,
+                 const Buffer& certKey);
 
   /// @brief Add a EKey to the database
   void