diff --git a/src/hello-protocol.cpp b/src/hello-protocol.cpp
index f5c0929..cc3ed63 100644
--- a/src/hello-protocol.cpp
+++ b/src/hello-protocol.cpp
@@ -187,9 +187,9 @@
 HelloProtocol::onContent(const ndn::Interest& interest, const ndn::Data& data)
 {
   NLSR_LOG_DEBUG("Received data for INFO(name): " << data.getName());
-  if (data.getSignature().hasKeyLocator() &&
-      data.getSignature().getKeyLocator().getType() == ndn::tlv::Name) {
-    NLSR_LOG_DEBUG("Data signed with: " << data.getSignature().getKeyLocator().getName());
+  auto kl = data.getKeyLocator();
+  if (kl && kl->getType() == ndn::tlv::Name) {
+    NLSR_LOG_DEBUG("Data signed with: " << kl->getName());
   }
   m_confParam.getValidator().validate(data,
                                       std::bind(&HelloProtocol::onContentValidated, this, _1),
diff --git a/src/nlsr.cpp b/src/nlsr.cpp
index f3da897..fac8ae7 100644
--- a/src/nlsr.cpp
+++ b/src/nlsr.cpp
@@ -128,9 +128,9 @@
   m_strategySetOnRouters.push_back(originRouter);
 
   ndn::Name routerKey(originRouter);
-  routerKey.append("KEY");
+  routerKey.append(ndn::security::Certificate::KEY_COMPONENT);
   ndn::Name instanceKey(originRouter);
-  instanceKey.append("nlsr").append("KEY");
+  instanceKey.append("nlsr").append(ndn::security::Certificate::KEY_COMPONENT);
 
   m_fib.setStrategy(routerKey, Fib::BEST_ROUTE_V2_STRATEGY, 0);
   m_fib.setStrategy(instanceKey, Fib::BEST_ROUTE_V2_STRATEGY, 0);
@@ -143,7 +143,7 @@
     siteKey.append(originRouter[i]);
   }
   ndn::Name opPrefix(siteKey);
-  siteKey.append("KEY");
+  siteKey.append(ndn::security::Certificate::KEY_COMPONENT);
   m_fib.setStrategy(siteKey, Fib::BEST_ROUTE_V2_STRATEGY, 0);
 
   opPrefix.append(std::string("%C1.Operator"));
diff --git a/src/route/fib-entry.cpp b/src/route/fib-entry.cpp
deleted file mode 100644
index bc11634..0000000
--- a/src/route/fib-entry.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2014-2020,  The University of Memphis,
- *                           Regents of the University of California
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "fib-entry.hpp"
-#include "logger.hpp"
-
-namespace nlsr {
-
-INIT_LOGGER(route.FibEntry);
-
-void
-FibEntry::writeLog() const
-{
-  NLSR_LOG_DEBUG("Name Prefix: " << m_name);
-  NLSR_LOG_DEBUG("Seq No: " << m_seqNo);
-  NLSR_LOG_DEBUG(m_nexthopList);
-}
-
-} // namespace nlsr
diff --git a/src/route/fib-entry.hpp b/src/route/fib-entry.hpp
deleted file mode 100644
index e5542e1..0000000
--- a/src/route/fib-entry.hpp
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/*
- * Copyright (c) 2014-2020,  The University of Memphis,
- *                           Regents of the University of California
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
-
-#ifndef NLSR_FIB_ENTRY_HPP
-#define NLSR_FIB_ENTRY_HPP
-
-#include "nexthop-list.hpp"
-
-#include <ndn-cxx/util/scheduler.hpp>
-
-namespace nlsr {
-
-class FibEntry
-{
-public:
-  FibEntry() = default;
-
-  FibEntry(const ndn::Name& name)
-    : m_name(name)
-  {
-  }
-
-  const ndn::Name&
-  getName() const
-  {
-    return m_name;
-  }
-
-  NexthopList&
-  getNexthopList()
-  {
-    return m_nexthopList;
-  }
-
-  void
-  setRefreshEventId(ndn::scheduler::EventId id)
-  {
-    m_refreshEventId = std::move(id);
-  }
-
-  ndn::scheduler::EventId
-  getRefreshEventId() const
-  {
-    return m_refreshEventId;
-  }
-
-  void
-  setSeqNo(int32_t fsn)
-  {
-    m_seqNo = fsn;
-  }
-
-  int32_t
-  getSeqNo() const
-  {
-    return m_seqNo;
-  }
-
-  void
-  writeLog() const;
-
-  typedef NexthopList::const_iterator const_iterator;
-
-  const_iterator
-  begin() const;
-
-  const_iterator
-  end() const;
-
-private:
-  ndn::Name m_name;
-  ndn::scheduler::EventId m_refreshEventId;
-  int32_t m_seqNo = 1;
-  NexthopList m_nexthopList;
-};
-
-inline FibEntry::const_iterator
-FibEntry::begin() const
-{
-  return m_nexthopList.cbegin();
-}
-
-inline FibEntry::const_iterator
-FibEntry::end() const
-{
-  return m_nexthopList.cend();
-}
-
-} // namespace nlsr
-
-#endif // NLSR_FIB_ENTRY_HPP
diff --git a/src/route/fib.cpp b/src/route/fib.cpp
index 2fef853..1004889 100644
--- a/src/route/fib.cpp
+++ b/src/route/fib.cpp
@@ -33,7 +33,6 @@
 
 INIT_LOGGER(route.Fib);
 
-const uint64_t Fib::GRACE_PERIOD = 10;
 const std::string Fib::MULTICAST_STRATEGY("ndn:/localhost/nfd/strategy/multicast");
 const std::string Fib::BEST_ROUTE_V2_STRATEGY("ndn:/localhost/nfd/strategy/best-route");
 
@@ -54,11 +53,10 @@
   auto it = m_table.find(name);
 
   // Only unregister the prefix if it ISN'T a neighbor.
-  if (it != m_table.end() && isNotNeighbor((it->second).getName())) {
-    for (const auto& nexthop : (it->second).getNexthopList().getNextHops()) {
-      unregisterPrefix((it->second).getName(), nexthop.getConnectingFaceUri());
+  if (it != m_table.end() && isNotNeighbor((it->second).name)) {
+    for (const auto& nexthop : (it->second).nexthopList.getNextHops()) {
+      unregisterPrefix((it->second).name, nexthop.getConnectingFaceUri());
     }
-    cancelEntryRefresh(it->second);
     m_table.erase(it);
   }
 }
@@ -66,14 +64,14 @@
 void
 Fib::addNextHopsToFibEntryAndNfd(FibEntry& entry, const NexthopList& hopsToAdd)
 {
-  const ndn::Name& name = entry.getName();
+  const ndn::Name& name = entry.name;
 
   bool shouldRegister = isNotNeighbor(name);
 
   for (const auto& hop : hopsToAdd.getNextHops())
   {
     // Add nexthop to FIB entry
-    entry.getNexthopList().addNextHop(hop);
+    entry.nexthopList.addNextHop(hop);
 
     if (shouldRegister) {
       // Add nexthop to NDN-FIB
@@ -108,11 +106,12 @@
   if (entryIt == m_table.end() && hopsToAdd.size() != 0) {
     NLSR_LOG_DEBUG("New FIB Entry");
 
-    FibEntry entry(name);
+    FibEntry entry;
+    entry.name = name;
 
     addNextHopsToFibEntryAndNfd(entry, hopsToAdd);
 
-    m_table.emplace(name, entry);
+    m_table.emplace(name, std::move(entry));
 
     entryIt = m_table.find(name);
   }
@@ -131,47 +130,39 @@
     addNextHopsToFibEntryAndNfd(entry, hopsToAdd);
 
     std::set<NextHop, NextHopComparator> hopsToRemove;
-    std::set_difference(entry.getNexthopList().begin(), entry.getNexthopList().end(),
+    std::set_difference(entry.nexthopList.begin(), entry.nexthopList.end(),
                         hopsToAdd.begin(), hopsToAdd.end(),
                         std::inserter(hopsToRemove, hopsToRemove.end()), NextHopComparator());
 
-    bool isUpdatable = isNotNeighbor(entry.getName());
+    bool isUpdatable = isNotNeighbor(entry.name);
     // Remove the uninstalled next hops from NFD and FIB entry
     for (const auto& hop : hopsToRemove){
       if (isUpdatable) {
-        unregisterPrefix(entry.getName(), hop.getConnectingFaceUri());
+        unregisterPrefix(entry.name, hop.getConnectingFaceUri());
       }
-      NLSR_LOG_DEBUG("Removing " << hop.getConnectingFaceUri() << " from " << entry.getName());
-      entry.getNexthopList().removeNextHop(hop);
+      NLSR_LOG_DEBUG("Removing " << hop.getConnectingFaceUri() << " from " << entry.name);
+      entry.nexthopList.removeNextHop(hop);
     }
 
     // Increment sequence number
-    entry.setSeqNo(entry.getSeqNo() + 1);
-
+    entry.seqNo += 1;
     entryIt = m_table.find(name);
-
   }
+
   if (entryIt != m_table.end() &&
-      !entryIt->second.getRefreshEventId() &&
-      isNotNeighbor(entryIt->second.getName())) {
-    scheduleEntryRefresh(entryIt->second,
-                         [this] (FibEntry& entry) {
-                           scheduleLoop(entry);
-                         });
+      !entryIt->second.refreshEventId &&
+      isNotNeighbor(entryIt->second.name)) {
+    scheduleEntryRefresh(entryIt->second, [this] (FibEntry& entry) { scheduleLoop(entry); });
   }
 }
 
 void
 Fib::clean()
 {
-  NLSR_LOG_DEBUG("Fib::clean called");
-  // can't use const ref here as getNexthopList can't be marked const
-  for (auto&& it : m_table) {
-    NLSR_LOG_DEBUG("Canceling Scheduled event. Name: " << it.second.getName());
-    cancelEntryRefresh(it.second);
-
-    for (const auto& hop : it.second.getNexthopList().getNextHops()) {
-      unregisterPrefix(it.second.getName(), hop.getConnectingFaceUri());
+  NLSR_LOG_DEBUG("Clean called");
+  for (const auto& it : m_table) {
+    for (const auto& hop : it.second.nexthopList.getNextHops()) {
+      unregisterPrefix(it.second.name, hop.getConnectingFaceUri());
     }
   }
 }
@@ -182,13 +173,8 @@
   uint32_t nNextHops = static_cast<uint32_t>(nextHopList.getNextHops().size());
   uint32_t nMaxFaces = m_confParameter.getMaxFacesPerPrefix();
 
-  // Allow all faces
-  if (nMaxFaces == 0) {
-    return nNextHops;
-  }
-  else {
-    return std::min(nNextHops, nMaxFaces);
-  }
+  // 0 == all faces
+  return nMaxFaces == 0 ? nNextHops : std::min(nNextHops, nMaxFaces);
 }
 
 bool
@@ -325,13 +311,13 @@
 void
 Fib::scheduleEntryRefresh(FibEntry& entry, const afterRefreshCallback& refreshCallback)
 {
-  NLSR_LOG_DEBUG("Scheduling refresh for " << entry.getName() <<
-                 " Seq Num: " << entry.getSeqNo() <<
+  NLSR_LOG_DEBUG("Scheduling refresh for " << entry.name <<
+                 " Seq Num: " << entry.seqNo <<
                  " in " << m_refreshTime << " seconds");
 
-  entry.setRefreshEventId(m_scheduler.schedule(ndn::time::seconds(m_refreshTime),
-                                               std::bind(&Fib::refreshEntry, this,
-                                                         entry.getName(), refreshCallback)));
+  entry.refreshEventId = m_scheduler.schedule(ndn::time::seconds(m_refreshTime),
+                                              std::bind(&Fib::refreshEntry, this,
+                                                        entry.name, refreshCallback));
 }
 
 void
@@ -341,13 +327,6 @@
 }
 
 void
-Fib::cancelEntryRefresh(const FibEntry& entry)
-{
-  NLSR_LOG_DEBUG("Canceling refresh for " << entry.getName() << " Seq Num: " << entry.getSeqNo());
-  entry.getRefreshEventId().cancel();
-}
-
-void
 Fib::refreshEntry(const ndn::Name& name, afterRefreshCallback refreshCb)
 {
   auto it = m_table.find(name);
@@ -356,13 +335,12 @@
   }
 
   FibEntry& entry = it->second;
-  NLSR_LOG_DEBUG("Refreshing " << entry.getName() << " Seq Num: " << entry.getSeqNo());
+  NLSR_LOG_DEBUG("Refreshing " << entry.name << " Seq Num: " << entry.seqNo);
 
-  // Increment sequence number
-  entry.setSeqNo(entry.getSeqNo() + 1);
+  entry.seqNo += 1;
 
-  for (const NextHop& hop : entry) {
-    registerPrefix(entry.getName(),
+  for (const NextHop& hop : entry.nexthopList) {
+    registerPrefix(entry.name,
                    ndn::FaceUri(hop.getConnectingFaceUri()),
                    hop.getRouteCostAsAdjustedInteger(),
                    ndn::time::seconds(m_refreshTime + GRACE_PERIOD),
@@ -377,7 +355,9 @@
 {
   NLSR_LOG_DEBUG("-------------------FIB-----------------------------");
   for (const auto& entry : m_table) {
-    entry.second.writeLog();
+    NLSR_LOG_DEBUG("Name Prefix: " << entry.second.name);
+    NLSR_LOG_DEBUG("Seq No: " <<  entry.second.seqNo);
+    NLSR_LOG_DEBUG(entry.second.nexthopList);
   }
 }
 
diff --git a/src/route/fib.hpp b/src/route/fib.hpp
index 27891eb..e8f8a40 100644
--- a/src/route/fib.hpp
+++ b/src/route/fib.hpp
@@ -22,19 +22,26 @@
 #ifndef NLSR_ROUTE_FIB_HPP
 #define NLSR_ROUTE_FIB_HPP
 
-#include "fib-entry.hpp"
 #include "test-access-control.hpp"
+#include "nexthop-list.hpp"
 
 #include <ndn-cxx/mgmt/nfd/controller.hpp>
+#include <ndn-cxx/util/scheduler.hpp>
 #include <ndn-cxx/util/time.hpp>
 
 namespace nlsr {
 
+struct FibEntry {
+  ndn::Name name;
+  ndn::scheduler::ScopedEventId refreshEventId;
+  int32_t seqNo = 1;
+  NexthopList nexthopList;
+};
+
 typedef std::function<void(FibEntry&)> afterRefreshCallback;
 
 class AdjacencyList;
 class ConfParameter;
-class FibEntry;
 
 /*! \brief Maps names to lists of next hops, and exports this information to NFD.
  *
@@ -203,16 +210,6 @@
   void
   scheduleLoop(FibEntry& entry);
 
-  /*! \brief Cancel an entry's refresh event.
-   *
-   * Cancel an entry's refresh event. This only needs to be done when
-   * an entry is removed. Typically this happens when NLSR is
-   * terminated or crashes, and we don't want the scheduler to crash
-   * because it's referencing memory that has no valid function.
-   */
-  void
-  cancelEntryRefresh(const FibEntry& entry);
-
   /*! \brief Refreshes an entry in NFD.
    */
   void
@@ -239,7 +236,7 @@
    * allow for things like stuttering prefix registrations and
    * processing time when refreshing events.
    */
-  static const uint64_t GRACE_PERIOD;
+  static constexpr uint64_t GRACE_PERIOD = 10;
 };
 
 } // namespace nlsr
