diff --git a/tests/unit-tests/security/conf/checker.t.cpp b/tests/unit-tests/security/conf/checker.t.cpp
index 64588eb..ba18323 100644
--- a/tests/unit-tests/security/conf/checker.t.cpp
+++ b/tests/unit-tests/security/conf/checker.t.cpp
@@ -33,61 +33,6 @@
 
 BOOST_FIXTURE_TEST_SUITE(SecurityConfChecker, IdentityManagementFixture)
 
-void
-interestChecked(const shared_ptr<const Interest>& interest)
-{
-  BOOST_CHECK(true);
-}
-
-void
-interestCheckFailed(const shared_ptr<const Interest>& interest,
-                    const std::string& failureInfo)
-{
-  std::cerr << failureInfo << std::endl;
-  BOOST_CHECK(false);
-}
-
-void
-interestCheckedFalse(const shared_ptr<const Interest>& interest)
-{
-  BOOST_CHECK(false);
-}
-
-void
-interestCheckFailedFalse(const shared_ptr<const Interest>& interest,
-                         const std::string& failureInfo)
-{
-  BOOST_CHECK(true);
-}
-
-void
-dataChecked(const shared_ptr<const Data>& interest)
-{
-  BOOST_CHECK(true);
-}
-
-void
-dataCheckFailed(const shared_ptr<const Data>& interest,
-                const std::string& failureInfo)
-{
-  std::cerr << failureInfo << std::endl;
-  BOOST_CHECK(false);
-}
-
-void
-dataCheckedFalse(const shared_ptr<const Data>& interest)
-{
-  BOOST_CHECK(false);
-}
-
-void
-dataCheckFailedFalse(const shared_ptr<const Data>& interest,
-                     const std::string& failureInfo)
-{
-  BOOST_CHECK(true);
-}
-
-
 BOOST_AUTO_TEST_CASE(CustomizedCheckerTest1)
 {
   using security::conf::CustomizedChecker;
@@ -131,24 +76,16 @@
                                                KeyLocatorChecker::RELATION_EQUAL);
   CustomizedChecker checker1(tlv::SignatureSha256WithRsa, keyLocatorCheckerEqual1);
 
-  result = checker1.check(*data1,
-                          bind(dataChecked, _1),
-                          bind(dataCheckFailed, _1, _2));
+  result = checker1.check(*data1);
   BOOST_CHECK_EQUAL(result, 0);
 
-  result = checker1.check(*data2,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker1.check(*data2);
   BOOST_CHECK_EQUAL(result, -1);
 
-  result = checker1.check(*interest1,
-                          bind(interestChecked, _1),
-                          bind(interestCheckFailed, _1, _2));
+  result = checker1.check(*interest1);
   BOOST_CHECK_EQUAL(result, 0);
 
-  result = checker1.check(*interest2,
-                          bind(interestCheckedFalse, _1),
-                          bind(interestCheckFailedFalse, _1, _2));
+  result = checker1.check(*interest2);
   BOOST_CHECK_EQUAL(result, -1);
 
 
@@ -157,14 +94,10 @@
                                                KeyLocatorChecker::RELATION_EQUAL);
   CustomizedChecker checker2(tlv::SignatureSha256WithRsa, keyLocatorCheckerEqual2);
 
-  result = checker2.check(*data1,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker2.check(*data1);
   BOOST_CHECK_EQUAL(result, -1);
 
-  result = checker2.check(*interest1,
-                          bind(interestCheckedFalse, _1),
-                          bind(interestCheckFailedFalse, _1, _2));
+  result = checker2.check(*interest1);
   BOOST_CHECK_EQUAL(result, -1);
 
 
@@ -173,14 +106,10 @@
                                                KeyLocatorChecker::RELATION_IS_PREFIX_OF);
   CustomizedChecker checker3(tlv::SignatureSha256WithRsa, keyLocatorCheckerPrefix1);
 
-  result = checker3.check(*data1,
-                          bind(dataChecked, _1),
-                          bind(dataCheckFailed, _1, _2));
+  result = checker3.check(*data1);
   BOOST_CHECK_EQUAL(result, 0);
 
-  result = checker3.check(*data2,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker3.check(*data2);
   BOOST_CHECK_EQUAL(result, -1);
 
 
@@ -189,14 +118,10 @@
                                                KeyLocatorChecker::RELATION_IS_PREFIX_OF);
   CustomizedChecker checker4(tlv::SignatureSha256WithRsa, keyLocatorCheckerPrefix2);
 
