security: refactoring KeyChain and related classess

1. rename IdentityStorage as SecPublicInfo and PrivateKeyStorage as SecTpm.
2. KeyChain is defined as a template of sub-classes of SecPublicInfo and SecTpm, and KeyChain inherits from these two classes rather than has objects of these two classes.
3. rename some methods of SecPublicInfo and SecTpm to clarify usage and avoid conflicts
   SecPublicInfo: addKey, getKey, doesKeyExist, activateKey, deactivateKey
   SecTpm: generateKeyPair, getPublicKey, generateKey
4. adjust getter/setter of KeyChain & SecPublicInfo

Change-Id: Ib67631ad1c883100b1200a1a381d837bbbdb1d37
diff --git a/src/common.cpp b/src/common.cpp
index ff420f9..16a5b7a 100644
--- a/src/common.cpp
+++ b/src/common.cpp
@@ -8,6 +8,13 @@
 #include <sstream>
 #include <ndn-cpp/common.hpp>
 
+#if NDN_CPP_HAVE_TIME_H
+#include <time.h>
+#endif
+#if NDN_CPP_HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
 using namespace std;
 
 namespace ndn {
@@ -30,5 +37,15 @@
   return result.str();
 }
 
+MillisecondsSince1970
+getNow()
+{
+  struct timeval t;
+  // Note: configure.ac requires gettimeofday.
+  gettimeofday(&t, 0);
+  return t.tv_sec * 1000.0 + t.tv_usec / 1000.0;
+}
+
+
 }