diff --git a/src/torrent-file.cpp b/src/torrent-file.cpp
index a9797fd..2b8fd15 100644
--- a/src/torrent-file.cpp
+++ b/src/torrent-file.cpp
@@ -21,9 +21,16 @@
 
 #include "torrent-file.hpp"
 
+#include <ndn-cxx/security/key-chain.hpp>
+#include <ndn-cxx/security/signing-helpers.hpp>
+
 #include <algorithm>
 
 #include <boost/range/adaptors.hpp>
+#include <boost/filesystem.hpp>
+#include <boost/filesystem/fstream.hpp>
+
+namespace fs = boost::filesystem;
 
 namespace ndn {
 
@@ -59,18 +66,6 @@
   this->wireDecode(block);
 }
 
-const Name&
-TorrentFile::getName() const
-{
-  return Data::getName();
-}
-
-const Name&
-TorrentFile::getCommonPrefix() const
-{
-  return m_commonPrefix;
-}
-
 void
 TorrentFile::createSuffixCatalog()
 {
@@ -186,14 +181,14 @@
   // Check whether there is a TorrentFilePtr
   auto element = content.elements_begin();
   if (content.elements_end() == element) {
-    BOOST_THROW_EXCEPTION(Error(".Torrent-file with empty content"));
+    BOOST_THROW_EXCEPTION(Error("Torrent-file with empty content"));
   }
   element->parse();
   Name name(*element);
   if (name.empty())
-    BOOST_THROW_EXCEPTION(Error("Empty name included in the .torrent-file"));
+    BOOST_THROW_EXCEPTION(Error("Empty name included in the torrent-file"));
 
-  if (name.get(name.size() - 3) == name::Component(".torrent-file")) {
+  if (name.get(name.size() - 3) == name::Component("torrent-file")) {
     m_torrentFilePtr = name;
     ++element;
     m_commonPrefix = Name(*element);
@@ -209,11 +204,11 @@
     element->parse();
     Name fileManifestSuffix(*element);
     if (fileManifestSuffix.empty())
-      BOOST_THROW_EXCEPTION(Error("Empty manifest file name included in the .torrent-file"));
+      BOOST_THROW_EXCEPTION(Error("Empty manifest file name included in the torrent-file"));
     this->insertToSuffixCatalog(fileManifestSuffix);
   }
   if (m_suffixCatalog.size() == 0) {
-    BOOST_THROW_EXCEPTION(Error(".Torrent-file with empty catalog of file manifest names"));
+    BOOST_THROW_EXCEPTION(Error("Torrent-file with empty catalog of file manifest names"));
   }
 }
 
@@ -235,6 +230,74 @@
   m_suffixCatalog.clear();
 }
 