-  result = checker4.check(*data1,
-                          bind(dataChecked, _1),
-                          bind(dataCheckFailed, _1, _2));
+  result = checker4.check(*data1);
   BOOST_CHECK_EQUAL(result, 0);
 
-  result = checker4.check(*data2,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker4.check(*data2);
   BOOST_CHECK_EQUAL(result, -1);
 
 
@@ -205,14 +130,10 @@
                                                KeyLocatorChecker::RELATION_IS_STRICT_PREFIX_OF);
   CustomizedChecker checker5(tlv::SignatureSha256WithRsa, keyLocatorCheckerStrict1);
 
-  result = checker5.check(*data1,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker5.check(*data1);
   BOOST_CHECK_EQUAL(result, -1);
 
-  result = checker5.check(*data2,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker5.check(*data2);
   BOOST_CHECK_EQUAL(result, -1);
 
   shared_ptr<RelationKeyLocatorNameChecker> keyLocatorCheckerStrict2 =
@@ -220,14 +141,10 @@
                                                KeyLocatorChecker::RELATION_IS_STRICT_PREFIX_OF);
   CustomizedChecker checker6(tlv::SignatureSha256WithRsa, keyLocatorCheckerStrict2);
 
-  result = checker6.check(*data1,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker6.check(*data1);
   BOOST_CHECK_EQUAL(result, 0);
 
-  result = checker6.check(*data2,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker6.check(*data2);
   BOOST_CHECK_EQUAL(result, -1);
 }
 
@@ -274,24 +191,16 @@
       Regex("^<SecurityTestConfChecker><CustomizedCheckerTest2>"));
   CustomizedChecker checker1(tlv::SignatureSha256WithRsa, keyLocatorCheckerRegex1);
 
-  result = checker1.check(*data1,
-                          bind(dataChecked, _1),
-                          bind(dataCheckFailed, _1, _2));
+  result = checker1.check(*data1);
   BOOST_CHECK_EQUAL(result, 0);
 
-  result = checker1.check(*data2,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker1.check(*data2);
   BOOST_CHECK_EQUAL(result, -1);
 
-  result = checker1.check(*interest1,
-                          bind(interestChecked, _1),
-                          bind(interestCheckFailed, _1, _2));
+  result = checker1.check(*interest1);
   BOOST_CHECK_EQUAL(result, 0);
 
-  result = checker1.check(*interest2,
-                          bind(interestCheckedFalse, _1),
-                          bind(interestCheckFailedFalse, _1, _2));
+  result = checker1.check(*interest2);
   BOOST_CHECK_EQUAL(result, -1);
 }
 
@@ -338,32 +247,22 @@
       Regex("^<SecurityTestConfChecker><CustomizedCheckerTest3>"));
   CustomizedChecker checker1(tlv::SignatureSha256WithEcdsa, keyLocatorCheckerRegex1);
 
-  result = checker1.check(*data1,
-                          bind(dataChecked, _1),
-                          bind(dataCheckFailed, _1, _2));
+  result = checker1.check(*data1);
   BOOST_CHECK_EQUAL(result, 0);
 
