security: Reorganizing source code to prepare for support of two version of NDN certificates

This commit also removes unused ndn_digestSha256 function and deprecates
crypto::sha256 in favor of crypto::computeSha256Digest in util/crypto.hpp.

Change-Id: I24ee50ff073a96b868633bdf2cfade412d3605f3
Refs: #3098
diff --git a/src/security/sec-tpm-file.cpp b/src/security/sec-tpm-file.cpp
index adb5938..931d8fd 100644
--- a/src/security/sec-tpm-file.cpp
+++ b/src/security/sec-tpm-file.cpp
@@ -30,7 +30,7 @@
 #include <boost/filesystem.hpp>
 #include <boost/algorithm/string.hpp>
 
-#include "cryptopp.hpp"
+#include "v1/cryptopp.hpp"
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -38,6 +38,7 @@
 #include <algorithm>
 
 namespace ndn {
+namespace security {
 
 using std::string;
 using std::ostringstream;
@@ -231,7 +232,7 @@
     boost::filesystem::remove(privateKeyPath);
 }
 
-shared_ptr<PublicKey>
+shared_ptr<v1::PublicKey>
 SecTpmFile::getPublicKeyFromTpm(const Name&  keyName)
 {
   string keyURI = keyName.toUri();
@@ -250,7 +251,7 @@
     BOOST_THROW_EXCEPTION(Error(e.what()));
   }
 
-  return make_shared<PublicKey>(reinterpret_cast<const uint8_t*>(os.str().c_str()),
+  return make_shared<v1::PublicKey>(reinterpret_cast<const uint8_t*>(os.str().c_str()),
                                 os.str().size());
 }
 
@@ -320,7 +321,7 @@
     AutoSeededRandomPool rng;
 
     // Read public key
-    shared_ptr<PublicKey> pubkeyPtr;
+    shared_ptr<v1::PublicKey> pubkeyPtr;
     pubkeyPtr = getPublicKeyFromTpm(keyName);
 
     switch (pubkeyPtr->getKeyType()) {
@@ -586,4 +587,5 @@
   }
 }
 
+} // namespace security
 } // namespace ndn