diff --git a/src/security/certificate-store.cpp b/src/security/certificate-store.cpp
index 11db5e3..684969a 100644
--- a/src/security/certificate-store.cpp
+++ b/src/security/certificate-store.cpp
@@ -85,12 +85,12 @@
   // Router's NLSR certificate
   ndn::Name nlsrKeyPrefix = m_confParam.getRouterPrefix();
   nlsrKeyPrefix.append("nlsr");
-  nlsrKeyPrefix.append("KEY");
+  nlsrKeyPrefix.append(ndn::security::Certificate::KEY_COMPONENT);
   prefixes.push_back(nlsrKeyPrefix);
 
   // Router's certificate
   ndn::Name routerKeyPrefix = m_confParam.getRouterPrefix();
-  routerKeyPrefix.append("KEY");
+  routerKeyPrefix.append(ndn::security::Certificate::KEY_COMPONENT);
   prefixes.push_back(routerKeyPrefix);
 
   // Router's operator's certificate
@@ -102,7 +102,7 @@
   // Router's site's certificate
   ndn::Name siteKeyPrefix = m_confParam.getNetwork();
   siteKeyPrefix.append(m_confParam.getSiteName());
-  siteKeyPrefix.append("KEY");
+  siteKeyPrefix.append(ndn::security::Certificate::KEY_COMPONENT);
   prefixes.push_back(siteKeyPrefix);
 
   // Start listening for interest of this router's NLSR certificate,