-  result = checker1.check(*data2,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker1.check(*data2);
   BOOST_CHECK_EQUAL(result, -1);
 
-  result = checker1.check(*interest1,
-                          bind(interestChecked, _1),
-                          bind(interestCheckFailed, _1, _2));
+  result = checker1.check(*interest1);
   BOOST_CHECK_EQUAL(result, 0);
 
-  result = checker1.check(*interest2,
-                          bind(interestCheckedFalse, _1),
-                          bind(interestCheckFailedFalse, _1, _2));
+  result = checker1.check(*interest2);
   BOOST_CHECK_EQUAL(result, -1);
 
 
   CustomizedChecker checker2(tlv::SignatureSha256WithRsa, keyLocatorCheckerRegex1);
 
-  result = checker2.check(*data1,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker2.check(*data1);
   BOOST_CHECK_EQUAL(result, -1);
 }
 
@@ -417,67 +316,43 @@
 
   HierarchicalChecker checker1(tlv::SignatureSha256WithEcdsa);
 
-  result = checker1.check(*data1,
-                          bind(dataChecked, _1),
-                          bind(dataCheckFailed, _1, _2));
+  result = checker1.check(*data1);
   BOOST_CHECK_EQUAL(result, 0);
 
-  result = checker1.check(*data2,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker1.check(*data2);
   BOOST_CHECK_EQUAL(result, -1);
 
-  result = checker1.check(*data3,
-                          bind(dataChecked, _1),
-                          bind(dataCheckFailed, _1, _2));
+  result = checker1.check(*data3);
   BOOST_CHECK_EQUAL(result, 0);
 
-  result = checker1.check(*data4,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker1.check(*data4);
   BOOST_CHECK_EQUAL(result, -1);
 
-  result = checker1.check(*data5,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker1.check(*data5);
   BOOST_CHECK_EQUAL(result, -1);
 
-  result = checker1.check(*data6,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker1.check(*data6);
   BOOST_CHECK_EQUAL(result, -1);
 
 
   HierarchicalChecker checker2(tlv::SignatureSha256WithRsa);
 
-  result = checker2.check(*data1,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker2.check(*data1);
   BOOST_CHECK_EQUAL(result, -1);
 
-  result = checker2.check(*data2,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker2.check(*data2);
   BOOST_CHECK_EQUAL(result, -1);
 
-  result = checker2.check(*data3,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker2.check(*data3);
   BOOST_CHECK_EQUAL(result, -1);
 
-  result = checker2.check(*data4,
-                          bind(dataChecked, _1),
-                          bind(dataCheckFailed, _1, _2));
+  result = checker2.check(*data4);
   BOOST_CHECK_EQUAL(result, 0);
 
-  result = checker2.check(*data5,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker2.check(*data5);
   BOOST_CHECK_EQUAL(result, -1);
 
-  result = checker2.check(*data6,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker2.check(*data6);
   BOOST_CHECK_EQUAL(result, -1);
 }
 
@@ -518,53 +393,37 @@
 
   FixedSignerChecker checker1(tlv::SignatureSha256WithEcdsa, certSet1);
 
-  result = checker1.check(*data1,
-                          bind(dataChecked, _1),
-                          bind(dataCheckFailed, _1, _2));
+  result = checker1.check(*data1);
   BOOST_CHECK_EQUAL(result, 1);
 
-  result = checker1.check(*data2,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker1.check(*data2);
   BOOST_CHECK_EQUAL(result, -1);
 
 
   FixedSignerChecker checker2(tlv::SignatureSha256WithRsa, certSet1);
 
-  result = checker2.check(*data1,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker2.check(*data1);
   BOOST_CHECK_EQUAL(result, -1);
 
-  result = checker2.check(*data2,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker2.check(*data2);
   BOOST_CHECK_EQUAL(result, -1);
 
 
   FixedSignerChecker checker3(tlv::SignatureSha256WithEcdsa, certSet2);
 
-  result = checker3.check(*data1,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker3.check(*data1);
   BOOST_CHECK_EQUAL(result, -1);
 
-  result = checker3.check(*data2,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker3.check(*data2);
   BOOST_CHECK_EQUAL(result, -1);
 
 
   FixedSignerChecker checker4(tlv::SignatureSha256WithRsa, certSet2);
 
-  result = checker4.check(*data1,
-                          bind(dataCheckedFalse, _1),
-                          bind(dataCheckFailedFalse, _1, _2));
+  result = checker4.check(*data1);
   BOOST_CHECK_EQUAL(result, -1);
 
-  result = checker4.check(*data2,
-                          bind(dataChecked, _1),
-                          bind(dataCheckFailed, _1, _2));
+  result = checker4.check(*data2);
   BOOST_CHECK_EQUAL(result, 1);
 }
 
diff --git a/tests/unit-tests/security/validator-config.t.cpp b/tests/unit-tests/security/validator-config.t.cpp
index 005ca9b..028d790 100644
--- a/tests/unit-tests/security/validator-config.t.cpp
+++ b/tests/unit-tests/security/validator-config.t.cpp
@@ -22,6 +22,7 @@
 #include "security/validator-config.hpp"
 
 #include "security/key-chain.hpp"
+#include "security/signing-helpers.hpp"
 #include "util/io.hpp"
 #include "util/scheduler.hpp"
 #include "util/dummy-client-face.hpp"
@@ -30,6 +31,7 @@
 
 #include "identity-management-fixture.hpp"
 #include "../identity-management-time-fixture.hpp"
+#include "../make-interest-data.hpp"
 #include "boost-test.hpp"
 
 namespace ndn {
@@ -52,15 +54,11 @@
 
   Name dataName1("/simple/equal");
   shared_ptr<Data> data1 = make_shared<Data>(dataName1);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data1,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data1, security::signingByIdentity(identity)));
 
   Name dataName2("/simple/different");
   shared_ptr<Data> data2 = make_shared<Data>(dataName2);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data2,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data2, security::signingByIdentity(identity)));
 
   std::string CONFIG_1 =
     "rule\n"
@@ -100,7 +98,7 @@
 
   Face face(nullptr, m_keyChain);
   ValidatorConfig validator(face);
-  validator.load(CONFIG, CONFIG_PATH.native());
+  validator.load(CONFIG, CONFIG_PATH.c_str());
 
   validator.validate(*data1,
     [] (const shared_ptr<const Data>&) { BOOST_CHECK(true); },
@@ -126,21 +124,15 @@
 
   Name dataName1("/simple/isPrefixOf");
   shared_ptr<Data> data1 = make_shared<Data>(dataName1);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data1,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data1, security::signingByIdentity(identity)));
 
   Name dataName2("/simple/notPrefixOf");
   shared_ptr<Data> data2 = make_shared<Data>(dataName2);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data2,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data2, security::signingByIdentity(identity)));
 
   Name dataName3("/simple/isPrefixOf/anotherLevel");
   shared_ptr<Data> data3 = make_shared<Data>(dataName3);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data3,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data3, security::signingByIdentity(identity)));
 
   std::string CONFIG_1 =
     "rule\n"
@@ -180,7 +172,7 @@
 
   Face face(nullptr, m_keyChain);
   ValidatorConfig validator(face);
-  validator.load(CONFIG, CONFIG_PATH.native());
+  validator.load(CONFIG, CONFIG_PATH.c_str());
 
   validator.validate(*data1,
     [] (const shared_ptr<const Data>&) { BOOST_CHECK(true); },
@@ -210,21 +202,15 @@
 
   Name dataName1("/simple/isStrictPrefixOf");
   shared_ptr<Data> data1 = make_shared<Data>(dataName1);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data1,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data1, security::signingByIdentity(identity)));
 
   Name dataName2("/simple");
   shared_ptr<Data> data2 = make_shared<Data>(dataName2);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data2,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data2, security::signingByIdentity(identity)));
 
   Name dataName3("/simple/isStrictPrefixOf/anotherLevel");
   shared_ptr<Data> data3 = make_shared<Data>(dataName3);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data3,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data3, security::signingByIdentity(identity)));
 
   std::string CONFIG_1 =
     "rule\n"
