diff --git a/daemon/table/cs.cpp b/daemon/table/cs.cpp
index 874ef52..e5da3fa 100644
--- a/daemon/table/cs.cpp
+++ b/daemon/table/cs.cpp
@@ -27,6 +27,7 @@
 #include "cs.hpp"
 #include "core/logger.hpp"
 #include <ndn-cpp-dev/util/crypto.hpp>
+#include "ndn-cpp-dev/security/signature-sha256-with-rsa.hpp"
 
 #define SKIPLIST_MAX_LAYERS 32
 #define SKIPLIST_PROBABILITY 25         // 25% (p = 1/4)
@@ -636,6 +637,24 @@
       return false;
     }
 
+  if (!interest.getPublisherPublicKeyLocator().empty())
+    {
+      if (entry->getData().getSignature().getType() == ndn::Signature::Sha256WithRsa)
+        {
+          ndn::SignatureSha256WithRsa rsaSignature(entry->getData().getSignature());
+          if (rsaSignature.getKeyLocator() != interest.getPublisherPublicKeyLocator())
+            {
+              NFD_LOG_TRACE("violates publisher key selector");
+              return false;
+            }
+        }
+      else
+        {
+          NFD_LOG_TRACE("violates publisher key selector");
+          return false;
+        }
+    }
+
   if (doesInterestContainDigest)
     {
       const ndn::name::Component& lastComponent = entry->getName().get(-1);
diff --git a/tests/table/cs.cpp b/tests/table/cs.cpp
index e8e5377..cdcc0db 100644
--- a/tests/table/cs.cpp
+++ b/tests/table/cs.cpp
@@ -422,6 +422,55 @@
   BOOST_CHECK_EQUAL(found, static_cast<const Data*>(0));
 }
 
+BOOST_AUTO_TEST_CASE(PublisherKeySelector)
+{
+  Cs cs;
+
+  Name name("/insert/withkey");
+  shared_ptr<Data> data = makeData(name);
+  cs.insert(*data);
+
+  shared_ptr<Interest> interest = make_shared<Interest>(name);
+  Name keyName("/somewhere/key");
+
+  ndn::KeyLocator locator(keyName);
+  interest->setPublisherPublicKeyLocator(locator);
+
+  const Data* found = cs.find(*interest);
+  BOOST_CHECK_EQUAL(found, static_cast<const Data*>(0));
+}
+
+BOOST_AUTO_TEST_CASE(PublisherKeySelector2)
+{
+  Cs cs;
+  Name name("/insert/withkey");
+  shared_ptr<Data> data = makeData(name);
+  cs.insert(*data);
+
+  Name name2("/insert/withkey2");
+  shared_ptr<Data> data2 = make_shared<Data>(name2);
+
+  Name keyName("/somewhere/key");
+  const ndn::KeyLocator locator(keyName);
+
+  ndn::SignatureSha256WithRsa fakeSignature;
+  fakeSignature.setValue(ndn::dataBlock(tlv::SignatureValue,
+                                        reinterpret_cast<const uint8_t*>(0), 0));
+
+  fakeSignature.setKeyLocator(locator);
+  data2->setSignature(fakeSignature);
+
+  cs.insert(*data2);
+
+  shared_ptr<Interest> interest = make_shared<Interest>(name2);
+  interest->setPublisherPublicKeyLocator(locator);
+
+  const Data* found = cs.find(*interest);
+  BOOST_CHECK_NE(found, static_cast<const Data*>(0));
+  BOOST_CHECK_EQUAL(found->getName(), data2->getName());
+}
+
+
 BOOST_AUTO_TEST_CASE(MinMaxComponentsSelector)
 {
   Cs cs;
