diff --git a/tests/daemon/mgmt/command-authenticator.t.cpp b/tests/daemon/mgmt/command-authenticator.t.cpp
index 3c2d59d..635ee12 100644
--- a/tests/daemon/mgmt/command-authenticator.t.cpp
+++ b/tests/daemon/mgmt/command-authenticator.t.cpp
@@ -50,11 +50,12 @@
 
   bool
   authorize(const std::string& module, const Name& identity,
-            const std::function<void(Interest&)>& modifyInterest = nullptr)
+            const std::function<void(Interest&)>& modifyInterest = nullptr,
+            ndn::security::SignedInterestFormat format = ndn::security::SignedInterestFormat::V02)
   {
-    Interest interest = this->makeControlCommandRequest(Name("/prefix/" + module + "/verb"),
-                                                        ControlParameters(), identity);
-    if (modifyInterest != nullptr) {
+    Interest interest = makeControlCommandRequest(Name("/prefix/" + module + "/verb"),
+                                                  {}, format, identity);
+    if (modifyInterest) {
       modifyInterest(interest);
     }
 
diff --git a/tests/daemon/mgmt/manager-base.t.cpp b/tests/daemon/mgmt/manager-base.t.cpp
index ce74b1c..ea7aea5 100644
--- a/tests/daemon/mgmt/manager-base.t.cpp
+++ b/tests/daemon/mgmt/manager-base.t.cpp
@@ -125,17 +125,26 @@
                     Name("/localhost/nfd/test-module/test-notification").appendSequenceNumber(0));
 }
 
-BOOST_AUTO_TEST_CASE(ExtractRequester)
+BOOST_AUTO_TEST_CASE(ExtractSigner)
 {
-  std::string requesterName;
-  auto testAccept = [&] (const std::string& requester) { requesterName = requester; };
+  std::string signer = ManagerBase::extractSigner(Interest("/test/interest/unsigned"));
+  BOOST_CHECK_EQUAL(signer, ""); // missing SignatureInfo
 
-  m_manager.extractRequester(Interest("/test/interest/unsigned"), testAccept);
-  BOOST_CHECK_EQUAL(requesterName, "");
+  auto signedV03 = makeControlCommandRequest("/test/interest/signed", {},
+                                             ndn::security::SignedInterestFormat::V03);
+  signer = ManagerBase::extractSigner(signedV03);
+  BOOST_CHECK_EQUAL(signer,
+                    m_keyChain.getPib().getIdentity(DEFAULT_COMMAND_SIGNER_IDENTITY)
+                    .getDefaultKey().getDefaultCertificate().getName().toUri());
 
-  requesterName.clear();
-  m_manager.extractRequester(makeControlCommandRequest("/test/interest/signed"), testAccept);
-  BOOST_CHECK_EQUAL(requesterName,
+  signedV03.setSignatureInfo(ndn::SignatureInfo(tlv::SignatureSha256WithEcdsa));
+  signer = ManagerBase::extractSigner(signedV03);
+  BOOST_CHECK_EQUAL(signer, ""); // missing KeyLocator
+
+  auto signedV02 = makeControlCommandRequest("/test/interest/signed", {},
+                                             ndn::security::SignedInterestFormat::V02);
+  signer = ManagerBase::extractSigner(signedV02);
+  BOOST_CHECK_EQUAL(signer,
                     m_keyChain.getPib().getIdentity(DEFAULT_COMMAND_SIGNER_IDENTITY)
                     .getDefaultKey().getDefaultCertificate().getName().toUri());
 }
diff --git a/tests/daemon/mgmt/manager-common-fixture.cpp b/tests/daemon/mgmt/manager-common-fixture.cpp
index b427a3e..d69763d 100644
--- a/tests/daemon/mgmt/manager-common-fixture.cpp
+++ b/tests/daemon/mgmt/manager-common-fixture.cpp
@@ -33,18 +33,23 @@
 }
 
 Interest