@@ -264,7 +250,7 @@
 
   Face face(nullptr, m_keyChain);
   ValidatorConfig validator(face);
-  validator.load(CONFIG, CONFIG_PATH.native());
+  validator.load(CONFIG, CONFIG_PATH.c_str());
 
   validator.validate(*data1,
     [] (const shared_ptr<const Data>&) { BOOST_CHECK(false); },
@@ -294,21 +280,15 @@
 
   Name dataName1("/simple/regex");
   shared_ptr<Data> data1 = make_shared<Data>(dataName1);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data1,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data1, security::signingByIdentity(identity)));
 
   Name dataName2("/simple/regex-wrong");
   shared_ptr<Data> data2 = make_shared<Data>(dataName2);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data2,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data2, security::signingByIdentity(identity)));
 
   Name dataName3("/simple/regex/correct");
   shared_ptr<Data> data3 = make_shared<Data>(dataName3);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data3,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data3, security::signingByIdentity(identity)));
 
   std::string CONFIG_1 =
     "rule\n"
@@ -347,7 +327,7 @@
 
   Face face(nullptr, m_keyChain);
   ValidatorConfig validator(face);
-  validator.load(CONFIG, CONFIG_PATH.native());
+  validator.load(CONFIG, CONFIG_PATH.c_str());
 
   validator.validate(*data1,
     [] (const shared_ptr<const Data>&) { BOOST_CHECK(true); },
@@ -378,21 +358,15 @@
   Name dataName1 = identity;
   dataName1.append("1");
   shared_ptr<Data> data1 = make_shared<Data>(dataName1);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data1,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data1, security::signingByIdentity(identity)));
 
   Name dataName2 = identity;
   shared_ptr<Data> data2 = make_shared<Data>(dataName2);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data2,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data2, security::signingByIdentity(identity)));
 
   Name dataName3("/TestValidatorConfig/KeyLocatorNameChecker1");
   shared_ptr<Data> data3 = make_shared<Data>(dataName3);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data3,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data3, security::signingByIdentity(identity)));
 
   const std::string CONFIG =
     "rule\n"
@@ -427,7 +401,7 @@
 
   Face face(nullptr, m_keyChain);
   ValidatorConfig validator(face);
