diff --git a/src/detail/face-impl.hpp b/src/detail/face-impl.hpp
index eb286d7..5e3558b 100644
--- a/src/detail/face-impl.hpp
+++ b/src/detail/face-impl.hpp
@@ -36,6 +36,7 @@
 #include "transport/tcp-transport.hpp"
 
 #include "management/nfd-controller.hpp"
+#include "management/nfd-command-options.hpp"
 
 namespace ndn {
 
@@ -182,23 +183,21 @@
   /////////////////////////////////////////////////////////////////////////////////////////////////
   /////////////////////////////////////////////////////////////////////////////////////////////////
 
-  template<class SignatureGenerator>
   const RegisteredPrefixId*
   registerPrefix(const Name& prefix,
                  const shared_ptr<InterestFilterRecord>& filter,
                  const RegisterPrefixSuccessCallback& onSuccess,
                  const RegisterPrefixFailureCallback& onFailure,
                  uint64_t flags,
-                 const SignatureGenerator& signatureGenerator)
+                 const nfd::CommandOptions& options)
   {
     using namespace nfd;
 
-    typedef void (nfd::Controller::*Registrator)
-      (const nfd::ControlParameters&,
-       const nfd::Controller::CommandSucceedCallback&,
-       const nfd::Controller::CommandFailCallback&,
-       const SignatureGenerator&,
-       const time::milliseconds&);
+    typedef void (Controller::*Registrator)
+      (const ControlParameters&,
+       const Controller::CommandSucceedCallback&,
+       const Controller::CommandFailCallback&,
+       const CommandOptions&);
 
     ControlParameters registerParameters, unregisterParameters;
     registerParameters.setName(prefix);
@@ -217,9 +216,9 @@
     }
 
     RegisteredPrefix::Unregistrator bindedUnregistrator =
-        ndn::bind(unregistrator, m_face.m_nfdController, unregisterParameters, _1, _2,
-                  signatureGenerator,
-                  m_face.m_nfdController->getDefaultCommandTimeout());
+        std::bind(unregistrator, m_face.m_nfdController, unregisterParameters, _1, _2,
+                  options);
+    // @todo get rid of "std::" after #2109
 
     shared_ptr<RegisteredPrefix> prefixToRegister =
       make_shared<RegisteredPrefix>(prefix, filter, bindedUnregistrator);
@@ -228,8 +227,7 @@
                                              bind(&Impl::afterPrefixRegistered, this,
                                                   prefixToRegister, onSuccess),
                                              bind(onFailure, prefixToRegister->getPrefix(), _2),
-                                             signatureGenerator,
-                                             m_face.m_nfdController->getDefaultCommandTimeout());
+                                             options);
 
     return reinterpret_cast<const RegisteredPrefixId*>(prefixToRegister.get());
   }
diff --git a/src/face.cpp b/src/face.cpp
index b24a436..66e61bf 100644
--- a/src/face.cpp
+++ b/src/face.cpp
@@ -239,10 +239,17 @@
   shared_ptr<InterestFilterRecord> filter =
     make_shared<InterestFilterRecord>(interestFilter, onInterest);
 
+  nfd::CommandOptions options;
+  if (certificate.getName().empty()) {
+    options.setSigningDefault();
+  }
+  else {
+    options.setSigningCertificate(certificate);
+  }
+
   return m_impl->registerPrefix(interestFilter.getPrefix(), filter,
                                 onSuccess, onFailure,
-                                flags,
-                                certificate);
+                                flags, options);
 }
 
 const RegisteredPrefixId*
@@ -255,10 +262,17 @@
   shared_ptr<InterestFilterRecord> filter =
     make_shared<InterestFilterRecord>(interestFilter, onInterest);
 
+  nfd::CommandOptions options;
+  if (certificate.getName().empty()) {
+    options.setSigningDefault();
+  }
+  else {
+    options.setSigningCertificate(certificate);
+  }
+
   return m_impl->registerPrefix(interestFilter.getPrefix(), filter,
                                 RegisterPrefixSuccessCallback(), onFailure,
-                                flags,
-                                certificate);
+                                flags, options);
 }
 
 const RegisteredPrefixId*
@@ -272,10 +286,12 @@
   shared_ptr<InterestFilterRecord> filter =
     make_shared<InterestFilterRecord>(interestFilter, onInterest);
 
+  nfd::CommandOptions options;
+  options.setSigningIdentity(identity);
+
   return m_impl->registerPrefix(interestFilter.getPrefix(), filter,
                                 onSuccess, onFailure,
-                                flags,
-                                identity);
+                                flags, options);
 }
 
 const RegisteredPrefixId*
@@ -288,10 +304,12 @@
   shared_ptr<InterestFilterRecord> filter =
     make_shared<InterestFilterRecord>(interestFilter, onInterest);
 
+  nfd::CommandOptions options;
+  options.setSigningIdentity(identity);
+
   return m_impl->registerPrefix(interestFilter.getPrefix(), filter,
                                 RegisterPrefixSuccessCallback(), onFailure,
-                                flags,
-                                identity);
+                                flags, options);
 }
 
 
@@ -314,10 +332,17 @@
                      const IdentityCertificate& certificate,
                      uint64_t flags)
 {
+  nfd::CommandOptions options;
+  if (certificate.getName().empty()) {
+    options.setSigningDefault();
+  }
+  else {
+    options.setSigningCertificate(certificate);
+  }
+
   return m_impl->registerPrefix(prefix, shared_ptr<InterestFilterRecord>(),
                                 onSuccess, onFailure,
-                                flags,
-                                certificate);
+                                flags, options);
 }
 
 const RegisteredPrefixId*
@@ -327,10 +352,12 @@
                      const Name& identity,
                      uint64_t flags)
 {
+  nfd::CommandOptions options;
+  options.setSigningIdentity(identity);
+
   return m_impl->registerPrefix(prefix, shared_ptr<InterestFilterRecord>(),
                                 onSuccess, onFailure,
-                                flags,
-                                identity);
+                                flags, options);
 }
 
 void
