Basic command-line tools to export KEK and KDKs

Change-Id: I0975871b6639653e60a2f7ccefaf435147828f33
diff --git a/src/access-manager.cpp b/src/access-manager.cpp
index 3ab89f0..5fb34ab 100644
--- a/src/access-manager.cpp
+++ b/src/access-manager.cpp
@@ -80,7 +80,7 @@
   m_face.unsetInterestFilter(m_kdkRegId);
 }
 
-void
+Data
 AccessManager::addMember(const Certificate& memberCert)
 {
   Name kdkName(m_nacKey.getIdentity());
@@ -118,6 +118,8 @@
   m_keyChain.sign(*kdk, signingByIdentity(m_identity));
 
   m_ims.insert(*kdk);
+
+  return *kdk;
 }
 
 void
diff --git a/src/access-manager.hpp b/src/access-manager.hpp
index 6f77d4c..d2a6f74 100644
--- a/src/access-manager.hpp
+++ b/src/access-manager.hpp
@@ -75,8 +75,9 @@
   /**
    * @brief Authorize a member identified by its certificate @p memberCert to decrypt data
    *        under the policy
+   * @return published KDK
    */
-  void
+  Data
   addMember(const Certificate& memberCert);
 
   // void
diff --git a/src/version.hpp.in b/src/version.hpp.in
new file mode 100644
index 0000000..2e207ea
--- /dev/null
+++ b/src/version.hpp.in
@@ -0,0 +1,68 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/**
+ * Copyright (c) 2013-2014 Regents of the University of California.
+ *
+ * This file is part of ndn-nac library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-nac library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-nac library is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-nac, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-nac authors and contributors.
+ */
+
+#ifndef NAC_VERSION_HPP
+#define NAC_VERSION_HPP
+
+namespace ndn {
+
+/** ndn-nac version follows Semantic Versioning 2.0.0 specification
+ *  http://semver.org/
+ */
+
+/** \brief ndn-nac version represented as an integer
+ *
+ *  MAJOR*1000000 + MINOR*1000 + PATCH
+ */
+#define NDN_NAC_VERSION @VERSION@
+
+/** \brief ndn-nac version represented as a string
+ *
+ *  MAJOR.MINOR.PATCH
+ */
+#define NDN_NAC_VERSION_STRING "@VERSION_STRING@"
+
+/** \brief ndn-nac version string, including git commit information, if ndn-nac is build from
+ *         specific git commit
+ *
+ * NDN_NAC_VERSION_BUILD_STRING is obtained using the following command (`ndn-nac-` prefix is
+ * afterwards removed):
+ *
+ *    `git describe --match 'ndn-nac-*'`
+ *
+ * When ndn-nac is built not from git, NDN_NAC_VERSION_BUILD_STRING equals NDN_NAC_VERSION_STRING
+ *
+ * MAJOR.MINOR.PATCH(-release-candidate-tag)(-(number-of-commits-since-tag)-COMMIT-HASH)
+ *
+ * Example, 0.1.0-rc1-1-g5c86570
+ */
+#define NDN_NAC_VERSION_BUILD_STRING "@VERSION_BUILD@"
+
+/// MAJOR version
+#define NDN_NAC_VERSION_MAJOR @VERSION_MAJOR@
+/// MINOR version
+#define NDN_NAC_VERSION_MINOR @VERSION_MINOR@
+/// PATCH version
+#define NDN_NAC_VERSION_PATCH @VERSION_PATCH@
+
+} // namespace ndn
+
+#endif // NAC_VERSION_HPP