-  validator.load(CONFIG, CONFIG_PATH.native());
+  validator.load(CONFIG, CONFIG_PATH.c_str());
 
   validator.validate(*data1,
     [] (const shared_ptr<const Data>&) { BOOST_CHECK(true); },
@@ -464,16 +438,12 @@
   Name dataName1 = identity;
   dataName1.append("data").appendVersion();
   shared_ptr<Data> data1 = make_shared<Data>(dataName1);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data1,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity1)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data1, security::signingByIdentity(identity1)));
 
   Name dataName2 = identity;
   dataName2.append("data").appendVersion();
   shared_ptr<Data> data2 = make_shared<Data>(dataName2);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data2,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity2)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data2, security::signingByIdentity(identity2)));
 
   Name interestName("/TestValidatorConfig/FixedSignerChecker/fakeSigInfo/fakeSigValue");
   shared_ptr<Interest> interest = make_shared<Interest>(interestName);
@@ -526,7 +496,7 @@
 
   Face face(nullptr, m_keyChain);
   ValidatorConfig validator(face);
-  validator.load(CONFIG, CONFIG_PATH.native());
+  validator.load(CONFIG, CONFIG_PATH.c_str());
 
   validator.validate(*data1,
     [] (const shared_ptr<const Data>&) { BOOST_CHECK(true); },
@@ -545,6 +515,148 @@
   boost::filesystem::remove(CERT_PATH);
 }
 
