diff --git a/src/face.cpp b/src/face.cpp
index 3722fda..b419e13 100644
--- a/src/face.cpp
+++ b/src/face.cpp
@@ -26,6 +26,7 @@
 
 #include "encoding/tlv.hpp"
 #include "security/key-chain.hpp"
+#include "security/signing-helpers.hpp"
 #include "util/time.hpp"
 #include "util/random.hpp"
 #include "util/face-uri.hpp"
@@ -215,11 +216,8 @@
     make_shared<InterestFilterRecord>(interestFilter, onInterest);
 
   nfd::CommandOptions options;
-  if (certificate.getName().empty()) {
-    options.setSigningDefault();
-  }
-  else {
-    options.setSigningCertificate(certificate);
+  if (!certificate.getName().empty()) {
+    options.setSigningInfo(signingByCertificate(certificate.getName()));
   }
 
   return m_impl->registerPrefix(interestFilter.getPrefix(), filter,
@@ -238,11 +236,8 @@
     make_shared<InterestFilterRecord>(interestFilter, onInterest);
 
   nfd::CommandOptions options;
-  if (certificate.getName().empty()) {
-    options.setSigningDefault();
-  }
-  else {
-    options.setSigningCertificate(certificate);
+  if (!certificate.getName().empty()) {
+    options.setSigningInfo(signingByCertificate(certificate.getName()));
   }
 
   return m_impl->registerPrefix(interestFilter.getPrefix(), filter,
@@ -262,7 +257,7 @@
     make_shared<InterestFilterRecord>(interestFilter, onInterest);
 
   nfd::CommandOptions options;
-  options.setSigningIdentity(identity);
+  options.setSigningInfo(signingByIdentity(identity));
 
   return m_impl->registerPrefix(interestFilter.getPrefix(), filter,
                                 onSuccess, onFailure,
@@ -280,7 +275,7 @@
     make_shared<InterestFilterRecord>(interestFilter, onInterest);
 
   nfd::CommandOptions options;
-  options.setSigningIdentity(identity);
+  options.setSigningInfo(signingByIdentity(identity));
 
   return m_impl->registerPrefix(interestFilter.getPrefix(), filter,
                                 RegisterPrefixSuccessCallback(), onFailure,
@@ -308,11 +303,8 @@
                      uint64_t flags)
 {
   nfd::CommandOptions options;
-  if (certificate.getName().empty()) {
-    options.setSigningDefault();
-  }
-  else {
-    options.setSigningCertificate(certificate);
+  if (!certificate.getName().empty()) {
+    options.setSigningInfo(signingByCertificate(certificate.getName()));
   }
 
   return m_impl->registerPrefix(prefix, shared_ptr<InterestFilterRecord>(),
@@ -328,7 +320,7 @@
                      uint64_t flags)
 {
   nfd::CommandOptions options;
-  options.setSigningIdentity(identity);
+  options.setSigningInfo(signingByIdentity(identity));
 
   return m_impl->registerPrefix(prefix, shared_ptr<InterestFilterRecord>(),
                                 onSuccess, onFailure,
diff --git a/src/management/nfd-command-options.cpp b/src/management/nfd-command-options.cpp
index f8141d3..97a1be8 100644
--- a/src/management/nfd-command-options.cpp
+++ b/src/management/nfd-command-options.cpp
@@ -21,6 +21,11 @@
 
 #include "nfd-command-options.hpp"
 
+#ifdef NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS
+#include "../security/identity-certificate.hpp"
+#include "../security/signing-helpers.hpp"
+#endif // NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS
+
 namespace ndn {
 namespace nfd {
 
@@ -30,7 +35,6 @@
 CommandOptions::CommandOptions()
   : m_timeout(DEFAULT_TIMEOUT)
   , m_prefix(DEFAULT_PREFIX)
-  , m_signingParamsKind(SIGNING_PARAMS_DEFAULT)
 {
 }
 
@@ -53,10 +57,54 @@
 }
 
 CommandOptions&
+CommandOptions::setSigningInfo(const security::SigningInfo& signingInfo)
+{
+  m_signingInfo = signingInfo;
+  return *this;
+}
+
+#ifdef NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS
+
+CommandOptions::SigningParamsKind
+CommandOptions::getSigningParamsKind() const
+{
+  switch (m_signingInfo.getSignerType()) {
+  case security::SigningInfo::SIGNER_TYPE_NULL:
+    return SIGNING_PARAMS_DEFAULT;
+  case security::SigningInfo::SIGNER_TYPE_ID:
+    return SIGNING_PARAMS_IDENTITY;
+  case security::SigningInfo::SIGNER_TYPE_CERT:
+    return SIGNING_PARAMS_CERTIFICATE;
+  default:
+    throw std::out_of_range("SigningInfo::SignerType is not convertible to CommandOptions::SigningParamsKind");
+  }
+}
+
+const Name&
+CommandOptions::getSigningIdentity() const
+{
+  BOOST_ASSERT(m_signingInfo.getSignerType() == security::SigningInfo::SIGNER_TYPE_ID);
+  return m_signingInfo.getSignerName();
+}
+
+const Name&
+CommandOptions::getSigningCertificate() const
+{
+  BOOST_ASSERT(m_signingInfo.getSignerType() == security::SigningInfo::SIGNER_TYPE_CERT);
+  return m_signingInfo.getSignerName();
+}
+
+CommandOptions&
+CommandOptions::setSigningDefault()
+{
+  m_signingInfo = security::SigningInfo();
+  return *this;
+}
+
+CommandOptions&
 CommandOptions::setSigningIdentity(const Name& identityName)
 {
-  m_signingParamsKind = SIGNING_PARAMS_IDENTITY;
-  m_identity = identityName;
+  m_signingInfo = security::signingByIdentity(identityName);
   return *this;
 }
 
@@ -69,8 +117,7 @@
     throw std::invalid_argument("certificate is invalid");
   }
 
-  m_signingParamsKind = SIGNING_PARAMS_CERTIFICATE;
-  m_identity = certificateName;
+  m_signingInfo = security::signingByCertificate(certificateName);
   return *this;
 }
 
@@ -80,5 +127,7 @@
   return this->setSigningCertificate(certificate.getName());
 }
 
+#endif // NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS
+
 } // namespace nfd
 } // namespace ndn
diff --git a/src/management/nfd-command-options.hpp b/src/management/nfd-command-options.hpp
index 54f744f..7d43c1d 100644
--- a/src/management/nfd-command-options.hpp
+++ b/src/management/nfd-command-options.hpp
@@ -22,9 +22,14 @@
 #ifndef NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_HPP
 #define NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_HPP
 
-#include "../security/identity-certificate.hpp"
+#include "../security/signing-info.hpp"
+
+#define NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS
 
 namespace ndn {
+
+class IdentityCertificate;
+
 namespace nfd {
 
 /** \ingroup management
@@ -34,6 +39,11 @@
 class CommandOptions
 {
 public:
+  /** \brief constructs CommandOptions
+   *  \post getTimeout() == DEFAULT_TIMEOUT
+   *  \post getPrefix() == DEFAULT_PREFIX
+   *  \post getSigningInfo().getSignerType() == SIGNER_TYPE_NULL
+   */
   CommandOptions();
 
   /** \return command timeout
@@ -66,8 +76,24 @@
   CommandOptions&
   setPrefix(const Name& prefix);
 
+  /** \return signing parameters
+   */
+  const security::SigningInfo&
+  getSigningInfo() const
+  {
+    return m_signingInfo;
+  }
+
+  /** \brief sets signing parameters
+   *  \return self
+   */
+  CommandOptions&
+  setSigningInfo(const security::SigningInfo& signingInfo);
+
+#ifdef NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS
 public: // signing parameters
-  /** \brief indicates the selection of signing parameters
+  /** \deprecated use getSigningInfo and setSigningInfo
+   *  \brief indicates the selection of signing parameters
    */
   enum SigningParamsKind {
     /** \brief picks the default signing identity and certificate
@@ -81,46 +107,36 @@
     SIGNING_PARAMS_CERTIFICATE
   };
 
-  /** \return selection of signing parameters
+  /** \deprecated use getSigningInfo and setSigningInfo
+   *  \return selection of signing parameters
    */
   SigningParamsKind
-  getSigningParamsKind() const
-  {
-    return m_signingParamsKind;
-  }
+  getSigningParamsKind() const;
 
-  /** \return identity Name
+  /** \deprecated use getSigningInfo and setSigningInfo
+   *  \return identity Name
    *  \pre getSigningParamsKind() == SIGNING_PARAMS_IDENTITY
    */
   const Name&
-  getSigningIdentity() const
-  {
-    BOOST_ASSERT(m_signingParamsKind == SIGNING_PARAMS_IDENTITY);
-    return m_identity;
-  }
+  getSigningIdentity() const;
 
-  /** \return certificate Name
+  /** \deprecated use getSigningInfo and setSigningInfo
+   *  \return certificate Name
    *  \pre getSigningParamsKind() == SIGNING_PARAMS_CERTIFICATE
    */
   const Name&
-  getSigningCertificate() const
-  {
-    BOOST_ASSERT(m_signingParamsKind == SIGNING_PARAMS_CERTIFICATE);
-    return m_identity;
-  }
+  getSigningCertificate() const;
 
-  /** \brief chooses to use default identity and certificate
+  /** \deprecated use getSigningInfo and setSigningInfo
+   *  \brief chooses to use default identity and certificate
    *  \post getSigningParamsKind() == SIGNING_PARAMS_DEFAULT
    *  \return self
    */
   CommandOptions&
-  setSigningDefault()
-  {
-    m_signingParamsKind = SIGNING_PARAMS_DEFAULT;
-    return *this;
-  }
+  setSigningDefault();
 
-  /** \brief chooses to use a specific identity and its default certificate
+  /** \deprecated use getSigningInfo and setSigningInfo
+   *  \brief chooses to use a specific identity and its default certificate
    *  \post getSigningParamsKind() == SIGNING_PARAMS_IDENTITY
    *  \post getIdentityName() == identityName
    *  \return self
@@ -128,22 +144,26 @@
   CommandOptions&
   setSigningIdentity(const Name& identityName);
 
-  /** \brief chooses to use a specific identity certificate
+  /** \deprecated use getSigningInfo and setSigningInfo
+   *  \brief chooses to use a specific identity certificate
    *  \param certificateName identity certificate Name
    *  \throw std::invalid_argument if certificateName is invalid
    *  \post getSigningParamsKind() == SIGNING_PARAMS_CERTIFICATE
-   *  \post getIdentityCertificate() is a copy of certificate
+   *  \post getSigningCertificate() == certificateName
    *  \return self
    */
   CommandOptions&
   setSigningCertificate(const Name& certificateName);
 
-  /** \brief chooses to use a specific identity certificate
+  /** \deprecated use getSigningInfo and setSigningInfo
+   *  \brief chooses to use a specific identity certificate
    *  \details This is equivalent to .setIdentityCertificate(certificate.getName())
    */
   CommandOptions&
   setSigningCertificate(const IdentityCertificate& certificate);
 
+#endif // NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS
+
 public:
   /** \brief gives the default command timeout: 10000ms
    */
@@ -156,8 +176,7 @@
 private:
   time::milliseconds m_timeout;
   Name m_prefix;
-  SigningParamsKind m_signingParamsKind;
-  Name m_identity; // identityName or certificateName
+  security::SigningInfo m_signingInfo;
 };
 
 } // namespace nfd
diff --git a/src/management/nfd-controller.cpp b/src/management/nfd-controller.cpp
index 5f2f133..0284889 100644
--- a/src/management/nfd-controller.cpp
+++ b/src/management/nfd-controller.cpp
@@ -45,23 +45,7 @@
   Name requestName = command->getRequestName(options.getPrefix(), parameters);
   Interest interest(requestName);
   interest.setInterestLifetime(options.getTimeout());
-
-  switch (options.getSigningParamsKind()) {
-  case CommandOptions::SIGNING_PARAMS_DEFAULT:
-    m_keyChain.sign(interest);
-    break;
-  case CommandOptions::SIGNING_PARAMS_IDENTITY:
-    m_keyChain.sign(interest, security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                    options.getSigningIdentity()));
-    break;
-  case CommandOptions::SIGNING_PARAMS_CERTIFICATE:
-    m_keyChain.sign(interest, security::SigningInfo(security::SigningInfo::SIGNER_TYPE_CERT,
-                                                    options.getSigningCertificate()));
-    break;
-  default:
-    BOOST_ASSERT(false);
-    break;
-  }
+  m_keyChain.sign(interest, options.getSigningInfo());
 
   m_face.expressInterest(interest,
                          bind(&Controller::processCommandResponse, this, _2,
diff --git a/tests/unit-tests/management/nfd-command-options.t.cpp b/tests/unit-tests/management/nfd-command-options.t.cpp
index 8a2a4b1..d67d865 100644
--- a/tests/unit-tests/management/nfd-command-options.t.cpp
+++ b/tests/unit-tests/management/nfd-command-options.t.cpp
@@ -20,6 +20,11 @@
  */
 
 #include "management/nfd-command-options.hpp"
+#include "security/signing-helpers.hpp"
+
+#ifdef NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS
+#include "security/identity-certificate.hpp"
+#endif // NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS
 
 #include "boost-test.hpp"
 
@@ -57,6 +62,17 @@
   BOOST_CHECK_EQUAL(co.getPrefix(), Name("ndn:/localhop/net/example/nfd"));
 }
 
+BOOST_AUTO_TEST_CASE(SigningInfo)
+{
+  CommandOptions co;
+  BOOST_CHECK_EQUAL(co.getSigningInfo().getSignerType(), security::SigningInfo::SIGNER_TYPE_NULL);
+
+  co.setSigningInfo(signingByIdentity("ndn:/tmp/identity"));
+  BOOST_CHECK_EQUAL(co.getSigningInfo().getSignerType(), security::SigningInfo::SIGNER_TYPE_ID);
+  BOOST_CHECK_EQUAL(co.getSigningInfo().getSignerName(), "ndn:/tmp/identity");
+}
+
+#ifdef NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS
 BOOST_AUTO_TEST_CASE(SigningParams)
 {
   CommandOptions co;
@@ -96,6 +112,7 @@
   BOOST_CHECK_EQUAL(co.getSigningParamsKind(),
                     CommandOptions::SIGNING_PARAMS_DEFAULT); // unchanged after throw
 }
+#endif // NDN_MANAGEMENT_NFD_COMMAND_OPTIONS_KEEP_DEPRECATED_SIGNING_PARAMS
 
 BOOST_AUTO_TEST_SUITE_END()
 
