security: Pair-up Tpm and Pib in KeyChain

In this commit, we also change the HOME setting for test cases.

Change-Id: I7fa15461555b3519d9d2005c6956c167ed07d66f
Refs: #2242
Refs: #2260
diff --git a/src/security/sec-public-info-sqlite3.hpp b/src/security/sec-public-info-sqlite3.hpp
index beaff10..7c2fbb6 100644
--- a/src/security/sec-public-info-sqlite3.hpp
+++ b/src/security/sec-public-info-sqlite3.hpp
@@ -45,7 +45,8 @@
     }
   };
 
-  SecPublicInfoSqlite3();
+  explicit
+  SecPublicInfoSqlite3(const std::string& dir = "");
 
   virtual
   ~SecPublicInfoSqlite3();
@@ -53,6 +54,16 @@
   /**********************
    * from SecPublicInfo *
    **********************/
+
+  virtual void
+  setTpmLocator(const std::string& tpmLocator);
+
+  virtual std::string
+  getTpmLocator();
+
+  virtual std::string
+  getPibLocator();
+
   virtual bool
   doesIdentityExist(const Name& identityName);
 
@@ -118,16 +129,35 @@
   virtual void
   deleteIdentityInfo(const Name& identity);
 
-protected:
-  virtual void
+private:
+  bool
+  initializeTable(const std::string& tableName, const std::string& initCommand);
+
+  void
+  deleteTable(const std::string& tableName);
+
+  void
+  setTpmLocatorInternal(const std::string& tpmLocator, bool needReset);
+
+  void
   setDefaultIdentityInternal(const Name& identityName);
 
-  virtual void
+  void
   setDefaultKeyNameForIdentityInternal(const Name& keyName);
 
-  virtual void
+  void
   setDefaultCertificateNameForKeyInternal(const Name& certificateName);
 
+  std::string
+  getScheme();
+
+NDN_CXX_PUBLIC_WITH_TESTS_ELSE_PRIVATE:
+  bool
+  doesTableExist(const std::string& tableName);
+
+public:
+  static const std::string SCHEME;
+
 private:
   sqlite3* m_database;
 };