+struct CertCleanFixture : public IdentityManagementTimeFixture
+{
+public:
+  CertCleanFixture()
+    : tmpPath(boost::filesystem::path(UNIT_TEST_CONFIG_PATH))
+  {
+    boost::filesystem::create_directories(tmpPath);
+  }
+
+  ~CertCleanFixture()
+  {
+    boost::filesystem::remove_all(tmpPath);
+  }
+
+public:
+  boost::filesystem::path tmpPath;
+};
+
+BOOST_FIXTURE_TEST_CASE(MultiCheckers, CertCleanFixture)
+{
+  std::string certDir = tmpPath.c_str();
+
+  Name identity1("/TestValidatorConfig/MultiCheckers/");
+  identity1.appendVersion();
+  addIdentity(identity1);
+  Name certName1 = m_keyChain.getDefaultCertificateNameForIdentity(identity1);
+  shared_ptr<IdentityCertificate> idCert1 = m_keyChain.getCertificate(certName1);
+  std::string certDir1 = certDir + "trust-anchor-multi-1.cert";
+  io::save(*idCert1, certDir1);
+
+  Name identity2("/TestValidatorConfig/");
+  identity2.appendVersion();
+  addIdentity(identity2);
+  Name certName2 = m_keyChain.getDefaultCertificateNameForIdentity(identity2);
+  shared_ptr<IdentityCertificate> idCert2 = m_keyChain.getCertificate(certName2);
+  std::string certDir2 = certDir + "trust-anchor-multi-2.cert";
+  io::save(*idCert2, certDir2);
+
+  const std::string CONFIG =
+    "rule\n"
+    "{\n"
+    "  id \"Simple Rule01\"\n"
+    "  for data\n"
+    "  filter"
+    "  {\n"
+    "    type name\n"
+    "    name /\n"
+    "    relation is-prefix-of\n"
+    "  }\n"
+    "  checker\n" // checker 1, signer should have prefix /TestValidatorConfig/MultiCheckers
+    "  {\n"
+    "    type customized\n"
+    "    sig-type rsa-sha256\n"
+    "    key-locator\n"
+    "    {\n"
+    "      type name\n"
+    "      name /TestValidatorConfig/MultiCheckers/\n"
+    "      relation is-prefix-of\n"
+    "    }\n"
+    "  }\n"
+    "  checker\n" // checker 2, data should have same prefix of its signer
+    "  {\n"
+    "    type hierarchical\n"
+    "    sig-type rsa-sha256\n"
+    "  }\n"
+    "  checker\n" // checker 3, the signer should be identity1
+    "  {\n"
+    "    type fixed-signer\n"
+    "    sig-type rsa-sha256\n"
+    "    signer\n"
+    "    {\n"
+    "      type file\n"
+    "      file-name \"trust-anchor-multi-1.cert\"\n"
+    "    }\n"
+    "  }\n"
+    "}\n";
+
+  const boost::filesystem::path CONFIG_PATH =
+    (tmpPath / std::string("unit-test-multicheckers.conf"));
+
+  ValidatorConfig validator;
+  validator.load(CONFIG, CONFIG_PATH.c_str());
+  conf::Checker& checker0 = *validator.m_dataRules.front()->m_checkers[0];
+  conf::Checker& checker1 = *validator.m_dataRules.front()->m_checkers[1];
+  conf::Checker& checker2 = *validator.m_dataRules.front()->m_checkers[2];
+
+  auto data1 = util::makeData(Name(identity1).append("Test"));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data1, security::signingByIdentity(identity1)));
+  BOOST_CHECK_EQUAL(checker0.check(*data1), 0);
+  BOOST_CHECK_EQUAL(checker1.check(*data1), 0);
+  BOOST_CHECK_EQUAL(checker2.check(*data1), 1);
+
+  auto data2 = util::makeData(Name(identity2).append("Data2"));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data2, security::signingByIdentity(identity2)));
+  BOOST_CHECK_EQUAL(checker0.check(*data2), -1);
+  BOOST_CHECK_EQUAL(checker1.check(*data2), 0);
+  BOOST_CHECK_EQUAL(checker2.check(*data2), -1);
+
+  auto data3 = util::makeData(Name(identity2).append("Data3"));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data3, security::signingByIdentity(identity1)));
+  BOOST_CHECK_EQUAL(checker0.check(*data3), 0);
+  BOOST_CHECK_EQUAL(checker1.check(*data3), -1);
+  BOOST_CHECK_EQUAL(checker2.check(*data3), 1);
+
+  auto data4 = util::makeData("/Data4");
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data4, security::signingByIdentity(identity2)));
+  BOOST_CHECK_EQUAL(checker0.check(*data4), -1);
+  BOOST_CHECK_EQUAL(checker1.check(*data4), -1);
+  BOOST_CHECK_EQUAL(checker2.check(*data4), -1);
+
+  int count = 0;
+  validator.validate(*data1,
+    [&] (const shared_ptr<const Data>&) {
+      BOOST_CHECK(true);
+      count++;
+    },
+    [] (const shared_ptr<const Data>&, const std::string& str) { BOOST_CHECK(false); });
+
+  validator.validate(*data2,
+    [] (const shared_ptr<const Data>&) { BOOST_CHECK(false); },
+    [&] (const shared_ptr<const Data>&, const std::string& str) {
+      BOOST_CHECK(true);
+      count++;
+    });
+
+  validator.validate(*data3,
+    [&] (const shared_ptr<const Data>&) {
+      BOOST_CHECK(true);
+      count++;
+    },
+    [] (const shared_ptr<const Data>&, const std::string& str) { BOOST_CHECK(false); });
+
+  validator.validate(*data4,
+    [] (const shared_ptr<const Data>&) { BOOST_CHECK(false); },
+    [&] (const shared_ptr<const Data>&, const std::string& str) {
+      BOOST_CHECK(true);
+      count++;
+    });
+
+  BOOST_CHECK_EQUAL(count, 4);
+}
+
 BOOST_AUTO_TEST_CASE(Reset)
 {
   Name root("/TestValidatorConfig/Reload");
@@ -602,7 +714,7 @@
 
   shared_ptr<ValidatorConfig> validator = shared_ptr<ValidatorConfig>(new ValidatorConfig(face));
 
-  validator->load(CONFIG, CONFIG_PATH.native());
+  validator->load(CONFIG, CONFIG_PATH.c_str());
   BOOST_CHECK_EQUAL(validator->isEmpty(), false);
 
   validator->reset();
@@ -621,9 +733,7 @@
 
   Name dataName1("/any/data");
   shared_ptr<Data> data1 = make_shared<Data>(dataName1);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data1,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data1, security::signingByIdentity(identity)));
 
   std::string CONFIG =
     "trust-anchor\n"
@@ -636,7 +746,7 @@
 
   Face face(nullptr, m_keyChain);
   ValidatorConfig validator(face);
-  validator.load(CONFIG, CONFIG_PATH.native());
+  validator.load(CONFIG, CONFIG_PATH.c_str());
 
   validator.validate(*data1,
     [] (const shared_ptr<const Data>&) { BOOST_CHECK(true); },
@@ -662,13 +772,9 @@
   interestName2.append("2");
   shared_ptr<Interest> interest2 = make_shared<Interest>(interestName2);
 
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest1,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity1)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest1, security::signingByIdentity(identity1)));
   usleep(10000);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest2,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity1)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest2, security::signingByIdentity(identity1)));
 
   const std::string CONFIG =
     "rule\n"
@@ -697,7 +803,7 @@
 
   Face face(nullptr, m_keyChain);
   ValidatorConfig validator(face);