@@ -152,8 +152,9 @@
 
     setInterestFilter(certName);
 
-    if (cert->getKeyName() != cert->getSignature().getKeyLocator().getName()) {
-      publishCertFromCache(cert->getSignature().getKeyLocator().getName());
+    const ndn::Name& keyLocatorName = cert->getSignatureInfo().getKeyLocator().getName();
+    if (cert->getKeyName() != keyLocatorName) {
+      publishCertFromCache(keyLocatorName);
     }
   }
   else {
@@ -165,7 +166,7 @@
 void
 CertificateStore::afterFetcherSignalEmitted(const ndn::Data& lsaSegment)
 {
-  const auto keyName = lsaSegment.getSignature().getKeyLocator().getName();
+  const auto keyName = lsaSegment.getSignatureInfo().getKeyLocator().getName();
   if (!find(keyName)) {
     NLSR_LOG_TRACE("Publishing certificate for: " << keyName);
     publishCertFromCache(keyName);
diff --git a/tests/identity-management-fixture.cpp b/tests/identity-management-fixture.cpp
index 77cc97c..4e6f731 100644
--- a/tests/identity-management-fixture.cpp
+++ b/tests/identity-management-fixture.cpp
@@ -104,7 +104,7 @@
 
   v2::AdditionalDescription description;
   description.set("type", "sub-certificate");
-  info.appendTypeSpecificTlv(description.wireEncode());
+  info.addCustomTlv(description.wireEncode());
 
   m_keyChain.sign(request, ndn::signingByIdentity(issuer).setSignatureInfo(info));
   m_keyChain.setDefaultCertificate(subIdentity.getDefaultKey(), request);
diff --git a/tests/route/test-fib-entry.cpp b/tests/route/test-fib-entry.cpp
deleted file mode 100644
index b323ca5..0000000
--- a/tests/route/test-fib-entry.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
- * Copyright (c) 2014-2019,  The University of Memphis,
- *                           Regents of the University of California
- *
- * This file is part of NLSR (Named-data Link State Routing).
- * See AUTHORS.md for complete list of NLSR authors and contributors.
- *
- * NLSR is free software: you can redistribute it and/or modify it under the terms
- * of the GNU General Public License as published by the Free Software Foundation,
- * either version 3 of the License, or (at your option) any later version.
- *
- * NLSR 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 General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License along with
- * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- *
- * \author Ashlesh Gawande <agawande@memphis.edu>
- **/
-
-#include "route/fib-entry.hpp"
-#include "route/nexthop-list.hpp"
-
-#include "tests/boost-test.hpp"
-
-#include <ndn-cxx/util/time.hpp>
-
-namespace nlsr {
-namespace test {
-
-BOOST_AUTO_TEST_SUITE(TestFibEntry)
-
-BOOST_AUTO_TEST_CASE(FibEntryConstructorAndGetters)
-{
-  FibEntry fe1("next1");
-
-  BOOST_CHECK_EQUAL(fe1.getName(), "next1");
-  BOOST_CHECK_EQUAL(fe1.getSeqNo(), 1);  // Initial Seq No.
-}
-
-BOOST_AUTO_TEST_SUITE_END()
-
-} // namespace test
-} // namespace nlsr
diff --git a/tests/route/test-fib.cpp b/tests/route/test-fib.cpp
index 5d2d27e..fd68e80 100644
--- a/tests/route/test-fib.cpp
+++ b/tests/route/test-fib.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
@@ -16,8 +16,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- *
- **/
+ */
 
 #include "route/fib.hpp"
 #include "../test-common.hpp"
@@ -301,13 +300,14 @@
 BOOST_FIXTURE_TEST_CASE(ScheduleFibEntryRefresh, FibFixture)
 {
   ndn::Name name1("/name/1");
-  FibEntry fe(name1);
-  fib->m_table.emplace(name1, fe);
-  int origSeqNo = fe.getSeqNo();
+  FibEntry fe;
+  fe.name = name1;
+  int origSeqNo = fe.seqNo;
+  fib->m_table.emplace(name1, std::move(fe));
 
   fib->scheduleEntryRefresh(fe,
                             [&] (FibEntry& entry) {
-                              BOOST_CHECK_EQUAL(origSeqNo + 1, entry.getSeqNo());
+                              BOOST_CHECK_EQUAL(origSeqNo + 1, entry.seqNo);
                             });
   this->advanceClocks(ndn::time::milliseconds(10), 1);
 }
diff --git a/tests/security/test-certificate-store.cpp b/tests/security/test-certificate-store.cpp
index b4ef2da..00d5d62 100644
--- a/tests/security/test-certificate-store.cpp
+++ b/tests/security/test-certificate-store.cpp
@@ -153,12 +153,12 @@
   // check if nlsrKeyPrefix is registered
   ndn::Name nlsrKeyPrefix = conf.getRouterPrefix();
   nlsrKeyPrefix.append("nlsr");
-  nlsrKeyPrefix.append("KEY");
+  nlsrKeyPrefix.append(ndn::security::Certificate::KEY_COMPONENT);
   checkPrefixRegistered(face, nlsrKeyPrefix);
 
   // check if routerPrefix is registered
   ndn::Name routerKeyPrefix = conf.getRouterPrefix();
-  routerKeyPrefix.append("KEY");
+  routerKeyPrefix.append(ndn::security::Certificate::KEY_COMPONENT);
   checkPrefixRegistered(face, routerKeyPrefix);
 
   // check if operatorKeyPrefix is registered
@@ -206,7 +206,7 @@
                                  });
 
   lsdb.emitSegmentValidatedSignal(data);
-  const auto keyName = data.getSignature().getKeyLocator().getName();
+  const auto keyName = data.getSignatureInfo().getKeyLocator().getName();
   BOOST_CHECK(certStore.find(keyName) != nullptr);
 
   // testing a callback after segment validation signal from lsdb
diff --git a/tests/test-common.cpp b/tests/test-common.cpp
index b611390..b2db763 100644
--- a/tests/test-common.cpp
+++ b/tests/test-common.cpp
@@ -1,5 +1,5 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
-/**
+/*
  * Copyright (c) 2014-2020,  The University of Memphis,
  *                           Regents of the University of California
  *
@@ -16,7 +16,7 @@
  *
  * You should have received a copy of the GNU General Public License along with
  * NLSR, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
- **/
+ */
 
 #include "test-common.hpp"
 
@@ -26,9 +26,8 @@
 ndn::Data&
 signData(ndn::Data& data)
 {
-  ndn::SignatureSha256WithRsa fakeSignature;
-  fakeSignature.setValue(ndn::encoding::makeEmptyBlock(ndn::tlv::SignatureValue));
-  data.setSignature(fakeSignature);
+  data.setSignatureInfo(ndn::SignatureInfo(ndn::tlv::SignatureTypeValue::SignatureSha256WithRsa));
+  data.setSignatureValue(ndn::encoding::makeEmptyBlock(ndn::tlv::SignatureValue).getBuffer());
   data.wireEncode();
 
   return data;