+std::pair<std::vector<TorrentFile>,
+          std::vector<std::pair<std::vector<FileManifest>,
+                                std::vector<Data>>>>
+TorrentFile::generate(const std::string& directoryPath,
+                      size_t namesPerSegment,
+                      size_t subManifestSize,
+                      size_t dataPacketSize,
+                      bool returnData)
+{
+  BOOST_ASSERT(0 < namesPerSegment);
+
+  std::vector<TorrentFile> torrentSegments;
+
+  fs::path path(directoryPath);
+  if (!fs::exists(path)) {
+    BOOST_THROW_EXCEPTION(Error(directoryPath + ": no such directory."));
+  }
+
+  Name directoryPathName(directoryPath);
+  fs::recursive_directory_iterator directoryPtr(fs::system_complete(directoryPath).string());
+
+  Name commonPrefix("/NTORRENT" +
+                    directoryPathName.getSubName(directoryPathName.size() - 1).toUri());
+
+  Name torrentName(commonPrefix.toUri() + "/torrent-file");
+  TorrentFile currentTorrentFile(torrentName, commonPrefix, {});
+  std::vector<std::pair<std::vector<FileManifest>, std::vector<Data>>> manifestPairs;
+
+  size_t manifestFileCounter = 0u;
+  for (fs::recursive_directory_iterator i = directoryPtr;
+       i != fs::recursive_directory_iterator();
+       ++i) {
+    Name manifestPrefix("/NTORRENT" +
+                        directoryPathName.getSubName(directoryPathName.size() - 1).toUri());
+    std::pair<std::vector<FileManifest>, std::vector<Data>> currentManifestPair =
+                                                    FileManifest::generate((*i).path().string(),
+                                                    manifestPrefix, subManifestSize,
+                                                    dataPacketSize, returnData);
+
+    if (manifestFileCounter != 0 && 0 == manifestFileCounter % namesPerSegment) {
+      torrentSegments.push_back(currentTorrentFile);
+      Name currentTorrentName = torrentName;
+      currentTorrentName.appendSequenceNumber(static_cast<int>(manifestFileCounter));
+      currentTorrentFile = TorrentFile(currentTorrentName, commonPrefix, {});
+    }
+    currentTorrentFile.insert(currentManifestPair.first[0].getName());
+    currentManifestPair.first.shrink_to_fit();
+    currentManifestPair.second.shrink_to_fit();
+    manifestPairs.push_back(currentManifestPair);
+    ++manifestFileCounter;
+  }
+
+  // Sign and append the last torrent-file
+  security::KeyChain keyChain;
+  keyChain.sign(currentTorrentFile, signingWithSha256());
+  torrentSegments.push_back(currentTorrentFile);
+
+  for (auto it = torrentSegments.rbegin() + 1; it != torrentSegments.rend(); ++it) {
+    auto next = it - 1;
+    it->setTorrentFilePtr(next->getFullName());
+    keyChain.sign(*it, signingWithSha256());
+  }
+
+  torrentSegments.shrink_to_fit();
+  manifestPairs.shrink_to_fit();
+  return std::make_pair(torrentSegments, manifestPairs);
+}
+
 } // namespace ntorrent
 
 } // namespace ndn
diff --git a/src/torrent-file.hpp b/src/torrent-file.hpp
index ea095ac..98e222c 100644
--- a/src/torrent-file.hpp
+++ b/src/torrent-file.hpp
@@ -22,6 +22,8 @@
 #ifndef TORRENT_FILE_HPP
 #define TORRENT_FILE_HPP
 
+#include "file-manifest.hpp"
+
 #include <ndn-cxx/name.hpp>
 #include <ndn-cxx/encoding/block.hpp>
 #include <ndn-cxx/data.hpp>
@@ -45,14 +47,14 @@
   };
 
   /**
-   * @brief Create a new empty .TorrentFile.
+   * @brief Create a new empty TorrentFile.
    */
   TorrentFile() = default;
 
   /**
-   * @brief Create a new .TorrentFile.
-   * @param torrentFileName The name of the .torrent-file
-   * @param torrentFilePtr A pointer (name) to the next segment of the .torrent-file
+   * @brief Create a new TorrentFile.
+   * @param torrentFileName The name of the torrent-file
+   * @param torrentFilePtr A pointer (name) to the next segment of the torrent-file
    * @param commonPrefix The common name prefix of the manifest file names included in the catalog
    * @param catalog The catalog containing the name of each file manifest
    */
@@ -62,8 +64,8 @@
               const std::vector<ndn::Name>& catalog);
 
   /**
-   * @brief Create a new .TorrentFile.
-   * @param torrentFileName The name of the .torrent-file
+   * @brief Create a new TorrentFile.
+   * @param torrentFileName The name of the torrent-file
    * @param commonPrefix The common name prefix of the manifest file names included in the catalog
    * @param catalog The catalog containing the name of each file manifest
    */
