diff --git a/tests/daemon/mgmt/manager-base.t.cpp b/tests/daemon/mgmt/manager-base.t.cpp
index 8b57258..a70784c 100644
--- a/tests/daemon/mgmt/manager-base.t.cpp
+++ b/tests/daemon/mgmt/manager-base.t.cpp
@@ -141,8 +141,9 @@
 
   requesterName = "";
   m_manager.extractRequester(makeControlCommandRequest("/test/interest/signed", ControlParameters()), testAccept);
-  auto keyLocator = m_keyChain.getPib().getIdentity(DEFAULT_COMMAND_SIGNER_IDENTITY).getDefaultKey().getName();
-  BOOST_CHECK_EQUAL(requesterName, keyLocator.toUri());
+  BOOST_CHECK_EQUAL(requesterName,
+    m_keyChain.getPib().getIdentity(DEFAULT_COMMAND_SIGNER_IDENTITY)
+      .getDefaultKey().getDefaultCertificate().getName().toUri());
 }
 
 BOOST_AUTO_TEST_CASE(ValidateParameters)
diff --git a/tests/daemon/mgmt/rib-manager.t.cpp b/tests/daemon/mgmt/rib-manager.t.cpp
index b688996..d23eb70 100644
--- a/tests/daemon/mgmt/rib-manager.t.cpp
+++ b/tests/daemon/mgmt/rib-manager.t.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  Regents of the University of California,
+ * Copyright (c) 2014-2022,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -128,17 +128,17 @@
     , m_fibUpdater(m_rib, m_nfdController)
     , m_manager(m_rib, m_face, m_keyChain, m_nfdController, m_dispatcher)
   {
-    m_keyChain.createIdentity(m_anchorId);
-    m_keyChain.createIdentity(m_derivedId);
-
-    m_derivedCert = m_keyChain.getPib().getIdentity(m_derivedId).getDefaultKey().getDefaultCertificate();
-    ndn::SignatureInfo signatureInfo;
-    signatureInfo.setValidityPeriod(m_derivedCert.getValidityPeriod());
-    ndn::security::SigningInfo signingInfo(ndn::security::SigningInfo::SIGNER_TYPE_ID,
-                                           m_anchorId, signatureInfo);
-    m_keyChain.sign(m_derivedCert, signingInfo);
+    auto anchorIdentity = m_keyChain.createIdentity(m_anchorId);
     saveIdentityCert(m_anchorId, "signer.ndncert", true);
 
+    auto derivedKey = m_keyChain.createIdentity(m_derivedId).getDefaultKey();
+    auto derivedSelfSigned = derivedKey.getDefaultCertificate();
+    ndn::security::MakeCertificateOptions opts;
+    opts.validity = derivedSelfSigned.getValidityPeriod();
+    auto derivedCert = m_keyChain.makeCertificate(derivedSelfSigned,
+                       ndn::security::signingByIdentity(anchorIdentity), opts);
+    m_keyChain.setDefaultCertificate(derivedKey, derivedCert);
+
     if (m_status.isLocalhostConfigured) {
       m_manager.applyLocalhostConfig(getValidatorConfigSection(), "test");
     }
@@ -155,11 +155,11 @@
       clearRib();
     }
 
-    m_face.onSendInterest.connect([this] (const Interest& interest) {
-      if (interest.getName().isPrefixOf(m_derivedCert.getName())) {
-        if (m_status.isLocalhopConfigured && interest.template getTag<lp::NextHopFaceIdTag>() != nullptr) {
-          m_face.put(m_derivedCert);
-        }
+    m_face.onSendInterest.connect([=] (const Interest& interest) {
+      if (interest.matchesData(derivedCert) &&
+          m_status.isLocalhopConfigured &&
+          interest.template getTag<lp::NextHopFaceIdTag>() != nullptr) {
+        m_face.put(derivedCert);
       }
     });
   }
@@ -234,7 +234,6 @@
   ConfigurationStatus m_status;
   Name m_anchorId;
   Name m_derivedId;
-  ndn::security::Certificate m_derivedCert;
 
   ndn::nfd::Controller m_nfdController;
   rib::Rib m_rib;
diff --git a/tests/key-chain-fixture.cpp b/tests/key-chain-fixture.cpp
index faca165..de6feb6 100644
--- a/tests/key-chain-fixture.cpp
+++ b/tests/key-chain-fixture.cpp
@@ -47,30 +47,6 @@
   }
 }
 
-Certificate
-KeyChainFixture::makeCert(const Key& key, const std::string& issuer, const Key& signingKey)
-{
-  Certificate cert;
-  cert.setName(Name(key.getName())
-               .append(issuer)
-               .appendVersion());
-
-  // set metainfo
-  cert.setContentType(tlv::ContentType_Key);
-  cert.setFreshnessPeriod(1_h);
-
-  // set content
-  cert.setContent(key.getPublicKey());
-
-  // set signature info
-  ndn::SignatureInfo info;
-  auto now = time::system_clock::now();
-  info.setValidityPeriod(ValidityPeriod(now - 30_days, now + 30_days));
-
-  m_keyChain.sign(cert, signingByKey(signingKey ? signingKey : key).setSignatureInfo(info));
-  return cert;
-}
-
 bool
 KeyChainFixture::saveCert(const Data& cert, const std::string& filename)
 {
diff --git a/tests/key-chain-fixture.hpp b/tests/key-chain-fixture.hpp
index 9f03ea0..0ffcb0e 100644
--- a/tests/key-chain-fixture.hpp
+++ b/tests/key-chain-fixture.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2014-2020,  Regents of the University of California,
+ * Copyright (c) 2014-2022,  Regents of the University of California,
  *                           Arizona Board of Regents,
  *                           Colorado State University,
  *                           University Pierre & Marie Curie, Sorbonne University,
@@ -49,16 +49,6 @@
 
 public:
   /**
-   * @brief Creates and returns a certificate for a given key
-   * @param key The key for which to make a certificate
-   * @param issuer The IssuerId to include in the certificate name
-   * @param signingKey The key with which to sign the certificate; if not provided, the
-   *                   certificate will be self-signed
-   */
-  Certificate
-  makeCert(const Key& key, const std::string& issuer, const Key& signingKey = Key());
-
-  /**
    * @brief Saves an NDN certificate to a file
    * @return true if successful, false otherwise
    */