-  validator.load(CONFIG, CONFIG_PATH.native());
+  validator.load(CONFIG, CONFIG_PATH.c_str());
 
   validator.validate(*interest1,
     [] (const shared_ptr<const Interest>&) { BOOST_CHECK(true); },
@@ -754,17 +860,11 @@
   interestName3.append("3");
   shared_ptr<Interest> interest3 = make_shared<Interest>(interestName3);
 
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest1,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity1)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest1, security::signingByIdentity(identity1)));
   usleep(10000);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest2,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity2)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest2, security::signingByIdentity(identity2)));
   usleep(10000);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest3,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity3)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest3, security::signingByIdentity(identity3)));
 
   const std::string CONFIG =
     "rule\n"
@@ -808,7 +908,7 @@
                             10,
                             2,                 // Two keys can be tracked
                             time::seconds(1)); // TTL is set to 1 sec
-  validator.load(CONFIG, CONFIG_PATH.native());
+  validator.load(CONFIG, CONFIG_PATH.c_str());
 
   validator.validate(*interest1,
     [] (const shared_ptr<const Interest>&) { BOOST_CHECK(true); },
@@ -892,21 +992,13 @@
   shared_ptr<Interest> interest4 = make_shared<Interest>(interestName4);
 
 
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest1,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity1)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest1, security::signingByIdentity(identity1)));
   usleep(10000);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest2,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity2)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest2, security::signingByIdentity(identity2)));
   usleep(10000);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest3,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity3)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest3, security::signingByIdentity(identity3)));
   usleep(10000);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest4,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             identity4)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest4, security::signingByIdentity(identity4)));
 
   const std::string CONFIG =
     "rule\n"
@@ -955,7 +1047,7 @@
                             10,
                             3,                 // Two keys can be tracked
                             time::seconds(1)); // TTL is set to 1 sec
-  validator.load(CONFIG, CONFIG_PATH.native());
+  validator.load(CONFIG, CONFIG_PATH.c_str());
 
   validator.validate(*interest1,
     [] (const shared_ptr<const Interest>&) { BOOST_CHECK(true); },
@@ -1033,22 +1125,14 @@
 
   Name dataName("/TestValidatorConfig/FixedSignerChecker2");
   shared_ptr<Data> dataRsa = make_shared<Data>(dataName);
-  m_keyChain.sign(*dataRsa,
-                  security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                        rsaIdentity));
+  m_keyChain.sign(*dataRsa, security::signingByIdentity(rsaIdentity));
   shared_ptr<Data> dataEcdsa = make_shared<Data>(dataName);
-  m_keyChain.sign(*dataEcdsa,
-                  security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                        ecdsaIdentity));
+  m_keyChain.sign(*dataEcdsa, security::signingByIdentity(ecdsaIdentity));
 
   shared_ptr<Interest> interestRsa = make_shared<Interest>(dataName);
-  m_keyChain.sign(*interestRsa,
-                  security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                        rsaIdentity));
+  m_keyChain.sign(*interestRsa, security::signingByIdentity(rsaIdentity));
   shared_ptr<Interest> interestEcdsa = make_shared<Interest>(dataName);
-  m_keyChain.sign(*interestEcdsa,
-                  security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                        ecdsaIdentity));
+  m_keyChain.sign(*interestEcdsa, security::signingByIdentity(ecdsaIdentity));
 
   const std::string CONFIG =
     "rule\n"
@@ -1098,7 +1182,7 @@
 
   Face face(nullptr, m_keyChain);
   ValidatorConfig validator(face);
-  validator.load(CONFIG, CONFIG_PATH.native());
+  validator.load(CONFIG, CONFIG_PATH.c_str());
 
   validator.validate(*dataEcdsa,
     [] (const shared_ptr<const Data>&) { BOOST_CHECK(true); },
@@ -1196,9 +1280,7 @@
                                                   time::system_clock::now(),
                                                   time::system_clock::now() + time::days(7300),
                                                   subjectDescription);
-  m_keyChain.sign(*sldCert,
-                  security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                        root));
+  m_keyChain.sign(*sldCert, security::signingByIdentity(root));
   m_keyChain.addCertificateAsIdentityDefault(*sldCert);
 
   Name nld("/TestValidatorConfig/HierarchicalChecker/NextLevel");
@@ -1211,9 +1293,7 @@
                                                   time::system_clock::now(),
                                                   time::system_clock::now() + time::days(7300),
                                                   subjectDescription);