@@ -72,26 +74,26 @@
               const std::vector<ndn::Name>& catalog);
 
   /**
-   * @brief Create a new .TorrentFile
-   * @param block The block format of the .torrent-file
+   * @brief Create a new TorrentFile
+   * @param block The block format of the torrent-file
    */
   explicit
   TorrentFile(const Block& block);
 
   /**
-   * @brief Get the name of the .TorrentFile
+   * @brief Get the name of the TorrentFile
    */
   const Name&
   getName() const;
 
   /**
-   * @brief Get the common prefix of the file manifest names of this .torrent-file
+   * @brief Get the common prefix of the file manifest names of this torrent-file
    */
   const Name&
   getCommonPrefix() const;
 
   /**
-   * @brief Get a shared pointer to the name of the next segment of the .torrent-file.
+   * @brief Get a shared pointer to the name of the next segment of the torrent-file.
    *
    * If there is no next segment, it returns a nullptr
    */
@@ -111,10 +113,10 @@
   wireDecode(const Block& wire);
 
   /**
-   * @brief Finalize .torrent-file before signing the data packet
+   * @brief Finalize torrent-file before signing the data packet
    *
    * This method has to be called (every time) right before signing or encoding
-   * the .torrent-file
+   * the torrent-file
    */
   void
   finalize();
@@ -137,9 +139,33 @@
   size_t
   catalogSize() const;
 
+  /**
+   * @brief Given a directory path for the torrent file, it generates the torrent file
+   *
+   * @param directoryPath The path to the directory for which we are to create a torrent-file
+   * @param torrentFilePrefix The prefix to be used for the name of this torrent-file
+   * @param namesPerSegment The number of manifest names to be included in each segment of the
+   *        torrent-file
+   * @param returnData Determines whether the data would be returned in memory or it will be
+   *        stored on disk without being returned
+   *
+   * Generates the torrent-file for the directory at the specified 'directoryPath',
+   * splitting the torrent-file into multiple segments, each one of which contains
+   * at most 'namesPerSegment' number of manifest names
+   *
+   **/
+  static std::pair<std::vector<TorrentFile>,
+            std::vector<std::pair<std::vector<FileManifest>,
+                                  std::vector<Data>>>>
+  generate(const std::string& directoryPath,
+           size_t namesPerSegment,
+           size_t subManifestSize,
+           size_t dataPacketSize,
+           bool returnData = false);
+
 protected:
   /**
-   * @brief prepend .torrent file as a Content block to the encoder
+   * @brief prepend torrent file as a Content block to the encoder
    */
   template<encoding::Tag TAG>
   size_t
@@ -153,7 +179,7 @@
 
 private:
   /**
-   * @brief Check whether the .torrent-file has a pointer to the next segment
+   * @brief Check whether the torrent-file has a pointer to the next segment
    */
   bool
   hasTorrentFilePtr() const;
@@ -172,7 +198,7 @@
    * @brief Construct the catalog of long names from a catalog of suffixes for the file
    *        manifests' name
    *
-   * After decoding a .torrent-file from its wire format, we construct the catalog of
+   * After decoding a torrent-file from its wire format, we construct the catalog of
    * long names from the decoded common prefix and suffixes
    *
    */
@@ -185,6 +211,12 @@
   void
   insertToSuffixCatalog(const PartialName& suffix);
 
+  /**
+   * @brief Set the pointer of the current torrent-file segment to the next segment
+   */
+  void
+  setTorrentFilePtr(const Name& ptrName);
+
 private:
   Name m_commonPrefix;
   Name m_torrentFilePtr;
@@ -222,6 +254,25 @@
   m_suffixCatalog.push_back(suffix);
 }
 
+inline void
+TorrentFile::setTorrentFilePtr(const Name& ptrName)
+{
+  m_torrentFilePtr = ptrName;
+}
+
+inline const Name&
+TorrentFile::getName() const
+{
+  return Data::getName();
+}
+
+inline const Name&
+TorrentFile::getCommonPrefix() const
+{
+  return m_commonPrefix;
+}
+
+
 } // namespace ntorrent
 
 } // namespace ndn