-InterestSignerFixture::makeCommandInterest(const Name& name, const Name& identity)
-{
-  return m_signer.makeCommandInterest(name, ndn::security::signingByIdentity(identity));
-}
-
-Interest
 InterestSignerFixture::makeControlCommandRequest(Name commandName,
                                                  const ControlParameters& params,
+                                                 ndn::security::SignedInterestFormat format,
                                                  const Name& identity)
 {
   commandName.append(tlv::GenericNameComponent, params.wireEncode());
-  return this->makeCommandInterest(commandName, identity);
+
+  switch (format) {
+    case ndn::security::SignedInterestFormat::V02:
+      return m_signer.makeCommandInterest(commandName, ndn::security::signingByIdentity(identity));
+    case ndn::security::SignedInterestFormat::V03: {
+      Interest interest(commandName);
+      m_signer.makeSignedInterest(interest, ndn::security::signingByIdentity(identity));
+      return interest;
+    }
+  }
+  NDN_CXX_UNREACHABLE;
 }
 
 void
diff --git a/tests/daemon/mgmt/manager-common-fixture.hpp b/tests/daemon/mgmt/manager-common-fixture.hpp
index 2ae3b85..4741ea4 100644
--- a/tests/daemon/mgmt/manager-common-fixture.hpp
+++ b/tests/daemon/mgmt/manager-common-fixture.hpp
@@ -46,23 +46,17 @@
 protected:
   InterestSignerFixture();
 
-  /** \brief sign a command Interest
-   *  \param name command name include prefix and parameters
-   *  \param identity signing identity
-   *  \return a command Interest
-   */
-  Interest
-  makeCommandInterest(const Name& name, const Name& identity = DEFAULT_COMMAND_SIGNER_IDENTITY);
-
-  /** \brief create a ControlCommand request
-   *  \param commandName command name including prefix, such as `/localhost/nfd/fib/add-nexthop`
-   *  \param params command parameters
-   *  \param identity signing identity
-   *  \return a command Interest
+  /**
+   * \brief Create a ControlCommand request
+   * \param commandName Command name including prefix, such as `/localhost/nfd/fib/add-nexthop`
+   * \param params Command parameters
+   * \param format Signed Interest format
+   * \param identity Signing identity
    */
   Interest
   makeControlCommandRequest(Name commandName,
                             const ControlParameters& params = {},
+                            ndn::security::SignedInterestFormat format = ndn::security::SignedInterestFormat::V03,
                             const Name& identity = DEFAULT_COMMAND_SIGNER_IDENTITY);
 
 protected:
diff --git a/tests/daemon/mgmt/rib-manager.t.cpp b/tests/daemon/mgmt/rib-manager.t.cpp
index 78589a2..ecdf8b2 100644
--- a/tests/daemon/mgmt/rib-manager.t.cpp
+++ b/tests/daemon/mgmt/rib-manager.t.cpp
@@ -173,7 +173,7 @@
     advanceClocks(1_ms);
 
     auto replyFibAddCommand = [this] (const Interest& interest) {
-      ControlParameters params(interest.getName().get(-5).blockFromValue());
+      ControlParameters params(interest.getName().at(4).blockFromValue());
       BOOST_CHECK(params.getName() == "/localhost/nfd/rib" || params.getName() == "/localhop/nfd/rib");
       params.setFaceId(1)
             .setCost(0);
@@ -315,6 +315,7 @@
   auto parameters  = this->makeRegisterParameters("/test-authorization", 9527);
   auto commandHost = this->makeControlCommandRequest("/localhost/nfd/rib/register", parameters);
   auto commandHop  = this->makeControlCommandRequest("/localhop/nfd/rib/register", parameters,
+                                                     ndn::security::SignedInterestFormat::V03,
                                                      this->m_derivedId);
   if (this->m_status.isLocalhopConfigured) {
     commandHop.setTag(make_shared<lp::IncomingFaceIdTag>(123));