-  m_keyChain.sign(*nldCert,
-                  security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                        sld));
+m_keyChain.sign(*nldCert, security::signingByIdentity(sld));
   m_keyChain.addCertificateAsIdentityDefault(*nldCert);
 
   face1.setInterestFilter(sldCert->getName().getPrefix(-1),
@@ -1229,16 +1309,12 @@
   Name dataName1 = nld;
   dataName1.append("data1");
   shared_ptr<Data> data1 = make_shared<Data>(dataName1);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data1,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             nld)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data1, security::signingByIdentity(nld)));
 
   Name dataName2("/ConfValidatorTest");
   dataName2.append("data1");
   shared_ptr<Data> data2 = make_shared<Data>(dataName2);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data2,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             nld)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data2, security::signingByIdentity(nld)));
 
 
   const std::string CONFIG =
@@ -1262,7 +1338,7 @@
 
 
   auto validator = make_shared<ValidatorConfig>(&face2);
-  validator->load(CONFIG, CONFIG_PATH.native());
+  validator->load(CONFIG, CONFIG_PATH.c_str());
 
   advanceClocks(time::milliseconds(2), 100);
   validator->validate(*data1,
@@ -1309,9 +1385,7 @@
                                                   time::system_clock::now(),
                                                   time::system_clock::now() + time::days(7300),
                                                   subjectDescription);
-  m_keyChain.sign(*sldCert,
-                  security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                        root));
+  m_keyChain.sign(*sldCert, security::signingByIdentity(root));
   m_keyChain.addCertificateAsIdentityDefault(*sldCert);
 
   Name nld("/TestValidatorConfig/Nrd-1/Nrd-2");
@@ -1324,9 +1398,7 @@
                                                   time::system_clock::now(),
                                                   time::system_clock::now() + time::days(7300),
                                                   subjectDescription);
-  m_keyChain.sign(*nldCert,
-                  security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                        sld));
+  m_keyChain.sign(*nldCert, security::signingByIdentity(sld));
   m_keyChain.addCertificateAsIdentityDefault(*nldCert);
 
   face1.setInterestFilter(sldCert->getName().getPrefix(-1),
@@ -1342,23 +1414,17 @@
   advanceClocks(time::milliseconds(10));
   Name interestName1("/localhost/nrd/register/option");
   shared_ptr<Interest> interest1 = make_shared<Interest>(interestName1);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest1,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             nld)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest1, security::signingByIdentity(nld)));
 
   advanceClocks(time::milliseconds(10));
   Name interestName2("/localhost/nrd/non-register");
   shared_ptr<Interest> interest2 = make_shared<Interest>(interestName2);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest2,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             nld)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest2, security::signingByIdentity(nld)));
 
   advanceClocks(time::milliseconds(10));
   Name interestName3("/localhost/nrd/register/option");
   shared_ptr<Interest> interest3 = make_shared<Interest>(interestName3);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest3,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             root)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*interest3, security::signingByIdentity(root)));
 
   advanceClocks(time::milliseconds(10));
   Name interestName4("/localhost/nrd/register/option/timestamp/nonce/fakeSigInfo/fakeSigValue");
@@ -1409,7 +1475,7 @@
     (boost::filesystem::current_path() / std::string("unit-test-nfd.conf"));
 
   auto validator = make_shared<ValidatorConfig>(&face2);
-  validator->load(CONFIG, CONFIG_PATH.native());
+  validator->load(CONFIG, CONFIG_PATH.c_str());
 
   advanceClocks(time::milliseconds(2), 100);
 
@@ -1510,15 +1576,11 @@
 
   Name dataName1("/any/data/1");
   shared_ptr<Data> data1 = make_shared<Data>(dataName1);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data1,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             firstIdentity)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data1, security::signingByIdentity(firstIdentity)));
 
   Name dataName2("/any/data/2");
   shared_ptr<Data> data2 = make_shared<Data>(dataName2);
-  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data2,
-                                       security::SigningInfo(security::SigningInfo::SIGNER_TYPE_ID,
-                                                             secondIdentity)));
+  BOOST_CHECK_NO_THROW(m_keyChain.sign(*data2, security::signingByIdentity(secondIdentity)));
 
   std::string CONFIG =
     "rule\n"
@@ -1551,7 +1613,7 @@
   const boost::filesystem::path CONFIG_PATH =
     (boost::filesystem::current_path() / std::string("unit-test-nfd.conf"));
 
-  validator.load(CONFIG, CONFIG_PATH.native());
+  validator.load(CONFIG, CONFIG_PATH.c_str());
 
   advanceClocks(time::milliseconds(10), 20);
   validator.validate(*data1,
